[mirror] option protect mirror from commit removals (like branchprotection deny force push) #7329

Closed
opened 2025-11-02 07:23:05 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @UmutAlihan on GitHub (May 12, 2021).

There was a case when an RPA tool is sold to another company and they revert to closed sourced licensing model while they are fully open and free. In this context they removed every single source code and commit history from their repositories and only left a readme file. (repo link)

Most of RPA developers using automagica as their base tool have lost reach to source code and commit history in related repo. Some had the chance of having a local offline copy of the codebase and saved their robots in action.

However, What happens if I had a Gitea mirror repo to this remote and they would remove all commit history and source code. Do we lose all the codebase once the cronjob is triggered to sync mirror repositories? Is there anything to avoid that? Is having a regular repository only option to avoid this risk of losing codebase caused by closing remote repo?

Cheers

Originally created by @UmutAlihan on GitHub (May 12, 2021). There was a case when an RPA tool is sold to another company and they revert to closed sourced licensing model while they are fully open and free. In this context they removed every single source code and commit history from their repositories and only left a readme file. ([repo link](https://github.com/automagica/automagica)) Most of RPA developers using automagica as their base tool have lost reach to source code and commit history in related repo. Some had the chance of having a local offline copy of the codebase and saved their robots in action. However, What happens if I had a Gitea mirror repo to this remote and they would remove all commit history and source code. Do we lose all the codebase once the cronjob is triggered to sync mirror repositories? Is there anything to avoid that? Is having a regular repository only option to avoid this risk of losing codebase caused by closing remote repo? Cheers
GiteaMirror added the type/proposal label 2025-11-02 07:23:05 -06:00
Author
Owner

@6543 commented on GitHub (May 12, 2021):

short: yes in default mirror config

long: you can tell gitea to not remove old refs if they got deleted from source. This should safe souch thungs. But i didnt test it ...

NO gitea mirror's currently have no such protection right now

@6543 commented on GitHub (May 12, 2021): short: yes in default mirror config ~~long: you can tell gitea to not remove old refs if they got deleted from source. This should safe souch thungs. But i didnt test it ...~~ **NO gitea mirror's currently have no such protection right now**
Author
Owner

@UmutAlihan commented on GitHub (May 12, 2021):

Many thanks for your answer and beautifying my issue!

Is it possible to edit app.ini file so that cron.update_mirrors option has "DEFAULT_INTERVAL= 0" or disabling it with extra option such as "MIRROR_SYNC_ENABLED = false" without changing main cron option "ENABLED = true"

cron mirror sync source

@UmutAlihan commented on GitHub (May 12, 2021): Many thanks for your answer and beautifying my issue! Is it possible to edit app.ini file so that **cron.update_mirrors** option has "DEFAULT_INTERVAL= 0" or disabling it with extra option such as "MIRROR_SYNC_ENABLED = false" without changing main **cron** option "ENABLED = true" [cron mirror sync source](https://docs.gitea.io/en-us/config-cheat-sheet/#mirror-mirror)
Author
Owner

@6543 commented on GitHub (May 12, 2021):

@UmutAlihan you can just disable mirror sync cron tab and do it manualy ...but i think it's not optimal

@6543 commented on GitHub (May 12, 2021): @UmutAlihan you can just disable mirror sync cron tab and do it manualy ...but i think it's not optimal
Author
Owner

@UmutAlihan commented on GitHub (May 12, 2021):

could you please provide an example app.ini line to only disable cron mirror sync w/out messing other regular cronjobs? It would really be very kind p2p act :)

(fyi I used docker-compose to spin up my gitea server)

@UmutAlihan commented on GitHub (May 12, 2021): could you please provide an example app.ini line to only disable cron mirror sync w/out messing other regular cronjobs? It would really be very kind p2p act :) (fyi I used docker-compose to spin up my gitea server)
Author
Owner

@6543 commented on GitHub (May 12, 2021):

@UmutAlihan -> https://docs.gitea.io/en-us/config-cheat-sheet/#cron---update-mirrors-cronupdate_mirrors
ENABLED = false

@6543 commented on GitHub (May 12, 2021): @UmutAlihan -> https://docs.gitea.io/en-us/config-cheat-sheet/#cron---update-mirrors-cronupdate_mirrors `ENABLED = false`
Author
Owner

@yoyoyonas commented on GitHub (Jan 13, 2022):

I'd suggest to close this duplicate in favor of #14076.

@yoyoyonas commented on GitHub (Jan 13, 2022): I'd suggest to close this duplicate in favor of #14076.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7329