refactor: use bubble instead
This commit is contained in:
17
image/overlay/daemon/update-keys.sh
Executable file
17
image/overlay/daemon/update-keys.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# VARIABLES: _REVISION_ _REPO_
|
||||
|
||||
set -euo pipefail
|
||||
mkdir -p /users && chown keeper /users && chmod 644 /users
|
||||
|
||||
su keeper
|
||||
|
||||
init_repo(){
|
||||
git clone -b _REVISION_ _REPO_ /users
|
||||
}
|
||||
|
||||
if [[ ! -d /users/.git ]]; then
|
||||
init_repo
|
||||
elif [[ -d /users && cd /users && ! git pull origin _REVISION_ ]]; then
|
||||
init_repo
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p /app
|
||||
cd /app
|
||||
rm -rf ./template ./snapshot
|
||||
mkdir /app/template /app/snapshot
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
git clone -b _REVISION_ _REPO_ template
|
||||
|
||||
python3 /daemon/orchestrate.py \
|
||||
--root /app/template \
|
||||
--network cloud \
|
||||
--volume-parent /data/volumes \
|
||||
--snapshot-root /app/snapshot
|
||||
11
image/overlay/etc/init.d/auth-server
Executable file
11
image/overlay/etc/init.d/auth-server
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/sbin/openrc-run
|
||||
command="/usr/bin/auth-server"
|
||||
command_background=true
|
||||
command_args="-addr 0.0.0.0:8080 -root /users"
|
||||
command_user="keeper"
|
||||
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
10
image/overlay/etc/init.d/bubble
Executable file
10
image/overlay/etc/init.d/bubble
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
depend() {
|
||||
need auth-server docker
|
||||
}
|
||||
|
||||
command="/usr/bin/bubble"
|
||||
command_args="-config /daemon/config.yaml"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
command_background=true
|
||||
@@ -1,2 +1,2 @@
|
||||
# min hour day month weekday command
|
||||
*/15 * * * * /usr/bin/sh /daemon/update.sh
|
||||
*/15 * * * * /usr/bin/sh /daemon/update-keys.sh
|
||||
Reference in New Issue
Block a user