1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mastodon_ynh.git synced 2024-09-03 19:46:02 +02:00

do not run bundle as root

This commit is contained in:
Kay0u 2020-12-11 14:39:35 +01:00
parent b93733d726
commit a7b1f9a27c
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 17 additions and 17 deletions

View file

@ -189,16 +189,16 @@ chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs ynh_use_nodejs
bundle config deployment 'true' sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config deployment 'true'
bundle config without 'development test' sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config without 'development test'
bundle install -j$(getconf _NPROCESSORS_ONLN) sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle install -j$(getconf _NPROCESSORS_ONLN)
yarn install --pure-lockfile sudo -u $app PATH=$PATH yarn install --pure-lockfile
echo "SAFETY_ASSURED=1">> $config echo "SAFETY_ASSURED=1">> $config
RAILS_ENV=production bundle exec rails db:setup --quiet sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails db:setup --quiet
RAILS_ENV=production bundle exec rails assets:precompile --quiet sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails assets:precompile --quiet
RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key > key.txt sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null sudo -u $app RAILS_ENV=production PATH=$PATH bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
RAILS_ENV=production bin/tootctl accounts modify "$admin" --approve sudo -u $app RAILS_ENV=production PATH=$PATH bin/tootctl accounts modify "$admin" --approve
popd popd
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt") vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")

View file

@ -284,14 +284,14 @@ chown -R "$app": "$final_path"
pushd "$final_path/live" pushd "$final_path/live"
ynh_use_nodejs ynh_use_nodejs
bundle config deployment 'true' sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config deployment 'true'
bundle config without 'development test' sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle config without 'development test'
bundle install -j$(getconf _NPROCESSORS_ONLN) sudo -u $app PATH=$PATH $RBENV_ROOT/shims/bundle install -j$(getconf _NPROCESSORS_ONLN)
yarn install --pure-lockfile sudo -u $app PATH=$PATH yarn install --pure-lockfile
RAILS_ENV=production bundle exec rails assets:clean sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails assets:clean
RAILS_ENV=production bundle exec rails assets:precompile sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails assets:precompile
RAILS_ENV=production bundle exec rails db:migrate sudo -u $app RAILS_ENV=production PATH=$PATH bin/bundle exec rails db:migrate
RAILS_ENV=production bin/tootctl cache clear sudo -u $app RAILS_ENV=production PATH=$PATH bin/tootctl cache clear
popd popd
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.