discourse: 3.5.3 -> 2025.12.0

3.5.x will be EOL by the end of January 2026. 2025.12.0 is the newest
released version. Ref: https://releases.discourse.org/

libv8-node is not compatible with NodeJS 24 in this version.
This commit is contained in:
Leona Maroni
2026-01-10 18:05:18 +01:00
parent bebc8a3e6d
commit 0cf640ccac
18 changed files with 732 additions and 632 deletions
@@ -846,7 +846,6 @@ in
RuntimeDirectory = map (p: "discourse/" + p) [
"config"
"home"
"assets/javascripts/plugins"
"public"
"sockets"
"assets-generated"
@@ -1,12 +1,12 @@
diff --git a/app/models/global_setting.rb b/app/models/global_setting.rb
index 6e06e18039..b2bef31fe2 100644
index f6eed5da52..571dce2bd2 100644
--- a/app/models/global_setting.rb
+++ b/app/models/global_setting.rb
@@ -255,6 +255,7 @@ class GlobalSetting
@@ -272,6 +272,7 @@
domain: GlobalSetting.smtp_domain,
user_name: GlobalSetting.smtp_user_name,
password: GlobalSetting.smtp_password,
+ ca_file: "/etc/ssl/certs/ca-certificates.crt",
enable_starttls_auto: GlobalSetting.smtp_enable_start_tls,
open_timeout: GlobalSetting.smtp_open_timeout,
read_timeout: GlobalSetting.smtp_read_timeout,
enable_starttls_auto: !GlobalSetting.smtp_force_tls && GlobalSetting.smtp_enable_start_tls,
open_timeout: GlobalSetting.smtp_open_timeout.to_f,
read_timeout: GlobalSetting.smtp_read_timeout.to_f,
+17 -19
View File
@@ -43,7 +43,7 @@
fetchPnpmDeps,
pnpmConfigHook,
svgo,
nodejs,
nodejs_22,
jq,
moreutils,
terser,
@@ -53,13 +53,13 @@
}:
let
version = "3.5.3";
version = "2025.12.0";
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse";
rev = "v${version}";
sha256 = "sha256-2lx6vFxio2CkMWa0vmzUGTljz1WC9OzpNgSxKjYPn8g=";
sha256 = "sha256-zURRueaYWl1FqOI12H+S/ssMhN38nDuWRBqb579w6HQ=";
};
ruby = ruby_3_3;
@@ -72,7 +72,7 @@ let
gnutar
git
brotli
nodejs
nodejs_22
# Misc required system utils
which
@@ -193,9 +193,9 @@ let
cd ../..
mkdir -p vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/
ln -s "${nodejs.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a
ln -s "${nodejs_22.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a
ln -s ${nodejs.libv8}/include vendor/v8/include
ln -s ${nodejs_22.libv8}/include vendor/v8/include
mkdir -p ext/libv8-node
echo '--- !ruby/object:Libv8::Node::Location::Vendor {}' >ext/libv8-node/.location.yml
@@ -229,7 +229,7 @@ let
unpackPhase
nativeBuildInputs
;
hash = "sha256-ydSXo3wp13/mPgJv1HbavNurkd2KxuKzuJNHliPpn2I=";
hash = "sha256-Yxcerq4Wil1nrEzHoEmsTAj4VnUmrwRlA3WO2b72yOc=";
};
dontBuild = false;
@@ -261,7 +261,7 @@ let
unpackPhase
nativeBuildInputs
;
hash = "sha256-IABOxUymtFkF9sl1kRWAS5hM6GNJI6Y4VFICXdX7zF0=";
hash = "sha256-zyGK+XJpMls6w0Uydegqsj4TH4IrVxANm0qmpR7+95I=";
};
dontBuild = false;
@@ -306,7 +306,7 @@ let
inherit version src;
pnpm = pnpm_9;
fetcherVersion = 1;
hash = "sha256-npRKX5Lr2QrPD8OFBysDl30exP+FTnjMxFeR/Gv0Z0I=";
hash = "sha256-/GJQqbmBXn5SSdxQ3TBQEUGe6Qm7aJ1ogoYqOFD5Pm0=";
};
nativeBuildInputs = runtimeDeps ++ [
@@ -318,16 +318,16 @@ let
terser
jq
moreutils
nodejs
nodejs_22
pnpmConfigHook
pnpm_9
];
outputs = [
"out"
"javascripts"
"node_modules"
"generated"
"frontend"
];
patches = [
@@ -347,7 +347,7 @@ let
# Little does he know, so he decided there is no need to generate the
# theme-transpiler over and over again. Which at the same time allows the removal
# of javascript devDependencies from the runtime environment.
./prebuild-theme-transpiler.patch
./prebuild-asset-processor.patch
];
env.RAILS_ENV = "production";
@@ -367,7 +367,7 @@ let
preBuild = ''
# Patch before running postinstall hook script
patchShebangs node_modules/
patchShebangs --build app/assets/javascripts
patchShebangs --build frontend/
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
redis-server >/dev/null &
@@ -409,10 +409,8 @@ let
mv node_modules $node_modules
rm -rf app/assets/javascripts/plugins
mv app/assets/javascripts $javascripts
ln -sf /run/discourse/assets/javascripts/plugins $javascripts/plugins
mv app/assets/generated $generated
mv frontend $frontend
runHook postInstall
'';
@@ -461,7 +459,7 @@ let
# Little does he know, so he decided there is no need to generate the
# theme-transpiler over and over again. Which at the same time allows the removal
# of javascript devDependencies from the runtime environment.
./prebuild-theme-transpiler.patch
./prebuild-asset-processor.patch
# Our app/assets/generated folder is a symlink, but the ruby File.mkdir_p doesn't allow
# a symlink in the way to the last directory. This patch explicitly resolves the symlink.
@@ -501,9 +499,9 @@ let
ln -sf /run/discourse/assets-generated $out/share/discourse/app/assets/generated
ln -sf ${assets.node_modules} $out/share/discourse/node_modules
ln -sf ${assets} $out/share/discourse/public.dist/assets
rm -r $out/share/discourse/app/assets/javascripts
# This needs to be copied because it contains symlinks to node_modules
cp -r ${assets.javascripts} $out/share/discourse/app/assets/javascripts
rm -r $out/share/discourse/frontend
cp -r ${assets.frontend} $out/share/discourse/frontend
${lib.concatMapStringsSep "\n" (
p: "ln -sf ${p} $out/share/discourse/plugins/${p.pluginName or ""}"
) plugins}
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-bbcode-color";
rev = "14b8370160cda35568470a36a25e508eb8364609";
sha256 = "sha256-3yIV5LKsYSDrhBwsalKZo9jY6j8kNzz99x/AJ95kPuk=";
rev = "2e32fe4573912612ab61cf9c1962f3ae85fd732a";
sha256 = "sha256-7M2K3yx1CwzrLgS83e/3YKGyGJA4S7wT2QG7m9yZNnI=";
};
meta = {
homepage = "https://github.com/discourse/discourse-bbcode-color";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-docs";
rev = "ff5d738a9f9d85847e6fc226f8324ad9cf466007";
sha256 = "sha256-p5QYM6jbsqe9a3UouHdVimSxZeBvsoM/hb0UQ7iV1IM=";
rev = "f755032b6988c217da30025d7e281d07361bbc47";
sha256 = "sha256-GOwLPbRLZ8F+hY4n+TAbN+DruaQgTzoM7KhVU9hfisM=";
};
meta = {
homepage = "https://github.com/discourse/discourse-docs";
@@ -14,4 +14,4 @@ DEPENDENCIES
rubyntlm (= 0.3.4)
BUNDLED WITH
2.5.22
2.7.2
@@ -11,8 +11,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "jonmbake";
repo = "discourse-ldap-auth";
rev = "fa1d661004ca99036ff628a9c4be12a81265d784";
sha256 = "sha256-2DYrYgC3H+e8USoo1MbJin1f5tshIUsQa6J7avnpvEc=";
rev = "1f225fa60e2cd580596aedd65d0fe76acd221c92";
sha256 = "sha256-S51VoXqwcnRYuahfjA1eeonPgy2OZdhiEhlo+zzu//U=";
};
meta = {
homepage = "https://github.com/jonmbake/discourse-ldap-auth";
@@ -3,7 +3,7 @@ GEM
specs:
prometheus_exporter (2.2.0)
webrick
webrick (1.9.1)
webrick (1.9.2)
PLATFORMS
ruby
@@ -12,4 +12,4 @@ DEPENDENCIES
prometheus_exporter (= 2.2.0)
BUNDLED WITH
2.5.22
2.7.2
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-prometheus";
rev = "a1e0ba671e13ceb9541a4d62d3ff7d206393d438";
sha256 = "sha256-tZdRbLxUs4qPbN39g/y1dVCa0b+6Pk8uvCvsKVbUkMk=";
rev = "9da0e79ef30544a626bc65c3697ef5c9005b01d2";
sha256 = "sha256-jq2tFzNshYZQRpiKsENB5dnKSlBgTjBQpMd4CPu7LIU=";
};
patches = [
@@ -15,9 +15,9 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "12d9n8hll67j737ym2zw4v23cn4vxyfkb6vyv1rzpwv6y6a3qbdl";
sha256 = "0ca1hr2rxrfw7s613rp4r4bxb454i3ylzniv9b9gxpklqigs3d5y";
type = "gem";
};
version = "1.9.1";
version = "1.9.2";
};
}
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-saved-searches";
rev = "e9afd599d95fa79ba8a37316290c1a059e995e04";
sha256 = "sha256-UtXDY3IxxM+JFOGZlN9mgiwrDImOAzJJuHNlhIdnotM=";
rev = "ba5e374a8d3b05b40f98585e664769fa50677e64";
sha256 = "sha256-hQufTeIG40Txtiit+XL338P2Hu6TX1E6b/Xcr3SbSbY=";
};
meta = {
homepage = "https://github.com/discourse/discourse-saved-searches";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-yearly-review";
rev = "a6baf4a5998a616091d94c31c23b9930409cd3e2";
sha256 = "sha256-KP/lQqS47oGTz4Rw/+0p2LZVQEWdUtx0sRPxh3/Ua8A=";
rev = "218e7290fc32a04d94bb4da29d9c4a8dbd9cc88e";
sha256 = "sha256-rRMwZw34vodYi3sFIk52GN/gztZkJHc4JGckH2WeBCQ=";
};
meta = {
homepage = "https://github.com/discourse/discourse-yearly-review";
@@ -0,0 +1,23 @@
diff --git a/lib/asset_processor.rb b/lib/asset_processor.rb
index 06e8cadbb4..b3368d4912 100644
--- a/lib/asset_processor.rb
+++ b/lib/asset_processor.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class AssetProcessor
- PROCESSOR_PATH = "tmp/asset-processor.js"
+ PROCESSOR_PATH = "frontend/asset-processor.js"
@mutex = Mutex.new
@ctx_init = Mutex.new
@@ -28,7 +28,9 @@ class AssetProcessor
end
def self.build_production_asset_processor
- File.write(PROCESSOR_PATH, build_asset_processor)
+ if (!Rails.env.production? or !File.file?(PROCESSOR_PATH))
+ File.write(PROCESSOR_PATH, build_asset_processor)
+ end
PROCESSOR_PATH
end
@@ -1,23 +0,0 @@
diff --git a/lib/discourse_js_processor.rb b/lib/discourse_js_processor.rb
index f1642386c5..5a672818da 100644
--- a/lib/discourse_js_processor.rb
+++ b/lib/discourse_js_processor.rb
@@ -54,7 +54,7 @@ class DiscourseJsProcessor
end
class Transpiler
- TRANSPILER_PATH = "tmp/theme-transpiler.js"
+ TRANSPILER_PATH = "app/assets/javascripts/theme-transpiler.js"
@mutex = Mutex.new
@ctx_init = Mutex.new
@@ -75,7 +75,9 @@ class DiscourseJsProcessor
end
def self.build_production_theme_transpiler
- File.write(TRANSPILER_PATH, build_theme_transpiler)
+ if (!Rails.env.production? or !File.file?(TRANSPILER_PATH))
+ File.write(TRANSPILER_PATH, build_theme_transpiler)
+ end
TRANSPILER_PATH
end
@@ -89,7 +89,6 @@ gem "oj"
gem "pg"
gem "mini_sql"
gem "pry-rails", require: false
gem "pry-byebug", require: false
gem "rtlcss", require: false
gem "messageformat-wrapper", require: false
gem "rake"
@@ -118,7 +117,7 @@ gem "net-imap", require: false
gem "net-pop", require: false
gem "digest", require: false
gem "goldiloader", require: false
gem "goldiloader"
group :test do
gem "capybara", require: false
@@ -144,7 +143,7 @@ group :test, :development do
gem "shoulda-matchers", require: false
gem "rspec-html-matchers"
gem "pry-stack_explorer", require: false
gem "byebug", require: ENV["RM_INFO"].nil?, platform: :mri
gem "debug", ">= 1.0.0", require: "debug/prelude"
gem "rubocop-discourse", require: false
gem "parallel_tests"
@@ -164,6 +163,9 @@ group :development do
gem "binding_of_caller"
gem "yaml-lint"
gem "yard"
gem "ruby-lsp", require: false
gem "ruby-lsp-rails", require: false
gem "ruby-lsp-rspec", require: false
end
if ENV["ALLOW_DEV_POPULATE"] == "1"
@@ -194,6 +196,7 @@ gem "rack-mini-profiler", require: ["enable_rails_patches"]
gem "unicorn", require: false, platform: :ruby
gem "puma", require: false
gem "pitchfork", require: false
gem "rbtrace", require: false, platform: :mri
@@ -312,4 +315,3 @@ gem "hashery", require: false
gem "ttfunk", require: false
gem "afm", require: false
gem "pdf-reader", require: false
gem "openssl", "~> 3.3.1"
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -236,11 +236,6 @@ def update(rev):
with open(rubyenv_dir / fn, 'w') as f:
f.write(repo.get_file(fn, version.tag))
# Workaround for https://github.com/NixOS/nixpkgs/pull/469624
# Can be removed when openssl gem is already new enough, i.e. with discourse 2025.11.1
with open(rubyenv_dir / "Gemfile", "a") as f:
f.write('gem "openssl", "~> 3.3.1"')
# work around https://github.com/nix-community/bundix/issues/8
os.environ["BUNDLE_FORCE_RUBY_PLATFORM"] = "true"
subprocess.check_output(['bundle', 'lock'], cwd=rubyenv_dir)