mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
cleaning
This commit is contained in:
parent
c0e2b71619
commit
0d63141930
4 changed files with 8 additions and 7 deletions
|
@ -75,7 +75,7 @@ ram.runtime = "500M"
|
||||||
stream.default = 4000
|
stream.default = 4000
|
||||||
|
|
||||||
[resources.apt]
|
[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]
|
[resources.apt.extras.yarn]
|
||||||
repo = "deb https://dl.yarnpkg.com/debian/ stable main"
|
repo = "deb https://dl.yarnpkg.com/debian/ stable main"
|
||||||
|
|
|
@ -32,6 +32,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -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)
|
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
|
||||||
# Building assets
|
# Building assets
|
||||||
ynh_use_nodejs
|
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
|
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 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
|
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_app_setting_set --app="$app" --key=vapid_public_key --value="$vapid_public_key"
|
||||||
ynh_secure_remove --file="$install_dir/live/key.txt"
|
ynh_secure_remove --file="$install_dir/live/key.txt"
|
||||||
ynh_delete_file_checksum --file="$config"
|
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"
|
chmod 400 "$config"
|
||||||
chown $app:$app "$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"
|
yunohost service add "$app-streaming" --description="$app streaming service"
|
||||||
|
|
||||||
# Create a cron file
|
# 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)
|
# Use logrotate to manage application logfile(s)
|
||||||
mkdir -p /var/log/$app
|
mkdir -p /var/log/$app
|
||||||
|
|
|
@ -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 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_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
|
||||||
ynh_use_nodejs
|
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:clean
|
||||||
ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile
|
ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile
|
||||||
popd
|
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"
|
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service"
|
||||||
yunohost service add "$app-streaming" --description="$app 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)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
mkdir -p /var/log/$app
|
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)"
|
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"
|
chmod 400 "$config"
|
||||||
chown $app:$app "$config"
|
chown $app:$app "$config"
|
||||||
|
|
Loading…
Add table
Reference in a new issue