This program acts as a proxy to serve files directly from repositories.
It expects the following environment variables to be set:
API_URL - Base Forgejo API url (ex. https://git.brut.systems)API_TOKEN - Forgejo API authorization tokenREDIRECT_URL - Redirect url when access fails or files do not exist (ex. https://git.brut.systems)PORT - Port to listen onCreate a file at /etc/systemd/system/docs.brut.service with the following:
[Unit]
Description=Serves files from Git repositories
After=network.target
[Service]
Type=simple
ExecStart=<path/to/respository>/start.sh
WorkingDirectory=<path/to/repository>
ExecStop=/usr/bin/pkill docs.brut.systems
Restart=always
User=<user to run as>
Environment="API_URL=<url>"
Environment="API_TOKEN=<token>"
Environment="REDIRECT_URL=<url>"
Environment="PORT=<port>"
[Install]
WantedBy=multi-user.target
Then start the service:
sudo systemctl enable docs.brut
sudo systemctl start docs.brut