Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror more data per repo and allow arbitrary user mirroring #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Brycey92
Copy link

@Brycey92 Brycey92 commented Mar 5, 2024

Enable LFS and wiki mirroring, and use auth token for all repo mirrors
Allow --mode user to fetch repos of arbitrary --user value
Improve error handling and error clarity

I made a number of design decisions while writing this that you'll have to decide whether you like or not. Where possible, I attempted to avoid breaking existing command syntax.

visibility="${1:-}"
log "Create migration user with name: ${github_user}"
local password=$(tr -dc 'A-Za-z0-9!@#$%^&*()_+\-=[]{}\|;:,.<>/`~' < /dev/urandom | head -c 64)
if ! $CURL -X POST $GITEA_URL/api/v1/admin/users "${header_options[@]}" --data '{"username": "'"${github_user}"'", "visibility": "'"${visibility}"'", "email": "'"${github_user}@example.com"'", "password": "'"${password}"'", "must_change_password": true}' > ${jsonoutput}/result.txt 2>${jsonoutput}/stderr.txt; then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite the Gitea API documentation saying the password field is not required, it is required, and Gitea will return a 400 Bad Request error without it.

@maxkratz
Copy link
Owner

Thank you for your PR, @Brycey92!

Enable LFS and wiki mirroring, and use auth token for all repo mirrors

This would break existing deployments that do not use an auth token (e.g., if one wants to mirror a public organization), right?

Allow --mode user to fetch repos of arbitrary --user value

I like that!

Improve error handling and error clarity

Well done.

@maxkratz
Copy link
Owner

One additional thought came to my mind: it would be nice if the mirroring of git LFS data and wikis would be configurable individually. Maybe not all users want to mirror a whole bunch of large(r) data files or the wiki information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants