mirror of
https://github.com/YunoHost-Apps/syncthing_ynh.git
synced 2024-09-03 20:26:23 +02:00
fixed nginx configuration, upgraded syncthing to v 0.11.2 and renamed default storage folder (from 'sync' to 'storage')
This commit is contained in:
parent
2f4a67786a
commit
b0bde1bf07
2 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
||||||
location PATHTOCHANGE {
|
location PATHTOCHANGE/ {
|
||||||
proxy_pass http://127.0.0.1:8080/;
|
proxy_pass http://127.0.0.1:8080/;
|
||||||
proxy_pass https://127.0.0.1:8080/;
|
proxy_set_header Host $host;
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
|
|
|
@ -5,11 +5,11 @@ domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
|
|
||||||
# Configurable variables
|
# Configurable variables
|
||||||
syncVersion="0.10.29"
|
syncVersion="0.11.2"
|
||||||
syncHome="/home/yunohost.syncthing"
|
syncHome="/home/yunohost.syncthing"
|
||||||
syncUser=debian-syncthing
|
syncUser=debian-syncthing
|
||||||
syncSyncport=22000
|
syncSyncport=22000
|
||||||
syncUIport=8080
|
syncUIport=8384
|
||||||
|
|
||||||
arch=`uname -m`
|
arch=`uname -m`
|
||||||
if [ "$arch" = "x86_64" ] ; then
|
if [ "$arch" = "x86_64" ] ; then
|
||||||
|
@ -25,6 +25,7 @@ fi
|
||||||
|
|
||||||
sudo yunohost app checkurl $domain$path -a syncthing
|
sudo yunohost app checkurl $domain$path -a syncthing
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
echo $domain$path is not available. Please choose another url for Syncthing.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -34,21 +35,23 @@ path=${path%/}
|
||||||
# Check port availability
|
# Check port availability
|
||||||
sudo yunohost app checkport $syncUIport
|
sudo yunohost app checkport $syncUIport
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
echo Port $syncUIport for Syncthing UI is not available.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sudo yunohost app checkport $syncSyncport
|
sudo yunohost app checkport $syncSyncport
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
echo Port $syncSyncport is for Syncthing protocol is not available.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open port in firewall
|
# Open port in firewall
|
||||||
sudo yunohost firewall allow TCP $syncSyncport > /dev/null 2>&1
|
sudo yunohost firewall allow TCP $syncSyncport > /dev/null 2>&1
|
||||||
|
|
||||||
# Create $syncUser user to syncthing service
|
# Create $syncUser user to run syncthing service
|
||||||
sudo useradd -m -d $syncHome/ -s /bin/bash $syncUser
|
sudo useradd -m -d $syncHome/ -s /bin/bash $syncUser
|
||||||
|
|
||||||
# Make directories and set rights
|
# Make directories and set rights
|
||||||
sudo mkdir -p $syncHome/{bin,sync}
|
sudo mkdir -p $syncHome/{bin,storage}
|
||||||
sudo chown -R $syncUser:$syncUser $syncHome/
|
sudo chown -R $syncUser:$syncUser $syncHome/
|
||||||
sudo find $syncHome/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done
|
sudo find $syncHome/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done
|
||||||
sudo find $syncHome/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done
|
sudo find $syncHome/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done
|
||||||
|
|
Loading…
Add table
Reference in a new issue