diff --git a/README.md b/README.md index f4f883c..167f10e 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,3 @@ # docs.brut.systems -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 token -- `REDIRECT_URL` - Redirect url when access fails or files do not exist (ex. `https://git.brut.systems`) -- `PORT` - Port to listen on - -## Usage w/ systemd - -Create 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=/start.sh -WorkingDirectory= -ExecStop=/usr/bin/pkill docs.brut.systems -Restart=always -User= -Environment="API_URL=" -Environment="API_TOKEN=" -Environment="REDIRECT_URL=" -Environment="PORT=" - -[Install] -WantedBy=multi-user.target -``` - -Then start the service: - -```sh -$ sudo systemctl enable docs.brut -$ sudo systemctl start docs.brut -``` +View documentation [here](https://docs.brut.systems/judah/docs.brut.systems) diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..6c4d1a5 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,73 @@ + + + Docs.Brut.Systems + + + +

Docs.Brut.Systems

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 token
  • REDIRECT_URL - Redirect url when access fails or files do not exist (ex. https://git.brut.systems)
  • PORT - Port to listen on

Usage W/ Systemd

Create 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
+
+ + \ No newline at end of file diff --git a/docs/index.riv b/docs/index.riv new file mode 100644 index 0000000..6100e19 --- /dev/null +++ b/docs/index.riv @@ -0,0 +1,39 @@ +DOCS.BRUT.SYSTEMS + +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 token +- `REDIRECT_URL` - Redirect url when access fails or files do not exist (ex. `https://git.brut.systems`) +- `PORT` - Port to listen on + + +USAGE W/ SYSTEMD + +Create 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=/start.sh + WorkingDirectory= + ExecStop=/usr/bin/pkill docs.brut.systems + Restart=always + User= + Environment="API_URL=" + Environment="API_TOKEN=" + Environment="REDIRECT_URL=" + Environment="PORT=" + + [Install] + WantedBy=multi-user.target + +Then start the service: + + sudo systemctl enable docs.brut + sudo systemctl start docs.brut diff --git a/main.go b/main.go index 0c6bf3e..e16dc93 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,4 @@ +//go:generate go run git.brut.systems/judah/rivit2html@latest docs/index.riv package main import (