forked from finn/tinyboard
compose.yaml, setup-spoke.sh: replace named Docker volume with host directory for syncthing config, reset compose.yaml to generic placeholders, remove volume permission fix step
This commit is contained in:
@@ -349,8 +349,9 @@ header "Configuring compose.yaml"
|
||||
info "Setting port to $TUNNEL_PORT and key to $KEY_NAME..."
|
||||
|
||||
SYNCTHING_MOUNT="$ARMBIAN_HOME/st/data"
|
||||
mkdir -p "$SYNCTHING_MOUNT"
|
||||
chown "$SPOKE_USER":"$SPOKE_USER" "$SYNCTHING_MOUNT"
|
||||
SYNCTHING_CONFIG="$ARMBIAN_HOME/st/config"
|
||||
mkdir -p "$SYNCTHING_MOUNT" "$SYNCTHING_CONFIG"
|
||||
chown "$SPOKE_USER":"$SPOKE_USER" "$SYNCTHING_MOUNT" "$SYNCTHING_CONFIG"
|
||||
|
||||
SPOKE_UID=$(id -u "$SPOKE_USER")
|
||||
SPOKE_GID=$(id -g "$SPOKE_USER")
|
||||
@@ -361,8 +362,8 @@ sed -i "/known_hosts/!s|/home/[^/]*/\.ssh/[^:]*:/home/[^/]*/\.ssh/[^:]*:ro|${SSH
|
||||
sed -i "s|/home/[^/]*/\.ssh/known_hosts|${SSH_DIR}/known_hosts|g" "$COMPOSE"
|
||||
sed -i "s| [a-zA-Z0-9._-]*@[a-zA-Z0-9._-]*\.[a-zA-Z0-9._-]*[[:space:]]*\$| ${HUB_USER}@${HUB_HOST}|" "$COMPOSE"
|
||||
sed -i "s|/home/[^/]*/st/data:|${SYNCTHING_MOUNT}:|g" "$COMPOSE"
|
||||
sed -i "s|PUID=[0-9]*|PUID=${SPOKE_UID}|g" "$COMPOSE"
|
||||
sed -i "s|PGID=[0-9]*|PGID=${SPOKE_GID}|g" "$COMPOSE"
|
||||
sed -i "s|/home/[^/]*/st/config:|${SYNCTHING_CONFIG}:|g" "$COMPOSE"
|
||||
sed -i "s|user: \"[0-9]*:[0-9]*\"|user: \"${SPOKE_UID}:${SPOKE_GID}\"|" "$COMPOSE"
|
||||
sed -i "s|container_name: spoke-autossh|container_name: ${SPOKE_NAME}-autossh|g" "$COMPOSE"
|
||||
sed -i "s|container_name: spoke-syncthing|container_name: ${SPOKE_NAME}-syncthing|g" "$COMPOSE"
|
||||
sed -i "s|hostname: spoke-syncthing|hostname: ${SPOKE_NAME}-syncthing|g" "$COMPOSE"
|
||||
@@ -375,11 +376,6 @@ docker build \
|
||||
--build-arg GID="$(id -g "$SPOKE_USER")" \
|
||||
-t spoke-autossh .
|
||||
|
||||
header "Fixing Syncthing Volume Permissions"
|
||||
info "Setting correct ownership on syncthing-config volume..."
|
||||
docker run --rm -v syncthing-config:/var/syncthing/config alpine chown -R "${SPOKE_UID}:${SPOKE_GID}" /var/syncthing/config
|
||||
info "Syncthing volume permissions set."
|
||||
|
||||
header "Starting Containers"
|
||||
TUNNEL_UP="false"
|
||||
for ATTEMPT in 1 2 3; do
|
||||
|
||||
Reference in New Issue
Block a user