1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00
* upgrade to 2.5.4
This commit is contained in:
Éric Gaspar 2020-11-14 15:59:45 +01:00 committed by GitHub
parent bffb38c36e
commit 7c3e351247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 27 deletions

View file

@ -33,7 +33,7 @@ Finally, if installing on a low-end ARM device (e.g. Raspberry Pi):
To learn more about the philosophy and goals of the project, [visit **discourse.org**](http://www.discourse.org). To learn more about the philosophy and goals of the project, [visit **discourse.org**](http://www.discourse.org).
**Shipped version:** 2.3.10 **Shipped version:** 2.5.4
## Screenshots ## Screenshots
@ -139,8 +139,7 @@ systemctl restart discourse
--- ---
Developer info ## Developer info
----------------
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/discourse_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/discourse_ynh/tree/testing).

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/discourse/discourse/archive/v2.3.10.tar.gz SOURCE_URL=https://github.com/discourse/discourse/archive/v2.5.4.tar.gz
SOURCE_SUM=1f7a9672b983d876ed2719b3d347575a76000cc189bfa3e045341728f92fd3f8 SOURCE_SUM=aa2b2cd9efdde3d50c930593e2ab13a634759f77d4d6dcd613a714ccbc30ec86
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,3 +1,3 @@
SOURCE_URL=https://github.com/jonmbake/discourse-ldap-auth/archive/v0.4.0.tar.gz SOURCE_URL=https://github.com/jonmbake/discourse-ldap-auth/archive/v0.4.1.tar.gz
SOURCE_SUM=5fedfe5f287f0ec49e5acf0591fda38084024676de490c6c35e9194de3440185 SOURCE_SUM=08afddecc236cb04f515fe510553c1530bfbec32470682bee89cde1760f4c81f
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz

View file

@ -27,7 +27,7 @@
log_not_found off; log_not_found off;
} }
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
alias __FINALPATH__/public/; alias __FINALPATH__/public/;
proxy_hide_header ETag; proxy_hide_header ETag;

View file

@ -13,6 +13,7 @@ Environment=__ADDITIONAL_ENV__
Environment=RAILS_ENV=production Environment=RAILS_ENV=production
Environment=UNICORN_SIDEKIQS=1 Environment=UNICORN_SIDEKIQS=1
Environment=LD_PRELOAD=__LIBJEMALLOC__ Environment=LD_PRELOAD=__LIBJEMALLOC__
Environment=UNICORN_LISTENER=__FINALPATH__/tmp/sockets/unicorn.sock
ExecStart=__RBENVROOT__/shims/bundle exec unicorn --config config/unicorn.conf.rb -E production ExecStart=__RBENVROOT__/shims/bundle exec unicorn --config config/unicorn.conf.rb -E production
Restart=always Restart=always
RestartSec=10 RestartSec=10

View file

@ -6,7 +6,7 @@
"en": "Discussion platform", "en": "Discussion platform",
"fr": "Plateforme de discussion" "fr": "Plateforme de discussion"
}, },
"version": "2.3.10~ynh2", "version": "2.5.4~ynh1",
"url": "http://Discourse.org", "url": "http://Discourse.org",
"license": "GPL-2.0", "license": "GPL-2.0",
"maintainer": { "maintainer": {
@ -15,7 +15,7 @@
"url": "" "url": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.5" "yunohost": ">= 4.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -6,7 +6,7 @@
pkg_dependencies="g++ libjemalloc1|libjemalloc2 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle brotli" pkg_dependencies="g++ libjemalloc1|libjemalloc2 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle brotli"
RUBY_VERSION="2.6.5" RUBY_VERSION="2.7.1"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
@ -183,8 +183,8 @@ SOURCE_SUM=80ad89ffe04c0b481503bd375f05c212bbc7d44ef5f5e649e0acdf25eba86736" > "
# Build an app.src for ruby-build # Build an app.src for ruby-build
mkdir -p "../conf" mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20191004.tar.gz echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20200520.tar.gz
SOURCE_SUM=6f053957acb0af6d621ebf2b9dacc9c265844b2dc6842a021eb10f0a70094fe8" > "../conf/ruby-build.src" SOURCE_SUM=52be6908a94fbd4a94f5064e8b19d4a3baa4b773269c3884165518d83bcc8922" > "../conf/ruby-build.src"
# Download and extract ruby-build # Download and extract ruby-build
ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build
@ -240,7 +240,10 @@ ynh_install_ruby () {
if ! type rbenv > /dev/null 2>&1 if ! type rbenv > /dev/null 2>&1
then then
ynh_install_rbenv ynh_install_rbenv
elif dpkg --compare-versions "$(/opt/rbenv/bin/rbenv --version | cut -d" " -f2)" lt "1.1.2" elif dpkg --compare-versions "$($rbenv_install_dir/bin/rbenv --version | cut -d" " -f2)" lt "1.1.2"
then
ynh_install_rbenv
elif dpkg --compare-versions "$($rbenv_install_dir/plugins/ruby-build/bin/ruby-build --version | cut -d" " -f2)" lt "20200520"
then then
ynh_install_rbenv ynh_install_rbenv
fi fi
@ -252,7 +255,7 @@ ynh_install_ruby () {
test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby
# Install the requested version of ruby # Install the requested version of ruby
CONFIGURE_OPTS="--disable-install-doc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version
# Store the ID of this app and the version of ruby requested for it # 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" echo "$YNH_APP_ID:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version"
@ -303,6 +306,35 @@ ynh_remove_ruby () {
fi fi
} }
# 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
}
# Returns true if upstream version is up to date # Returns true if upstream version is up to date
# #
# This helper should be used to avoid an upgrade of the upstream version # This helper should be used to avoid an upgrade of the upstream version

View file

@ -188,13 +188,6 @@ echo "svgo: false" > $final_path/.image_optim.yml
#================================================= #=================================================
ynh_script_progression --message="Setting up Unicorn..." ynh_script_progression --message="Setting up Unicorn..."
unicorn_config_file="$final_path/config/unicorn.conf.rb"
# Use socket connection
ynh_replace_string --match_string='listen (ENV\["UNICORN_PORT"\] || 3000).to_i' --replace_string='# listen (ENV["UNICORN_PORT"] || 3000).to_i' "--target_file=$unicorn_config_file"
ynh_replace_string --match_string='# listen "#{discourse_path}/tmp/sockets/unicorn.sock"' --replace_string='listen "#{discourse_path}/tmp/sockets/unicorn.sock"' --target_file="$unicorn_config_file"
# Calculate and store the config file checksum
ynh_store_file_checksum --file="$unicorn_config_file"
# Set a secret value # Set a secret value
cp ../conf/secrets.yml "$final_path/config/secrets.yml" cp ../conf/secrets.yml "$final_path/config/secrets.yml"
ynh_replace_string --match_string="__SECRET__" --replace_string="$(ynh_string_random)" --target_file="$final_path/config/secrets.yml" ynh_replace_string --match_string="__SECRET__" --replace_string="$(ynh_string_random)" --target_file="$final_path/config/secrets.yml"

View file

@ -253,10 +253,6 @@ then
# Make a backup of the original config file if modified # Make a backup of the original config file if modified
ynh_backup_if_checksum_is_different "$unicorn_config_file" ynh_backup_if_checksum_is_different "$unicorn_config_file"
# Use socket connection
ynh_replace_string --match_string='listen (ENV\["UNICORN_PORT"\] || 3000).to_i' --replace_string='# listen (ENV["UNICORN_PORT"] || 3000).to_i' --target_file="$unicorn_config_file"
ynh_replace_string --match_string='# listen "#{discourse_path}/tmp/sockets/unicorn.sock"' --replace_string='listen "#{discourse_path}/tmp/sockets/unicorn.sock"' --target_file="$unicorn_config_file"
# Calculate and store the config file checksum # Calculate and store the config file checksum
ynh_store_file_checksum --file="$unicorn_config_file" ynh_store_file_checksum --file="$unicorn_config_file"