aboutsummaryrefslogtreecommitdiff
path: root/demo/entrypoint.sh
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-04-03 13:09:45 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-04-03 13:09:45 -0400
commit1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5 (patch)
treea7030830b9df35ec761d34a48453ba9108e673dc /demo/entrypoint.sh
parentae22addfc7984a147aeb80ab14c6b2833a7dc4b2 (diff)
downloadsteam-export-1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5.tar.gz
steam-export-1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5.tar.xz
Some changes to make supporting a demo environment easier. Docker compose demo.
Diffstat (limited to 'demo/entrypoint.sh')
-rwxr-xr-xdemo/entrypoint.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/demo/entrypoint.sh b/demo/entrypoint.sh
new file mode 100755
index 0000000..e060597
--- /dev/null
+++ b/demo/entrypoint.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+USER_SHELL="${USER_SHELL:-/bin/ash}"
+# UID and GID used by the `git` user inside of the container
+USER_UID="${USER_UID:-3500}"
+USER_GID="${USER_GID:-3500}"
+
+TRUSTED_CIDRS="${TRUSTED_CIDRS:-127.0.0.1/8}"
+
+# LISTEN="${LISTEN:-:8899}"
+
+username="steam"
+userhome="/steam"
+
+# This is only run once in the container's lifetime unless /setup is removed
+setup() {
+if [ -e /setup ] ; then return ; fi
+
+addgroup -g "${USER_GID}" "$username"
+adduser -h "$userhome" --gecos "$FULL_NAME" -D \
+ -s "${USER_SHELL}" -u "${USER_UID}" -G "$username" "$username"
+passwd -u "$username"
+
+touch /setup
+}
+
+run_steam_export() {
+mkdir -p /steam-lib/common
+chown -R "$username:$username" /steam
+chown -R "$username:$username" /steam-lib
+su steam -c "steam-export -demo -L /steam-lib -t \"$TRUSTED_CIDRS\" -s \"$SHARE_LINK\""
+}
+
+setup
+run_steam_export