From 986148b6dbcb37f450cf2d739e9b2a62e58975f8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 17 Dec 2023 10:39:46 +0100 Subject: [PATCH] cleaning --- manifest.toml | 2 +- scripts/backup | 1 + scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7feecae..3a8ac5b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -75,7 +75,7 @@ ram.runtime = "500M" stream.default = 4000 [resources.apt] - packages = "imagemagick, ffmpeg, libpq-dev, libxml2-dev, libxslt1-dev, file, git-core, g++, libprotobuf-dev, protobuf-compiler, pkg-config, gcc, autoconf, bison, build-essential, libssl-dev, libyaml-dev, libreadline6-dev, zlib1g-dev, libncurses5-dev, libffi-dev, libgdbm6, libgdbm-dev, redis-tools, redis-server, postgresql, postgresql-contrib, libidn11-dev, libicu-dev, libjemalloc-dev, curl, apt-transport-https" + packages = "imagemagick, ffmpeg, libpq-dev, libxml2-dev, libxslt1-dev, file, git, git-core, g++, libprotobuf-dev, protobuf-compiler, pkg-config, gcc, autoconf, bison, build-essential, libssl-dev, libyaml-dev, libreadline6-dev, zlib1g-dev, libncurses5-dev, libffi-dev, libgdbm6, libgdbm-dev, redis-tools, redis-server, postgresql, postgresql-contrib, libidn11-dev, libicu-dev, libjemalloc-dev, curl, apt-transport-https" [resources.apt.extras.yarn] repo = "deb https://dl.yarnpkg.com/debian/ stable main" diff --git a/scripts/backup b/scripts/backup index 2cd6afd..de1ba98 100644 --- a/scripts/backup +++ b/scripts/backup @@ -32,6 +32,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP LOGROTATE #================================================= + ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= diff --git a/scripts/install b/scripts/install index cee92f8..4f2f56c 100644 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,7 @@ pushd "$install_dir/live" ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN) # Building assets ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile + ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile --production --network-timeout 600000 echo "SAFETY_ASSURED=1">> $config ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate --quiet ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet @@ -118,7 +118,7 @@ vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K.+" "$install_dir/live/key.txt") ynh_app_setting_set --app="$app" --key=vapid_public_key --value="$vapid_public_key" ynh_secure_remove --file="$install_dir/live/key.txt" ynh_delete_file_checksum --file="$config" -ynh_add_config --template="../conf/.env.production.sample" --destination="$config" +ynh_add_config --template=".env.production.sample" --destination="$config" chmod 400 "$config" chown $app:$app "$config" @@ -141,7 +141,7 @@ ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming yunohost service add "$app-streaming" --description="$app streaming service" # Create a cron file -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="cron" --destination="/etc/cron.d/$app" # Use logrotate to manage application logfile(s) mkdir -p /var/log/$app diff --git a/scripts/upgrade b/scripts/upgrade index 0f49a0c..aaafcc0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,7 +95,7 @@ pushd "$install_dir/live" ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config set force_ruby_platform true --quiet ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs - ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile + ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile --production --network-timeout 600000 ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile popd @@ -117,7 +117,7 @@ yunohost service add "$app-sidekiq" --description="$app sidekiq service" ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" yunohost service add "$app-streaming" --description="$app streaming service" -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="cron" --destination="/etc/cron.d/$app" # Use logrotate to manage app-specific logfile(s) mkdir -p /var/log/$app @@ -133,7 +133,7 @@ ynh_script_progression --message="Updating a config file..." --weight=1 language="$(echo $language | head -c 2)" -ynh_add_config --template="../conf/.env.production.sample" --destination="$config" +ynh_add_config --template=".env.production.sample" --destination="$config" chmod 400 "$config" chown $app:$app "$config"