From f19ba7125cf82dabeff311d4ca1b51a30346de3b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Nov 2021 11:53:18 +0100 Subject: [PATCH] Fix --- conf/config.yaml.default | 71 ++++++++++++++++++++++++++++++++++++++++ scripts/install | 13 +++----- 2 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 conf/config.yaml.default diff --git a/conf/config.yaml.default b/conf/config.yaml.default new file mode 100644 index 0000000..98387cc --- /dev/null +++ b/conf/config.yaml.default @@ -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 ' + 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 diff --git a/scripts/install b/scripts/install index 7c1eda8..0937f8d 100755 --- a/scripts/install +++ b/scripts/install @@ -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 ]