discourse: 3.4.7 -> 3.5.1

https://meta.discourse.org/t/3-5-0-major-release/379212?tl=en
https://meta.discourse.org/t/3-5-1-security-and-maintenance-release/383511

This release introduces a few rust-based ruby dependencies.

Two plugins were removed
- discourse-migratepassword as it's deprecated
- discourse-topic-voting as it's integrated into discourse core

pgvector extension handling:
Co-Authored-By: talyz <kim.lindberger@gmail.com>
This commit is contained in:
Leona Maroni
2025-09-13 10:47:57 +02:00
parent f7a1994b7d
commit aeeb97eb19
30 changed files with 1688 additions and 902 deletions
+13 -2
View File
@@ -17,7 +17,10 @@ let
upstreamPostgresqlVersion = lib.getVersion pkgs.postgresql_15;
postgresqlPackage =
if config.services.postgresql.enable then config.services.postgresql.package else pkgs.postgresql;
if config.services.postgresql.enable then
config.services.postgresql.finalPackage
else
pkgs.postgresql;
postgresqlVersion = lib.getVersion postgresqlPackage;
@@ -540,7 +543,7 @@ in
assertions = [
{
assertion = (cfg.database.host != null) -> (cfg.database.passwordFile != null);
message = "When services.gitlab.database.host is customized, services.discourse.database.passwordFile must be set!";
message = "When services.discourse.database.host is customized, services.discourse.database.passwordFile must be set!";
}
{
assertion = cfg.hostname != "";
@@ -694,6 +697,9 @@ in
services.postgresql = lib.mkIf databaseActuallyCreateLocally {
enable = true;
extensions = ps: [
ps.pgvector
];
ensureUsers = [ { name = "discourse"; } ];
};
@@ -719,6 +725,7 @@ in
psql -tAc "SELECT 1 FROM pg_database WHERE datname = 'discourse'" | grep -q 1 || psql -tAc 'CREATE DATABASE "discourse" OWNER "discourse"'
psql '${cfg.database.name}' -tAc "CREATE EXTENSION IF NOT EXISTS pg_trgm"
psql '${cfg.database.name}' -tAc "CREATE EXTENSION IF NOT EXISTS hstore"
psql '${cfg.database.name}' -tAc "CREATE EXTENSION IF NOT EXISTS vector"
'';
serviceConfig = {
@@ -805,8 +812,11 @@ in
cp -r ${cfg.package}/share/discourse/config.dist/* /run/discourse/config/
cp -r ${cfg.package}/share/discourse/public.dist/* /run/discourse/public/
cp -r ${cfg.package.assets.generated}/* /run/discourse/assets-generated/
ln -sf /var/lib/discourse/uploads /run/discourse/public/uploads
ln -sf /var/lib/discourse/backups /run/discourse/public/backups
# discourse creates images in this folder, and by default it only has u=rx
chmod 750 /run/discourse/public/images
(
umask u=rwx,g=,o=
@@ -839,6 +849,7 @@ in
"assets/javascripts/plugins"
"public"
"sockets"
"assets-generated"
];
RuntimeDirectoryMode = "0750";
StateDirectory = map (p: "discourse/" + p) [
+1 -1
View File
@@ -29,7 +29,7 @@ in
nodes.discourse =
{ nodes, ... }:
{
virtualisation.memorySize = 2048;
virtualisation.memorySize = 4096;
virtualisation.cores = 4;
virtualisation.useNixStoreImage = true;
virtualisation.writableStore = false;
+134 -48
View File
@@ -10,6 +10,7 @@
callPackage,
nixosTests,
defaultGemConfig,
ruby_3_3,
gzip,
gnutar,
@@ -34,6 +35,10 @@
procps,
rsync,
icu,
rustPlatform,
buildRubyGem,
rustc,
cargo,
pnpm_9,
svgo,
nodejs,
@@ -46,13 +51,13 @@
}:
let
version = "3.4.7";
version = "3.5.1";
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse";
rev = "v${version}";
sha256 = "sha256-vidv5aa2r1YOcnvkqrk7ttuIk1bN5Ct7kMANl8kpEm0=";
sha256 = "sha256-hMC2YZUxe/zoL2oSMVlWqqiP+UDcJMPVsGzHdh8nwjc=";
};
ruby = ruby_3_3;
@@ -168,54 +173,116 @@ let
name = "discourse-ruby-env-${version}";
inherit version ruby;
gemdir = ./rubyEnv;
gemset =
let
gems = import ./rubyEnv/gemset.nix;
in
gems
// {
mini_racer = gems.mini_racer // {
buildInputs = [ icu ];
gemset = import ./rubyEnv/gemset.nix;
gemConfig = defaultGemConfig // {
mini_racer = attrs: {
buildInputs = [ icu ];
dontBuild = false;
NIX_LDFLAGS = "-licui18n";
};
libv8-node =
attrs:
let
noopScript = writeShellScript "noop" "exit 0";
linkFiles = writeShellScript "link-files" ''
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.libv8}/include vendor/v8/include
mkdir -p ext/libv8-node
echo '--- !ruby/object:Libv8::Node::Location::Vendor {}' >ext/libv8-node/.location.yml
'';
in
{
dontBuild = false;
NIX_LDFLAGS = "-licui18n";
};
libv8-node =
let
noopScript = writeShellScript "noop" "exit 0";
linkFiles = writeShellScript "link-files" ''
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.libv8}/include vendor/v8/include
mkdir -p ext/libv8-node
echo '--- !ruby/object:Libv8::Node::Location::Vendor {}' >ext/libv8-node/.location.yml
'';
in
gems.libv8-node
// {
dontBuild = false;
postPatch = ''
cp ${noopScript} libexec/build-libv8
cp ${noopScript} libexec/build-monolith
cp ${noopScript} libexec/download-node
cp ${noopScript} libexec/extract-node
cp ${linkFiles} libexec/inject-libv8
'';
};
mini_suffix = gems.mini_suffix // {
propagatedBuildInputs = [ libpsl ];
dontBuild = false;
# Use our libpsl instead of the vendored one, which isn't
# available for aarch64. It has to be called
# libpsl.x86_64.so or it isn't found.
postPatch = ''
cp $(readlink -f ${lib.getLib libpsl}/lib/libpsl.so) vendor/libpsl.x86_64.so
cp ${noopScript} libexec/build-libv8
cp ${noopScript} libexec/build-monolith
cp ${noopScript} libexec/download-node
cp ${noopScript} libexec/extract-node
cp ${linkFiles} libexec/inject-libv8
'';
};
mini_suffix = attrs: {
propagatedBuildInputs = [ libpsl ];
dontBuild = false;
# Use our libpsl instead of the vendored one, which isn't
# available for aarch64. It has to be called
# libpsl.x86_64.so or it isn't found.
postPatch = ''
cp $(readlink -f ${lib.getLib libpsl}/lib/libpsl.so) vendor/libpsl.x86_64.so
'';
};
tokenizers = attrs: {
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (buildRubyGem { inherit (attrs) gemName version source; })
name
src
unpackPhase
nativeBuildInputs
;
hash = "sha256-ydSXo3wp13/mPgJv1HbavNurkd2KxuKzuJNHliPpn2I=";
};
dontBuild = false;
nativeBuildInputs = [
cargo
rustc
rustPlatform.cargoSetupHook
rustPlatform.bindgenHook
];
disallowedReferences = [
rustc.unwrapped
];
preInstall = ''
export CARGO_HOME="$PWD/../.cargo/"
'';
postInstall = ''
find $out -type f -name .rustc_info.json -delete
'';
};
tiktoken_ruby = attrs: {
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (buildRubyGem { inherit (attrs) gemName version source; })
name
src
unpackPhase
nativeBuildInputs
;
hash = "sha256-IABOxUymtFkF9sl1kRWAS5hM6GNJI6Y4VFICXdX7zF0=";
};
dontBuild = false;
nativeBuildInputs = [
cargo
rustc
rustPlatform.cargoSetupHook
rustPlatform.bindgenHook
];
disallowedReferences = [
rustc.unwrapped
];
preInstall = ''
export CARGO_HOME="$PWD/../.cargo/"
'';
postInstall = ''
#ls $GEM_HOME/gems/${attrs.gemName}-${attrs.version}/lib
#mv -v $GEM_HOME/gems/${attrs.gemName}-${attrs.version}/lib/{glfm_markdown/glfm_markdown.so,}
find $out -type f -name .rustc_info.json -delete
'';
};
};
groups = [
"default"
@@ -233,11 +300,13 @@ let
pname = "discourse-assets";
inherit version src;
fetcherVersion = 1;
hash = "sha256-WyRBnuKCl5NJLtqy3HK/sJcrpMkh0PjbasGPNDV6+7Y=";
hash = "sha256-npRKX5Lr2QrPD8OFBysDl30exP+FTnjMxFeR/Gv0Z0I=";
};
nativeBuildInputs = runtimeDeps ++ [
postgresql
(postgresql.withPackages (ps: [
ps.pgvector
]))
redis
uglify-js
terser
@@ -251,6 +320,7 @@ let
"out"
"javascripts"
"node_modules"
"generated"
];
patches = [
@@ -274,6 +344,14 @@ let
];
env.RAILS_ENV = "production";
env.DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS = "0";
# Allow to use different bundler version than the lockfile has
env.BUNDLER_VERSION = pkgs.bundler.version;
# requires full git and repository, even a src `leaveDotGit` is not enough. So patch this function to return the version
postPatch = ''
substituteInPlace script/assemble_ember_build.rb --replace-fail "def core_tree_hash" "def core_tree_hash; return \"v${version}\""
'';
# We have to set up an environment that is close enough to
# production ready or the assets:precompile task refuses to
@@ -300,6 +378,7 @@ let
psql -d postgres -tAc 'CREATE DATABASE "discourse" OWNER "discourse"'
psql 'discourse' -tAc "CREATE EXTENSION IF NOT EXISTS pg_trgm"
psql 'discourse' -tAc "CREATE EXTENSION IF NOT EXISTS hstore"
psql 'discourse' -tAc "CREATE EXTENSION IF NOT EXISTS vector"
${lib.concatMapStringsSep "\n" (p: "ln -sf ${p} plugins/${p.pluginName or ""}") plugins}
@@ -310,6 +389,7 @@ let
buildPhase = ''
runHook preBuild
patchShebangs script/
bundle exec rake assets:precompile
runHook postBuild
@@ -322,9 +402,10 @@ let
mv node_modules $node_modules
rm -r app/assets/javascripts/plugins
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
runHook postInstall
'';
@@ -374,6 +455,10 @@ let
# 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
# 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.
./resolve_generated_assets_symlink.patch
];
postPatch = ''
@@ -406,6 +491,7 @@ let
ln -sf /var/lib/discourse/tmp $out/share/discourse/tmp
ln -sf /run/discourse/config $out/share/discourse/config
ln -sf /run/discourse/public $out/share/discourse/public
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
@@ -14,7 +14,6 @@ in
discourse-github = callPackage ./discourse-github { };
discourse-ldap-auth = callPackage ./discourse-ldap-auth { };
discourse-math = callPackage ./discourse-math { };
discourse-migratepassword = callPackage ./discourse-migratepassword { };
discourse-oauth2-basic = callPackage ./discourse-oauth2-basic { };
discourse-openid-connect = callPackage ./discourse-openid-connect { };
discourse-prometheus = callPackage ./discourse-prometheus { };
@@ -22,6 +21,5 @@ in
discourse-saved-searches = callPackage ./discourse-saved-searches { };
discourse-solved = callPackage ./discourse-solved { };
discourse-spoiler-alert = callPackage ./discourse-spoiler-alert { };
discourse-voting = callPackage ./discourse-voting { };
discourse-yearly-review = callPackage ./discourse-yearly-review { };
}
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-assign";
rev = "261a47d119d200a8d922d008ad3d1667df869435";
sha256 = "sha256-0OClWO70btM7EN7Vir1LIhCTeO5+2jtkP4RozoKzp+0=";
rev = "6050446a9920f6ccf0694b38cec611452654b7bc";
sha256 = "sha256-MxPCzqRbb9bgmR9OO4gfJUzFvmyBOcU1E1y1FUdUp9M=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-docs";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-bbcode-color";
rev = "ecd4befeb4eae48aa0a37a88e5aca60e59730411";
sha256 = "sha256-enpeXc6pE9+5EdbMIFsnWd++ixlHBKFRxbXmvJYJftg=";
rev = "14b8370160cda35568470a36a25e508eb8364609";
sha256 = "sha256-3yIV5LKsYSDrhBwsalKZo9jY6j8kNzz99x/AJ95kPuk=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-bbcode-color";
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-calendar";
rev = "8d09cf8503b78f4c72b47a7319c0f4b9ad0247e7";
sha256 = "sha256-ES0/f/sv4Doao/MOdHYMwadRIVXb1I7FgSsl7790tio=";
rev = "43e97c16e595f3f80d53a787614eb7c0f9d6a1c1";
sha256 = "sha256-zks4zqzc4ZnUxMHSiUkcwaZEzmUXXgFMdiEp6CRPEIU=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-calendar";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-chat-integration";
rev = "29ad813cd04812786780e1706cbc043810dea7d8";
sha256 = "sha256-5mGnHLlw3qIGi8et3WV1RXnrPB+bySi3wQryKTa5wNg=";
rev = "428df114ff7f8416314dc585e59bc898ee59c674";
sha256 = "sha256-pP9MzQz9nghGIPMnGFOEXxW/OH/8BzHltcxAQboLYec=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-chat-integration";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-data-explorer";
rev = "2ba204a1de2638a7959e588b88f3b6c7fcf7a70f";
sha256 = "sha256-u8yGKANEyqm63/ZnJLe3u1nkNGZyX0wFUBIKU5GgjzY=";
rev = "b61e81fb616ce5880af96584ab9175f07f6362d4";
sha256 = "sha256-4E2PR7RwoM/e6cJFuaorK6EYe1nSDKkorJWrlWPzg3g=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-data-explorer";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-docs";
rev = "4e42539cda9a54d7827bcdf51b6dfbcf56d24cc9";
sha256 = "sha256-sv9Q0qEQVncQw3QLiro5YfVcHJAG8sJ0GTjduCZ0iP4=";
rev = "ff5d738a9f9d85847e6fc226f8324ad9cf466007";
sha256 = "sha256-p5QYM6jbsqe9a3UouHdVimSxZeBvsoM/hb0UQ7iV1IM=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-docs";
@@ -3,20 +3,20 @@ GEM
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
faraday (2.12.3)
faraday (2.13.4)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.4.0)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
json (2.10.2)
json (2.13.2)
logger (1.7.0)
net-http (0.6.0)
uri
octokit (5.6.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
public_suffix (6.0.1)
public_suffix (6.0.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-github";
rev = "59e5fc5692959c6c564ab0e09de364ccfedd6702";
sha256 = "sha256-b+8eSw8Kbz2CZN16Rd7c8uyH5P1iYhOJmdXu1C5UclU=";
rev = "d0cd63043de2ddac624db61ba282e0474fd447e2";
sha256 = "sha256-NDC8KdfbgwM60i9g4PpziWD6uU9Mp67SOG7oYhS4j5I=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-github";
@@ -20,10 +20,10 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0dxalpc0ldvjjmd7z95na9lm99d2baz48sf9axk3a6x3pn50ibdi";
sha256 = "09mcghancmn0s5cwk2xz581j3xm3xqxfv0yxg75axnyhrx9gy6f7";
type = "gem";
};
version = "2.12.3";
version = "2.13.4";
};
faraday-net_http = {
dependencies = [ "net-http" ];
@@ -31,20 +31,20 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0jp5ci6g40d6i50bsywp35l97nc2fpi9a592r2cibwicdb6y9wd1";
sha256 = "0fxbckg468dabkkznv48ss8zv14d9cd8mh1rr3m98aw7wzx5fmq9";
type = "gem";
};
version = "3.4.0";
version = "3.4.1";
};
json = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "01lbdaizhkxmrw4y8j3wpvsryvnvzmg0pfs56c52laq2jgdfmq1l";
sha256 = "0s5vklcy2fgdxa9c6da34jbfrqq7xs6mryjglqqb5iilshcg3q82";
type = "gem";
};
version = "2.10.2";
version = "2.13.2";
};
logger = {
groups = [ "default" ];
@@ -86,10 +86,10 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0vqcw3iwby3yc6avs1vb3gfd0vcp2v7q310665dvxfswmcf4xm31";
sha256 = "1543ap9w3ydhx39ljcd675cdz9cr948x9mp00ab8qvq6118wv9xz";
type = "gem";
};
version = "6.0.1";
version = "6.0.2";
};
sawyer = {
dependencies = [
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-math";
rev = "90a56a5b463546cba5017cf25168bae759bcbf77";
sha256 = "sha256-q8cNRIHYEkaE6QkdsHu4tPwSw3LnCNgKjbyESBXheE0=";
rev = "8db3f371e543bdf21fba35b1a539036386517272";
sha256 = "sha256-ARyPDpDUlPlhhw4KL+eo5AUzp1F2moenXEemV72kfsI=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-math";
@@ -1,9 +0,0 @@
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rails"
gem 'bcrypt', '3.1.13'
gem 'unix-crypt', '1.3.0'
gem 'ffi-compiler', '1.0.1', require: false
gem 'argon2', '2.2.0'
@@ -1,25 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
argon2 (2.2.0)
ffi (~> 1.15)
ffi-compiler (~> 1.0)
bcrypt (3.1.13)
ffi (1.17.0)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
rake (13.2.1)
unix-crypt (1.3.0)
PLATFORMS
ruby
DEPENDENCIES
argon2 (= 2.2.0)
bcrypt (= 3.1.13)
ffi-compiler (= 1.0.1)
unix-crypt (= 1.3.0)
BUNDLED WITH
2.5.11
@@ -1,22 +0,0 @@
{
lib,
mkDiscoursePlugin,
fetchFromGitHub,
}:
mkDiscoursePlugin {
name = "discourse-migratepassword";
bundlerEnvArgs.gemdir = ./.;
src = fetchFromGitHub {
owner = "communiteq";
repo = "discourse-migratepassword";
rev = "a732ae244cd4125561fd225a67bae95ef5f738d0";
sha256 = "sha256-EO+QnFTy3PgxZ92DZBm9sP8sFAny3ZpFw+faTX32j7Q=";
};
meta = with lib; {
homepage = "https://github.com/communiteq/discourse-migratepassword";
maintainers = with maintainers; [ ryantm ];
license = licenses.gpl2Only;
description = "Support migrated password hashes";
};
}
@@ -1,70 +0,0 @@
{
argon2 = {
dependencies = [
"ffi"
"ffi-compiler"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1wdllcqlr81nzyf485ldv1p660xsi476p79ghbj7zsf3n9n86gwd";
type = "gem";
};
version = "2.2.0";
};
bcrypt = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0ai0m15jg3n0b22mimk09ppnga316dc7dyvz06w8rrqh5gy1lslp";
type = "gem";
};
version = "3.1.13";
};
ffi = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "07139870npj59jnl8vmk39ja3gdk3fb5z9vc0lf32y2h891hwqsi";
type = "gem";
};
version = "1.17.0";
};
ffi-compiler = {
dependencies = [
"ffi"
"rake"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0c2caqm9wqnbidcb8dj4wd3s902z15qmgxplwyfyqbwa0ydki7q1";
type = "gem";
};
version = "1.0.1";
};
rake = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "17850wcwkgi30p7yqh60960ypn7yibacjjha0av78zaxwvd3ijs6";
type = "gem";
};
version = "13.2.1";
};
unix-crypt = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1wflipsmmicmgvqilp9pml4x19b337kh6p6jgrzqrzpkq2z52gdq";
type = "gem";
};
version = "1.3.0";
};
}
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-openid-connect";
rev = "e08efecc012a5ab8fa95084be93d4fd07ccebab9";
sha256 = "sha256-v4UWFDdOFON+nHkH490kBQ4sXX7Mrp7KVhN1x9HML7w=";
rev = "8b879884b677b60ee726282457427864f2767926";
sha256 = "sha256-+j3YRbZYCDnoweyfiCFP3U6AX860B1RQT14IBhnSi4M=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-openid-connect";
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-prometheus";
rev = "f46906e1d555f6838d74ea38d5037264cc1020b0";
sha256 = "sha256-czrxhH0L+vCZA8DKN6acW///iWJs9GIppEeaP2MOJBQ=";
rev = "a1e0ba671e13ceb9541a4d62d3ff7d206393d438";
sha256 = "sha256-tZdRbLxUs4qPbN39g/y1dVCa0b+6Pk8uvCvsKVbUkMk=";
};
patches = [
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-reactions";
rev = "f87583d9054421869ba0de16c24ad15e32bbebe7";
sha256 = "sha256-v2AkpSTF3VNgBUfvRMQ3BCw0nClWjcVTdKNn9yiByBM=";
rev = "ed83e21e6e722cef3e38d6da083d483bfa14503b";
sha256 = "sha256-XA9ADzBzp1TVV4belv4b4GR7xWY/05WFAWRlUBr2M+o=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-reactions";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-saved-searches";
rev = "b78aae086e95255b1a1e91a01e2d56b45b7aead2";
sha256 = "sha256-Wai+oZR+Pzjre6Th0kQDgvFOwfPRHlZkpKYYOUKNlx4=";
rev = "e9afd599d95fa79ba8a37316290c1a059e995e04";
sha256 = "sha256-UtXDY3IxxM+JFOGZlN9mgiwrDImOAzJJuHNlhIdnotM=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-saved-searches";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-solved";
rev = "e82c6ae1ca38ccebb34669148f8de93a3028906e";
sha256 = "sha256-KwpBCk4fjkZlSzgtc0OXvQupPd+aPb9nONyyALpEZhg=";
rev = "8e777aa05dd3a303ccd772226e24b2e5f4d6be31";
sha256 = "sha256-z/fB+QQW6iMBBDHUWvr5UmWyLyo18qnXddEOiPM7aRQ=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-solved";
@@ -1,21 +0,0 @@
{
lib,
mkDiscoursePlugin,
fetchFromGitHub,
}:
mkDiscoursePlugin {
name = "discourse-voting";
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-topic-voting";
rev = "d779202749e56aaee2d548b538796fb5db1b9b7c";
sha256 = "sha256-8YF7W5SXhI7TGJNZkx5or7bxI0MKiDtx10TE2ekBMuM=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-voting";
maintainers = with maintainers; [ dpausp ];
license = licenses.gpl2Only;
description = "Adds the ability for voting on a topic within a specified category in Discourse";
};
}
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-yearly-review";
rev = "439e0d78f1d8a0f387c0ec26f233a090ce82ef72";
sha256 = "sha256-DXA5P7XnItBjP4H1J/G1cGbFddSDZh0wjMZiJ5JA9s8=";
rev = "a6baf4a5998a616091d94c31c23b9930409cd3e2";
sha256 = "sha256-KP/lQqS47oGTz4Rw/+0p2LZVQEWdUtx0sRPxh3/Ua8A=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-yearly-review";
@@ -0,0 +1,13 @@
diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
index a5a5b8f943..30faee615d 100644
--- a/lib/plugin/instance.rb
+++ b/lib/plugin/instance.rb
@@ -1383,7 +1383,7 @@ class Plugin::Instance
contents = javascript_includes.map { |js| File.read(js) }
if contents.present?
- ensure_directory(extra_js_file_path)
+ ensure_directory(File.realpath(extra_js_file_path))
Discourse::Utils.atomic_write_file(extra_js_file_path, contents.join("\n;\n"))
else
begin
+50 -30
View File
@@ -1,26 +1,24 @@
# frozen_string_literal: true
ruby "~> 3.3"
source "https://rubygems.org"
# if there is a super emergency and rubygems is playing up, try
#source 'http://production.cf.rubygems.org'
gem "bootsnap", require: false, platform: :mri
gem "actionmailer", "~> 7.2.0"
gem "actionpack", "~> 7.2.0"
gem "actionview", "~> 7.2.0"
gem "activemodel", "~> 7.2.0"
gem "activerecord", "~> 7.2.0"
gem "activesupport", "~> 7.2.0"
gem "railties", "~> 7.2.0"
gem "sprockets-rails"
gem "actionmailer", "~> 8.0.0"
gem "actionpack", "~> 8.0.0"
gem "actionview", "~> 8.0.0"
gem "activemodel", "~> 8.0.0"
gem "activerecord", "~> 8.0.0"
gem "activesupport", "~> 8.0.0"
gem "railties", "~> 8.0.0"
gem "propshaft"
gem "json"
# TODO: At the moment Discourse does not work with Sprockets 4, we would need to correct internals
# We intend to drop sprockets rather than upgrade to 4.x
gem "sprockets", "~> 3.7.3"
# this will eventually be added to rails,
# allows us to precompile all our templates in the unicorn master
gem "actionview_precompiler", require: false
@@ -31,9 +29,11 @@ gem "mail"
gem "mini_mime"
gem "mini_suffix"
# config/initializers/006-mini_profiler.rb depends upon the RedisClient#call.
# Rework this when upgrading to redis client 5.0 and above.
gem "redis", "< 5.0"
# NOTE: hiredis-client is recommended for high performance use of Redis
# however a recent attempt at an upgrade lead to https://meta.discourse.org/t/rebuild-error/375387
# for now we are sticking with the socked based implementation that is not sensitive to this issue
# gem "hiredis-client"
gem "redis"
# This is explicitly used by Sidekiq and is an optional dependency.
# We tell Sidekiq to use the namespace "sidekiq" which triggers this
@@ -52,6 +52,7 @@ gem "active_model_serializers", "~> 0.8.3"
gem "http_accept_language", require: false
gem "discourse-fonts", require: "discourse_fonts"
gem "discourse-emojis", require: "discourse_emojis"
gem "message_bus"
@@ -61,6 +62,7 @@ gem "fastimage"
gem "aws-sdk-s3", require: false
gem "aws-sdk-sns", require: false
gem "aws-sdk-mediaconvert", require: false
gem "excon", require: false
gem "unf", require: false
@@ -98,12 +100,12 @@ gem "rinku"
gem "sidekiq"
gem "mini_scheduler"
gem "execjs", require: false
gem "mini_racer", "0.17.pre13"
gem "mini_racer"
gem "highline", require: false
gem "rack"
# When unicorn is not used anymore, we can use Rack 3
gem "rack", "< 3"
gem "rack-protection" # security
gem "cbor", require: false
@@ -116,22 +118,16 @@ gem "net-imap", require: false
gem "net-pop", require: false
gem "digest", require: false
# Gems used only for assets and not required in production environments by default.
# Allow everywhere for now cause we are allowing asset debugging in production
group :assets do
gem "uglifier"
end
gem "goldiloader", require: false
group :test do
gem "capybara", require: false
gem "webmock", require: false
gem "fakeweb", require: false
gem "simplecov", require: false
gem "selenium-webdriver", "~> 4.14", require: false
gem "selenium-devtools", require: false
gem "test-prof"
gem "rails-dom-testing", require: false
gem "minio_runner", require: false
gem "capybara-playwright-driver"
end
group :test, :development do
@@ -154,10 +150,9 @@ group :test, :development do
gem "rswag-specs"
gem "annotate"
gem "annotaterb"
gem "syntax_tree"
gem "syntax_tree-disable_ternary"
gem "rspec-multi-mock"
end
@@ -173,11 +168,11 @@ end
if ENV["ALLOW_DEV_POPULATE"] == "1"
gem "discourse_dev_assets"
gem "faker", "~> 2.16"
gem "faker"
else
group :development, :test do
gem "discourse_dev_assets"
gem "faker", "~> 2.16"
gem "faker"
end
end
@@ -292,3 +287,28 @@ end
gem "dry-initializer", "~> 3.1"
gem "parallel"
# for discourse-zendesk-plugin
gem "inflection", require: false
gem "multipart-post", require: false
gem "faraday-multipart", require: false
gem "zendesk_api", require: false
# for discourse-subscriptions
gem "stripe", require: false
# for discourse-github
gem "sawyer", require: false
gem "octokit", require: false
# for discourse-ai
gem "tokenizers", require: false
gem "tiktoken_ruby", require: false
gem "discourse_ai-tokenizers", require: false
gem "ed25519" # TODO: remove this as existing ssl gem should handle this
gem "Ascii85", require: false
gem "ruby-rc4", require: false
gem "hashery", require: false
gem "ttfunk", require: false
gem "afm", require: false
gem "pdf-reader", require: false
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -291,14 +291,12 @@ def update_plugins():
{'name': 'discourse-github'},
{'name': 'discourse-ldap-auth', 'owner': 'jonmbake'},
{'name': 'discourse-math'},
{'name': 'discourse-migratepassword', 'owner': 'discoursehosting'},
{'name': 'discourse-openid-connect'},
{'name': 'discourse-prometheus'},
{'name': 'discourse-reactions'},
{'name': 'discourse-saved-searches'},
{'name': 'discourse-solved'},
{'name': 'discourse-spoiler-alert'},
{'name': 'discourse-voting', 'repo_name': "discourse-topic-voting"},
{'name': 'discourse-yearly-review'},
]