Syncthing. Linux. Headless installation: различия между версиями

Материал из Wiki
Перейти к навигации Перейти к поиску
(Создана пустая страница)
 
 
(не показана 1 промежуточная версия этого же участника)
Строка 1: Строка 1:
Download


<code>wget <nowiki>https://github.com/syncthing/syncthing/releases/download/v1.27.1/syncthing-linux-amd64-v1.27.1.tar.gz</nowiki></code>
Create dirs
<code>mkdir /mnt/d1/apps/</code>
<code>cd /mnt/d1/apps</code>
Extract and rename
<code>tar xvf ./syncthing-linux-amd64-v1.27.1.tar.gz</code>
<code>mv ./syncthing-linux-amd64-v1.27.1 ./syncthing</code>
User creation
<code>useradd syncthing</code>
<code>passwd syncthing</code>
Systemd service
<code>nano /etc/systemd/system/syncthing.service</code><syntaxhighlight lang="ini">
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/mnt/d1/apps/syncthing/syncthing --data /mnt/d1/apps/syncthing --config /mnt/d1/apps/syncthing --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
User=syncthing
Group=syncthing
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
# Elevated permissions to sync ownership (disabled by default),
# see https://docs.syncthing.net/advanced/folder-sync-ownership
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER
[Install]
WantedBy=default.target
</syntaxhighlight>Change owner
<code>chown -R syncthing:syncthing /mnt/d1/apps/syncthing</code>
Restart service
<code>systemctl daemon-reload</code>
<code>systemctl enable syncthing</code>
<code>systemctl restart syncthing</code>
<code>systemctl status syncthing</code>
Let everybody connect to web syncthing service
<code>nano /mnt/d1/apps/syncthing/config.xml</code>
...
<gui enabled="true" tls="false" debugging="false" sendBasicAuthPrompt="false">
         <address>'''0.0.0.0''':8384</address>
...
Service restart
<code>systemctl restart syncthing</code>
Go to the web service
<code>http://'''<IP>''':'''8384'''</code>
[[Категория:Syncthing]]
[[Категория:AlmaLinux 8]]
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__
__БЕЗ_РЕДАКТИРОВАНИЯ_РАЗДЕЛА__

Текущая версия на 11:10, 14 декабря 2023

Download

wget https://github.com/syncthing/syncthing/releases/download/v1.27.1/syncthing-linux-amd64-v1.27.1.tar.gz

Create dirs

mkdir /mnt/d1/apps/

cd /mnt/d1/apps

Extract and rename

tar xvf ./syncthing-linux-amd64-v1.27.1.tar.gz

mv ./syncthing-linux-amd64-v1.27.1 ./syncthing

User creation

useradd syncthing

passwd syncthing

Systemd service

nano /etc/systemd/system/syncthing.service

[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4

[Service]
ExecStart=/mnt/d1/apps/syncthing/syncthing --data /mnt/d1/apps/syncthing --config /mnt/d1/apps/syncthing --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
User=syncthing
Group=syncthing

# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true

# Elevated permissions to sync ownership (disabled by default),
# see https://docs.syncthing.net/advanced/folder-sync-ownership
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER

[Install]
WantedBy=default.target

Change owner

chown -R syncthing:syncthing /mnt/d1/apps/syncthing

Restart service

systemctl daemon-reload

systemctl enable syncthing

systemctl restart syncthing

systemctl status syncthing

Let everybody connect to web syncthing service

nano /mnt/d1/apps/syncthing/config.xml

...
<gui enabled="true" tls="false" debugging="false" sendBasicAuthPrompt="false">
        <address>0.0.0.0:8384</address>
...

Service restart

systemctl restart syncthing

Go to the web service

http://<IP>:8384