From 1cc50f8ff06783c0faae7aa2fa1a3703e96b10de Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Sun, 19 Apr 2026 15:35:13 -0700 Subject: [PATCH] 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 --- spoke/compose.yaml | 15 ++++++--------- spoke/setup-spoke.sh | 14 +++++--------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/spoke/compose.yaml b/spoke/compose.yaml index f18d17c..8489fe9 100644 --- a/spoke/compose.yaml +++ b/spoke/compose.yaml @@ -11,25 +11,22 @@ services: -o "ServerAliveInterval=60" -o "ServerAliveCountMax=3" -R 11111:localhost:22 - -i /home/armbian/.ssh/oilykey2026 - armbian@oily.dad + -i /home/armbian/.ssh/hubkey + armbian@hub.example.com volumes: - - /home/armbian/.ssh/oilykey2026:/home/armbian/.ssh/oilykey2026:ro + - /home/armbian/.ssh/hubkey:/home/armbian/.ssh/hubkey:ro - /home/armbian/.ssh/known_hosts:/home/armbian/.ssh/known_hosts:ro syncthing: image: syncthing/syncthing container_name: spoke-syncthing hostname: spoke-syncthing restart: unless-stopped + user: "1000:1000" environment: - - PUID=1000 - - PGID=1000 + - HOME=/var/syncthing ports: - "127.0.0.1:8384:8384" - "22000:22000" volumes: - - syncthing-config:/var/syncthing/config + - /home/armbian/st/config:/var/syncthing/config - /home/armbian/st/data:/var/syncthing/data - -volumes: - syncthing-config: diff --git a/spoke/setup-spoke.sh b/spoke/setup-spoke.sh index 1ecde89..c4b3465 100755 --- a/spoke/setup-spoke.sh +++ b/spoke/setup-spoke.sh @@ -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