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

fix linter

This commit is contained in:
Tagada 2022-01-05 15:46:26 +01:00
parent 7237f85575
commit 09f4af3efe
4 changed files with 21 additions and 20 deletions

View file

@ -6,7 +6,7 @@
"en": "Libre and federated social network, fork of Mastodon",
"fr": "Réseau social libre et fédéré, scission de Mastodon"
},
"version": "2021-12-27~ynh1",
"version": "2021.12.27~ynh1",
"url": "https://github.com/glitch-soc/mastodon",
"upstream": {
"license": "free",

View file

@ -9,9 +9,9 @@ pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git
MEMORY_NEEDED="2560"
RUBY_VERSION="2.7.2"
RUBY_VERSION="3.0.3"
NODEJS_VERSION="16"
NODEJS_VERSION="12"
#=================================================
# PERSONAL HELPERS
@ -117,6 +117,7 @@ ynh_is_main_device_a_sd_card () {
# FUTURE OFFICIAL HELPERS
#=================================================
# ynh_install_ruby__2
ynh_ruby_try_bash_extension() {
if [ -x src/configure ]; then
src/configure && make -C src || {

View file

@ -90,13 +90,13 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
ynh_script_progression --message="Creating a PostgreSQL database..."
ynh_psql_test_if_first_run
# Create PostgreSQL database
db_name=$(ynh_sanitize_dbid --db_name="${app}_production")
db_user=$(ynh_sanitize_dbid --db_name=$app)
db_pwd=$(ynh_string_random --length=30)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;"
@ -204,13 +204,13 @@ pushd "$final_path/live"
sudo -u $app $ynh_ruby_load_path bin/bundle config without 'development test'
sudo -u $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
ynh_exec_warn_less sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
echo "SAFETY_ASSURED=1">> $config
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:setup --quiet
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts modify "$admin" --approve
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:setup --quiet
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts modify "$admin" --approve
popd
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")

View file

@ -84,12 +84,6 @@ fi
# Remove paperclip_secret
ynh_app_setting_delete --app=$app --key=paperclip_secret
# If redis_namespace doesn't exist, create it
if [[ -z "$redis_namespace" ]]; then
redis_namespace=${app}_production
ynh_app_setting_set --app=$app --key=redis_namespace --value=$redis_namespace
fi
# If secret_key_base doesn't exist, retrieve it or create it
if [[ -z "$secret_key_base" ]]; then
secret_key_base=$(grep -oP "SECRET_KEY_BASE=\K\w+" $config)
@ -116,6 +110,12 @@ if [[ -z "$vapid_private_key" ]]; then
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
fi
# If redis_namespace doesn't exist, create it
if [[ -z "$redis_namespace" ]]; then
redis_namespace=${app}_production
ynh_app_setting_set --app=$app --key=redis_namespace --value=$redis_namespace
fi
#Remove previous added repository
ynh_remove_extra_repo
@ -267,10 +267,10 @@ pushd "$final_path/live"
sudo -u $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:clean
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:migrate
sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl cache clear
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:clean
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails assets:precompile
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/bundle exec rails db:migrate
ynh_exec_warn_less sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl cache clear
popd
#=================================================