Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #470 from Poeschl/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Poeschl authored Mar 24, 2024
2 parents 081b14a + c7a4c6d commit 41c02f8
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ updates:
interval: "weekly"
labels:
- "dependency-update"
groups:
GH actions:
dependency-type: production
6 changes: 3 additions & 3 deletions .github/workflows/check-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
uses: actions/checkout@v4

- name: 📂 Detect chanced addons
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/paths-filter.yml

- name: 📂 Detect chanced files
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: changed-files

with:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
path: "./${{ matrix.addon }}/"

- name: 🗄️ Cache docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.addon }}-${{ hashFiles('**/Dockerfile') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
uses: actions/checkout@v4

- name: 📂 Detect chanced addons
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/paths-filter.yml

- name: 📂 Detect chanced files
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: changed-files
with:
list-files: csv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🏷️ Label issue
uses: github/issue-labeler@v3.3
uses: github/issue-labeler@v3.4
with:
repo-token: "${{ secrets.CR_PAT }}"
configuration-path: .github/labeler.yaml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
uses: actions/checkout@v4

- name: 📂 Detect chanced addons
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/paths-filter.yml

- name: 📂 Detect chanced files
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: changed-files

with:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: 📂 Detect chanced files
id: filter
uses: dorny/paths-filter@v2.9.0
uses: dorny/paths-filter@v3
with:
list-files: 'shell'
filters: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main-addon-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4

- name: 📂 Detect chanced files
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/paths-filter.yml
Expand All @@ -41,7 +41,7 @@ jobs:
path: "./${{ matrix.addon }}/"

- name: 🗄️ Cache docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.addon }}-${{ hashFiles('**/Dockerfile') }}
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
mv /tmp/buildx-cache-new /tmp/buildx-cache
- name: 🔑 GHCR Login
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
6 changes: 6 additions & 0 deletions syncthing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.19.0 - 2024-03-24

* 🔨 Mount all available directories into add-on container and improve documentation. Home Assistant's config folder is now available under `/homeassistant` and the configuration of all Home Assistant add-ons under `/addon_configs` (fixes #460, @salim-b | #467).
* 🔨 Hide authentication warnings inside addon. For further discussion see #340 (thanks @salim-b | #457)
* 🔼 Updated syncthing to `1.27.4-r2` (thanks @salim-b | #462)

## 1.18.2 - 2024-01-13

* 🐛 Fix migration issue (again)
Expand Down
32 changes: 22 additions & 10 deletions syncthing/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Configuration is done via [Syncthing's web UI](/hassio/ingress/243ffc37_syncthing) (embedded into Home Assistant). First start the add-on from the [*Info* tab](/hassio/addon/243ffc37_syncthing/info) and then click `OPEN WEB UI`.

After starting up, Syncthing displays a notice (in a yellow box at the top) saying

> Insecure admin access is enabled.
This can safely be ignored since it [does not apply to this add-on](https://github.com/Poeschl/Hassio-Addons/issues/340).

## Syncthing Home Assistant integration

If you want to monitor the Syncthing add-on via Home Assistant's [**Syncthing** integration](https://www.home-assistant.io/integrations/syncthing/), you need to expose Syncthing's web UI to the (local) network rather than only to the [Home Assistant Supervisor](https://developers.home-assistant.io/docs/supervisor).
Expand All @@ -10,24 +16,30 @@ To do so, go to the add-on's [*Configuration* tab](/hassio/addon/243ffc37_syncth

To finish the setup, follow the sections [*Prerequisites*](https://www.home-assistant.io/integrations/syncthing/#prerequisites) and [*Configuration*](https://www.home-assistant.io/integrations/syncthing/#configuration) from the integration's documentation.

NOTE that if your Home Assistant installation is reachable from the internet (e.g. because you enabled [remote access](https://www.home-assistant.io/docs/configuration/remote/)), setting the above port has security implications. It's strongly advised to set a `GUI Authentication User` and a strong `GUI Authentication Password` via Syncthing's settings in that case. See [*Security Principles*](https://docs.syncthing.net/users/security) for further information.
Note that if your Home Assistant installation is reachable from the internet (e.g. because you enabled [remote access](https://www.home-assistant.io/docs/configuration/remote/)), setting the above port has security implications. It's strongly advised to set a `GUI Authentication User` and a strong `GUI Authentication Password` via Syncthing's settings in that case. See [*Security Principles*](https://docs.syncthing.net/users/security) for further information.

## Available directories

When using this add-on to permanently hold your data, put the synced folders inside one of the following directories:
To permanently hold your data, synced folders must be put under one of the following paths:

- `/data`
- `/media`
- `/share`
- `/ssl`
- `/addons`
| Path | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `/addon_configs` | Configuration of all Home Assistant add-ons. |
| `/addons` | Local Home Assistant add-ons. |
| `/backups` | Home Assistant backups. |
| `/config` | Syncthing's own configuration. |
| `/data` | Syncthing's own internal data (state). Not recommended to store synced folders. |
| `/homeassistant` | Home Assistant's own configuration. |
| **`/media`** | Media files to be shared between add-ons and Home Assistant. See below for a possible way to automatically mount external storage devices under this path. |
| ***`/share`*** | Data to be shared between add-ons and Home Assistant. This is the default path for synced folders. |
| `/ssl` | TLS/SSL certificates. |

Only the above directories are mapped into the add-on container. If you put synced folders in any other directory (like `/root` or `/mnt`), the synced data will be deleted on container restart.
Only the above directories are mapped into the add-on container. If you put synced folders under any other directory (like `/root` or `/mnt`), the synced data is deleted on add-on restart. We recommend to put synced folders under either **`/share`** or **`/media`**. Both of these directories are intended to be shared between add-ons, so you can access synced folders via the [Terminal & SSH](/hassio/addon/core_ssh/info) add-on, for example.

Furthermore, note that

- a backup of the syncthing add-on will include the `/data` directory and its contents.
- a [*full* Home Assistant backup](https://www.home-assistant.io/common-tasks/os/#backups) will include the `/media`, `/share`, `/config`, `/ssl` and `/addons` directories and their contents. Create a *partial* backup to specifically exclude any of them.
- a backup of the Syncthing add-on will include its `/data` directory where its internal state is stored. This folder can take up several GiB of data.
- a [*full* Home Assistant backup](https://www.home-assistant.io/common-tasks/os/#backups) will include the `/addons`, `/config`, `/media`, `/share` and`/ssl` directories and their contents. Create a *partial* backup to specifically exclude any of them.
- syncing the `/backup` directory (preferably in [send only mode](https://docs.syncthing.net/users/foldertypes.html#send-only-folder)) is a simple way to automatically backup the Home Assistant backups to any of your other Syncthing devices. 😉
- syncing data to memory cards (eMMC, SD, etc.) might be a bad idea due to rapid wearout, or even impossible to begin with if the synced data is too large. This problem can be remedied either
- by [configuring Home Assistant to use an external data disk](https://www.home-assistant.io/common-tasks/os/#using-external-data-disk), or
Expand Down
3 changes: 2 additions & 1 deletion syncthing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ ARG BUILD_FROM
FROM $BUILD_FROM

RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
"syncthing=1.27.2-r0"
"syncthing=1.27.4-r2"

COPY root /
RUN chmod +x /etc/s6-overlay/s6-rc.d/syncthing-setup/run

ENV HOME=/share \
STCONFDIR=/config \
Expand Down
4 changes: 3 additions & 1 deletion syncthing/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Syncthing
version: "1.18.2"
version: "1.19.0"
slug: syncthing
description: "Syncthing is a continuous file synchronization program in a
de-centralized way"
Expand Down Expand Up @@ -28,7 +28,9 @@ panel_icon: mdi:sync
map:
- addon_config:rw
- addons:rw
- all_addon_configs:rw
- backup:rw
- homeassistant_config:rw
- media:rw
- share:rw
- ssl:rw
20 changes: 20 additions & 0 deletions syncthing/root/etc/s6-overlay/s6-rc.d/syncthing-setup/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e

# determine IP address for api requests
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
bashio::log.info "Couldn't detect local syncthing address. Falling back to: $ip"
else
bashio::log.info "Detected syncthing address: $ip"
fi

bashio::net.wait_for 8384 "$ip"
bashio::log.info 'Post-Start syncthing setup'

apikey=$(grep -o '<apikey>[^<]*' /config/config.xml | sed 's/<apikey>//;s/<\/apikey>//')
syncthing cli --gui-address="$ip:8384" --gui-apikey="$apikey" config gui insecure-admin-access set true
1 change: 1 addition & 0 deletions syncthing/root/etc/s6-overlay/s6-rc.d/syncthing-setup/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions syncthing/root/etc/s6-overlay/s6-rc.d/syncthing-setup/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/syncthing-setup/run
Empty file.

0 comments on commit 41c02f8

Please sign in to comment.