mirror of
https://github.com/YunoHost-Apps/discourse_ynh.git
synced 2024-09-03 18:26:18 +02:00
Fix install
This commit is contained in:
parent
fb9ee16f88
commit
f08065180f
9 changed files with 78 additions and 9 deletions
|
@ -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"
|
||||||
|
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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
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…
Reference in a new issue