Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncthing] Improve configuration #450

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions syncthing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.18.0 - 2024-?-?

* 🔨 Configure Syncthing via environment variables instead of CLI arguments where possible and properly separate config and database/state directories (thanks @salim-b | #450)

## 1.17.0 - 2023-10-13

* 🔨 Set gui-address to first IP in container (thanks @reedy | #426)
Expand Down
9 changes: 8 additions & 1 deletion syncthing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ FROM $BUILD_FROM
RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
"syncthing=1.25.0-r1"

COPY root /

ENV STCONFDIR=/config \
STDATADIR=/data \
salim-b marked this conversation as resolved.
Show resolved Hide resolved
STNODEFAULTFOLDER=1 \
STNORESTART=1 \
STNOUPGRADE=1
salim-b marked this conversation as resolved.
Show resolved Hide resolved

ENTRYPOINT [ "/init" ]
CMD []
COPY root /
10 changes: 5 additions & 5 deletions syncthing/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Syncthing
version: "1.17.0"
version: "1.18.0"
slug: syncthing
description: "Syncthing is a continuous file synchronization program in a
de-centralized way"
Expand All @@ -26,9 +26,9 @@ ingress_port: 8384
panel_title: Syncthing
panel_icon: mdi:sync
map:
- share:rw
- config:rw
- backup:rw
- addon_config:rw
- addons:rw
- ssl:rw
- backup:rw
- media:rw
- share:rw
- ssl:rw
16 changes: 7 additions & 9 deletions syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
# shellcheck shell=bash
set -e

export STNOUPGRADE=1

bashio::log.info 'Setup config'
mkdir -p /data/config
bashio::log.info 'Intializing Syncthing'

ip=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{sub("addr:",""); print $2}' | head -n 1)

if [ -z "$ip" ]
then
ip=0.0.0.0
ip=0.0.0.0
bashio::log.info "Couldn't detect IP address. Falling back to: $ip"
else
bashio::log.info "Detected IP address: $ip"
fi

bashio::log.info "Detected IP Address: $ip"

bashio::log.info 'Start syncthing'
syncthing --no-browser --no-restart --home=/data/config --gui-address="$ip:8384"
bashio::log.info 'Starting Syncthing'
syncthing --gui-address="$ip:8384" --no-browser
Loading