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

Merge pull request #180 from YunoHost-Apps/testing

Upgrade to 3.0.1
This commit is contained in:
yalh76 2019-10-11 20:21:48 +02:00 committed by GitHub
commit 6702cf0834
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 59 additions and 39 deletions

View file

@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
## Overview
Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly.
**Shipped version:** 2.9.3
**Shipped version:** 3.0.1
## Important points to read before installing

View file

@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble
Mastodon est un réseau social gratuit et open source. Une alternative décentralisée aux plates-formes commerciales, elle évite les risques d'une seule société qui monopolise votre communication. Choisissez un serveur sur lequel vous faites confiance - selon votre choix, vous pouvez interagir avec tous les autres. N'importe qui peut exécuter sa propre instance de Mastodon et participer au réseau social de façon transparente.
**Version incluse:** 2.9.3
**Version incluse:** 3.0.1
## Points importants à lire avant l'installation

View file

@ -69,6 +69,7 @@ SMTP_PORT=25
#SMTP_LOGIN=
#SMTP_PASSWORD=
SMTP_FROM_ADDRESS=__SMTP_FROM_ADDRESS__
#SMTP_REPLY_TO=
#SMTP_DOMAIN= # defaults to LOCAL_DOMAIN
SMTP_DELIVERY_METHOD=sendmail # delivery method can also be smtp
SMTP_AUTH_METHOD=none
@ -114,6 +115,20 @@ SMTP_OPENSSL_VERIFY_MODE=none
# S3_ENDPOINT=
# S3_SIGNATURE_VERSION=
# Google Cloud Storage (optional)
# Use S3 compatible API. Since GCS does not support Multipart Upload,
# increase the value of S3_MULTIPART_THRESHOLD to disable Multipart Upload.
# The attachment host must allow cross origin request - see the description
# above.
# S3_ENABLED=true
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_PROTOCOL=https
# S3_HOSTNAME=storage.googleapis.com
# S3_ENDPOINT=https://storage.googleapis.com
# S3_MULTIPART_THRESHOLD=52428801 # 50.megabytes
# Swift (optional)
# The attachment host must allow cross origin request - see the description
# above.

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.9.3.tar.gz
SOURCE_SUM=5b8841328be1e3da8e513d9386f99f0576eb9dbeafb31f2bbe9f4288e9f62756
SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.0.1.tar.gz
SOURCE_SUM=8a9d2bd0d6ad1c7e2a3ecb7561595f7c2186d161cd9be675c08aadb4a07ee475
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -1,2 +1,2 @@
RAILS_ENV=production
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.1/bin/bundle exec rake __USER__:media:remove_remote
@daily cd __FINAL__PATH__/live && /opt/rbenv/versions/2.6.5/bin/bundle exec rake __USER__:media:remove_remote

View file

@ -9,7 +9,7 @@
Environment="RAILS_ENV=production"
Environment="DB_POOL=25"
Environment="MALLOC_ARENA_MAX=2"
ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec sidekiq -c 25
ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec sidekiq -c 25
TimeoutSec=15
Restart=always
StandardError=syslog

View file

@ -8,7 +8,7 @@
WorkingDirectory=__FINALPATH__/live
Environment="RAILS_ENV=production"
Environment="PORT=__PORT_WEB__"
ExecStart=/opt/rbenv/versions/2.6.1/bin/bundle exec puma -C config/puma.rb
ExecStart=/opt/rbenv/versions/2.6.5/bin/bundle exec puma -C config/puma.rb
ExecReload=/bin/kill -SIGUSR1 $MAINPID
TimeoutSec=15
Restart=always

View file

@ -6,7 +6,7 @@
"en": "Mastodon is a free, open-source social network.",
"fr": "Mastodon est un réseau social gratuit et open source."
},
"version": "2.9.3~ynh1",
"version": "3.0.1~ynh1",
"url": "https://github.com/tootsuite/mastodon",
"license": "AGPL-3.0-or-later",
"maintainer": [

View file

@ -7,7 +7,7 @@
#=================================================
source _common.sh
source ynh_install_ruby
source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3
source ynh_send_readme_to_admin__2
source ynh_add_swap
@ -96,6 +96,7 @@ 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;"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -146,9 +147,9 @@ ynh_add_swap --size=$swap_needed
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424
ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.1/bin/gem update --system
#/opt/rbenv/versions/2.6.1/bin/gem install bundler --no-document
ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.5/bin/gem update --system
#/opt/rbenv/versions/2.6.5/bin/gem install bundler --no-document
#=================================================
# MODIFY A CONFIG FILE
@ -186,20 +187,20 @@ chown -R "$app": "$final_path"
pushd "$final_path/live"
ynh_use_nodejs
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
sudo -u "$app" echo "SAFETY_ASSURED=1">> .env.production
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails db:setup --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:precompile --quiet
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > acc.txt
popd
admin_pass=$( tail -1 $final_path/live/acc.txt | head -1 | cut -c 15- )
ynh_secure_remove --file="$final_path/live/acc.txt"
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt")
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt")
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K.+" "$final_path/live/key.txt")
ynh_replace_string --match_string="__VAPID_PRIVATE_KEY__" --replace_string="$vapid_private_key" --target_file="${final_path}/live/.env.production"
ynh_replace_string --match_string="__VAPID_PUBLIC_KEY__" --replace_string="$vapid_public_key" --target_file="${final_path}/live/.env.production"

View file

@ -7,7 +7,7 @@
#=================================================
source _common.sh
source ynh_install_ruby
source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3
source ynh_add_swap
source /usr/share/yunohost/helpers

View file

@ -8,7 +8,7 @@
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_install_ruby
source ../settings/scripts/ynh_install_ruby__2
source ../settings/scripts/ynh_add_extra_apt_repos__3
source ../settings/scripts/ynh_add_swap
source ../settings/scripts/ynh_check_ram
@ -112,8 +112,8 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=393
ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.1/bin/gem update --system
ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.5/bin/gem update --system
#=================================================
# RESTORE THE POSTGRESQL DATABASE
@ -122,6 +122,7 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight
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;"
ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
#=================================================

View file

@ -7,7 +7,7 @@
#=================================================
source _common.sh
source ynh_install_ruby
source ynh_install_ruby__2
source ynh_add_extra_apt_repos__3
source ynh_add_swap
source ynh_check_ram
@ -118,8 +118,8 @@ fi
# If vapid_private_key doesn't exist, retrieve it or create it
if [[ -z "$vapid_private_key" ]]; then
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" ${final_path}/live/.env.production)
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" ${final_path}/live/.env.production)
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" ${final_path}/live/.env.production)
vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K.+" ${final_path}/live/.env.production)
ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
fi
@ -228,9 +228,9 @@ ynh_add_swap --size=$swap_needed
#=================================================
ynh_script_progression --message="Installing Ruby..." --weight=424
ynh_install_ruby --ruby_version=2.6.1
/opt/rbenv/versions/2.6.1/bin/gem update --system
#/opt/rbenv/versions/2.6.1/bin/gem install bundler
ynh_install_ruby --ruby_version=2.6.5
/opt/rbenv/versions/2.6.5/bin/gem update --system
#/opt/rbenv/versions/2.6.5/bin/gem install bundler
#=================================================
# MODIFY A CONFIG FILE
@ -267,22 +267,22 @@ chown -R "$app": "$final_path"
pushd "$final_path/live"
ynh_use_nodejs
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --without development test
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install --deployment --without development test
else
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.1/bin/bundle install --deployment --force --without development test
sudo -u "$app" env PATH=$PATH /opt/rbenv/versions/2.6.5/bin/bundle install --deployment --force --without development test
fi
sudo -u "$app" env PATH=$PATH yarn install --pure-lockfile
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:clean
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails assets:precompile
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.1/bin/bundle exec rails db:migrate
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:clean
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails assets:precompile
sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.5/bin/bundle exec rails db:migrate
sudo -u "$app" env PATH=$PATH RAILS_ENV=production bin/tootctl cache clear
popd
# If vapid_private_key doesn't exist, retrieve it or create it
#if [[ -z "$vapid_private_key" ]]; then
# sudo -u "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/2.6.0/bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
# vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K\w+" "$final_path/live/key.txt")
# vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K\w+" "$final_path/live/key.txt")
# vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")
# vapid_public_key=$(grep -oP "VAPID_PUBLIC_KEY=\K.+" "$final_path/live/key.txt")
# ynh_app_setting_set "$app" vapid_private_key "$vapid_private_key"
# ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
# ynh_secure_remove "$final_path/live/key.txt"

View file

@ -15,15 +15,15 @@ ynh_install_rbenv () {
echo "Installation of rbenv - ruby version management" >&2
# Build an app.src for rbenv
mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/rbenv/archive/v1.1.1.tar.gz
SOURCE_SUM=41f1a60714c55eceb21d692a469aee1ec4f46bba351d0dfcb0c660ff9cf1a1c9" > "../conf/rbenv.src"
echo "SOURCE_URL=https://github.com/rbenv/rbenv/archive/v1.1.2.tar.gz
SOURCE_SUM=80ad89ffe04c0b481503bd375f05c212bbc7d44ef5f5e649e0acdf25eba86736" > "../conf/rbenv.src"
# Download and extract rbenv
ynh_setup_source "$rbenv_install_dir" rbenv
# Build an app.src for ruby-build
mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20190314.tar.gz
SOURCE_SUM=2cc0f9fdb232042e71edad93a5c3ae108bcd090ea0b6db4e5bb6325547e07968" > "../conf/ruby-build.src"
echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20191004.tar.gz
SOURCE_SUM=6f053957acb0af6d621ebf2b9dacc9c265844b2dc6842a021eb10f0a70094fe8" > "../conf/ruby-build.src"
# Download and extract ruby-build
ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build
@ -77,6 +77,9 @@ ynh_install_ruby () {
# If rbenv is not previously setup, install it
if ! type rbenv > /dev/null 2>&1
then
ynh_install_rbenv
elif dpkg --compare-versions "$(/opt/rbenv/bin/rbenv --version | cut -d" " -f2)" lt "1.1.2"
then
ynh_install_rbenv
fi