From bc10b03b01b3ebdd92499a49fcaa8351a111c4e1 Mon Sep 17 00:00:00 2001 From: NathanFlurry Date: Thu, 21 Nov 2024 03:50:22 +0000 Subject: [PATCH] chore: add welcome message to monolith (#1405) ## Changes --- docker/monolith/scripts/poststart.sh | 18 ++++++++++++++++++ docker/monolith/scripts/prestart.sh | 14 ++++++++++++++ docker/monolith/scripts/setup_s6.ts | 25 ++++++++++++++----------- 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100755 docker/monolith/scripts/poststart.sh create mode 100755 docker/monolith/scripts/prestart.sh diff --git a/docker/monolith/scripts/poststart.sh b/docker/monolith/scripts/poststart.sh new file mode 100755 index 0000000000..08632f1bff --- /dev/null +++ b/docker/monolith/scripts/poststart.sh @@ -0,0 +1,18 @@ +#!/bin/sh +cat << EOF +Server is ready + + Dashboard http://127.0.0.1:8080/ui/ + API 127.0.0.1:8081 + Edge API 127.0.0.1:8081 + Orchestrator 127.0.0.1:8082 + S3 127.0.0.1:9000 + Server Config /etc/rivet-server/config.yaml + Client Config /etc/rivet-server/config.yaml + +Please visit https://rivet-gg/docs/quickstart to get started. +EOF + +# Sleep for infinity since this service will be restarted if it exits +sleep infinity + diff --git a/docker/monolith/scripts/prestart.sh b/docker/monolith/scripts/prestart.sh new file mode 100755 index 0000000000..060b162f13 --- /dev/null +++ b/docker/monolith/scripts/prestart.sh @@ -0,0 +1,14 @@ +#!/bin/sh +cat << EOF +Starting Rivet + + Version $(rivet-server --version) + Operating https://rivet.gg/docs/self-hosting + Documentation https://rivet.gg/docs + Discord https://rivet.gg/discord + +EOF + +# Sleep for infinity since this service will be restarted if it exits +sleep infinity + diff --git a/docker/monolith/scripts/setup_s6.ts b/docker/monolith/scripts/setup_s6.ts index cbddf8b818..54289f3e38 100755 --- a/docker/monolith/scripts/setup_s6.ts +++ b/docker/monolith/scripts/setup_s6.ts @@ -3,6 +3,10 @@ import { resolve } from "@std/path"; import dedent from "dedent"; +const basePath = "/etc/s6-overlay"; +const rcPath = resolve(basePath, "s6-rc.d"); +const scriptsPath = resolve(basePath, "scripts"); + interface Service { name: string; command: string; @@ -42,14 +46,18 @@ interface Service { } const services: Service[] = [ - // Dependencies take a long time to start, so let the user know that - // something is happening { - name: "rivet-start-message", - // Sleep for infinity since this service will be restarted if it exits + name: "rivet-prestart", command: - "echo 'Starting...'; sleep infinity", - noRedirectLogs: true, + `${scriptsPath}/scripts/prestart.sh`, + rootUser: true, + ports: {}, + }, + { + name: "rivet-poststart", + command: + `${scriptsPath}/scripts/poststart.sh`, + dependencies: ["rivet-server"], rootUser: true, ports: {}, }, @@ -57,7 +65,6 @@ const services: Service[] = [ { name: "rivet-server", command: "rivet-server start", - noRedirectLogs: true, healthCheckCommand: "curl -f http://127.0.0.1:8090/health/liveness", dependencies: [ "cockroachdb", @@ -184,10 +191,6 @@ const services: Service[] = [ }, ]; -const basePath = "/etc/s6-overlay"; -const rcPath = resolve(basePath, "s6-rc.d"); -const scriptsPath = resolve(basePath, "scripts"); - /** * Create the `fs-setup` service. *