From 4891579ebfcdaba0800550a0774d96a70186237e Mon Sep 17 00:00:00 2001 From: my Date: Fri, 16 Jan 2026 15:51:54 +0100 Subject: [PATCH] code blocks --- Readme.md | 89 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/Readme.md b/Readme.md index 1ebf42e..6a0334c 100644 --- a/Readme.md +++ b/Readme.md @@ -23,46 +23,47 @@ I am going to pretend i did this in the right order. We first setup the SSD, so ### Set up the SSD. Create mount directory: -> sudo mkdir /media/ssd +`sudo mkdir /media/ssd ` -Test mount -> sudo mount /dev/sda1 /media/ssd +Test mount. +`sudo mount /dev/sda1 /media/ssd` If it works add it to fstab -To get uuid -> lsblk -f +To get uuid +`lsblk -f` -/etc/fstab -UUID= /media/ssd ext4 defaults,no-fail 0 2 +Edit /etc/fstab and add: +`UUID= /media/ssd ext4 defaults,no-fail 0 2` -No-fail so the raspi boot even if the disk unplugged +No-fail so the raspi boot even if the disk unplugged. ### Then install Forgejo Following: https://pimylifeup.com/raspberry-pi-forgejo/ -Install docker with: -> curl -sSL https://get.docker.com | sh +Install docker with: +`curl -sSL https://get.docker.com | sh` -Create user (in current user group) -> sudo usermod -aG docker $USER +Create user (in current user group) +`sudo usermod -aG docker $USER` -Logout -> logout -Check if the group exist -> groups +Logout +`logout` +Check if the group exist: +`groups` -test: -> docker run hello-world +test: +`docker run hello-world` Docker should now be set up. Create a directory for the installation: - -> sudo mkdir -p /opt/stacks/forgejo -> cd /opt/stacks/forgejo -> nano compose.yaml +```bash +sudo mkdir -p /opt/stacks/forgejo +cd /opt/stacks/forgejo +nano compose.yaml +``` ```yaml services: @@ -108,25 +109,27 @@ networks: external: false ``` -> docker compose up -d +`docker compose up -d` It should now be accessible at :3000 Now we have to set up tinc proxying, but in this case it was already setup for another service. So only nginx config on the tinc edge node and creating a certificate. -> sudo certbot --nginx -d git.hackersanddesigners.nl +` sudo certbot --nginx -d git.hackersanddesigners.nl` And configure nginx in /etc/nginx/sites-available/forgejo.conf: -Set the newly created domain in the Forgejo config with: -> nano /media/ssd/forgejo/gitea/conf/app.ini +Set the newly created domain in the Forgejo config with: +` nano /media/ssd/forgejo/gitea/conf/app.ini` And change the domains: +``` ROOT_URL = https://git.hackersanddesigners.nl DOMAIN = git.hackersanddesigners.nl +``` -And restart the service -> docker compose restart +And restart the service +` docker compose restart` We shoudl now have a running instance of Forgejo @@ -136,10 +139,10 @@ We shoudl now have a running instance of Forgejo Setup web hooks like this: https://www.shawenyao.com/Voice-Controlled-Raspberry-Pi/ -> sudo apt install webhook +` sudo apt install webhook` -configure -> sudo nano /etc/webhook.conf +configure +` sudo nano /etc/webhook.conf` ``` [ { @@ -152,7 +155,7 @@ configure ``` Create the shell script -> sudo nano /usr/local/bin/deploy-git-site.sh +` sudo nano /usr/local/bin/deploy-git-site.sh` ```sh #!/usr/bin/env bash @@ -162,33 +165,33 @@ cd /var/www/html/testsite git pull --ff-only ``` -Make it executable -> sudo chmod +x /usr/local/bin/deploy-braids.py +Make it executable +` sudo chmod +x /usr/local/bin/deploy-braids.py` -Edit the web hook: -> sudo systemctl edit webhook -Add: +Edit the web hook: +` sudo systemctl edit webhook` +Add: ``` [Service] ExecStart= ExecStart=/usr/bin/webhook -hooks /etc/webhook.conf -ip 0.0.0.0 -port 9010 -verbose ``` -> sudo systemctl daemon-reload -> sudo systemctl enable --now webhook -> sudo systemctl restart webhook +` sudo systemctl daemon-reload` +` sudo systemctl enable --now webhook` +` sudo systemctl restart webhook` Check for errors: -> sudo systemctl status webhook --no-pager +` sudo systemctl status webhook --no-pager` Allow the webhook to connect to localhost, add to compose.yaml -> - FORGEJO__WEBHOOK__ALLOWED_HOST_LIST=private,loopback +` - FORGEJO__WEBHOOK__ALLOWED_HOST_LIST=private,loopback` We have to call the webhook on the IP of the docker host. Get it with: -> ip -4 addr show docker0 +` ip -4 addr show docker0` Gave: ```