1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/turtl_ynh.git synced 2024-09-03 20:26:35 +02:00
This commit is contained in:
ericgaspar 2021-11-25 11:53:18 +01:00
parent 4536811c70
commit f19ba7125c
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 76 additions and 8 deletions

71
conf/config.yaml.default Normal file
View file

@ -0,0 +1,71 @@
---
server:
# Per default, turtl will listen on all IP addresses
# You can choose the IP it will use with this parameter
host:
port: __PORT__
db:
connstr: 'postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__'
pool: 24
loglevel: 'debug'
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'
www_url: 'https://__DOMAIN__'
login:
# Max failed login attemps. Set to -1 to disable
max_attemps: 5
# User locked for this duration in seconds
lock_duration: 60
emails:
admin: 'admin@turtlapp.com'
info: 'Turtl <info@turtlapp.com>'
invites: 'invites@turtlapp.com'
# TODO: replace this with a long, unique value. seriously. write down a dream
# you had, or the short story you came up with during your creative writing
# class in your freshmen year of college. have fun with it.
secure_hash_salt: "__HASH__"
# set to true if you think it's ok to SEND invites if you have not confirmed
# your account. great for testing, not so great for production. but what do
# i know...
allow_unconfirmed_invites: false
sync:
# how many sync records can a client send at a time? it's a good idea to have
# a limit here, lest a rogue client flood the server with sync items
max_bulk_sync_records: 32
plugins:
plugin_location: '/var/www/turtl/server/plugins'
# each key here corresponds to a folder name in the plugins folder, so `email`
# below would be a plugin at /var/www/turtl/server/plugins/email (see the
# example-plugins/ folder for an email plugin you can use)
email:
enabled: false
endpoint: 'smtps://user:password@smtp.gmail.com/?pool=true'
defaults: {}
uploads:
# if set to a path, files will be uploaded to the local filesystem instead of
# S3. otherwise, set to false
local: '/var/www/turtl/server/public/uploads'
# if true, downloading local files will be proxied through the turtl server.
# this avoids needing to set up any CORS config in your favorite webserver,
# but may slightly affect performance on high-demand servers.
local_proxy: true
# if local_proxy is false, this is should be the url path the uploaded files
# are publicly available on
url: 'http://api.turtl.dev/uploads'
s3:
token: 'IHADAPETSNAKEBUTHEDIEDNOOOOO'
secret: ''
bucket: ''
endpoint: 'https://s3.amazonaws.com'
pathstyle: false

View file

@ -27,6 +27,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
hash=$(ynh_string_random --length=128)
app=$YNH_APP_INSTANCE_NAME
@ -89,11 +90,9 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --time --weight=1
ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
#ynh_setup_source --dest_dir="$final_path"
git clone https://github.com/turtl/server "$final_path" --quiet
chmod 750 "$final_path"
@ -105,8 +104,6 @@ chown -R $app:www-data "$final_path"
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
### `ynh_add_nginx_config` will use the file conf/nginx.conf
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -156,14 +153,14 @@ ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
ynh_script_progression --message="Starting a systemd service..." --weight=5
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
@ -171,7 +168,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..." --time --weight=1
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]