discourse: 3.3.2 -> 3.4.2 (#394129)

This commit is contained in:
Martin Weinelt
2025-04-21 16:44:43 +02:00
committed by GitHub
34 changed files with 822 additions and 713 deletions
@@ -425,6 +425,7 @@
- `programs.clash-verge.tunMode` was deprecated and removed because now service mode is necessary to start program. Without `programs.clash-verge.enable`, clash-verge-rev will refuse to start.
- `services.discourse` now requires PostgreSQL 15 per default. Please update before upgrading.
- `services.homepage-dashboard` now requires the `allowedHosts` option to be set in accordance with the [documentation](https://gethomepage.dev/installation/#homepage_allowed_hosts).
@@ -13,8 +13,8 @@ let
cfg = config.services.discourse;
opt = options.services.discourse;
# Keep in sync with https://github.com/discourse/discourse_docker/blob/main/image/base/slim.Dockerfile#L5
upstreamPostgresqlVersion = lib.getVersion pkgs.postgresql_13;
# Keep in sync with https://github.com/discourse/discourse_docker/blob/main/image/base/Dockerfile PG_MAJOR
upstreamPostgresqlVersion = lib.getVersion pkgs.postgresql_15;
postgresqlPackage =
if config.services.postgresql.enable then config.services.postgresql.package else pkgs.postgresql;
@@ -676,6 +676,8 @@ in
dns_query_timeout_secs = null;
regex_timeout_seconds = 2;
allow_impersonation = true;
log_line_max_chars = 160000;
yjit_enabled = false;
};
services.redis.servers.discourse =
@@ -901,6 +903,9 @@ in
extraConfig
+ ''
proxy_set_header X-Request-Start "t=''${msec}";
proxy_set_header X-Sendfile-Type "";
proxy_set_header X-Accel-Mapping "";
proxy_set_header Client-Ip "";
'';
};
cache = time: ''
+1 -2
View File
@@ -59,7 +59,7 @@ import ./make-test-python.nix (
environment.systemPackages = [ pkgs.jq ];
services.postgresql.package = pkgs.postgresql_13;
services.postgresql.package = pkgs.postgresql_15;
services.discourse = {
enable = true;
@@ -104,7 +104,6 @@ import ./make-test-python.nix (
services.dovecot2 = {
enable = true;
protocols = [ "imap" ];
modules = [ pkgs.dovecot_pigeonhole ];
};
services.postfix = {
+22 -45
View File
@@ -9,7 +9,7 @@
bundlerEnv,
callPackage,
ruby_3_2,
ruby_3_3,
replace,
gzip,
gnutar,
@@ -34,11 +34,9 @@
procps,
rsync,
icu,
fetchYarnDeps,
yarn,
fixup-yarn-lock,
pnpm_9,
nodePackages,
nodejs_18,
nodejs,
jq,
moreutils,
terser,
@@ -48,16 +46,16 @@
}@args:
let
version = "3.3.2";
version = "3.4.2";
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse";
rev = "v${version}";
sha256 = "sha256-FaPcUta5z/8oasw+9zGBRZnUVYD8eCo1t/XwwsFoSM8=";
sha256 = "sha256-glTuY9aQ7wYvFZstOP579RkdSwKKh3q9mJt4wqg3zYk=";
};
ruby = ruby_3_2;
ruby = ruby_3_3;
runtimeDeps = [
# For backups, themes and assets
@@ -67,7 +65,7 @@ let
gnutar
git
brotli
nodejs_18
nodejs
# Misc required system utils
which
@@ -189,9 +187,9 @@ let
cd ../..
mkdir -p vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/
ln -s "${nodejs_18.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a
ln -s "${nodejs.libv8}/lib/libv8.a" vendor/v8/${stdenv.hostPlatform.system}/libv8/obj/libv8_monolith.a
ln -s ${nodejs_18.libv8}/include vendor/v8/include
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
@@ -232,9 +230,10 @@ let
pname = "discourse-assets";
inherit version src;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-cSQofaULCmPuWGxS+hK4KlRq9lSkCPiYvhax9X6Dor8=";
pnpmDeps = pnpm_9.fetchDeps {
pname = "discourse-assets";
inherit version src;
hash = "sha256-WyRBnuKCl5NJLtqy3HK/sJcrpMkh0PjbasGPNDV6+7Y=";
};
nativeBuildInputs = runtimeDeps ++ [
@@ -242,10 +241,10 @@ let
redis
uglify-js
terser
yarn
jq
moreutils
fixup-yarn-lock
nodejs
pnpm_9.configHook
];
outputs = [
@@ -281,31 +280,9 @@ let
# run. This means that Redis and PostgreSQL has to be running and
# database migrations performed.
preBuild = ''
# Yarn wants a real home directory to write cache, config, etc to
export HOME=$NIX_BUILD_TOP/fake_home
yarn_install() {
local offlineCache=$1 yarnLock=$2
# Make yarn install packages from our offline cache, not the registry
yarn config --offline set yarn-offline-mirror $offlineCache
# Fixup "resolved"-entries in yarn.lock to match our offline cache
fixup-yarn-lock $yarnLock
# Install while ignoring hook scripts
yarn --offline --ignore-scripts --cwd $(dirname $yarnLock) install
}
# Install runtime and devDependencies.
# The dev deps are necessary for generating the theme-transpiler executed as dependent task
# assets:precompile:theme_transpiler before db:migrate and unfortunately also in the runtime
yarn_install $yarnOfflineCache yarn.lock
# Patch before running postinstall hook script
patchShebangs node_modules/
patchShebangs --build app/assets/javascripts
yarn --offline --cwd app/assets/javascripts run postinstall
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
redis-server >/dev/null &
@@ -351,6 +328,10 @@ let
runHook postInstall
'';
# The node_modules output by design has broken symlinks, as it refers to the source code.
# They are resolved in the primary discourse derivation.
dontCheckForBrokenSymlinks = true;
};
discourse = stdenv.mkDerivation {
@@ -425,12 +406,11 @@ 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
# This needs to be copied because of symlinks in node_modules
# Also this needs to be full node_modules (including dev deps) because without loader.js it just throws 500
cp -r ${assets.node_modules} $out/share/discourse/node_modules
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
ln -sf ${assets.javascripts} $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
${lib.concatMapStringsSep "\n" (
p: "ln -sf ${p} $out/share/discourse/plugins/${p.pluginName or ""}"
) plugins}
@@ -466,9 +446,6 @@ let
maintainers = with maintainers; [ talyz ];
license = licenses.gpl2Plus;
description = "Discourse is an open source discussion platform";
# fails to compile mini_racer:
# mini_racer_v8.cc:316:45: error: no matching function for call to 'v8::ScriptOrigin::ScriptOrigin(v8::Local<v8::String>&)'
broken = true;
};
};
in
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-assign";
rev = "6472f4593e1a4abbb457288db012ddb10f0b16f5";
sha256 = "sha256-+jcL/6ddXldUG0VvcWiEMaFk0f37HyOf+bOFEMzuoXo=";
rev = "bf2a4bdb3ea4e26ec493d8dbc1f4cc8680f6c543";
sha256 = "sha256-inoANPG7xlKdhnuyoRay7Oyz7OSZWzphWS599kNP4Uo=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-docs";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-bbcode-color";
rev = "6a26e5937b48bbf3ca9bd19e4f40adc513bcd774";
sha256 = "sha256-dWXvCZLxhCxte/88EnYOsy1gjBWjk24BjUM01s55CaU=";
rev = "ecd4befeb4eae48aa0a37a88e5aca60e59730411";
sha256 = "sha256-enpeXc6pE9+5EdbMIFsnWd++ixlHBKFRxbXmvJYJftg=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-bbcode-color";
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-calendar";
rev = "908ad614bc412f831f929ca726a4bda0b9ccaab6";
sha256 = "sha256-ZzzcmTY/w9wa5wTR7ofJiNVmXwoKTKaKN202O80DO9g=";
rev = "c1031224a552ea01958d153350c2d1254b323579";
sha256 = "sha256-xwaYoJpBBvbmuPsDLxczLPXU862OVcirxeYpW5sfy5A=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-calendar";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-chat-integration";
rev = "e19808d4ad3f7d16cd9b93f315ca586f694e6288";
sha256 = "sha256-EplT9bQFtOvraSkFpBpe7TyNLROsdcRXz79j4MNPEs4=";
rev = "29ad813cd04812786780e1706cbc043810dea7d8";
sha256 = "sha256-5mGnHLlw3qIGi8et3WV1RXnrPB+bySi3wQryKTa5wNg=";
};
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 = "2d0dc39767f0c68d333f113c550731a5546c3137";
sha256 = "sha256-3eQDMzTjfcSip94BXy1/VcbulsTsL1EHjRs41c27+ns=";
rev = "2ba204a1de2638a7959e588b88f3b6c7fcf7a70f";
sha256 = "sha256-u8yGKANEyqm63/ZnJLe3u1nkNGZyX0wFUBIKU5GgjzY=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-data-explorer";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-docs";
rev = "7721b1646dead4719c02868ef7965f1b27c74eb3";
sha256 = "sha256-k2m88wsUmxAXC2LLvElwHVlMp6UzGSLDzEB+HJmKm5g=";
rev = "4e42539cda9a54d7827bcdf51b6dfbcf56d24cc9";
sha256 = "sha256-sv9Q0qEQVncQw3QLiro5YfVcHJAG8sJ0GTjduCZ0iP4=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-docs";
@@ -3,15 +3,15 @@ GEM
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
faraday (2.12.3)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.3.0)
net-http
json (2.7.3)
logger (1.6.1)
net-http (0.4.1)
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
json (2.10.2)
logger (1.7.0)
net-http (0.6.0)
uri
octokit (5.6.1)
faraday (>= 1, < 3)
@@ -20,7 +20,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
uri (0.13.1)
uri (1.0.3)
PLATFORMS
ruby
@@ -30,4 +30,4 @@ DEPENDENCIES
sawyer (= 0.9.2)
BUNDLED WITH
2.4.22
2.5.22
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-github";
rev = "e24de3f5cd6ec5cef17dc3e07dfb3bfac8867e08";
sha256 = "sha256-MbVYIsO2m0O5FriF5HphNhLcazgAJzIsl0aVd2YQGaA=";
rev = "59e5fc5692959c6c564ab0e09de364ccfedd6702";
sha256 = "sha256-b+8eSw8Kbz2CZN16Rd7c8uyH5P1iYhOJmdXu1C5UclU=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-github";
@@ -20,10 +20,10 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "05s5pyxh7y68jphb0lgrh0ksxbp4lmbsc6a6qg0ahj15pjqx01ni";
sha256 = "0dxalpc0ldvjjmd7z95na9lm99d2baz48sf9axk3a6x3pn50ibdi";
type = "gem";
};
version = "2.12.0";
version = "2.12.3";
};
faraday-net_http = {
dependencies = [ "net-http" ];
@@ -31,30 +31,30 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0rg54k4skaz8z7j358p6pdzc9pr84fjq7sdlpicf7s5ig7vb1rlk";
sha256 = "0jp5ci6g40d6i50bsywp35l97nc2fpi9a592r2cibwicdb6y9wd1";
type = "gem";
};
version = "3.3.0";
version = "3.4.0";
};
json = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1prbjd8r4rq6hjc6d5hn8hlpf4g9h62swxj7absjac7qqnzwrhvw";
sha256 = "01lbdaizhkxmrw4y8j3wpvsryvnvzmg0pfs56c52laq2jgdfmq1l";
type = "gem";
};
version = "2.7.3";
version = "2.10.2";
};
logger = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0lwncq2rf8gm79g2rcnnyzs26ma1f4wnfjm6gs4zf2wlsdz5in9s";
sha256 = "00q2zznygpbls8asz5knjvvj2brr3ghmqxgr83xnrdj4rk3xwvhr";
type = "gem";
};
version = "1.6.1";
version = "1.7.0";
};
net-http = {
dependencies = [ "uri" ];
@@ -62,10 +62,10 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "10n2n9aq00ih8v881af88l1zyrqgs5cl3njdw8argjwbl5ggqvm9";
sha256 = "1ysrwaabhf0sn24jrp0nnp51cdv0jf688mh5i6fsz63q2c6b48cn";
type = "gem";
};
version = "0.4.1";
version = "0.6.0";
};
octokit = {
dependencies = [
@@ -110,9 +110,9 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "07ndgxyhzd02cg94s6rnfhkb9rwx9z72lzk368sa9j78wc9qnbfz";
sha256 = "04bhfvc25b07jaiaf62yrach7khhr5jlr5bx6nygg8pf11329wp9";
type = "gem";
};
version = "0.13.1";
version = "1.0.3";
};
}
@@ -5,5 +5,4 @@ source "https://rubygems.org"
# gem "rails"
gem 'pyu-ruby-sasl', '0.0.3.3', require: false
gem 'rubyntlm', '0.3.4', require: false
gem 'net-ldap', '0.17.1'
gem 'omniauth-ldap', '1.0.5'
gem 'net-ldap', '0.18.0'
@@ -1,28 +1,17 @@
GEM
remote: https://rubygems.org/
specs:
hashie (5.0.0)
net-ldap (0.17.1)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-ldap (1.0.5)
net-ldap (~> 0.12)
omniauth (~> 1.0)
pyu-ruby-sasl (~> 0.0.3.2)
rubyntlm (~> 0.3.4)
net-ldap (0.18.0)
pyu-ruby-sasl (0.0.3.3)
rack (2.2.7)
rubyntlm (0.3.4)
PLATFORMS
ruby
DEPENDENCIES
net-ldap (= 0.17.1)
omniauth-ldap (= 1.0.5)
net-ldap (= 0.18.0)
pyu-ruby-sasl (= 0.0.3.3)
rubyntlm (= 0.3.4)
BUNDLED WITH
2.4.10
2.5.22
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "jonmbake";
repo = "discourse-ldap-auth";
rev = "edcf06957090e8d978a89fe7b07a6ba56fe35214";
sha256 = "sha256-VxBBip8QEXDQGDOsU5cXjUZe2HThJn20BPsNr33KhKI=";
rev = "fa1d661004ca99036ff628a9c4be12a81265d784";
sha256 = "sha256-2DYrYgC3H+e8USoo1MbJin1f5tshIUsQa6J7avnpvEc=";
};
meta = with lib; {
homepage = "https://github.com/jonmbake/discourse-ldap-auth";
@@ -1,53 +1,13 @@
{
hashie = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1nh3arcrbz1rc1cr59qm53sdhqm137b258y8rcb4cvd3y98lwv4x";
type = "gem";
};
version = "5.0.0";
};
net-ldap = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1ycw0qsw3hap8svakl0i30jkj0ffd4lpyrn17a1j0w8mz5ainmsj";
sha256 = "0xqcffn3c1564c4fizp10dzw2v5g2pabdzrcn25hq05bqhsckbar";
type = "gem";
};
version = "0.17.1";
};
omniauth = {
dependencies = [
"hashie"
"rack"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1jn9j54l5h7xcba2vjq74l1dk0xrwvsjxam4qhylpi52nw0h5502";
type = "gem";
};
version = "1.9.2";
};
omniauth-ldap = {
dependencies = [
"net-ldap"
"omniauth"
"pyu-ruby-sasl"
"rubyntlm"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1ld3mx46xa1qhc0cpnck1n06xcxs0ag4n41zgabxri27a772f9wz";
type = "gem";
};
version = "1.0.5";
version = "0.18.0";
};
pyu-ruby-sasl = {
groups = [ "default" ];
@@ -59,16 +19,6 @@
};
version = "0.0.3.3";
};
rack = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "16w217k9z02c4hqizym8dkj6bqmmzx4qdvqpnskgzf174a5pwdxk";
type = "gem";
};
version = "2.2.7";
};
rubyntlm = {
groups = [ "default" ];
platforms = [ ];
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-math";
rev = "19ab34b62ab75589419ee39af7d6ba2fec1bdc4a";
sha256 = "sha256-Z6+Bx1DKEE+s1flt5K/HfevzXsA+mA0YfQxmg7JQMfA=";
rev = "90a56a5b463546cba5017cf25168bae759bcbf77";
sha256 = "sha256-q8cNRIHYEkaE6QkdsHu4tPwSw3LnCNgKjbyESBXheE0=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-math";
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-openid-connect";
rev = "07e30e59bf5ca3925328e936359a5564d7f5b0af";
sha256 = "sha256-uqxwUjbkS2o9r9pvnTgv+3jzFhUOb8KmorT3ody2d3o=";
rev = "e08efecc012a5ab8fa95084be93d4fd07ccebab9";
sha256 = "sha256-v4UWFDdOFON+nHkH490kBQ4sXX7Mrp7KVhN1x9HML7w=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-openid-connect";
@@ -3,5 +3,4 @@
source "https://rubygems.org"
# gem "rails"
gem "webrick", "1.8.1"
gem "prometheus_exporter", "2.0.6"
gem "prometheus_exporter", "2.2.0"
@@ -1,16 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
prometheus_exporter (2.0.6)
prometheus_exporter (2.2.0)
webrick
webrick (1.8.1)
webrick (1.9.1)
PLATFORMS
ruby
DEPENDENCIES
prometheus_exporter (= 2.0.6)
webrick (= 1.8.1)
prometheus_exporter (= 2.2.0)
BUNDLED WITH
2.4.22
2.5.22
@@ -10,8 +10,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-prometheus";
rev = "b1b899ca995783ef5eba90c35dbfc120a2949c38";
sha256 = "sha256-tSU1aba8EadObOsb/nRM4jAdQ6D1F9QiIaGoHi2GGDk=";
rev = "f46906e1d555f6838d74ea38d5037264cc1020b0";
sha256 = "sha256-czrxhH0L+vCZA8DKN6acW///iWJs9GIppEeaP2MOJBQ=";
};
patches = [
@@ -5,19 +5,19 @@
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0pb4k6px8b36bvnw3d14j31s33ns60dcwxixbcgvhpzavd7fparb";
sha256 = "15vl8fw8vjnaj9g129dzrwk9nlrdqgffaj3rys4ba9ns2bqim9rq";
type = "gem";
};
version = "2.0.6";
version = "2.2.0";
};
webrick = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "13qm7s0gr2pmfcl7dxrmq38asaza4w0i2n9my4yzs499j731wh8r";
sha256 = "12d9n8hll67j737ym2zw4v23cn4vxyfkb6vyv1rzpwv6y6a3qbdl";
type = "gem";
};
version = "1.8.1";
version = "1.9.1";
};
}
@@ -1,20 +1,16 @@
diff --git a/bin/collector b/bin/collector
index 6bd04a8caffb..119526fc6ea3 100644
index 4bdce08178..5edc0a4aee 100755
--- a/bin/collector
+++ b/bin/collector
@@ -3,12 +3,14 @@
@@ -3,9 +3,11 @@
Process.setproctitle("discourse prometheus-collector")
+# We need the ABI version {MAJOR}.{MINOR}.0 here.
+abi_version = ENV['GEM_PATH'].split("/")[-1]
[
"webrick-#{ENV["WEBRICK_VERSION"]}",
"prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}",
].each do |spec_name|
spec_file =
- File.expand_path("../../gems/#{RUBY_VERSION}/specifications/#{spec_name}.gemspec", __FILE__)
+ File.expand_path("../../gems/#{abi_version}/specifications/#{spec_name}.gemspec", __FILE__)
spec = Gem::Specification.load(spec_file)
spec.activate
end
spec_file =
File.expand_path(
- "../../gems/#{RUBY_VERSION}/specifications/#{"prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}"}.gemspec",
+ "../../gems/#{abi_version}/specifications/#{"prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}"}.gemspec",
__FILE__,
)
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-reactions";
rev = "c4cde3bb12841733d1f2ac4df1bb099aae15cece";
sha256 = "sha256-JXyXBJX7PBYmVylZ7PE+14RnlgR4EA1XBSue1ek0P/g=";
rev = "4844fe7afc2fc6a809ed0249a6b42a4c92384461";
sha256 = "sha256-iudlFK+U+FwjNbduNTdwnT7oHww+xPz0+rZgzFUKT/8=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-reactions";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-saved-searches";
rev = "16bde9b0bcb3b517cfabc0ea740c10b091157799";
sha256 = "sha256-tn1AKiRPaunqlrtcC/6NETUnNxJq1uNi+IIF0TZPbDg=";
rev = "b78aae086e95255b1a1e91a01e2d56b45b7aead2";
sha256 = "sha256-Wai+oZR+Pzjre6Th0kQDgvFOwfPRHlZkpKYYOUKNlx4=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-saved-searches";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-solved";
rev = "1bbdfd8f5681171dc3f0e9ea93cd56997dc7938a";
sha256 = "sha256-nuF/tCoHgsKE+wjQ3BRV1s1X77vjQiASLRCWErh64C4=";
rev = "e82c6ae1ca38ccebb34669148f8de93a3028906e";
sha256 = "sha256-KwpBCk4fjkZlSzgtc0OXvQupPd+aPb9nONyyALpEZhg=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-solved";
@@ -8,9 +8,9 @@ mkDiscoursePlugin {
name = "discourse-voting";
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-voting";
rev = "4ebcd1187b59290b79db8c61c89df9f72bf1363c";
sha256 = "sha256-aDJKy7Qpsj1n+HrumoORUo+R9HF3gQ0juJBKXj7GHsY=";
repo = "discourse-topic-voting";
rev = "b31bc6e037af776d2cea3f34c44b02a105b34d24";
sha256 = "sha256-835xFg2NnhE4HPju2j3w+N5rtRYinOBbBMerRJpnpxQ=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-voting";
@@ -9,8 +9,8 @@ mkDiscoursePlugin {
src = fetchFromGitHub {
owner = "discourse";
repo = "discourse-yearly-review";
rev = "bb124c211c37873c1d54e96e7063f1868c65d0ad";
sha256 = "sha256-xAFpt/uVW8+Y2wwL20u/rMixcFgygwrarsdRsywsbmQ=";
rev = "5229931ace1ee19ef2d1b7ed2469911f315669bb";
sha256 = "sha256-2xgHtXB7F5XP2OmB1QswrnPk5Sf32DFoUhlU4RMEZhI=";
};
meta = with lib; {
homepage = "https://github.com/discourse/discourse-yearly-review";
@@ -1,21 +1,23 @@
diff --git a/lib/discourse_js_processor.rb b/lib/discourse_js_processor.rb
index 26d142fa4d..6040aba6f4 100644
index f1642386c5..5a672818da 100644
--- a/lib/discourse_js_processor.rb
+++ b/lib/discourse_js_processor.rb
@@ -68,7 +68,7 @@ class DiscourseJsProcessor
TRANSPILER_PATH =
(
if Rails.env.production?
- "tmp/theme-transpiler.js"
+ "app/assets/javascripts/theme-transpiler.js"
else
"tmp/theme-transpiler/#{Process.pid}.js"
end
@@ -87,6 +87,6 @@ class DiscourseJsProcessor
"node",
"app/assets/javascripts/theme-transpiler/build.js",
TRANSPILER_PATH,
- )
+ ) if !Rails.env.production? or !File.file?(TRANSPILER_PATH)
@@ -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
+30 -14
View File
@@ -6,13 +6,13 @@ source "https://rubygems.org"
gem "bootsnap", require: false, platform: :mri
gem "actionmailer", "~> 7.1.0"
gem "actionpack", "~> 7.1.0"
gem "actionview", "~> 7.1.0"
gem "activemodel", "~> 7.1.0"
gem "activerecord", "~> 7.1.0"
gem "activesupport", "~> 7.1.0"
gem "railties", "~> 7.1.0"
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 "json"
@@ -99,7 +99,7 @@ gem "sidekiq"
gem "mini_scheduler"
gem "execjs", require: false
gem "mini_racer"
gem "mini_racer", "0.17.pre13"
gem "highline", require: false
@@ -158,6 +158,8 @@ group :test, :development do
gem "syntax_tree"
gem "syntax_tree-disable_ternary"
gem "rspec-multi-mock"
end
group :development do
@@ -241,8 +243,6 @@ if ENV["IMPORT"] == "1"
gem "reverse_markdown"
gem "tiny_tds"
gem "csv"
gem "parallel", require: false
end
group :generic_import, optional: true do
@@ -269,10 +269,26 @@ gem "cgi", ">= 0.3.6", require: false
gem "tzinfo-data"
gem "csv", require: false
# TODO: Can be removed once we upgrade to Rails 7.1
gem "mutex_m"
gem "drb"
# dependencies for the automation plugin
gem "iso8601"
gem "rrule"
group :migrations, optional: true do
gem "extralite-bundle", require: "extralite"
# auto-loading
gem "zeitwerk"
# databases
gem "trilogy"
# CLI
gem "ruby-progressbar"
# non-cryptographic hashing algorithm for generating placeholder IDs
gem "digest-xxhash"
end
gem "dry-initializer", "~> 3.1"
gem "parallel"
@@ -1,28 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
useragent (~> 0.16)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
@@ -31,25 +29,27 @@ GEM
actionview (>= 6.0.a)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
timeout (>= 0.4.0)
activesupport (7.1.3.4)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotate (3.2.0)
@@ -76,17 +76,18 @@ GEM
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
benchmark (0.4.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
bootsnap (1.18.3)
bootsnap (1.18.4)
msgpack (~> 1.2)
builder (3.3.0)
bullet (7.2.0)
bullet (8.0.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
@@ -104,26 +105,27 @@ GEM
cgi (0.4.1)
chunky_png (1.4.0)
coderay (1.1.3)
colored2 (4.0.0)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
cose (1.3.0)
colored2 (4.0.3)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
cose (1.3.1)
cbor (~> 0.5.9)
openssl-signature_algorithm (~> 1.0)
cppjieba_rb (0.4.2)
cppjieba_rb (0.4.4)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
css_parser (1.17.1)
css_parser (1.21.0)
addressable
csv (3.3.0)
date (3.3.4)
csv (3.3.2)
date (3.4.1)
debug_inspector (1.2.0)
diff-lcs (1.5.1)
diffy (3.4.2)
digest (3.1.1)
discourse-fonts (0.0.9)
diffy (3.4.3)
digest (3.2.0)
digest-xxhash (0.2.9)
discourse-fonts (0.0.18)
discourse-seed-fu (2.3.12)
activerecord (>= 3.1)
activesupport (>= 3.1)
@@ -132,50 +134,53 @@ GEM
literate_randomizer
docile (1.4.1)
drb (2.2.1)
email_reply_trimmer (0.1.13)
erubi (1.13.0)
excon (0.111.0)
execjs (2.9.1)
exifr (1.4.0)
dry-initializer (3.2.0)
email_reply_trimmer (0.2.0)
erubi (1.13.1)
excon (1.2.3)
execjs (2.10.0)
exifr (1.4.1)
extralite-bundle (2.8.2)
fabrication (2.31.0)
faker (2.23.0)
i18n (>= 1.8.11, < 2)
fakeweb (1.3.0)
faraday (2.10.0)
faraday-net_http (>= 2.0, < 3.2)
faraday (2.12.2)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.1.1)
net-http
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
faraday-retry (2.2.1)
faraday (~> 2.0)
fast_blank (1.0.1)
fastimage (2.3.1)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.1)
ffi (1.17.1-arm64-darwin)
ffi (1.17.1-x86_64-darwin)
fspath (3.1.2)
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (4.27.2)
google-protobuf (4.29.3)
bigdecimal
rake (>= 13)
google-protobuf (4.27.2-arm64-darwin)
google-protobuf (4.29.3-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.27.2-x86_64-darwin)
google-protobuf (4.29.3-x86_64-darwin)
bigdecimal
rake (>= 13)
guess_html_encoding (0.0.11)
hana (1.3.7)
hashdiff (1.1.0)
hashdiff (1.1.2)
hashie (5.0.0)
highline (3.1.0)
highline (3.1.2)
reline
htmlentities (4.3.4)
http_accept_language (2.1.1)
i18n (1.14.5)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
image_optim (0.31.3)
image_optim (0.31.4)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (>= 1.5, < 4)
@@ -183,32 +188,34 @@ GEM
progress (~> 3.0, >= 3.0.1)
image_size (3.4.0)
in_threads (1.6.0)
io-console (0.7.2)
irb (1.14.0)
io-console (0.8.0)
irb (1.15.1)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
iso8601 (0.13.0)
jmespath (1.6.2)
json (2.7.2)
json-schema (4.3.1)
addressable (>= 2.8)
json_schemer (2.3.0)
json (2.9.1)
json-schema (5.1.1)
addressable (~> 2.8)
bigdecimal (~> 3.1)
json_schemer (2.4.0)
bigdecimal
hana (~> 1.3)
regexp_parser (~> 2.0)
simpleidn (~> 0.2)
jwt (2.8.2)
jwt (2.10.1)
base64
kgio (2.11.4)
language_server-protocol (3.17.0.3)
libv8-node (18.19.0.0)
libv8-node (18.19.0.0-arm64-darwin)
libv8-node (18.19.0.0-x86_64-darwin)
language_server-protocol (3.17.0.4)
libv8-node (22.7.0.4)
libv8-node (22.7.0.4-arm64-darwin)
libv8-node (22.7.0.4-x86_64-darwin)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
literate_randomizer (0.4.0)
logger (1.6.0)
logger (1.6.5)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
@@ -216,7 +223,7 @@ GEM
request_store (~> 1.0)
logstash-event (1.2.02)
logster (2.20.0)
loofah (2.22.0)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lru_redux (1.1.0)
@@ -228,34 +235,33 @@ GEM
net-smtp
matrix (0.4.2)
maxminddb (0.1.22)
memory_profiler (1.0.2)
memory_profiler (1.1.0)
message_bus (4.3.8)
rack (>= 1.1.3)
messageformat-wrapper (1.1.0)
mini_racer (>= 0.6.3)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
mini_racer (0.14.1)
libv8-node (~> 18.19.0.0)
mini_scheduler (0.16.0)
sidekiq (>= 4.2.3, < 7.0)
mini_sql (1.5.0)
mini_portile2 (2.8.8)
mini_racer (0.17.0.pre13)
libv8-node (~> 22.7.0.4)
mini_scheduler (0.18.0)
sidekiq (>= 6.5, < 8.0)
mini_sql (1.6.0)
mini_suffix (0.3.3)
ffi (~> 1.9)
minio_runner (0.1.2)
minitest (5.24.1)
mocha (2.4.5)
minitest (5.25.4)
mocha (2.7.1)
ruby2_keywords (>= 0.0.5)
msgpack (1.7.2)
msgpack (1.7.5)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mustache (1.1.1)
mutex_m (0.2.0)
net-http (0.4.1)
net-http (0.6.0)
uri
net-imap (0.4.14)
net-imap (0.5.5)
date
net-protocol
net-pop (0.1.2)
@@ -264,13 +270,13 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.7)
nio4r (2.7.4)
nokogiri (1.18.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
nokogiri (1.18.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.18.2-x86_64-darwin)
racc (~> 1.4)
oauth (1.1.0)
oauth-tty (~> 1.0, >= 1.0.1)
@@ -284,8 +290,9 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
oj (3.16.4)
oj (3.16.9)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
@@ -299,27 +306,32 @@ GEM
oauth2 (~> 1.1)
omniauth (~> 1.1)
omniauth-oauth2 (>= 1.6)
omniauth-oauth (1.2.0)
omniauth-oauth (1.2.1)
oauth
omniauth (>= 1.0, < 3)
rack (>= 1.6.2, < 4)
omniauth-oauth2 (1.7.3)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
openssl (3.2.0)
openssl (3.3.0)
openssl-signature_algorithm (1.3.0)
openssl (> 2.0)
optimist (3.1.0)
parallel (1.25.1)
parallel_tests (4.7.1)
optimist (3.2.0)
ostruct (0.6.1)
parallel (1.26.3)
parallel_tests (4.9.0)
parallel
parser (3.3.4.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pg (1.5.4)
pg (1.5.9)
pp (0.6.2)
prettyprint
prettier_print (1.2.1)
prettyprint (0.2.0)
progress (3.6.0)
pry (0.14.2)
coderay (~> 1.1)
@@ -332,13 +344,14 @@ GEM
pry-stack_explorer (0.6.1)
binding_of_caller (~> 1.0)
pry (~> 0.13)
psych (5.1.2)
psych (5.2.3)
date
stringio
public_suffix (6.0.1)
puma (6.4.2)
puma (6.6.0)
nio4r (~> 2.0)
racc (1.8.0)
rack (2.2.9)
racc (1.8.1)
rack (2.2.10)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-protection (3.2.0)
@@ -346,29 +359,29 @@ GEM
rack (~> 2.2, >= 2.2.4)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (1.0.0)
rackup (1.0.1)
rack (< 3)
webrick
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails_failover (2.1.1)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails_failover (2.2.0)
activerecord (>= 6.1, < 8.0)
concurrent-ruby
railties (>= 6.1, < 8.0)
rails_multisite (6.0.0)
rails_multisite (6.1.0)
activerecord (>= 6.0)
railties (>= 6.0)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
@@ -383,23 +396,22 @@ GEM
ffi (>= 1.0.6)
msgpack (>= 0.4.3)
optimist (>= 3.0.0)
rchardet (1.8.0)
rdoc (6.7.0)
rchardet (1.9.0)
rdoc (6.11.0)
psych (>= 4.0.0)
redcarpet (3.6.0)
redis (4.8.1)
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.9.2)
reline (0.5.9)
regexp_parser (2.10.0)
reline (0.6.0)
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
rexml (3.3.2)
strscan
rexml (3.4.0)
rinku (2.0.6)
rotp (6.3.0)
rouge (4.3.0)
rouge (4.5.1)
rqrcode (2.2.0)
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
@@ -410,51 +422,52 @@ GEM
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-html-matchers (0.10.0)
nokogiri (~> 1)
rspec (>= 3.0.0.a)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.3)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-multi-mock (0.3.1)
rspec (>= 3.7.0)
rspec-rails (7.1.0)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rss (0.3.0)
rspec-support (3.13.2)
rss (0.3.1)
rexml
rswag-specs (2.13.0)
activesupport (>= 3.1, < 7.2)
json-schema (>= 2.2, < 5.0)
railties (>= 3.1, < 7.2)
rswag-specs (2.16.0)
activesupport (>= 5.2, < 8.1)
json-schema (>= 2.2, < 6.0)
railties (>= 5.2, < 8.1)
rspec-core (>= 2.14)
rtlcss (0.2.1)
mini_racer (>= 0.6.3)
rubocop (1.65.0)
rubocop (1.71.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-discourse (3.8.1)
rubocop-discourse (3.9.3)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
@@ -464,26 +477,26 @@ GEM
rubocop-rspec_rails (>= 2.30.0)
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-rails (2.25.1)
rubocop-rails (2.29.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.3)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
rubocop-rspec (~> 3, >= 3.0.1)
ruby-prof (1.7.0)
ruby-prof (1.7.1)
ruby-progressbar (1.13.0)
ruby-readability (0.7.1)
ruby-readability (0.7.2)
guess_html_encoding (>= 0.0.4)
nokogiri (>= 1.6.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sanitize (6.1.2)
rubyzip (2.4.1)
sanitize (7.0.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
nokogiri (>= 1.16.8)
sass-embedded (1.77.5)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13)
@@ -493,15 +506,16 @@ GEM
google-protobuf (>= 3.25, < 5.0)
sassc-embedded (1.77.7)
sass-embedded (~> 1.77)
selenium-devtools (0.126.0)
securerandom (0.4.1)
selenium-devtools (0.132.0)
selenium-webdriver (~> 4.2)
selenium-webdriver (4.23.0)
selenium-webdriver (4.28.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
shoulda-matchers (6.2.0)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
sidekiq (6.5.12)
connection_pool (>= 2.2.5, < 3)
@@ -511,64 +525,65 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
simpleidn (0.2.3)
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
sprockets (3.7.3)
sprockets (3.7.5)
base64
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.5.1)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (2.0.2)
sqlite3 (2.5.0)
mini_portile2 (~> 2.8.0)
sqlite3 (2.0.2-arm64-darwin)
sqlite3 (2.0.2-x86_64-darwin)
sqlite3 (2.5.0-arm64-darwin)
sqlite3 (2.5.0-x86_64-darwin)
sshkey (3.0.0)
stackprof (0.2.26)
stringio (3.1.1)
strscan (3.1.0)
stackprof (0.2.27)
stringio (3.1.2)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
syntax_tree-disable_ternary (1.0.0)
test-prof (1.3.3.1)
thor (1.3.1)
timeout (0.4.1)
test-prof (1.4.4)
thor (1.3.2)
timeout (0.4.3)
trilogy (2.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2024.1)
tzinfo-data (1.2025.1)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
unicode-display_width (2.5.0)
unf (0.2.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
uniform_notifier (1.16.0)
uri (0.13.0)
uri (1.0.2)
useragent (0.16.11)
version_gem (1.1.4)
web-push (3.0.1)
jwt (~> 2.0)
openssl (~> 3.0)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
webrick (1.9.1)
websocket (1.2.11)
xpath (3.2.0)
nokogiri (~> 1.8)
yaml-lint (0.1.2)
yard (0.9.36)
zeitwerk (2.6.16)
yard (0.9.37)
zeitwerk (2.7.1)
PLATFORMS
arm64-darwin-21
@@ -577,16 +592,18 @@ PLATFORMS
arm64-darwin-24
ruby
x86_64-darwin-22
x86_64-darwin-23
x86_64-darwin-24
DEPENDENCIES
actionmailer (~> 7.1.0)
actionpack (~> 7.1.0)
actionview (~> 7.1.0)
actionmailer (~> 7.2.0)
actionpack (~> 7.2.0)
actionview (~> 7.2.0)
actionview_precompiler
active_model_serializers (~> 0.8.3)
activemodel (~> 7.1.0)
activerecord (~> 7.1.0)
activesupport (~> 7.1.0)
activemodel (~> 7.2.0)
activerecord (~> 7.2.0)
activesupport (~> 7.2.0)
addressable
annotate
aws-sdk-s3
@@ -607,13 +624,15 @@ DEPENDENCIES
csv
diffy
digest
digest-xxhash
discourse-fonts
discourse-seed-fu
discourse_dev_assets
drb
dry-initializer (~> 3.1)
email_reply_trimmer
excon
execjs
extralite-bundle
fabrication
faker (~> 2.16)
fakeweb
@@ -641,7 +660,7 @@ DEPENDENCIES
message_bus
messageformat-wrapper
mini_mime
mini_racer
mini_racer (= 0.17.pre13)
mini_scheduler
mini_sql
mini_suffix
@@ -649,7 +668,6 @@ DEPENDENCIES
mocha
multi_json
mustache
mutex_m
net-http
net-imap
net-pop
@@ -662,6 +680,7 @@ DEPENDENCIES
omniauth-google-oauth2
omniauth-oauth2
omniauth-twitter
parallel
parallel_tests
pg
pry-byebug
@@ -674,7 +693,7 @@ DEPENDENCIES
rails-dom-testing
rails_failover
rails_multisite
railties (~> 7.1.0)
railties (~> 7.2.0)
rake
rb-fsevent
rbtrace
@@ -688,12 +707,14 @@ DEPENDENCIES
rrule
rspec
rspec-html-matchers
rspec-multi-mock
rspec-rails
rss
rswag-specs
rtlcss
rubocop-discourse
ruby-prof
ruby-progressbar
ruby-readability
rubyzip
sanitize
@@ -712,6 +733,7 @@ DEPENDENCIES
syntax_tree-disable_ternary
test-prof
thor
trilogy
tzinfo-data
uglifier
unf
@@ -720,6 +742,7 @@ DEPENDENCIES
webmock
yaml-lint
yard
zeitwerk
BUNDLED WITH
2.4.22
2.5.22
File diff suppressed because it is too large Load Diff
+34 -21
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ requests click click-log packaging ])" bundix bundler nix-update nurl prefetch-yarn-deps
#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ requests click click-log packaging ])" bundix bundler nix-update nurl
from __future__ import annotations
import click
@@ -86,13 +86,6 @@ class DiscourseRepo:
return self._latest_commit_sha
def get_yarn_lock_hash(self, rev: str, path: str):
yarnLockText = self.get_file(path, rev)
with tempfile.NamedTemporaryFile(mode='w') as lockFile:
lockFile.write(yarnLockText)
hash = subprocess.check_output(['prefetch-yarn-deps', lockFile.name]).decode().strip()
return subprocess.check_output(["nix", "hash", "to-sri", "--type", "sha256", hash]).decode().strip()
def get_file(self, filepath, rev):
"""Return file contents at a given rev.
@@ -105,6 +98,24 @@ class DiscourseRepo:
return r.text
def _get_build_lock_hash():
nixpkgs_path = Path(__file__).parent / '../../../../'
output = subprocess.run(['nix-build', '-A', 'discourse'], text=True, cwd=nixpkgs_path, capture_output=True)
# The line is of the form " got: sha256-xxx"
lines = [i.strip() for i in output.stderr.splitlines()]
new_hash_lines = [i.strip("got:").strip() for i in lines if i.startswith("got:")]
if len(new_hash_lines) == 0:
if output.returncode != 0:
print("Error while fetching new hash with nix build")
print(output.stderr)
print("No hash change is needed")
return None
if len(new_hash_lines) > 1:
print(new_hash_lines)
raise Exception("Got an unexpected number of new hash lines:")
return new_hash_lines[0]
def _call_nix_update(pkg, version):
"""Call nix-update from nixpkgs root dir."""
nixpkgs_path = Path(__file__).parent / '../../../../'
@@ -233,16 +244,17 @@ def update(rev):
_call_nix_update('discourse', version.version)
old_yarn_hash = _nix_eval('discourse.assets.yarnOfflineCache.outputHash')
new_yarn_hash = repo.get_yarn_lock_hash(version.tag, "yarn.lock")
click.echo(f"Updating yarn lock hash: {old_yarn_hash} -> {new_yarn_hash}")
old_pnpm_hash = _nix_eval('discourse.assets.pnpmDeps.outputHash')
new_pnpm_hash = _get_build_lock_hash()
if new_pnpm_hash is not None:
click.echo(f"Updating yarn lock hash: {old_pnpm_hash} -> {new_pnpm_hash}")
with open(Path(__file__).parent / "default.nix", 'r+') as f:
content = f.read()
content = content.replace(old_yarn_hash, new_yarn_hash)
f.seek(0)
f.write(content)
f.truncate()
with open(Path(__file__).parent / "default.nix", 'r+') as f:
content = f.read()
content = content.replace(old_pnpm_hash, new_pnpm_hash)
f.seek(0)
f.write(content)
f.truncate()
@cli.command()
@@ -286,7 +298,7 @@ def update_plugins():
{'name': 'discourse-saved-searches'},
{'name': 'discourse-solved'},
{'name': 'discourse-spoiler-alert'},
{'name': 'discourse-voting'},
{'name': 'discourse-voting', 'repo_name': "discourse-topic-voting"},
{'name': 'discourse-yearly-review'},
]
@@ -307,8 +319,9 @@ def update_plugins():
# https://meta.discourse.org/t/pinning-plugin-and-theme-versions-for-older-discourse-installs/156971
# this makes sure we don't upgrade plugins to revisions that
# are incompatible with the packaged Discourse version
repo_latest_commit = repo.latest_commit_sha
try:
compatibility_spec = repo.get_file('.discourse-compatibility', repo.latest_commit_sha)
compatibility_spec = repo.get_file('.discourse-compatibility', repo_latest_commit)
versions = [(DiscourseVersion(discourse_version), plugin_rev.strip(' '))
for [discourse_version, plugin_rev]
in [line.lstrip("< ").split(':')
@@ -317,12 +330,12 @@ def update_plugins():
discourse_version = DiscourseVersion(_get_current_package_version('discourse'))
versions = list(filter(lambda ver: ver[0] >= discourse_version, versions))
if versions == []:
rev = repo.latest_commit_sha
rev = repo_latest_commit
else:
rev = versions[0][1]
print(rev)
except requests.exceptions.HTTPError:
rev = repo.latest_commit_sha
rev = repo_latest_commit
filename = _nix_eval(f'builtins.unsafeGetAttrPos "src" discourse.plugins.{name}')
if filename is None: