Skip to content
This repository was archived by the owner on Jun 21, 2025. It is now read-only.

Commit aba1dc6

Browse files
authored
Merge pull request #4 from Poeschl/refactoring-the-sync
♻️ Complete refactoring of the container.
2 parents 94f327e + 53fc4a1 commit aba1dc6

6 files changed

Lines changed: 109 additions & 55 deletions

File tree

Dockerfile

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM docker.io/debian:bookworm-slim as resources
2-
ENV DEBIAN_FRONTEND=noninteractive
2+
ENV DEBIAN_FRONTEND=noninteractive TERM=xterm-256color
33

44
RUN apt-get update && apt-get install --no-install-recommends -y \
55
wget tar ca-certificates sed
@@ -8,40 +8,29 @@ RUN wget https://www.eti-lan.xyz/sync_server.tar \
88
&& mkdir /sync_server \
99
&& tar xvf sync_server.tar -C /sync_server
1010

11-
# Patch a permission change for /lan
12-
RUN sed -i '/start() {/a chmod -R 0777 /lan; ls -al /lan' /sync_server/etc/init.d/eti
11+
# Fix sync folder path
12+
RUN sed -i 's|/lan/|/$sync_dir/|' /sync_server/etc/init.d/eti
1313

14+
# Patch resilio sync out of the init script
15+
RUN sed -i '/resilio-sync/s/^/#/' /sync_server/etc/init.d/eti
16+
17+
# Patch iptables sync out of the init script
18+
# Firewalling should be handled by the host
19+
RUN sed -i '/iptables/s/^/#/' /sync_server/etc/init.d/eti \
20+
&& sed -i '/ip6tables/s/^/#/' /sync_server/etc/init.d/eti
21+
22+
# Set the terminal width to a fixed value to avoid issues with the init script
23+
RUN sed -i 's/terminal_width=$(tput cols)/terminal_width=100/' /sync_server/etc/init.d/eti \
24+
&& sed -i '/clear/s/^/#/' /sync_server/etc/init.d/eti
1425

1526
FROM docker.io/debian:bookworm-slim as running
16-
ENV DEBIAN_FRONTEND=noninteractive
27+
ENV DEBIAN_FRONTEND=noninteractive TERM=xterm-256color
1728

18-
RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg ca-certificates systemd systemd-sysv iproute2 procps \
29+
RUN apt-get update && apt-get install --no-install-recommends -y curl sqlite3 \
1930
&& apt-get clean \
2031
&& rm -rf /var/lib/apt/lists/*
2132

22-
RUN echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" > /etc/apt/sources.list.d/resilio-sync.list \
23-
&& wget -qO - http://linux-packages.resilio.com/resilio-sync/key.asc | apt-key add - \
24-
&& wget -O resilio-sync.deb https://download-cdn.resilio.com/2.7.3.1381/Debian/resilio-sync_2.7.3.1381-1_amd64.deb \
25-
&& apt-get update \
26-
&& apt-get install --no-install-recommends -y net-tools curl sqlite3 iptables iptables-persistent \
27-
&& dpkg -i resilio-sync.deb \
28-
&& apt-mark hold resilio-sync \
29-
&& apt-get clean \
30-
&& rm -rf /var/lib/apt/lists/* \
31-
&& rm -f resilio-sync.deb
32-
3333
COPY --from=resources /sync_server /
3434

35-
RUN echo "alias eti='/etc/init.d/eti'" >> /root/.bashrc \
36-
&& update-rc.d eti defaults \
37-
&& update-rc.d -f resilio-sync remove \
38-
&& chmod +x /etc/rc.local \
39-
&& echo 'root:lan' | chpasswd
40-
41-
RUN mkdir /lan && chmod 0777 /lan
42-
VOLUME /lan
43-
VOLUME /etc/iptables
44-
45-
STOPSIGNAL SIGRTMIN+3
46-
EXPOSE 8888
47-
ENTRYPOINT ["/usr/sbin/init"]
35+
ENTRYPOINT ["/etc/init.d/eti"]
36+
CMD ["start"]

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@
33
This is a dockerized version of the [Sync Server of the eti Lan Tools](https://www.eti-lan.xyz/sync_server.php).
44
It will start the sync server inside a docker container and provides them locally to any installed eti [Lan-Launcher](https://www.eti-lan.xyz/).
55

6+
## Differences to the original server running in a VM
7+
8+
* The container does not have any firewall functionality, so setting it to lan-only mode needs to be done by the host.
9+
* The commands of the VM-based sync server are not available.
10+
The server starts automatically in the container and shuts it down when the container stops, that's it.
11+
* There is no auto-update of the sync-server container itself, you need to pull the latest image manually.
12+
However, the auto-update of the lan-launcher and its games works as usual.
13+
So the sync server will always be up-to-date with the latest games of the eti Lan Tools after a successful start.
14+
615
## Setup
716

817
As a requirement for a successful operation make sure to have a __linux__ system and a __docker__ or a __rootful podman__ installation running.
9-
Since systemd is running inside the container we need those privileges (PRs to change welcome).
1018

11-
To make the setup as easy as possible a docker-compose.yaml is provided.
19+
To make the setup as easy as possible a docker-compose.yaml and working config-files are provided in the `deploy` folder.
1220
Download it to a new folder and execute `podman-compose up -d` to run it in daemon mode in the background.
13-
The UI should be available under http://localhost:8888 and your hosts ip in the local network.
21+
The Resilio UI should be available under http://localhost:8888 and your hosts ip in the local network.
1422
(For the login look in the next section)
1523

1624
## Auth
1725

18-
When logging into the container the authentication is:
26+
The default login for the Resilio Sync Web UI is:
1927

28+
```
2029
User: `root`
21-
2230
Password: `lan`
23-
24-
This is the same as the default web-ui password. This can be changed via the custom config file `eti-config.conf`.
31+
```
2532

2633
## FAQ
2734

deploy/docker-compose.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
services:
2+
eti-sync-server:
3+
image: ghcr.io/poeschl/eti-sync-server
4+
depends_on:
5+
- resilio
6+
volumes:
7+
- ./eti-config.conf:/root/eti-config.conf
8+
9+
# Keep this line in sync with the data directory in the resilio container
10+
- resilio-data:/sync:z
11+
#- ./resilio-data:/sync:z
12+
13+
resilio:
14+
image: linuxserver/resilio-sync:2.8.1
15+
# use the host_network or the ports. It's up to you.
16+
#network_mode: host
17+
ports:
18+
- 8888:8888
19+
- 55555:55555
20+
environment:
21+
PUID: 1000
22+
PGID: 1000
23+
TZ: Europe/Berlin
24+
volumes:
25+
- ./resilio-config.conf:/config/sync.conf
26+
27+
# Keep this line to let docker take care of the data directory
28+
- resilio-data:/sync:z
29+
# Otherwise use the next line to keep the data directory in the current directory
30+
#- ./resilio-data:/sync:z
31+
32+
volumes:
33+
resilio-data:

deploy/eti-config.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Sync Webinterface Login
2+
user=root
3+
pass=lan
4+
5+
sync_dir=/sync
6+
7+
8+
# You should not change this
9+
syncoptions='&force=1&use_tracker=1&search_lan=1&use_dht=1&use_hosts=1&use_relay_server=1&overwrite_changes=1&folder_deletetotrash=0&use_sync_trash=0'
10+
eti_call='http://resilio:8888/api?method=add_folder&secret=BICDWADB4KCVNR6FCAGYTHEKZBYVUGTZX'
11+
eti_server_call='http://resilio:8888/api?method=add_folder&secret=BOS2KKF2RFQRQGKCC5U2YQNIWLPAQKHWY'
12+
eti_server_key='BOS2KKF2RFQRQGKCC5U2YQNIWLPAQKHWY'
13+
sync_call='http://resilio:8888/api?method=add_folder'
14+
remove_call='http://resilio:8888/api?method=remove_folder'
15+
prefs_call='http://resilio:8888/api?method=set_folder_prefs'
16+
exit_call='http://resilio:8888/api?method=shutdown'

deploy/resilio-config.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"storage_path" : "/sync",
3+
"device_name": "eti-sync-server",
4+
"agree_to_EULA" : "yes",
5+
"check_for_updates" : false,
6+
"use_gui": false,
7+
"use_upnp" : true,
8+
"download_limit" : 0,
9+
"upload_limit" : 0,
10+
"rate_limit_local_peers": false,
11+
"lan_encrypt_data": false,
12+
"sync_max_time_diff": 172800,
13+
"peer_expiration_days": 1,
14+
"folder_defaults.lan_discovery_mode": 3,
15+
// "folder_defaults.use_lan_broadcast": true,
16+
// "service_folders.use_tracker": true,
17+
"service_folders.use_relay": true,
18+
"sync_trash_ttl": 1,
19+
"send_statistics": false,
20+
21+
"webui" :
22+
{
23+
"listen" : "0.0.0.0:8888",
24+
"login" : "root",
25+
"password" : "lan",
26+
"api_key" : "VGWWKFEB2BVHKUNMUPMZHTZFNEVSPWT5CO3UKNKOMXL54FOYDF7VQ2FTUK2M7HXQRMRZ4H5XPABI3NKR7EMCMCVEJDGG54RDO56AGASC2WTU366TPMDTTH4HUS4XWL5PHLK2LIA"
27+
}
28+
}

docker-compose.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)