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:
commit
6e245f7eef
16 changed files with 114 additions and 31 deletions
|
@ -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!
|
||||
|
||||
**Shipped version:** 2.7.13~ynh5
|
||||
**Shipped version:** 2.8.6~ynh1
|
||||
|
||||
**Demo:** https://try.discourse.org
|
||||
|
||||
|
|
|
@ -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 !
|
||||
|
||||
**Version incluse :** 2.7.13~ynh5
|
||||
**Version incluse :** 2.8.6~ynh1
|
||||
|
||||
**Démo :** https://try.discourse.org
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
upgrade=1
|
||||
# 2.6.1~ynh2
|
||||
upgrade=1 from_commit=c626379c98bb7f052061446cd152e4406979d49d
|
||||
# 2.7.13~ynh5
|
||||
upgrade=1 from_commit=c1a386fa83c9278ba7bd58875b51e03606f84f13
|
||||
backup_restore=1
|
||||
# Activate multi-instance test only if you have more than 2Gb RAM!
|
||||
multi_instance=0
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/discourse/discourse/archive/v2.7.13.tar.gz
|
||||
SOURCE_SUM=29905c395311844fb3dacbbc11de37d3147ec45fc6c5f0a68b5d8ea98a2bc364
|
||||
SOURCE_URL=https://github.com/discourse/discourse/archive/v2.8.6.tar.gz
|
||||
SOURCE_SUM=15df26119cfe296da82902d1876ef28ddd2f33465c940357322ba183bf3fa443
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -173,7 +173,7 @@ message_bus_redis_skip_client_commands = false
|
|||
enable_cors = false
|
||||
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
|
||||
|
||||
# number of sidekiq workers (launched via unicorn master)
|
||||
|
@ -210,7 +210,7 @@ secret_key_base =
|
|||
fallback_assets_path =
|
||||
|
||||
# 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_region =
|
||||
s3_access_key_id =
|
||||
|
@ -225,7 +225,7 @@ s3_install_cors_rule =
|
|||
max_user_api_reqs_per_minute = 20
|
||||
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_10_seconds = 50
|
||||
|
@ -239,6 +239,9 @@ max_reqs_per_ip_mode = block
|
|||
# bypass rate limiting any IP resolved as a private IP
|
||||
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
|
||||
|
||||
# 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
|
||||
# in allowlist mode all theme updates must happen via git repos
|
||||
# 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
|
||||
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
|
||||
# the application cluster is the same one you are expecting
|
||||
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 =
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Discussion platform",
|
||||
"fr": "Plateforme de discussion"
|
||||
},
|
||||
"version": "2.7.13~ynh5",
|
||||
"version": "2.8.6~ynh1",
|
||||
"url": "http://Discourse.org",
|
||||
"upstream": {
|
||||
"license": "GPL-2.0",
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
#=================================================
|
||||
|
||||
# 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"
|
||||
build_pkg_dependencies=""
|
||||
#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="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
|
||||
|
|
|
@ -65,7 +65,9 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
|
|||
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_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_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# 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)
|
||||
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
|
||||
#=================================================
|
||||
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/rake assets:precompile
|
||||
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/bundle exec rake themes:update assets:precompile
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_package_autoremove
|
||||
|
|
|
@ -89,6 +89,7 @@ ynh_script_progression --message="Removing dependencies..."
|
|||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
ynh_remove_nodejs
|
||||
ynh_remove_ruby
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -78,7 +78,9 @@ ynh_script_progression --message="Reinstalling dependencies..."
|
|||
|
||||
# Define and install 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_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
|
|
|
@ -183,7 +183,9 @@ chown -R $app:www-data "$final_path"
|
|||
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_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_nodejs --nodejs_version=$nodejs_version
|
||||
ynh_use_ruby
|
||||
|
||||
#=================================================
|
||||
|
@ -270,6 +272,14 @@ then
|
|||
ln -s $(ldconfig -p | grep libpsl | awk 'END {print $NF}') libpsl.so
|
||||
)
|
||||
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
|
||||
|
||||
#=================================================
|
||||
|
@ -280,8 +290,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
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/rake assets:precompile
|
||||
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/bundle exec rake themes:update assets:precompile
|
||||
fi
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
|
|
@ -2,11 +2,13 @@ diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
|
|||
index 4a02d5f1b1..7b47f21658 100644
|
||||
--- a/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}")
|
||||
|
||||
|
||||
uglified, map = Uglifier.new(comments: :none,
|
||||
+ harmony: true,
|
||||
+ mangle: false,
|
||||
+ compress: false,
|
||||
source_map: {
|
||||
filename: File.basename(from),
|
||||
output_filename: File.basename(to)
|
||||
|
|
|
@ -3,20 +3,20 @@ index 2b53a91eb3..eec55647d5 100644
|
|||
--- a/lib/discourse.rb
|
||||
+++ b/lib/discourse.rb
|
||||
@@ -439,7 +439,7 @@ module Discourse
|
||||
$full_version ||=
|
||||
begin
|
||||
git_cmd = 'git describe --dirty --match "v[0-9]*"'
|
||||
- self.try_git(git_cmd, 'unknown')
|
||||
+ self.try_git(git_cmd, Discourse::VERSION::STRING)
|
||||
end
|
||||
def self.full_version
|
||||
@full_version ||= begin
|
||||
git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null'
|
||||
- self.try_git(git_cmd, 'unknown')
|
||||
+ self.try_git(git_cmd, Discourse::VERSION::STRING)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -448,7 +448,7 @@ module Discourse
|
||||
$last_commit_date ||=
|
||||
begin
|
||||
git_cmd = 'git log -1 --format="%ct"'
|
||||
- seconds = self.try_git(git_cmd, nil)
|
||||
+ seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch
|
||||
seconds.nil? ? nil : DateTime.strptime(seconds, '%s')
|
||||
end
|
||||
def self.last_commit_date
|
||||
@last_commit_date ||= begin
|
||||
git_cmd = 'git log -1 --format="%ct"'
|
||||
- seconds = self.try_git(git_cmd, nil)
|
||||
+ seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch
|
||||
seconds.nil? ? nil : DateTime.strptime(seconds, '%s')
|
||||
end
|
||||
end
|
||||
|
|
15
sources/patches/app-5-fix-admin-watched-words-action.patch
Normal file
15
sources/patches/app-5-fix-admin-watched-words-action.patch
Normal 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 });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
13
sources/patches/app-6-fix-download-calendar.patch
Normal file
13
sources/patches/app-6-fix-download-calendar.patch
Normal 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",
|
||||
});
|
13
sources/patches/app-7-fix-uppy-upload.patch
Normal file
13
sources/patches/app-7-fix-uppy-upload.patch
Normal 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,
|
Loading…
Add table
Reference in a new issue