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 #14 from YunoHost-Apps/enh_update_2.2.1

Upgrade to upstream version 2.2.1
This commit is contained in:
JimboJoe 2019-02-10 12:25:17 +01:00 committed by GitHub
commit 2072200467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 89 additions and 38 deletions

View file

@ -32,7 +32,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.1.8 **Shipped version:** 2.2.1
## Screenshots ## Screenshots

View file

@ -12,7 +12,7 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=c97db21b4a821651355c48c4f7efdfb763e2a072 upgrade=1 from_commit=c8a29d271b87eac57e8dbf1a464c11a51d09810c
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=1 multi_instance=1
@ -36,6 +36,6 @@
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=c97db21b4a821651355c48c4f7efdfb763e2a072 ; commit=c8a29d271b87eac57e8dbf1a464c11a51d09810c
name=Upgrade to upstream version 2.0.2 name=Upgrade to upstream version 2.1.8
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&

View file

@ -1,3 +1,3 @@
SOURCE_URL=https://github.com/discourse/discourse/archive/v2.1.8.tar.gz SOURCE_URL=https://github.com/discourse/discourse/archive/v2.2.1.tar.gz
SOURCE_SUM=f4c18a61f47d29381677e10d3ffaf68c407cc07eb5dae3b9a97245fab9f1d4b1 SOURCE_SUM=d7fb8ea9facefa8a0488c89b478a544eb032c5ab36dba4b39c95f0d2462af25b
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz

View file

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

View file

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

View file

@ -4,7 +4,7 @@
# #
pkg_dependencies="libjemalloc1 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev checkinstall libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle" pkg_dependencies="libjemalloc1 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev checkinstall libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle"
RUBY_VERSION="2.4.4" RUBY_VERSION="2.6.0"
# Execute a command as another user with login # Execute a command as another user with login
# (hence in user home dir, with prior loading of .profile, etc.) # (hence in user home dir, with prior loading of .profile, etc.)
@ -339,13 +339,6 @@ SOURCE_SUM=41f1a60714c55eceb21d692a469aee1ec4f46bba351d0dfcb0c660ff9cf1a1c9" > "
# Download and extract rbenv # Download and extract rbenv
ynh_setup_source "$rbenv_install_dir" 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/v20180329.tar.gz
SOURCE_SUM=4c8610c178ef2fa6bb29d4bcfca52608914632a51a56a5e70aeec8bf0894167b" > "../conf/ruby-build.src"
# Download and extract ruby-build
ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build
(cd $rbenv_install_dir (cd $rbenv_install_dir
./src/configure && make -C src) ./src/configure && make -C src)
@ -396,6 +389,16 @@ ynh_install_ruby () {
ynh_install_rbenv ynh_install_rbenv
fi fi
# Download ruby-build (replace if already exists)
if [ -d $rbenv_install_dir/plugins/ruby-build ]; then
rm -Rf $rbenv_install_dir/plugins/ruby-build
fi
# Build an app.src for ruby-build
mkdir -p "../conf"
echo "SOURCE_URL=https://github.com/rbenv/ruby-build/archive/v20181225.tar.gz
SOURCE_SUM=5ace4787ace47384dc419b20f5eb5a59f1174e00bfabcfed74a175033cd0b18a" > "../conf/ruby-build.src"
# Download and extract ruby-build
ynh_setup_source "$rbenv_install_dir/plugins/ruby-build" ruby-build
# Restore /usr/local/bin in PATH (if needed) # Restore /usr/local/bin in PATH (if needed)
PATH=$CLEAR_PATH PATH=$CLEAR_PATH

View file

@ -272,7 +272,7 @@ y
# Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder # Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder
# (Can only do that now because we are patching dependencies which have just been downloaded) # (Can only do that now because we are patching dependencies which have just been downloaded)
# Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16 # Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16
(cd $final_path/plugins/discourse-ldap-auth/gems/*/gems/omniauth-ldap*/ (cd $final_path/plugins/discourse-ldap-auth/gems/${RUBY_VERSION}/gems/omniauth-ldap*/
patch -p1 < $YNH_CWD/../conf/ldap-auth-fix-subfolder.patch) patch -p1 < $YNH_CWD/../conf/ldap-auth-fix-subfolder.patch)
#================================================= #=================================================

View file

@ -66,12 +66,6 @@ fi
ynh_install_app_dependencies "$pkg_dependencies" ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# INSTALL RUBY
#=================================================
ynh_install_ruby $RUBY_VERSION
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -99,12 +93,42 @@ if ! ynh_is_upstream_up_to_date ; then
cp ../sources/patches_arm/* ../sources/patches cp ../sources/patches_arm/* ../sources/patches
fi fi
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
# Backup files to keep
tmpdir=$(mktemp -d)
cp -Rp $final_path/public/uploads $final_path/plugins $final_path/config/discourse.conf $tmpdir
if [ -d $final_path/public/backups ] ; then
cp -Rp $final_path/public/backups $tmpdir
fi
if [ -d $final_path/log ] ; then
cp -Rp $final_path/log $tmpdir
fi
# Remove destination directory
ynh_secure_remove $final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path" ynh_setup_source "$final_path"
# Restore previous files
cp -Rp $tmpdir/uploads $final_path/public
if [ -d $tmpdir/backups ] ; then
cp -Rp $tmpdir/backups $final_path/public
fi
if [ -d $tmpdir/log ] ; then
cp -Rp $tmpdir/log $final_path
fi
cp -Rp $tmpdir/plugins/* $final_path/plugins
cp -Rp $tmpdir/log $final_path
cp -p $tmpdir/discourse.conf $final_path/config
# Install LDAP plugin # Install LDAP plugin
ynh_secure_remove "$final_path/plugins/discourse-ldap-auth"
mkdir -p "$final_path/plugins/discourse-ldap-auth" mkdir -p "$final_path/plugins/discourse-ldap-auth"
ynh_setup_source "$final_path/plugins/discourse-ldap-auth" ldap-auth ynh_setup_source "$final_path/plugins/discourse-ldap-auth" ldap-auth
#=================================================
# INSTALL RUBY
#=================================================
ynh_install_ruby $RUBY_VERSION
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -149,6 +173,7 @@ if ! ynh_is_upstream_up_to_date ; 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 "$final_path/plugins/discourse-ldap-auth/config/settings.yml" ynh_backup_if_checksum_is_different "$final_path/plugins/discourse-ldap-auth/config/settings.yml"
# Configure LDAP plugin # Configure LDAP plugin
ldap_config_file="$final_path/plugins/discourse-ldap-auth/config/settings.yml" ldap_config_file="$final_path/plugins/discourse-ldap-auth/config/settings.yml"
ynh_replace_string "adfs.example.com" "localhost" "$ldap_config_file" ynh_replace_string "adfs.example.com" "localhost" "$ldap_config_file"
@ -156,6 +181,9 @@ if ! ynh_is_upstream_up_to_date ; then
ynh_replace_string "sAMAccountName" "uid" "$ldap_config_file" ynh_replace_string "sAMAccountName" "uid" "$ldap_config_file"
ynh_store_file_checksum "$ldap_config_file" ynh_store_file_checksum "$ldap_config_file"
# Disable svgo worker
echo "svgo: false" > $final_path/.image_optim.yml
#================================================= #=================================================
# SETUP UNICORN, A RUBY SERVER # SETUP UNICORN, A RUBY SERVER
#================================================= #=================================================
@ -176,14 +204,20 @@ if ! ynh_is_upstream_up_to_date ; then
chown -R $app: $final_path chown -R $app: $final_path
# Install puma with gem
(cd "$final_path" (cd "$final_path"
# Install bundler, a gems installer # Install bundler, a gems installer
gem install bundler gem install bundler
# Install without documentation # Install without documentation
exec_as $app echo "gem: --no-ri --no-rdoc" >> "$final_path/.gemrc" exec_as $app echo "gem: --no-ri --no-rdoc" >> "$final_path/.gemrc")
# Specific actions on ARM architecture
if [ -n "$(uname -m | grep arm)" ] ; then
# Define the platform specifically to retrieve binaries
# for libv8 because it currently doesn't compile on ARM devices
exec_login_as $app bundle config specific_platform arm-linux
fi
# Install dependencies # Install dependencies
exec_login_as $app bundle install --path vendor/bundle --with development) exec_login_as $app MAKEFLAGS=-j2 bundle install --jobs 2 --path vendor/bundle --with development
# On ARM architecture, replace bundled libpsl by system native libpsl # On ARM architecture, replace bundled libpsl by system native libpsl
# because the provided binary isn't compatible # because the provided binary isn't compatible
if [ -n "$(uname -m | grep arm)" ] ; then if [ -n "$(uname -m | grep arm)" ] ; then
@ -200,12 +234,26 @@ if ! ynh_is_upstream_up_to_date ; then
$rake_exec db:migrate $rake_exec db:migrate
$rake_exec assets:precompile $rake_exec assets:precompile
#=================================================
# CONFIGURE PLUGINS
#=================================================
# Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder
# (Can only do that now because we are patching dependencies which have just been downloaded)
# Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16
(cd $final_path/plugins/discourse-ldap-auth/gems/${RUBY_VERSION}/gems/omniauth-ldap*/
patch -p1 < $YNH_CWD/../conf/ldap-auth-fix-subfolder.patch)
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Add a pids and socket directory for the systemd script.
mkdir -p "$final_path/tmp/pids"
mkdir "$final_path/tmp/sockets"
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
# Restrict rights to log directory (needed by logrotate) # Restrict rights to log directory (needed by logrotate)

View file

@ -1,8 +1,8 @@
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index bdca7c30ed..847a8d07c2 100644 index 8575ca11dc..a643316bac 100644
--- a/lib/tasks/assets.rake --- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake
@@ -95,6 +95,7 @@ def compress_ruby(from, to) @@ -94,6 +94,7 @@ def compress_ruby(from, to)
data = File.read("#{assets_path}/#{from}") data = File.read("#{assets_path}/#{from}")
uglified, map = Uglifier.new(comments: :none, uglified, map = Uglifier.new(comments: :none,

View file

@ -1,9 +1,9 @@
diff --git a/Gemfile.lock b/Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock
index 5752044b07..016f600bcc 100644 index b59803ab6a..02b5d55b3d 100644
--- a/Gemfile.lock --- a/Gemfile.lock
+++ b/Gemfile.lock +++ b/Gemfile.lock
@@ -171,7 +171,7 @@ GEM @@ -172,7 +172,7 @@ GEM
jwt (1.5.6) jwt (2.1.0)
kgio (2.11.2) kgio (2.11.2)
kramdown (1.17.0) kramdown (1.17.0)
- libv8 (6.7.288.46.1) - libv8 (6.7.288.46.1)
@ -11,14 +11,14 @@ index 5752044b07..016f600bcc 100644
listen (3.1.5) listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
@@ -198,8 +198,8 @@ GEM @@ -200,8 +200,8 @@ GEM
method_source (0.8.2) method_source (0.8.2)
mini_mime (1.0.0) mini_mime (1.0.1)
mini_portile2 (2.3.0) mini_portile2 (2.3.0)
- mini_racer (0.2.0) - mini_racer (0.2.3)
- libv8 (>= 6.3) - libv8 (>= 6.3)
+ mini_racer (0.1.15) + mini_racer (0.1.15)
+ libv8 (~> 6.3) + libv8 (~> 6.3)
mini_scheduler (0.8.1) mini_scheduler (0.9.1)
sidekiq
mini_sql (0.1.10) mini_sql (0.1.10)
mini_suffix (0.3.0)