Infrastructure repo for all things hackathon.bz.it
create a CNAME and proxy entry
- create a dedicated volume and attach it to the chosen docker instance.
- Tag the volume for AWS backup with
AWSBackup=true
- initialize the volume using this guide
- mount volume to /mnt/forgejo
On the docker host:
# create a system user for forgejo
useradd -r -M -s /bin/false forgejo
# make this user own the mounted volume
chown -R forgejo:forgejo /mnt/forgejo
# get user and group id of the user. use this in config of forgejo
echo "userid:groupid = $(id -u forgejo):$(id -g forgejo)"Create a EC2 LifecycleManager backup policy that runs hourly during the hackathon event:
cron(0 * 1,2 8 ? 2025)
with a retention of 1 day.
Anubis is used to prevent excessive AI crawler traffic.
To not fall behind in the weapons race, we always use the latest version.
But because forgejo has some custom handling of favicons that leads to problems, we have to supply our own policy file.
The ci/cd downloads the most recent default policy and inserts the custom rule every time, hoping it aligns with latest
There is a local version that might be out of sync with the most recent Anubis version.
In that case follow what the ci/cd does: download the most recent one, and add the favicon rule.
If the format or name has changed, adjust the pipeline accordingly
cp .env.example .env
docker compose --profile dev --project-directory . -f infrastructure/docker-compose.run.yml upnow you can access via http://localhost:8080 (assuming default $LOCAL_DEV_PORT)
Note that since Anubis does now work without a proxy server, when testing locally you need to access via the included caddy, and not directly via the port SERVER_PORT_WEB
The provided config file creates an admin user with credentials hackathon:hackathon
For initial setup, go to the web page, and the installation site will greet you.
- remove the slogan
- create the Administrator account
To create, restore or change the admin user after initial setup, access the docker container shell and run the forgejo admin user create command (see docs)
# note --user, must be executed as 'git' user inside container. Use 'su git' in interactive mode to access the forgejo cli
docker exec --user git forgejo forgejo admin user create --admin --username hackathon --email forgejo@hackathon.bz.it --password '******'- create an API token with scopes:
- admin:read+write
- organization:read+write
- repository:read+write
- user:read+write
- customize the
.envvalues with prefixSCRIPT_
The scripts are usually run in this order:
Creates the admin users. Only has to be run once, or when users change
Sets up the hackathon top level organization (and an empty jury team). Run this before the hackathon event, and before the other scripts below
Make sure to set SCRIPT_ORGNAME env variable beforehand, and use the same for the following scripts.
Then customize the Hackathon details like title and location in the script itself
./scripts/setup_organization.shTakes an input csv with all the hackathon participants and their teams.
Creates the individual users, repositories and teams.
./scripts/setup_hackathon.sh input.csvpassing your input csv file in the same format as input.example.csv
Only the team number, name and email columns are used
At gong sound run this script to make all org repos public.
./scripts/gong_open_repos.shWhen the hackathon is concluded (typically after all team presentations, but maybe even during the gong - but this should be communicated to teams) remove repo permissions from all teams.
./scripts/disarm_teams.sh- backup volume & upgrade forgejo. They have upgrade guides
- add or remove admin users if team changed
- create hackathon organization via setup_organization.sh (see above)
- setup volume backup schedule for during event (see above)
- prepare .env file for scripts