Merge pull request #269469 from NetaliDev/zammad-update

This commit is contained in:
Janik 2023-12-05 09:29:51 +01:00 committed by GitHub
commit 7703f36fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 561 additions and 374 deletions

View File

@ -21,6 +21,7 @@ let
NODE_ENV = "production";
RAILS_SERVE_STATIC_FILES = "true";
RAILS_LOG_TO_STDOUT = "true";
REDIS_URL = "redis://${cfg.redis.host}:${toString cfg.redis.port}";
};
databaseConfig = settingsFormat.generate "database.yml" cfg.database.settings;
in
@ -65,6 +66,36 @@ in
description = lib.mdDoc "Websocket service port.";
};
redis = {
createLocally = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc "Whether to create a local redis automatically.";
};
name = mkOption {
type = types.str;
default = "zammad";
description = lib.mdDoc ''
Name of the redis server. Only used if `createLocally` is set to true.
'';
};
host = mkOption {
type = types.str;
default = "localhost";
description = lib.mdDoc ''
Redis server address.
'';
};
port = mkOption {
type = types.port;
default = 6379;
description = lib.mdDoc "Port of the redis server.";
};
};
database = {
type = mkOption {
type = types.enum [ "PostgreSQL" "MySQL" ];
@ -206,6 +237,10 @@ in
assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
message = "a password cannot be specified if services.zammad.database.createLocally is set to true";
}
{
assertion = cfg.redis.createLocally -> cfg.redis.host == "localhost";
message = "the redis host must be localhost if services.zammad.redis.createLocally is set to true";
}
];
services.mysql = optionalAttrs (cfg.database.createLocally && cfg.database.type == "MySQL") {
@ -231,6 +266,13 @@ in
];
};
services.redis = optionalAttrs cfg.redis.createLocally {
servers."${cfg.redis.name}" = {
enable = true;
port = cfg.redis.port;
};
};
systemd.services.zammad-web = {
inherit environment;
serviceConfig = serviceConfig // {
@ -240,6 +282,8 @@ in
after = [
"network.target"
"postgresql.service"
] ++ optionals cfg.redis.createLocally [
"redis-${cfg.redis.name}.service"
];
requires = [
"postgresql.service"
@ -303,16 +347,15 @@ in
script = "./script/websocket-server.rb -b ${cfg.host} -p ${toString cfg.websocketPort} start";
};
systemd.services.zammad-scheduler = {
inherit environment;
serviceConfig = serviceConfig // { Type = "forking"; };
systemd.services.zammad-worker = {
inherit serviceConfig environment;
after = [ "zammad-web.service" ];
requires = [ "zammad-web.service" ];
description = "Zammad scheduler";
description = "Zammad background worker";
wantedBy = [ "multi-user.target" ];
script = "./script/scheduler.rb start";
script = "./script/background-worker.rb start";
};
};
meta.maintainers = with lib.maintainers; [ garbas taeer ];
meta.maintainers = with lib.maintainers; [ taeer netali ];
}

View File

@ -4,7 +4,7 @@ import ./make-test-python.nix (
{
name = "zammad";
meta.maintainers = with lib.maintainers; [ garbas taeer n0emis ];
meta.maintainers = with lib.maintainers; [ taeer n0emis netali ];
nodes.machine = { config, ... }: {
services.zammad.enable = true;
@ -44,9 +44,10 @@ import ./make-test-python.nix (
testScript = ''
start_all()
machine.wait_for_unit("postgresql.service")
machine.wait_for_unit("redis-zammad.service")
machine.wait_for_unit("zammad-web.service")
machine.wait_for_unit("zammad-websocket.service")
machine.wait_for_unit("zammad-scheduler.service")
machine.wait_for_unit("zammad-worker.service")
# wait for zammad to fully come up
machine.sleep(120)

View File

@ -7,7 +7,7 @@ index d85a17491..90ea5e387 100644
require 'rails/all'
+require 'nulldb'
require_relative 'issue_2656_workaround_for_rails_issue_33600'
require_relative '../lib/zammad/safe_mode'
# DO NOT REMOVE THIS LINE - see issue #2037
diff --git a/db/schema.rb b/db/schema.rb

View File

@ -19,11 +19,12 @@
, yarn2nix-moretea
, v8
, cacert
, redis
}:
let
pname = "zammad";
version = "5.4.1";
version = "6.1.0";
src = applyPatches {
@ -100,7 +101,7 @@ let
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-HI4RR4/ll/zNBNtDCb8OvEsG/BMVYacM0CcYqbkNHEY=";
hash = "sha256-PVQ2L+Io6Ct9UHvfoQmxV01ECG8fj0+xKwpMfAvD7q0=";
};
yarnPreBuild = ''
@ -124,13 +125,26 @@ stdenv.mkDerivation {
cacert
];
nativeBuildInputs = [
redis
];
RAILS_ENV = "production";
buildPhase = ''
node_modules=${yarnEnv}/libexec/Zammad/node_modules
${yarn2nix-moretea.linkNodeModulesHook}
mkdir redis-work
pushd redis-work
redis-server &
REDIS_PID=$!
popd
rake DATABASE_URL="nulldb://user:pass@127.0.0.1/dbname" assets:precompile
kill $REDIS_PID
rm -r redis-work
'';
installPhase = ''
@ -151,6 +165,6 @@ stdenv.mkDerivation {
homepage = "https://zammad.org";
license = licenses.agpl3Plus;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [ n0emis garbas taeer ];
maintainers = with maintainers; [ n0emis taeer netali ];
};
}

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
{
"private": true,
"scripts": {
"generate-graphql-api": "RAILS_ENV=development bundle exec rails generate zammad:graphql_introspection > tmp/graphql_introspection.json && npx graphql-codegen -c .graphql_code_generator.yml && rm tmp/graphql_introspection.json",
"generate-graphql-api": "RAILS_ENV=development bundle exec rails generate zammad:graphql_introspection > app/graphql/graphql_introspection.json && npx graphql-codegen -c .graphql_code_generator.yml",
"generate-setting-types": "RAILS_ENV=development bundle exec rails generate zammad:setting_types",
"dev": "RAILS_ENV=development forego start -f Procfile.dev",
"dev:https": "VITE_RUBY_HTTPS=true RAILS_ENV=development forego start -f Procfile.dev-https",
"https:generate": "sh contrib/ssl/generate-ssl.sh",
"dev:https": "VITE_RUBY_HOST=0.0.0.0 VITE_RUBY_HTTPS=true RAILS_ENV=development forego start -f Procfile.dev-https",
"i18n": "rails generate zammad:translation_catalog",
"lint": "vue-tsc --noEmit && eslint --cache --cache-location ./tmp/eslintcache.js -c .eslintrc.js --ext .js,.ts,.vue app/frontend/ .eslint-plugin-zammad/",
"lint": "vue-tsc --noEmit && eslint --cache --cache-location ./tmp/eslintcache.js --cache-strategy content -c .eslintrc.js --ext .js,.ts,.vue app/frontend/ .eslint-plugin-zammad/",
"lint:fix": "yarn lint -- --fix",
"lint:css": "stylelint **/*.{css,vue,scss}",
"lint:css:fix": "stylelint **/*.{css,vue,scss} --fix",
@ -24,129 +24,134 @@
},
"packageManager": "yarn@1.22.19",
"devDependencies": {
"@graphql-codegen/cli": "^3.0.0",
"@graphql-codegen/introspection": "^3.0.0",
"@faker-js/faker": "^8.0.2",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/introspection": "^4.0.0",
"@graphql-codegen/near-operation-file-preset": "^2.5.0",
"@graphql-codegen/typescript": "^3.0.0",
"@graphql-codegen/typescript-operations": "^3.0.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-vue-apollo": "^3.3.7",
"@histoire/plugin-vue": "^0.14.2",
"@pinia/testing": "^0.0.14",
"@tailwindcss/line-clamp": "^0.4.2",
"@testing-library/jest-dom": "^5.16.5",
"@histoire/plugin-vue": "^0.17.1",
"@pinia/testing": "^0.1.3",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/user-event": "^14.4.3",
"@testing-library/vue": "^6.6.1",
"@types/lodash-es": "^4.17.6",
"@testing-library/vue": "^7.0.0",
"@types/lodash-es": "^4.17.8",
"@types/rails__actioncable": "^6.1.6",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/test-utils": "^2.2.10",
"autoprefixer": "^10.4.13",
"eslint": "^8.33.0",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.4.1",
"autoprefixer": "^10.4.15",
"eslint": "^8.45.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier-vue": "^4.2.0",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-sonarjs": "^0.18.0",
"eslint-plugin-vue": "^9.9.0",
"eslint-plugin-sonarjs": "^0.19.0",
"eslint-plugin-vue": "^9.15.1",
"eslint-plugin-zammad": "file:.eslint-plugin-zammad",
"histoire": "^0.14.2",
"jsdom": "^21.1.0",
"histoire": "^0.17.0",
"jsdom": "^22.1.0",
"mock-apollo-client": "^1.2.1",
"postcss": "^8.4.21",
"postcss": "^8.4.28",
"postcss-html": "^1.5.0",
"prettier": "2.8.4",
"prettier-plugin-tailwindcss": "^0.2.2",
"regenerator-runtime": "^0.13.11",
"sass": "^1.58.0",
"stylelint": "^14.16.1",
"prettier": "3.0.2",
"prettier-plugin-tailwindcss": "^0.5.3",
"regenerator-runtime": "^0.14.0",
"sass": "^1.65.1",
"stylelint": "^15.10.3",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-config-standard-scss": "^6.1.0",
"stylelint-prettier": "^2.0.0",
"stylelint-scss": "^4.4.0",
"tailwindcss": "^3.2.6",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^10.0.0",
"stylelint-prettier": "^4.0.2",
"stylelint-scss": "^5.1.0",
"svg-baker": "^1.7.0",
"svgo": "^3.0.2",
"tailwindcss": "^3.3.3",
"timezone-mock": "^1.3.6",
"ts-node": "^10.9.1",
"type-fest": "^3.5.7",
"typescript": "^4.9.5",
"vite": "^4.0.4",
"vite-plugin-pwa": "^0.14.1",
"vite-plugin-ruby": "^3.1.3",
"vite-plugin-svg-icons": "^2.0.1",
"vitest": "^0.28.4",
"type-fest": "^3.13.1",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-plugin-pwa": "^0.16.4",
"vite-plugin-ruby": "^3.2.2",
"vitest": "^0.34.3",
"vitest-axe": "^0.1.0",
"vue-tsc": "^1.0.24"
"vue-tsc": "^1.8.8"
},
"dependencies": {
"@apollo/client": "^3.7.7",
"@formkit/core": "^1.0.0-beta.13-c578106",
"@formkit/dev": "^1.0.0-beta.13-c578106",
"@formkit/i18n": "^1.0.0-beta.13-c578106",
"@formkit/inputs": "^1.0.0-beta.13-c578106",
"@formkit/rules": "^1.0.0-beta.13-c578106",
"@formkit/tailwindcss": "^1.0.0-beta.13-c578106",
"@formkit/themes": "^1.0.0-beta.13-c578106",
"@formkit/utils": "^1.0.0-beta.13-c578106",
"@formkit/validation": "^1.0.0-beta.13-c578106",
"@formkit/vue": "^1.0.0-beta.13-c578106",
"@apollo/client": "^3.7.17",
"@formkit/core": "^0.17.4",
"@formkit/dev": "^0.17.4",
"@formkit/i18n": "^0.17.4",
"@formkit/inputs": "^0.17.4",
"@formkit/rules": "^0.17.4",
"@formkit/tailwindcss": "^0.17.4",
"@formkit/themes": "^0.17.4",
"@formkit/utils": "^0.17.4",
"@formkit/validation": "^0.17.4",
"@formkit/vue": "^0.17.4",
"@github/webauthn-json": "^2.1.1",
"@rails/actioncable": "6.1.7",
"@tiptap/core": "^2.0.0-beta.217",
"@tiptap/extension-blockquote": "^2.0.0-beta.217",
"@tiptap/extension-character-count": "^2.0.0-beta.217",
"@tiptap/extension-image": "^2.0.0-beta.217",
"@tiptap/extension-link": "^2.0.0-beta.217",
"@tiptap/extension-list-item": "^2.0.0-beta.217",
"@tiptap/extension-mention": "^2.0.0-beta.217",
"@tiptap/extension-ordered-list": "^2.0.0-beta.217",
"@tiptap/extension-paragraph": "^2.0.0-beta.217",
"@tiptap/extension-strike": "^2.0.0-beta.217",
"@tiptap/extension-underline": "^2.0.0-beta.217",
"@tiptap/pm": "^2.0.0-beta.217",
"@tiptap/starter-kit": "^2.0.0-beta.217",
"@tiptap/suggestion": "^2.0.0-beta.217",
"@tiptap/vue-3": "^2.0.0-beta.217",
"@vue/apollo-composable": "^4.0.0-beta.2",
"@vueuse/core": "^9.12.0",
"@vueuse/router": "^9.12.0",
"@vueuse/shared": "^9.12.0",
"@tiptap/core": "^2.0.4",
"@tiptap/extension-blockquote": "^2.0.4",
"@tiptap/extension-character-count": "^2.0.4",
"@tiptap/extension-hard-break": "^2.0.4",
"@tiptap/extension-image": "^2.0.4",
"@tiptap/extension-link": "^2.0.4",
"@tiptap/extension-list-item": "^2.0.4",
"@tiptap/extension-mention": "^2.0.4",
"@tiptap/extension-ordered-list": "^2.0.4",
"@tiptap/extension-paragraph": "^2.0.4",
"@tiptap/extension-strike": "^2.0.4",
"@tiptap/extension-underline": "^2.0.4",
"@tiptap/pm": "^2.0.4",
"@tiptap/starter-kit": "^2.0.4",
"@tiptap/suggestion": "^2.0.4",
"@tiptap/vue-3": "^2.0.4",
"@vue/apollo-composable": "4.0.0-beta.5",
"@vueuse/core": "^10.4.0",
"@vueuse/router": "^10.4.0",
"@vueuse/shared": "^10.4.0",
"async-mutex": "^0.4.0",
"flatpickr": "^4.6.13",
"graphql": "^16.6.0",
"graphql-ruby-client": "^1.11.5",
"graphql": "^16.7.1",
"graphql-ruby-client": "^1.11.8",
"graphql-tag": "^2.12.6",
"linkify-string": "^4.1.0",
"linkifyjs": "^4.1.0",
"linkify-string": "^4.1.1",
"linkifyjs": "^4.1.1",
"lodash-es": "^4.17.21",
"loglevel": "^1.8.1",
"mitt": "^3.0.0",
"pinia": "^2.0.30",
"mitt": "^3.0.1",
"pinia": "^2.1.6",
"tippy.js": "^6.3.7",
"ua-parser-js": "^1.0.33",
"tiptap-text-direction": "^0.3.0",
"ua-parser-js": "^1.0.35",
"uuid": "^9.0.0",
"vue": "^3.2.47",
"vue": "^3.3.4",
"vue-advanced-cropper": "^2.8.8",
"vue-easy-lightbox": "1.12.0",
"vue-router": "^4.1.6",
"vue-easy-lightbox": "1.16.0",
"vue-router": "^4.2.4",
"vue3-draggable-resizable": "^1.6.5",
"vuedraggable": "^4.1.0",
"workbox-core": "^6.5.4",
"workbox-precaching": "^6.5.4",
"workbox-window": "^6.5.4"
"workbox-core": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-window": "^7.0.0"
},
"resolutions": {
"loader-utils": "^3.2.1",
"postcss": "^8.4.21"
"postcss": "^8.4.28",
"stylelint-config-recommended": "^13.0.0"
},
"name": "Zammad",
"version": "5.4.1"
"version": "6.1.0"
}

View File

@ -1,8 +1,8 @@
{
"owner": "zammad",
"repo": "zammad",
"rev": "643aba6ba4ba66c6127038c8cc2cc7a20b912678",
"hash": "sha256-vLLn989M5ZN+jTh60BopEKbuaxOBfDsk6PiM+gHFClo=",
"rev": "ec4ddb8ae6a55d1c8e64ab5ddda9ff3e9d4f45c8",
"hash": "sha256-+AphZ0pKlXFdcncnDxeLdDL3OH2dyF0nb69+/W2dLgc=",
"fetchSubmodules": true
}

View File

@ -55,11 +55,6 @@ pushd $SOURCE_DIR
echo ":: Creating gemset.nix"
bundix --lockfile=./Gemfile.lock --gemfile=./Gemfile --gemset=$TARGET_DIR/gemset.nix
echo ":: Creating yarn.nix"
yarn install
cp yarn.lock $TARGET_DIR
yarn2nix > $TARGET_DIR/yarn.nix
# needed to avoid import from derivation
jq --arg VERSION "$VERSION" '. += {name: "Zammad", version: $VERSION}' package.json > $TARGET_DIR/package.json