Skip to content

Commit

Permalink
chore: add welcome message to monolith
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Nov 20, 2024
1 parent 0d81c44 commit aabc154
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
18 changes: 18 additions & 0 deletions docker/monolith/scripts/poststart.sh
Original file line number Diff line number Diff line change
@@ -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

14 changes: 14 additions & 0 deletions docker/monolith/scripts/prestart.sh
Original file line number Diff line number Diff line change
@@ -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

25 changes: 14 additions & 11 deletions docker/monolith/scripts/setup_s6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -42,22 +46,25 @@ 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: {},
},

{
name: "rivet-server",
command: "rivet-server start",
noRedirectLogs: true,
healthCheckCommand: "curl -f http://127.0.0.1:8090/health/liveness",
dependencies: [
"cockroachdb",
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit aabc154

Please sign in to comment.