initial commit

This commit is contained in:
knoflook 2021-11-01 16:36:11 +01:00
commit 972575738d
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
4 changed files with 45 additions and 0 deletions

3
.env.sample Normal file
View File

@ -0,0 +1,3 @@
TYPE=croc
SECRET_CROC_PASS_VERSION=v1

1
abra.sh Normal file
View File

@ -0,0 +1 @@
export CROC_ENTRYPOINT_VERSION=v1

25
compose.yml Normal file
View File

@ -0,0 +1,25 @@
version: '3.8'
services:
app:
image: schollz/croc:master
ports:
- 9009-9013:9009-9013
environment:
- CROC_PASS_FILE=/run/secrets/croc_pass
secrets:
- croc_pass
configs:
- source: croc_entrypoint
target: /abra-entrypoint.sh
mode: 0555
entrypoint: /abra-entrypoint.sh
secrets:
croc_pass:
name: ${STACK_NAME}_croc_pass_${SECRET_CROC_PASS_VERSION}
external: true
configs:
croc_entrypoint:
name: ${STACK_NAME}_croc_entrypoint_${CROC_ENTRYPOINT_VERSION}
file: entrypoint.sh

16
entrypoint.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
if test -f "/run/secrets/croc_pass"; then
pwd=`cat /run/secrets/croc_pass`
if [ -z $pwd ]; then
echo >&2 "error: /run/secrets/croc_pass is empty"
exit 1
fi
export "CROC_PASS"="$pwd"
unset "pwd"
else
echo >&2 "error: /run/secrets/croc_pass does not exist"
exit 1
fi
/croc-entrypoint.sh relay