1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Merge pull request #119 from YunoHost-Apps/ci-auto-update-v2.8.6

Upgrade to version 2.8.6
This commit is contained in:
yalh76 2022-07-29 17:41:41 +02:00 committed by GitHub
commit 6e245f7eef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 114 additions and 31 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Discourse is modern forum software for your community. Use it as a mailing list, discussion forum, long-form chat room, and more! Discourse is modern forum software for your community. Use it as a mailing list, discussion forum, long-form chat room, and more!
**Shipped version:** 2.7.13~ynh5 **Shipped version:** 2.8.6~ynh1
**Demo:** https://try.discourse.org **Demo:** https://try.discourse.org

View file

@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Discourse est un logiciel de forum moderne pour votre communauté. Utilisez-le comme liste de diffusion, forum de discussion, salle de discussion longue durée, et plus encore ! Discourse est un logiciel de forum moderne pour votre communauté. Utilisez-le comme liste de diffusion, forum de discussion, salle de discussion longue durée, et plus encore !
**Version incluse :** 2.7.13~ynh5 **Version incluse :** 2.8.6~ynh1
**Démo :** https://try.discourse.org **Démo :** https://try.discourse.org

View file

@ -14,6 +14,8 @@
upgrade=1 upgrade=1
# 2.6.1~ynh2 # 2.6.1~ynh2
upgrade=1 from_commit=c626379c98bb7f052061446cd152e4406979d49d upgrade=1 from_commit=c626379c98bb7f052061446cd152e4406979d49d
# 2.7.13~ynh5
upgrade=1 from_commit=c1a386fa83c9278ba7bd58875b51e03606f84f13
backup_restore=1 backup_restore=1
# Activate multi-instance test only if you have more than 2Gb RAM! # Activate multi-instance test only if you have more than 2Gb RAM!
multi_instance=0 multi_instance=0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/discourse/discourse/archive/v2.7.13.tar.gz SOURCE_URL=https://github.com/discourse/discourse/archive/v2.8.6.tar.gz
SOURCE_SUM=29905c395311844fb3dacbbc11de37d3147ec45fc6c5f0a68b5d8ea98a2bc364 SOURCE_SUM=15df26119cfe296da82902d1876ef28ddd2f33465c940357322ba183bf3fa443
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

@ -173,7 +173,7 @@ message_bus_redis_skip_client_commands = false
enable_cors = false enable_cors = false
cors_origin = '' cors_origin = ''
# enable if you really need to serve assets in prd # enable if you really need to serve assets in prod
serve_static_assets = true serve_static_assets = true
# number of sidekiq workers (launched via unicorn master) # number of sidekiq workers (launched via unicorn master)
@ -210,7 +210,7 @@ secret_key_base =
fallback_assets_path = fallback_assets_path =
# S3 settings used for serving ALL public files # S3 settings used for serving ALL public files
# be sure to configre a CDN as well per cdn_url # be sure to configure a CDN as well per cdn_url
s3_bucket = s3_bucket =
s3_region = s3_region =
s3_access_key_id = s3_access_key_id =
@ -225,7 +225,7 @@ s3_install_cors_rule =
max_user_api_reqs_per_minute = 20 max_user_api_reqs_per_minute = 20
max_user_api_reqs_per_day = 2880 max_user_api_reqs_per_day = 2880
max_admin_api_reqs_per_key_per_minute = 60 max_admin_api_reqs_per_minute = 60
max_reqs_per_ip_per_minute = 200 max_reqs_per_ip_per_minute = 200
max_reqs_per_ip_per_10_seconds = 50 max_reqs_per_ip_per_10_seconds = 50
@ -239,6 +239,9 @@ max_reqs_per_ip_mode = block
# bypass rate limiting any IP resolved as a private IP # bypass rate limiting any IP resolved as a private IP
max_reqs_rate_limit_on_private = false max_reqs_rate_limit_on_private = false
# use per user rate limits vs ip rate limits for users with this trust level or more.
skip_per_ip_rate_limit_trust_level = 1
# logged in DoS protection # logged in DoS protection
# protection will only trigger for requests that queue longer than this amount # protection will only trigger for requests that queue longer than this amount
@ -315,7 +318,7 @@ anon_cache_store_threshold = 2
# you may restrict it so only specific themes are approved # you may restrict it so only specific themes are approved
# in allowlist mode all theme updates must happen via git repos # in allowlist mode all theme updates must happen via git repos
# themes missing from the list are automatically disallowed # themes missing from the list are automatically disallowed
# list is a comma seperated list of git repos eg: # list is a comma separated list of git repos eg:
# https://github.com/discourse/discourse-custom-header-links.git,https://github.com/discourse/discourse-simple-theme.git # https://github.com/discourse/discourse-custom-header-links.git,https://github.com/discourse/discourse-simple-theme.git
allowed_theme_repos = allowed_theme_repos =
@ -336,3 +339,12 @@ max_digests_enqueued_per_30_mins_per_site = 10000
# This cluster name can be passed to the /srv/status route to verify # This cluster name can be passed to the /srv/status route to verify
# the application cluster is the same one you are expecting # the application cluster is the same one you are expecting
cluster_name = cluster_name =
# The YAML file used to configure multisite clusters
multisite_config_path = config/multisite.yml
# If false, only short (regular) polling will be attempted
enable_long_polling =
# Length of time to hold open a long polling connection in milliseconds
long_polling_interval =

View file

@ -6,7 +6,7 @@
"en": "Discussion platform", "en": "Discussion platform",
"fr": "Plateforme de discussion" "fr": "Plateforme de discussion"
}, },
"version": "2.7.13~ynh5", "version": "2.8.6~ynh1",
"url": "http://Discourse.org", "url": "http://Discourse.org",
"upstream": { "upstream": {
"license": "GPL-2.0", "license": "GPL-2.0",

View file

@ -5,10 +5,13 @@
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="g++ libjemalloc1|libjemalloc2 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-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-dev libapr1-dev libxslt1-dev libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle brotli"
build_pkg_dependencies="" pkg_dependencies="postgresql postgresql-client postgresql-contrib imagemagick libjemalloc1|libjemalloc2"
build_pkg_dependencies="libcurl4-openssl-dev libyaml-dev libxml2-dev libpq-dev libreadline-dev brotli libunwind-dev libtcmalloc-minimal4 cmake pngcrush pngquant advancecomp jhead jpegoptim libjpeg-turbo-progs optipng"
ruby_version="2.7.1" ruby_version="2.7.6"
nodejs_version="16"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -65,7 +65,9 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_script_progression --message="Installing dependencies..." ynh_script_progression --message="Installing dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -186,13 +188,21 @@ if [ -n "$(uname -m | grep arm)" ] ; then
ln -s $(ldconfig -p | grep libpsl | awk 'END {print $NF}') libpsl.so) ln -s $(ldconfig -p | grep libpsl | awk 'END {print $NF}') libpsl.so)
fi fi
pushd "$final_path"
ynh_use_nodejs
ynh_npm install --location=global terser
ynh_npm install --location=global uglify-js
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --production --frozen-lockfile
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn cache clean
popd
#================================================= #=================================================
# PREPARE THE DATABASE # PREPARE THE DATABASE
#================================================= #=================================================
ynh_script_progression --message="Preparing the database..." ynh_script_progression --message="Preparing the database..."
ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/rake db:migrate ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/bundle exec rake db:migrate
ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/rake assets:precompile ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/bundle exec rake themes:update assets:precompile
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_package_autoremove ynh_package_autoremove

View file

@ -89,6 +89,7 @@ ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
ynh_remove_nodejs
ynh_remove_ruby ynh_remove_ruby
#================================================= #=================================================

View file

@ -78,7 +78,9 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies # Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION

View file

@ -183,7 +183,9 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Upgrading dependencies..." ynh_script_progression --message="Upgrading dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_use_ruby ynh_use_ruby
#================================================= #=================================================
@ -270,6 +272,14 @@ then
ln -s $(ldconfig -p | grep libpsl | awk 'END {print $NF}') libpsl.so ln -s $(ldconfig -p | grep libpsl | awk 'END {print $NF}') libpsl.so
) )
fi fi
pushd "$final_path"
ynh_use_nodejs
ynh_npm install --location=global terser
ynh_npm install --location=global uglify-js
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --production --frozen-lockfile
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn cache clean
popd
fi fi
#================================================= #=================================================
@ -280,8 +290,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Preparing the database..." ynh_script_progression --message="Preparing the database..."
ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/rake db:migrate ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/bundle exec rake db:migrate
ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/rake assets:precompile ynh_exec_warn_less exec_login_as $app RAILS_ENV=production bin/bundle exec rake themes:update assets:precompile
fi fi
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies

View file

@ -2,11 +2,13 @@ diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index 4a02d5f1b1..7b47f21658 100644 index 4a02d5f1b1..7b47f21658 100644
--- a/lib/tasks/assets.rake --- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake
@@ -94,6 +94,7 @@ def compress_ruby(from, to) @@ -126,6 +126,9 @@
data = File.read("#{assets_path}/#{from}") data = File.read("#{assets_path}/#{from}")
uglified, map = Uglifier.new(comments: :none, uglified, map = Uglifier.new(comments: :none,
+ harmony: true, + harmony: true,
+ mangle: false,
+ compress: false,
source_map: { source_map: {
filename: File.basename(from), filename: File.basename(from),
output_filename: File.basename(to) output_filename: File.basename(to)

View file

@ -3,20 +3,20 @@ index 2b53a91eb3..eec55647d5 100644
--- a/lib/discourse.rb --- a/lib/discourse.rb
+++ b/lib/discourse.rb +++ b/lib/discourse.rb
@@ -439,7 +439,7 @@ module Discourse @@ -439,7 +439,7 @@ module Discourse
$full_version ||= def self.full_version
begin @full_version ||= begin
git_cmd = 'git describe --dirty --match "v[0-9]*"' git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null'
- self.try_git(git_cmd, 'unknown') - self.try_git(git_cmd, 'unknown')
+ self.try_git(git_cmd, Discourse::VERSION::STRING) + self.try_git(git_cmd, Discourse::VERSION::STRING)
end end
end end
@@ -448,7 +448,7 @@ module Discourse @@ -448,7 +448,7 @@ module Discourse
$last_commit_date ||= def self.last_commit_date
begin @last_commit_date ||= begin
git_cmd = 'git log -1 --format="%ct"' git_cmd = 'git log -1 --format="%ct"'
- seconds = self.try_git(git_cmd, nil) - seconds = self.try_git(git_cmd, nil)
+ seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch + seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch
seconds.nil? ? nil : DateTime.strptime(seconds, '%s') seconds.nil? ? nil : DateTime.strptime(seconds, '%s')
end end
end end

View file

@ -0,0 +1,15 @@
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
index 2b53a91eb3..eec55647d5 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js
@@ -32,9 +32,9 @@
for (const { regexp, word } of words) {
try {
RegExp(regexp);
- } catch {
+ } catch (err) {
return I18n.t("admin.watched_words.invalid_regex", { word });
}
}
},

View file

@ -0,0 +1,13 @@
diff --git a/app/assets/javascripts/discourse/app/lib/download-calendar.js b/app/assets/javascripts/discourse/app/lib/download-calendar.js
index 2b53a91eb3..eec55647d5 100644
--- a/app/assets/javascripts/discourse/app/lib/download-calendar.js
+++ b/app/assets/javascripts/discourse/app/lib/download-calendar.js
@@ -22,7 +22,7 @@
}
export function downloadIcs(title, dates) {
- const REMOVE_FILE_AFTER = 20_000;
+ const REMOVE_FILE_AFTER = 20000;
const file = new File([generateIcsData(title, dates)], {
type: "text/plain",
});

View file

@ -0,0 +1,13 @@
diff --git a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
index 2b53a91eb3..eec55647d5 100644
--- a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
+++ b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js
@@ -21,7 +21,7 @@
import { warn } from "@ember/debug";
import bootbox from "bootbox";
-export const HUGE_FILE_THRESHOLD_BYTES = 104_857_600; // 100MB
+export const HUGE_FILE_THRESHOLD_BYTES = "104_857_600"; // 100MB
export default Mixin.create(UppyS3Multipart, {
uploading: false,