diff --git a/conf/config.yaml.default b/conf/config.yaml.default index 14633fe..eae2461 100644 --- a/conf/config.yaml.default +++ b/conf/config.yaml.default @@ -2,21 +2,21 @@ server: # Per default, turtl will listen on all IP addresses # You can choose the IP it will use with this parameter - host: + host: _IP_SERVER__ port: __PORT__ db: connstr: 'postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__' pool: 24 -loglevel: 'debug' +loglevel: 'info' app: # ALWAYS false in production. Always. # Set to 'I UNDERSTAND THIS VIOLATES THE PRIVACY OF MY USERS' to enable enable_bookmarker_proxy: false # no trailing slash - api_url: 'http://api.__DOMAIN__:8181' + api_url: 'https://__DOMAIN__' www_url: 'https://__DOMAIN__' login: # Max failed login attemps. Set to -1 to disable diff --git a/conf/systemd.service b/conf/systemd.service index a0ba71a..d1578c1 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,15 +1,22 @@ [Unit] -Description=Note taking service +Description=Turtl Server: Note taking service Documentation=https://turtlapp.com/ After=network.target + [Service] Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ Environment="PATH=__ENV_PATH__" -ExecStart=__YNH_NODE__ __FINALPATH__/server.js -Restart=on-failure +ExecStart=__YNH_NODE__ __FINALPATH__/entrypoint.sh +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=turtl +Restart=always +RestartSec=10 +StartLimitInterval=900 +StartLimitBurst=3 [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index 4980edf..3ab921b 100755 --- a/scripts/install +++ b/scripts/install @@ -97,6 +97,9 @@ git clone https://github.com/turtl/server "$final_path" --quiet mkdir -p $final_path/plugins +chmod 700 $final_path/plugins +chown $app:$app $final_path/plugins + chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -140,6 +143,7 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 +ip_server="$(curl -s ip.yunohost.org)" || true ynh_add_config --template="../conf/config.yaml.default" --destination="$final_path/config/config.yaml" chmod 400 "$final_path/config/config.yaml"