From 15ae6718500ed0a86cec95f67a7b7fe0e393dcbb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Aug 2019 23:33:29 +0200 Subject: Upgrade to 2.9.3 --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'conf') diff --git a/conf/app.src b/conf/app.src index 0973ab9..c423876 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.9.2.tar.gz -SOURCE_SUM=b46f5f2b2032b531997acf942005ce5f88c9389fc3e5b307a281854179d64878 +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v2.9.3.tar.gz +SOURCE_SUM=5b8841328be1e3da8e513d9386f99f0576eb9dbeafb31f2bbe9f4288e9f62756 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -- cgit v1.2.3-70-g09d2 From bf58460ad1dd67f92d861a4abe3ed681a917bde7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 4 Oct 2019 01:43:21 +0200 Subject: Upgrade to 3.0.0 --- README.md | 2 +- README_fr.md | 2 +- conf/.env.production.sample | 15 +++++++++++++++ conf/app.src | 4 ++-- manifest.json | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index 7c70e55..abdab76 100644 --- a/README.md +++ b/README.md @@ -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.0 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index 0613566..7aba0c4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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.0 ## Points importants à lire avant l'installation diff --git a/conf/.env.production.sample b/conf/.env.production.sample index 203b74b..94c65b8 100644 --- a/conf/.env.production.sample +++ b/conf/.env.production.sample @@ -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. diff --git a/conf/app.src b/conf/app.src index c423876..f65585c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -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.0.tar.gz +SOURCE_SUM=6ab9f3bd3a1fedb2cb380f292bb1e95b4a82aff11327ac9230976ba9cd8d6e33 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 5afef4b..eb3c0d5 100644 --- a/manifest.json +++ b/manifest.json @@ -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.0~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": [ -- cgit v1.2.3-70-g09d2 From 45573a61cdb375205cc51a68e2b89595bf5d3f6a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 7 Oct 2019 22:54:13 +0200 Subject: Upgrade to ruby 2.6.5 --- conf/cron | 2 +- conf/mastodon-sidekiq.service | 2 +- conf/mastodon-web.service | 2 +- scripts/install | 16 ++--- scripts/remove | 2 +- scripts/restore | 6 +- scripts/upgrade | 18 +++--- scripts/ynh_install_ruby | 140 ------------------------------------------ scripts/ynh_install_ruby__2 | 140 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 164 insertions(+), 164 deletions(-) delete mode 100644 scripts/ynh_install_ruby create mode 100644 scripts/ynh_install_ruby__2 (limited to 'conf') diff --git a/conf/cron b/conf/cron index 6463d70..9a984a3 100644 --- a/conf/cron +++ b/conf/cron @@ -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 diff --git a/conf/mastodon-sidekiq.service b/conf/mastodon-sidekiq.service index cd7db81..d5fc7e1 100644 --- a/conf/mastodon-sidekiq.service +++ b/conf/mastodon-sidekiq.service @@ -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 diff --git a/conf/mastodon-web.service b/conf/mastodon-web.service index d2f5fdd..bb65afe 100644 --- a/conf/mastodon-web.service +++ b/conf/mastodon-web.service @@ -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 diff --git a/scripts/install b/scripts/install index 1810c9b..311ea59 100644 --- a/scripts/install +++ b/scripts/install @@ -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 @@ -146,9 +146,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,12 +186,12 @@ 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:migrate --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 diff --git a/scripts/remove b/scripts/remove index f482ffe..3db3310 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/restore b/scripts/restore index 1d8180d..689f5c2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index b35d643..563b983 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 @@ -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,14 +267,14 @@ 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 diff --git a/scripts/ynh_install_ruby b/scripts/ynh_install_ruby deleted file mode 100644 index 9e53c06..0000000 --- a/scripts/ynh_install_ruby +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash - -# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args - -rbenv_install_dir="/opt/rbenv" -# RBENV_ROOT is the directory of rbenv, it needs to be loaded as a environment variable. -export RBENV_ROOT="$rbenv_install_dir" - -# Install ruby version management -# -# [internal] -# -# usage: ynh_install_rbenv -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" - # 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" - # Download and extract ruby-build - ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build - - (cd $rbenv_install_dir - ./src/configure && make -C src) - -# Create shims directory if needed -if [ ! -d $rbenv_install_dir/shims ] ; then - mkdir $rbenv_install_dir/shims -fi -} - -# Install a specific version of ruby -# -# ynh_install_ruby will install the version of ruby provided as argument by using rbenv. -# -# rbenv (ruby version management) stores the target ruby version in a .ruby_version file created in the target folder (using rbenv local ) -# It then uses that information for every ruby user that uses rbenv provided ruby command -# -# This helper creates a /etc/profile.d/rbenv.sh that configures PATH environment for rbenv -# for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) -# -# Don't forget to execute ruby-dependent command in a login environment -# (e.g. sudo --login option) -# When not possible (e.g. in systemd service definition), please use direct path -# to rbenv shims (e.g. $RBENV_ROOT/shims/bundle) -# -# usage: ynh_install_ruby ruby_version user -# | arg: -v, --ruby_version= - Version of ruby to install. -# If possible, prefer to use major version number (e.g. 8 instead of 8.10.0). -# The crontab will handle the update of minor versions when needed. -ynh_install_ruby () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [v]=ruby_version= ) - # Use rbenv, https://github.com/rbenv/rbenv to manage the ruby versions - local ruby_version - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - # Create $rbenv_install_dir - mkdir -p "$rbenv_install_dir/plugins/ruby-build" - - # Load rbenv path in PATH - CLEAR_PATH="$rbenv_install_dir/bin:$PATH" - - # Remove /usr/local/bin in PATH in case of ruby prior installation - PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') - - # Move an existing ruby binary, to avoid to block rbenv - test -x /usr/bin/ruby && mv /usr/bin/ruby /usr/bin/ruby_rbenv - - # If rbenv is not previously setup, install it - if ! type rbenv > /dev/null 2>&1 - then - ynh_install_rbenv - fi - - # Restore /usr/local/bin in PATH (if needed) - PATH=$CLEAR_PATH - - # And replace the old ruby binary - test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby - - # Install the requested version of ruby - CONFIGURE_OPTS="--disable-install-doc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version - - # Store the ID of this app and the version of ruby requested for it - echo "$YNH_APP_ID:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version" - - # Store ruby_version into the config of this app - ynh_app_setting_set $app ruby_version $ruby_version - - # Set environment for ruby users - echo "#rbenv -export RBENV_ROOT=$rbenv_install_dir -export PATH=\"$rbenv_install_dir/bin:$PATH\" -eval \"\$(rbenv init -)\" -#rbenv" > /etc/profile.d/rbenv.sh - - # Load the right environment for the Installation - eval "$(rbenv init -)" - - (cd $final_path - rbenv local $ruby_version) -} - -# Remove the version of ruby used by the app. -# -# This helper will check if another app uses the same version of ruby, -# if not, this version of ruby will be removed. -# If no other app uses ruby, rbenv will be also removed. -# -# usage: ynh_remove_ruby -ynh_remove_ruby () { - ruby_version=$(ynh_app_setting_get $app ruby_version) - - # Remove the line for this app - sed --in-place "/$YNH_APP_ID:$ruby_version/d" "$rbenv_install_dir/ynh_app_version" - - # If no other app uses this version of ruby, remove it. - if ! grep --quiet "$ruby_version" "$rbenv_install_dir/ynh_app_version" - then - $rbenv_install_dir/bin/rbenv uninstall --force $ruby_version - fi - - # Remove rbenv environment configuration - rm /etc/profile.d/rbenv.sh - - # If no other app uses rbenv, remove rbenv and dedicated group - if [ ! -s "$rbenv_install_dir/ynh_app_version" ] - then - ynh_secure_remove "$rbenv_install_dir" - fi -} diff --git a/scripts/ynh_install_ruby__2 b/scripts/ynh_install_ruby__2 new file mode 100644 index 0000000..c08b5f4 --- /dev/null +++ b/scripts/ynh_install_ruby__2 @@ -0,0 +1,140 @@ +#!/bin/bash + +# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args + +rbenv_install_dir="/opt/rbenv" +# RBENV_ROOT is the directory of rbenv, it needs to be loaded as a environment variable. +export RBENV_ROOT="$rbenv_install_dir" + +# Install ruby version management +# +# [internal] +# +# usage: ynh_install_rbenv +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.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/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 + + (cd $rbenv_install_dir + ./src/configure && make -C src) + +# Create shims directory if needed +if [ ! -d $rbenv_install_dir/shims ] ; then + mkdir $rbenv_install_dir/shims +fi +} + +# Install a specific version of ruby +# +# ynh_install_ruby will install the version of ruby provided as argument by using rbenv. +# +# rbenv (ruby version management) stores the target ruby version in a .ruby_version file created in the target folder (using rbenv local ) +# It then uses that information for every ruby user that uses rbenv provided ruby command +# +# This helper creates a /etc/profile.d/rbenv.sh that configures PATH environment for rbenv +# for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) +# +# Don't forget to execute ruby-dependent command in a login environment +# (e.g. sudo --login option) +# When not possible (e.g. in systemd service definition), please use direct path +# to rbenv shims (e.g. $RBENV_ROOT/shims/bundle) +# +# usage: ynh_install_ruby ruby_version user +# | arg: -v, --ruby_version= - Version of ruby to install. +# If possible, prefer to use major version number (e.g. 8 instead of 8.10.0). +# The crontab will handle the update of minor versions when needed. +ynh_install_ruby () { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [v]=ruby_version= ) + # Use rbenv, https://github.com/rbenv/rbenv to manage the ruby versions + local ruby_version + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + # Create $rbenv_install_dir + mkdir -p "$rbenv_install_dir/plugins/ruby-build" + + # Load rbenv path in PATH + CLEAR_PATH="$rbenv_install_dir/bin:$PATH" + + # Remove /usr/local/bin in PATH in case of ruby prior installation + PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') + + # Move an existing ruby binary, to avoid to block rbenv + test -x /usr/bin/ruby && mv /usr/bin/ruby /usr/bin/ruby_rbenv + + # If rbenv is not previously setup, install it + if ! type rbenv > /dev/null 2>&1 + then + ynh_install_rbenv + fi + + # Restore /usr/local/bin in PATH (if needed) + PATH=$CLEAR_PATH + + # And replace the old ruby binary + test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby + + # Install the requested version of ruby + CONFIGURE_OPTS="--disable-install-doc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version + + # Store the ID of this app and the version of ruby requested for it + echo "$YNH_APP_ID:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version" + + # Store ruby_version into the config of this app + ynh_app_setting_set $app ruby_version $ruby_version + + # Set environment for ruby users + echo "#rbenv +export RBENV_ROOT=$rbenv_install_dir +export PATH=\"$rbenv_install_dir/bin:$PATH\" +eval \"\$(rbenv init -)\" +#rbenv" > /etc/profile.d/rbenv.sh + + # Load the right environment for the Installation + eval "$(rbenv init -)" + + (cd $final_path + rbenv local $ruby_version) +} + +# Remove the version of ruby used by the app. +# +# This helper will check if another app uses the same version of ruby, +# if not, this version of ruby will be removed. +# If no other app uses ruby, rbenv will be also removed. +# +# usage: ynh_remove_ruby +ynh_remove_ruby () { + ruby_version=$(ynh_app_setting_get $app ruby_version) + + # Remove the line for this app + sed --in-place "/$YNH_APP_ID:$ruby_version/d" "$rbenv_install_dir/ynh_app_version" + + # If no other app uses this version of ruby, remove it. + if ! grep --quiet "$ruby_version" "$rbenv_install_dir/ynh_app_version" + then + $rbenv_install_dir/bin/rbenv uninstall --force $ruby_version + fi + + # Remove rbenv environment configuration + rm /etc/profile.d/rbenv.sh + + # If no other app uses rbenv, remove rbenv and dedicated group + if [ ! -s "$rbenv_install_dir/ynh_app_version" ] + then + ynh_secure_remove "$rbenv_install_dir" + fi +} -- cgit v1.2.3-70-g09d2 From 7e8d2cee5094cafb77954489e75674a636bcc3af Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 10 Oct 2019 20:46:55 +0200 Subject: upgrade to 3.0.1 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index abdab76..0675331 100644 --- a/README.md +++ b/README.md @@ -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:** 3.0.0 +**Shipped version:** 3.0.1 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index 7aba0c4..aa050bc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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:** 3.0.0 +**Version incluse:** 3.0.1 ## Points importants à lire avant l'installation diff --git a/conf/app.src b/conf/app.src index f65585c..ae219ff 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.0.0.tar.gz -SOURCE_SUM=6ab9f3bd3a1fedb2cb380f292bb1e95b4a82aff11327ac9230976ba9cd8d6e33 +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 diff --git a/manifest.json b/manifest.json index eb3c0d5..bd1fc77 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "3.0.0~ynh1", + "version": "3.0.1~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": [ -- cgit v1.2.3-70-g09d2 From ad105db3e151df638402de7c14a39dbec473aba1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 9 Feb 2020 12:42:32 +0100 Subject: Upgrade to 3.1.0 --- README.md | 2 +- README_fr.md | 2 +- conf/.env.production.sample | 20 +++++++++++++++++--- conf/app.src | 4 ++-- manifest.json | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index 0675331..4f1ee70 100644 --- a/README.md +++ b/README.md @@ -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:** 3.0.1 +**Shipped version:** 3.1.0 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index aa050bc..cee679b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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:** 3.0.1 +**Version incluse:** 3.1.0 ## Points importants à lire avant l'installation diff --git a/conf/.env.production.sample b/conf/.env.production.sample index 94c65b8..8b992d9 100644 --- a/conf/.env.production.sample +++ b/conf/.env.production.sample @@ -178,7 +178,11 @@ STREAMING_CLUSTER_NUM=1 # LDAP_BIND_DN=uid=__LDAP_USER__,ou=users,dc=yunohost,dc=org # LDAP_PASSWORD=__LDAP_PASSWORD__ # LDAP_UID=uid -# LDAP_SEARCH_FILTER="%{uid}=%{email}" +# LDAP_MAIL=mail +# LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(%{mail}=%{email})) +# LDAP_UID_CONVERSION_ENABLED=true +# LDAP_UID_CONVERSION_SEARCH=., - +# LDAP_UID_CONVERSION_REPLACE=_ # PAM authentication (optional) # PAM authentication uses for the email generation the "email" pam variable @@ -222,8 +226,8 @@ STREAMING_CLUSTER_NUM=1 # Optional SAML authentication (cf. omniauth-saml) # SAML_ENABLED=true -# SAML_ACS_URL= -# SAML_ISSUER=http://localhost:3000/auth/auth/saml/callback +# SAML_ACS_URL=http://localhost:3000/auth/auth/saml/callback +# SAML_ISSUER=https://example.com # SAML_IDP_SSO_TARGET_URL=https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO # SAML_IDP_CERT= # SAML_IDP_CERT_FINGERPRINT= @@ -246,3 +250,13 @@ STREAMING_CLUSTER_NUM=1 # http_proxy=http://gateway.local:8118 # Access control for hidden service. # ALLOW_ACCESS_TO_HIDDEN_SERVICE=true + +# Authorized fetch mode (optional) +# Require remote servers to authentify when fetching toots, see +# https://docs.joinmastodon.org/admin/config/#authorized_fetch +# AUTHORIZED_FETCH=true + +# Whitelist mode (optional) +# Only allow federation with whitelisted domains, see +# https://docs.joinmastodon.org/admin/config/#whitelist_mode +# WHITELIST_MODE=true diff --git a/conf/app.src b/conf/app.src index ae219ff..bde4af0 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.0.1.tar.gz -SOURCE_SUM=8a9d2bd0d6ad1c7e2a3ecb7561595f7c2186d161cd9be675c08aadb4a07ee475 +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.0.tar.gz +SOURCE_SUM=735e6201885c2c65338bcc645263b87e332664eec12fdabdf4e14f2c18e06ecb SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 8991309..97767b7 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "3.0.1~ynh2", + "version": "3.1.0~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": [ -- cgit v1.2.3-70-g09d2 From 64b80717ddbc8a4d205118257eb4a9beb04c1e3e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 10 Feb 2020 20:08:03 +0100 Subject: Upgrade to 3.1.1 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index 4f1ee70..ec0e046 100644 --- a/README.md +++ b/README.md @@ -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:** 3.1.0 +**Shipped version:** 3.1.1 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index cee679b..6bea9d1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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:** 3.1.0 +**Version incluse:** 3.1.1 ## Points importants à lire avant l'installation diff --git a/conf/app.src b/conf/app.src index bde4af0..5e78c4e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.0.tar.gz -SOURCE_SUM=735e6201885c2c65338bcc645263b87e332664eec12fdabdf4e14f2c18e06ecb +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.1.tar.gz +SOURCE_SUM=4d44458b28667e49bc0d69e7f344a953f869a0df5e41140d932982aa952ab13c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 97767b7..1a29d40 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "3.1.0~ynh1", + "version": "3.1.1~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": [ -- cgit v1.2.3-70-g09d2 From ea70a2cd4f17daecf49e2b414c0e95e4385cf1a6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 22 Feb 2020 17:21:37 +0100 Subject: Fix message --- conf/message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/message b/conf/message index 488d86d..403c4e0 100644 --- a/conf/message +++ b/conf/message @@ -1,5 +1,5 @@ Mastodon was successfully installed :) -Please open 'https://__DOMAIN____PATH_URL__' +Please open : https://__DOMAIN____PATH_URL__ The admin email is: __ADMIN_MAIL__ The admin password is: __ADMIN_PASS__ If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/mastodon_ynh \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 6ff11dacb201a08506b345953aa7b9bd39eeacf5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 23 Feb 2020 18:44:50 +0100 Subject: Apply example_ynh --- README.md | 1 - README_fr.md | 1 - conf/nginx.conf | 96 +++++++++++++++++++++++++++--------------------------- scripts/_common.sh | 3 +- scripts/backup | 2 ++ scripts/install | 7 ++-- scripts/remove | 10 +++--- scripts/restore | 2 ++ scripts/upgrade | 7 ++++ 9 files changed, 71 insertions(+), 58 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index ec0e046..dfce394 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,6 @@ $ screen -r * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/mastodon/) ## Links diff --git a/README_fr.md b/README_fr.md index 6bea9d1..2092750 100644 --- a/README_fr.md +++ b/README_fr.md @@ -57,7 +57,6 @@ L'utilisateur admin est crée automatiquement comme: user@domain.tld * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mastodon/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mastodon/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/mastodon%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/mastodon/) ## Links diff --git a/conf/nginx.conf b/conf/nginx.conf index 190c650..7fa7b87 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,70 +6,70 @@ root __FINALPATH__/live/public; location / { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } + # Force usage of https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } - proxy_set_header Accept-Encoding ""; - try_files $uri @proxy; + proxy_set_header Accept-Encoding ""; + try_files $uri @proxy; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) { - add_header Cache-Control "public, max-age=31536000, immutable"; - add_header Strict-Transport-Security "max-age=31536000"; - try_files $uri @proxy; + add_header Cache-Control "public, max-age=31536000, immutable"; + add_header Strict-Transport-Security "max-age=31536000"; + try_files $uri @proxy; } location /sw.js { - add_header Cache-Control "public, max-age=0"; - add_header Strict-Transport-Security "max-age=31536000"; - try_files $uri @proxy; + add_header Cache-Control "public, max-age=0"; + add_header Strict-Transport-Security "max-age=31536000"; + try_files $uri @proxy; } location @proxy { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header Proxy ""; - proxy_pass_header Server; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; + proxy_pass_header Server; - proxy_pass http://127.0.0.1:3000; - proxy_buffering on; - proxy_redirect off; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; + proxy_pass http://127.0.0.1:3000; + proxy_buffering on; + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; - #proxy_cache CACHE; - proxy_cache_valid 200 7d; - proxy_cache_valid 410 24h; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - add_header X-Cached $upstream_cache_status; - add_header Strict-Transport-Security "max-age=31536000"; + #proxy_cache CACHE; + proxy_cache_valid 200 7d; + proxy_cache_valid 410 24h; + proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + add_header X-Cached $upstream_cache_status; + add_header Strict-Transport-Security "max-age=31536000"; - tcp_nodelay on; + tcp_nodelay on; } location /api/v1/streaming { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header Proxy ""; - - proxy_pass http://127.0.0.1:4000; - proxy_buffering off; - proxy_redirect off; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - tcp_nodelay on; -} + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header Proxy ""; + + proxy_pass http://127.0.0.1:4000; + proxy_buffering off; + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + tcp_nodelay on; +} -error_page 500 501 502 503 504 /500.html; \ No newline at end of file +error_page 500 501 502 503 504 /500.html; diff --git a/scripts/_common.sh b/scripts/_common.sh index 904553d..029d4ff 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,7 @@ #================================================= # dependencies used by the app -#pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools postgresql postgresql-contrib certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev" - pkg_dependencies="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 libgdbm3 libgdbm-dev redis-server redis-tools postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https" +pkg_dependencies="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 libgdbm3 libgdbm-dev redis-server redis-tools postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 62ac387..61ad5f4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_script_progression --message="Managing script failure..." --weight=1 ynh_clean_setup () { ynh_clean_check_starting @@ -77,6 +78,7 @@ ynh_backup --src_path="/etc/systemd/system/$app-streaming.service" #================================================= # BACKUP A CRON FILE #================================================= +ynh_script_progression --message="Backing up a cron file..." --weight=1 ynh_backup --src_path="/etc/cron.d/$app" diff --git a/scripts/install b/scripts/install index 58f0caa..f769f03 100644 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_script_progression --message="Managing script failure..." --weight=1 ynh_clean_setup () { ynh_clean_check_starting @@ -27,6 +28,7 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= +ynh_script_progression --message="Retrieving arguments from the manifest..." --weight=1 domain=$YNH_APP_ARG_DOMAIN path_url="/" @@ -67,7 +69,7 @@ ynh_app_setting_set --app=$app --key=language --value=$language #================================================= ynh_script_progression --message="Configuring firewall..." --weight=1 -# Find a free port +# Find an available port port_web=$(ynh_find_port --port=3000) port_stream=$(ynh_find_port --port=4000) # Open this port @@ -91,7 +93,7 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=5 # Create postgresql database db_name="${app}_production" db_user=$app -db_pwd=$(ynh_string_random 30) +db_pwd=$(ynh_string_random --length30) 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 @@ -129,6 +131,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # ADD SWAP IF NEEDED #================================================= +ynh_script_progression --message="Adding swap is needed..." --weight=4 total_memory=$(ynh_check_ram) total_swap=$(ynh_check_ram --only_swap) diff --git a/scripts/remove b/scripts/remove index 3db3310..b88da99 100644 --- a/scripts/remove +++ b/scripts/remove @@ -27,23 +27,24 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE #================================================= -# REMOVE SERVICE FROM ADMIN PANEL +# REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= +ynh_script_progression --message="Removing service integration in YunoHost..." --weight=2 # Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status "$app-web" >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status "$app-web" >/dev/null then ynh_script_progression --message="Removing $app-web service..." --weight=2 yunohost service remove "$app-web" fi -if yunohost service status "$app-sidekiq" >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status "$app-sidekiq" >/dev/null then ynh_script_progression --message="Removing $app-sidekiq service..." --weight=2 yunohost service remove "$app-sidekiq" fi -if yunohost service status "$app-streaming" >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status "$app-streaming" >/dev/null then ynh_script_progression --message="Removing $app-streaming service..." --weight=2 yunohost service remove "$app-streaming" @@ -99,6 +100,7 @@ ynh_remove_nginx_config #================================================= # REMOVE THE CRON FILE #================================================= +ynh_script_progression --message="Removing the cron file..." --weight=2 # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 1985b26..a45925e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,6 +17,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= +ynh_script_progression --message="Managing script failure..." --weight=2 ynh_clean_setup () { ynh_clean_check_starting @@ -85,6 +86,7 @@ chown -R $app: $final_path #================================================= # ADD SWAP IF NEEDED #================================================= +ynh_script_progression --message="Adding swap if needed..." --weight=4 total_memory=$(ynh_check_ram) total_swap=$(ynh_check_ram --only_swap) diff --git a/scripts/upgrade b/scripts/upgrade index 9cfe1cc..32426a2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,6 +42,7 @@ vapid_public_key=$(ynh_app_setting_get --app=$app --key=vapid_public_key) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) @@ -147,6 +148,11 @@ ynh_abort_if_errors #================================================= # Normalize the URL path syntax +# N.B. : this is for app installations before YunoHost 2.7 +# where this value might be something like /foo/ or foo/ +# instead of /foo .... +# If nobody installed your app before 2.7, then you may +# safely remove this line path_url=$(ynh_normalize_url_path --path_url=$path_url) #================================================= @@ -218,6 +224,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # ADD SWAP IF NEEDED #================================================= +ynh_script_progression --message="Adding swap if needed..." --weight=7 total_memory=$(ynh_check_ram) total_swap=$(ynh_check_ram --only_swap) -- cgit v1.2.3-70-g09d2 From 1eda887adea3599e18fb5e32b08d681820b91614 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 27 Feb 2020 20:05:27 +0100 Subject: Upgrade to 3.1.2 --- README.md | 2 +- README_fr.md | 2 +- check_process | 16 ++++++++++++++++ conf/app.src | 4 ++-- manifest.json | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) (limited to 'conf') diff --git a/README.md b/README.md index dfce394..30abd8e 100644 --- a/README.md +++ b/README.md @@ -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:** 3.1.1 +**Shipped version:** 3.1.2 ## Important points to read before installing diff --git a/README_fr.md b/README_fr.md index 2092750..78e6170 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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:** 3.1.1 +**Version incluse:** 3.1.2 ## Points importants à lire avant l'installation diff --git a/check_process b/check_process index 21c17ae..951b1d3 100644 --- a/check_process +++ b/check_process @@ -12,8 +12,24 @@ setup_private=0 setup_public=1 upgrade=1 + # 2.7.4 + upgrade=1 from_commit=2987ccf8b3aa393dbef79b874dfe5839a0ee10da + # 2.8.2 + upgrade=1 from_commit=2697b734a663bd828d609d3626552611995e6c07 + # 2.8.3 + upgrade=1 from_commit=19299ae680dc851f03a37d49f4e80ca8521e615f + # 2.8.4 + upgrade=1 from_commit=a25e4569c8341ec94a39a57aaccad86379c8a630 + # 2.9.0 + upgrade=1 from_commit=8d0d3ea6611d788635251379e4a51d566b19d8db + # 2.9.2 + upgrade=1 from_commit=1ec1d44c6ed1daa5887367700f077286355a184f + # 2.9.3 + upgrade=1 from_commit=b9086682d2d7762d2882fff2cda4f5dceb73e32b # 3.0.1 upgrade=1 from_commit=168573d3d7dcc4306691f21d5b64819d1f6dd38c + # 3.1.1 + upgrade=1 from_commit=53aeae382eda1263d0ebf9a454bd1c3eeca8ddb1 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. diff --git a/conf/app.src b/conf/app.src index 5e78c4e..fc275ee 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.1.tar.gz -SOURCE_SUM=4d44458b28667e49bc0d69e7f344a953f869a0df5e41140d932982aa952ab13c +SOURCE_URL=https://github.com/tootsuite/mastodon/archive/v3.1.2.tar.gz +SOURCE_SUM=c12fd8c1b426861825d37d2eab1d6356be05b2b321eae0c1b87f80fcc11b0da7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 1a29d40..a38eac9 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "3.1.1~ynh1", + "version": "3.1.2~ynh1", "url": "https://github.com/tootsuite/mastodon", "license": "AGPL-3.0-or-later", "maintainer": [ -- cgit v1.2.3-70-g09d2