Skip to content

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

Open
Brycey92 wants to merge 3 commits into
maxkratz:masterfrom
Brycey92:feature/mirror-more
Open

Mirror more data per repo and allow arbitrary user mirroring#6
Brycey92 wants to merge 3 commits into
maxkratz:masterfrom
Brycey92:feature/mirror-more

Conversation

@Brycey92

@Brycey92 Brycey92 commented Mar 5, 2024

Copy link
Copy Markdown

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.

Comment thread github2gitea-mirror
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@GlassedSilver

Copy link
Copy Markdown

Any updates on this? :)

@maxkratz

Copy link
Copy Markdown
Owner

Any updates on this? :)

No updates from my side. I'm still waiting for a response of @Brycey92 :)

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.

3 participants