···1-this is a small patch to stop logging IPs for https://github.com/AndersBallegaard/TCProxy
2-3-additionally, a systemd template service, which expects config directories in /srv/TCProxy/
4-with the corresponding resulting service, for example TCProxy@test.service would be /srv/TCProxy/test.
5-In there, it would look for a configuration file as per usual.
6-7-The service unit expects a compiled binary in /srv/TCProxy/TCProxy.
···1-service and timer files that we use to auto-restart the server every night at 4 AM.
···0
-10
systemd-wait.fish/README.md
···1-# systemd-wait.fish
2-3-A small script that checks whether or not an HTTP(s) endpoint is
4-reachable before starting a list of services.
5-6-Please read the script, it isn't very long and but it is configured
7-directly in the script.
8-9-There is a sample systemd unit to run this script, but note that this
10-is best paired with your own setup for (re)starting services.
···0000000000
-38
systemd-wait.fish/systemd-wait.fish
···1-#!/usr/bin/env fish
2-3-# systemd-wait.fish
4-# a small script using `curl` that lets you wait until certain endpoints return
5-# certain HTTP responses before starting services
6-7-# CONFIG:
8-set services drasl headscale headplane
9-# you must add your own endpoint to `curl` like so:
10-set endpoint "https://auth.starlightnet.work/application/o/headplane/.well-known/openid-configuration"
11-12-# set initial value to false
13-set -g serviceReachable false
14-15-function checkEndpoint
16- if test (curl -o /dev/null -s -w "%{http_code}" "$endpoint") = "200"
17- echo "HTTP 200, Service is reachable"
18- set -g serviceReachable true
19- return 0
20- else
21- echo "service is not yet reachable."
22- set -g serviceReachable false
23- echo "waiting 5 more seconds..."
24- sleep 5s
25- return 1
26- end
27-end
28-29-while test $serviceReachable = "false"
30- checkEndpoint
31-end
32-33-echo $serviceReachable
34-35-if test $serviceReachable = "true"
36- echo "Starting services: $services"
37- systemctl start $services
38-end
···00000000000000000000000000000000000000
-6
systemd-wait.fish/systemd-wait.service
···1-[Unit]
2-Description=systemd-wait.fish - wait for an endpoint to return before starting services
3-4-[Service]
5-Type=oneshot
6-ExecStart=/usr/local/bin/systemd-wait.fish