this post was submitted on 16 Aug 2024
57 points (100.0% liked)

Selfhosted

40347 readers
340 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I want to have a local mirror/proxy for some repos I'm using.

The idea is having something I can point my reads to so that I'm free to migrate my upstream repositories whenever I want and also so that my stuff doesn't stop working if some of the jankiest third-party repos I use disappears.

I know the various forjego/gitea/gitlab/... (well, at least some of them - I didn't check the specifics) have pull mirroring, but I'm looking for something simpler... ideally something with a single config file where I list what to mirror and how often to update and which then allows anonymous read access over the network.

Does anything come to mind?

you are viewing a single comment's thread
view the rest of the comments
[–] bjoern_tantau@swg-empire.de 21 points 3 months ago* (last edited 3 months ago) (2 children)

A bash script would probably be easiest to write and pluck into cron.

Edit: Clone all repos you want into one directory and then loop with a script over all cloned dirs and issue git fetch. Done. If you want to add a repo you clone another.

[–] shnizmuffin@lemmy.inbutts.lol 15 points 3 months ago* (last edited 3 months ago) (1 children)

This can be made even simpler by installing all the repos you want to mirror as submodules of the parent directory's git repository. Instead of many git pull or git fetch, you blast a single git submodule update --recursive --remote and go about your day.


Bonus: This has the added benefit of generating a git history for your automated process if you script in a commit message with a timestamp, making your mirrors reversible.

[–] Findmysec@infosec.pub 1 points 3 months ago

I need to try this, thanks