#!/usr/bin/env bash # Installs the SQLInsight Pro forum (Discourse) on a fresh Linux server with the official discourse_docker launcher. # Run as root on the forum server, from a checkout of this repository, after filling in deploy/forum/app.yml: # sudo deploy/forum/install.sh # Needs: DNS for the forum's host name pointing here, ports 80 and 443 free, 2 GB memory (4 GB recommended) 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)." >&2 exit 1 fi # Refuse to install with the example values still in place: Discourse is useless without a working mail server. if grep -nE 'example\.com|"CHANGE"' "$HERE/app.yml" | grep -vE '^[0-9]+:\s*#'; then echo "Udfyld værdierne markeret CHANGE i $HERE/app.yml først (linjerne ovenfor)." >&2 exit 1 fi if ! command -v docker >/dev/null; then echo "Installerer Docker ..." curl -fsSL https://get.docker.com | sh fi if [[ ! -d $TARGET/.git ]]; then git clone --depth 1 https://github.com/discourse/discourse_docker.git "$TARGET" fi install -m 600 "$HERE/app.yml" "$TARGET/containers/app.yml" cd "$TARGET" ./launcher rebuild app host=$(sed -n 's/^\s*DISCOURSE_HOSTNAME:\s*//p' "$HERE/app.yml" | tr -d '"' | head -1) cat < CONTACT_EMAIL= python3 $HERE/configure.py 4. Slet API-nøglen igen under Admin → API, når opsætningen er færdig. NEXT