Cet article fait référence à ce sujet : Création d’un média center 100% autonome.
Rappel : Le téléchargement de média sous copyright est illégal. Cet article est à but lucratif et pour test !
Syncthing est une solution pour synchroniser des fichiers entre deux points. Il synchronise les fichiers via le protocole torrent, et peut détecter automatiquement les changements dans un dossier pour lancer la synchro.
Si vous ne voulez pas de synchronisation automatique mais, une synchronisation à heure fixe. Vous pouvez sauter ce chapitre. -> rutorrent, déplacer les fichiers téléchargés
Installation de Syncthing
Ajout des sources d’installation.
1 2 |
curl -s https://syncthing.net/release-key.txt | sudo apt-key add - echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list |
Installer syncthing.
1 |
sudo apt update && sudo apt install syncthing -y |
Activation du service
1 |
sudo systemctl enable syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
Démarrage du service
1 |
sudo systemctl start syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
Vérification du service
1 |
sudo systemctl status syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<span style="color: #00ff00;">●</span> syncthing@[su_user field="display_name" default="scotch"].service - Syncthing - Open Source Continuous File Synchronization for [su_user field="display_name" default="scotch"] Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled; vendor preset: enabled) Active: <span style="color: #00ff00;">active (running)</span> since Fri 2019-05-17 15:22:24 CEST; 5s ago Docs: man:syncthing(1) Main PID: 25986 (syncthing) CGroup: /system.slice/system-syncthing.slice/syncthing@[su_user field="display_name" default="scotch"].service └─25986 /usr/bin/syncthing -no-browser -no-restart -logflags=0 May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Using discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=XXX May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Using discovery server https://discovery.syncthing.net/v2/?noannounce&id=XXX May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: TCP listener ([::]:22000) starting May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Loading HTTPS certificate: open /home/[su_user field="display_name" default="scotch"]/.config/syncthing/https-cert.pem: no such file or directory May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Creating new HTTPS certificate May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Completed initial scan of sendreceive folder "Default Folder" (default) May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: GUI and API listening on 127.0.0.1:8384 May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: Access the GUI via the following URL: http://127.0.0.1:8384/ May 17 15:22:26 seedbox syncthing[25986]: [QQPAG] INFO: My name is "seedbox" |
Configuration de Syncthing
Par défaut, syncthing n’est pas accessible depuis une autre machine. Nous allons modifier cela.
Arrêt du service
1 |
sudo systemctl stop syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
Editer le fichier config.xml de syncthing
1 |
sudo nano ~/.config/syncthing/config.xml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<configuration version="28"> <folder id="default" label="Default Folder" path="/home/[su_user field="display_name" default="scotch"]/Sync" type="sendreceive" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="false" autoNormalize="true"> <filesystemType>basic</filesystemType> <device id="XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX" introducedBy=""></device> <minDiskFree unit="%">1</minDiskFree> <versioning></versioning> <copiers>0</copiers> <pullerMaxPendingKiB>0</pullerMaxPendingKiB> <hashers>0</hashers> <order>random</order> <ignoreDelete>false</ignoreDelete> <scanProgressIntervalS>0</scanProgressIntervalS> <pullerPauseS>0</pullerPauseS> <maxConflicts>-1</maxConflicts> <disableSparseFiles>false</disableSparseFiles> <disableTempIndexes>false</disableTempIndexes> <paused>false</paused> <weakHashThresholdPct>25</weakHashThresholdPct> <markerName>.stfolder</markerName> <useLargeBlocks>false</useLargeBlocks> </folder> <device id="XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX" name="MediaCenter" compression="metadata" introducer="false" skipIntroductionRemovals="false" introducedBy=""> <address>dynamic</address> <paused>false</paused> <autoAcceptFolders>false</autoAcceptFolders> <maxSendKbps>0</maxSendKbps> <maxRecvKbps>0</maxRecvKbps> <maxRequestKiB>0</maxRequestKiB> </device> <gui enabled="true" tls="false" debugging="false"> <strong> <span style="color: #ff0000;"><address>127.0.0.1:8384</address></span> </strong> <apikey>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</apikey> <theme>default</theme> </gui> <ldap></ldap> <options> <listenAddress>default</listenAddress> <globalAnnounceServer>default</globalAnnounceServer> <globalAnnounceEnabled>true</globalAnnounceEnabled> <localAnnounceEnabled>true</localAnnounceEnabled> <localAnnouncePort>21027</localAnnouncePort> <localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr> <maxSendKbps>0</maxSendKbps> <maxRecvKbps>0</maxRecvKbps> <reconnectionIntervalS>60</reconnectionIntervalS> <relaysEnabled>true</relaysEnabled> <relayReconnectIntervalM>10</relayReconnectIntervalM> |
Remplacer la ligne 31 par
1 |
<address><strong><span style="color: #ff0000;">0.0.0.0</span></strong>:8384</address> |
Ctrl + X pour quitter nano.
« Y » pour enregistrer les modifications.
Touche Entrée pour confirmer.
Démarrage du service
1 |
sudo systemctl start syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
Vérification du service
1 |
sudo systemctl status syncthing@<span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span>.service |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<span style="color: #00ff00;">●</span> syncthing@[su_user field="display_name" default="scotch"].service - Syncthing - Open Source Continuous File Synchronization for <span style="color: #ff0000;">[su_user field="display_name" default="scotch"]</span> Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled; vendor preset: enabled) Active: <span style="color: #00ff00;">active (running)</span> since Fri 2019-05-17 15:28:16 CEST; 7s ago Docs: man:syncthing(1) Main PID: 26169 (syncthing) CGroup: /system.slice/system-syncthing.slice/syncthing@[su_user field="display_name" default="scotch"].service └─26169 /usr/bin/syncthing -no-browser -no-restart -logflags=0 May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Overall send rate is unlimited, receive rate is unlimited May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Using discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=XXX May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Using discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=XXX May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Using discovery server https://discovery.syncthing.net/v2/?noannounce&id=XXX May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: GUI and API listening on [::]:8384 May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Access the GUI via the following URL: http://127.0.0.1:8384/ May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: My name is "seedbox" May 17 15:28:18 seedbox syncthing[26169]: [QQPAG] INFO: Completed initial scan of sendreceive folder "Default Folder" (default) |
Nous verrons la configuration plus tard après avoir installer Syncthing sur votre média center.
-> rutorrent, déplacer les fichiers téléchargés