r/forgejo • • Nov 02 '26

Fully disabling automated sync of pull repos?

EDIT: Solved

This did the trick...

[cron.update_mirrors]
ENABLED: false

Exactly what I wanted. Now I can manually trigger a sync using the rest api on a per-repo basis without forgejo being so damn chatty.


I've had forgejo installed for a couple/few weeks and adore it.

But it's FAR too aggressive with automatically syncing a pull repo and I've no interest in it governing that synchronization process.

How do I shut down the automation entirely? I'll trigger the sync via the api when I need to.

1 Upvotes

10 comments sorted by

2

u/topMarksForNotTrying Nov 02 '26

I found this in the docs to turn off mirroring.

This section documents the cron job that triggers the mirroring.

Based on those 2 sections, I think it might be possible to disable the auto mirroring and then trigger it through a single-run cron job.

I don't have access to my forgejo instance right now so I cannot test this out.

1

u/frobnosticus Nov 02 '26

I saw that and wasn't sure if "ENABLED = false" implied "DISABLE_NEW_PULL" which is definitely not what I want.

It sure looks like

[cron.update_mirrors]
ENABLED: false

or

[cron.update_mirrors]
PULL_LIMIT 0

would be the way to go.

It's just odd to me that the git user on the box (which forgejo is running as) doesn't even have a crontab.

2

u/krimpenrik Nov 02 '26

Going to setup forgejo can you explain with what you encountering and mean with syncing a pull repo???

1

u/frobnosticus Nov 02 '26

In my setup I have local mirrors of repositories I use frequently. The forgejo UI tends to refer to them as "pull migrations." You can give it a github repo url and it'll just create an "instance local" mirror.

I did NOT realize it was somewhat aggressively keeping it in sync with the upstream repository. All well and good. That's what "mirror" means, after all.

But I can't have it doing that.

2

u/luisbandalap Nov 02 '26

When creating a new repository you can configure forgejo to pull changes from an existing repository in GitHub, gitlab, other gitea/forgejo repositories, and many other git repositories.

2

u/Minimal-Matt Nov 02 '26

In the settings of the pull mirror repository you can set "0" to disable periodic sync

1

u/frobnosticus Nov 02 '26

One by each, sure. o7

But how about the global default config? It looks like:

[cron.update_mirrors]
ENABLED: false

might be what I want.

1

u/luisbandalap Nov 02 '26

Try using gitea mirror instead of forgejo built in functionality.

https://gitea-mirror.raylabs.io/

It has an API so you can set-up a webhook to pull and push changes.

1

u/frobnosticus Nov 02 '26

It's not the only thing I'm using forgejo for. That's not really enough of a reason to add an additional parallel tool. I should just be able to configure it's behavior.

1

u/luisbandalap Nov 02 '26

Then in the repository configuration you can configure when to synchronize repository and disable automatic synchronization.