#!/usr/bin/env bash # Installs or rebuilds the SQLInsight Pro forum (Discourse) with the official discourse_docker launcher. # # Normally run by .forgejo/workflows/deploy-forum.yml (in a helper container with /var/discourse and docker.sock # from the host). By hand, as root on the server, with the values render.py needs exported: # sudo -E deploy/forum/install.sh # Needs 4 GB memory (2 GB minimum), 20 GB disk, and a mail server. set -euo pipefail HERE="$(cd "$(dirname "$0")" && pwd)" TARGET=/var/discourse if [[ $EUID -ne 0 ]]; then echo "Kør som root (sudo -E)." >&2 exit 1 fi command -v docker >/dev/null || { echo "Docker mangler." >&2; exit 1; } # Check the values before touching anything on the server. rendered="$(mktemp)" trap 'rm -f "$rendered"' EXIT python3 "$HERE/render.py" "$HERE/app.yml" "$rendered" if [[ ! -d $TARGET/.git ]]; then git clone --depth 1 https://github.com/discourse/discourse_docker.git "$TARGET" else git -C "$TARGET" pull -q --ff-only fi mkdir -p "$TARGET/containers" install -m 600 "$rendered" "$TARGET/containers/app.yml" cd "$TARGET" # Skip the interactive prerequisite checks (they cannot be answered from a workflow). ./launcher rebuild app --skip-prereqs host="${FORUM_HOSTNAME:-forum.seosoft.dk}" cat < CONTACT_EMAIL= python3 deploy/forum/configure.py 5. Slet API-nøglen igen under Admin → API. NEXT