how to host forgejo on fly.io
| Dockerfile | ||
| fly.toml | ||
| README.md | ||
host forgejo on fly.io
original guide: https://lugh.ch/forgejo-on-flyio.html#should-you-self-host-your-git-instance
Dockerfile is vanilla forgejo (the guide uses the rootless version)
setup
- see fly.toml for all the env vars
- in the original guide most of the
FIXMEs are straightforward (don't make the two cookie names the exact same) - the
FIXMEs below (in the admin script)- initial guide didn't mention
ROOT_URL(which is probably of interest to most!)
- initial guide didn't mention
create the initial user (admin)
fly ssh console(be fast before the scale to 0 kicks in... haha)su git(git user owns the files already there)forgejo admin user create --username FIXME --password FIXME --email "some@email" --admin- if needed (config file is not found), you can add something like
--config custom/conf/app.ini(take note of the app.ini, you canfind . | grep app.ini)
- if needed (config file is not found), you can add something like
maintenance
ssh/scp to grab backups
fly ssh issue(temp ssh creds)fly ssh console(use the creds)su - git
forgejo dump \
--config /var/lib/gitea/custom/conf/app.ini \
--type tar.gz \
--file /var/tmp/forgejo_$(date +%Y%m%d_%H%M%SZ).tar.gz
scp -i ~/.ssh/MY_KEY root@<APP_NAME>.internal:/var/tmp/forgejo\* .(from wherever!)fly ssh rm -r /var/tmp/forgejo*remove the backup archive on the machine (don’t wanna trigger an auto disk resize)