From 249a3aec3603c49f5772f9e5f526af4a9a72fd5d Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Wed, 27 Mar 2024 23:53:19 -0400 Subject: [PATCH] feat(forge): code-forge start+stop scripts --- services/code-forge/README.md | 27 +++++++++++++++++++++++++++ services/code-forge/start.sh | 21 +++++++++++++++++++++ services/code-forge/stop.sh | 3 +++ 3 files changed, 51 insertions(+) create mode 100644 services/code-forge/README.md create mode 100755 services/code-forge/start.sh create mode 100755 services/code-forge/stop.sh diff --git a/services/code-forge/README.md b/services/code-forge/README.md new file mode 100644 index 0000000..b6a0ebe --- /dev/null +++ b/services/code-forge/README.md @@ -0,0 +1,27 @@ +# Code Forge + +Forgejo instance serving https://forge.karnov.club. + +## Usage + +### Starting / restarting + +```bash +FORGEJO_ROOT= ./start.sh +``` + +The storage root should be readable+writable by the user within the container. + +Calling the `start.sh` script will replace the containers if they already exists. + +### Stopping + +```bash +./stop.sh +``` + +## Networking + +| Port | Notes | +|---|---| +|`3000`|Web listening port| diff --git a/services/code-forge/start.sh b/services/code-forge/start.sh new file mode 100755 index 0000000..caa1b2f --- /dev/null +++ b/services/code-forge/start.sh @@ -0,0 +1,21 @@ +#!/usr/bin/bash + +if [[ -z "$FORGEJO_ROOT" ]]; then + echo "Error: FORGEJO_ROOT must be defined in the environment." + exit 1 +fi + +podman pod create \ + -p 3000:3000 \ + --replace \ + "code-forge" + +podman run -itd \ + --name "code-forge_app" \ + --pod "code-forge" \ + -v "$FORGEJO_ROOT"/data:/var/lib/gitea \ + -v "$FORGEJO_ROOT"/config:/etc/gitea \ + -v /etc/timezone:/etc/timezone:ro \ + -v /etc/localtime:/etc/localtime:ro \ + --replace \ + codeberg.org/forgejo/forgejo:1.21.8-0-rootless diff --git a/services/code-forge/stop.sh b/services/code-forge/stop.sh new file mode 100755 index 0000000..784b968 --- /dev/null +++ b/services/code-forge/stop.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +podman pod stop "code-forge"