Merge pull request #286523 from MarcelCoding/listmonk

listmonk: 2.5.1 -> 3.0.0
This commit is contained in:
Sandro 2024-03-06 18:49:20 +01:00 committed by GitHub
commit e656679228
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 92 additions and 106 deletions

View File

@ -187,7 +187,11 @@ in {
# Indeed, it will try to create all the folders and realize one of them already exist.
# Therefore, we have to create it ourselves.
''${pkgs.coreutils}/bin/mkdir -p "''${STATE_DIRECTORY}/listmonk/uploads"''
"${cfg.package}/bin/listmonk --config ${cfgFile} --idempotent --install --upgrade --yes"
# setup database if not already done
"${cfg.package}/bin/listmonk --config ${cfgFile} --idempotent --install --yes"
# apply db migrations (setup and migrations can not be done in one step
# with "--install --upgrade" listmonk ignores the upgrade)
"${cfg.package}/bin/listmonk --config ${cfgFile} --upgrade --yes"
"${updateDatabaseConfigScript}/bin/update-database-config.sh"
];
ExecStart = "${cfg.package}/bin/listmonk --config ${cfgFile}";

View File

@ -0,0 +1,37 @@
{ mkYarnPackage
, fetchYarnDeps
, meta
, version
, src
}:
mkYarnPackage {
pname = "listmonk-frontend";
inherit version;
src = "${src}/frontend";
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/frontend/yarn.lock";
hash = "sha256-TdrglyRtb2Q8SFtoiCoDj/zBV2+7DwzIm/Fzlt0ZvSo=";
};
configurePhase = ''
ln -s $node_modules node_modules
'';
buildPhase = ''
yarn --offline build
'';
installPhase = ''
mkdir $out
cp -R dist/* $out
'';
doDist = false;
inherit meta;
}

View File

@ -0,0 +1,45 @@
{
"name": "listmonk",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore src",
"prebuild": "eslint --ext .js,.vue --ignore-path .gitignore src"
},
"dependencies": {
"@tinymce/tinymce-vue": "^3",
"axios": "^1.6.2",
"buefy": "^0.9.25",
"bulma": "^0.9.4",
"chart.js": "^4.4.1",
"codeflask": "^1.4.1",
"dayjs": "^1.11.10",
"indent.js": "^0.3.5",
"qs": "^6.10.1",
"textversionjs": "^1.1.3",
"tinymce": "^5.10.9",
"turndown": "^7.1.2",
"vue": "^2.7.14",
"vue-chartjs": "^5.3.0",
"vue-i18n": "^8.28.2",
"vue-router": "^3.2.0",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vitejs/plugin-vue2": "^2.3.1",
"@vue/eslint-config-airbnb": "^7.0.1",
"cypress": "13.6.1",
"cypress-file-upload": "^5.0.2",
"eslint": "^8.56.0",
"eslint-define-config": "^2.0.0",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-vue": "^9.19.2",
"sass": "^1.34.0",
"vite": "^5.0.12",
"vue-eslint-parser": "^9.3.2",
"vue-template-compiler": "^2.6.12"
}
}

View File

@ -1,25 +1,17 @@
{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests, fetchpatch }:
{ lib, buildGoModule, fetchFromGitHub, callPackage, stuffbin, nixosTests }:
buildGoModule rec {
pname = "listmonk";
version = "2.5.1";
version = "3.0.0";
src = fetchFromGitHub {
owner = "knadh";
repo = "listmonk";
rev = "v${version}";
sha256 = "sha256-gCnIblc83CmG1auvYYxqW/xBl6Oy1KHGkqSY/3yIm3I=";
sha256 = "sha256-eNX+2ens+mz2V8ZBHtFFHDVbi64AAiiREElMjh67Dd8=";
};
patches = [
# Ensure that listmonk supports Go 1.20
(fetchpatch {
url = "https://github.com/knadh/listmonk/commit/25513b81044803b104ada63c0be57a913960484e.patch";
hash = "sha256-SYACM8r+NgeSWn9VJV4+wkm+6s/MhNGwn5zyc2tw7FU=";
})
];
vendorHash = "sha256-0sgC1+ueZTUCP+7JwI/OKLktfMHQq959GEk1mC0TQgE=";
vendorHash = "sha256-XAm2VfX1nHWTuAV2COEn8qrqPNv0xbaWgTYCpjrEfMw=";
nativeBuildInputs = [
stuffbin
@ -50,7 +42,7 @@ buildGoModule rec {
'';
passthru = {
frontend = callPackage ./frontend.nix { inherit meta; };
frontend = callPackage ./frontend.nix { inherit meta version src; };
tests = { inherit (nixosTests) listmonk; };
};

View File

@ -1,44 +0,0 @@
{ yarn2nix-moretea
, fetchFromGitHub
, fetchYarnDeps
, meta
}:
yarn2nix-moretea.mkYarnPackage rec {
pname = "listmonk-frontend";
version = "2.5.1";
src = fetchFromGitHub {
owner = "knadh";
repo = "listmonk";
rev = "v${version}";
sha256 = "sha256-gCnIblc83CmG1auvYYxqW/xBl6Oy1KHGkqSY/3yIm3I=";
};
packageJSON = ./package.json;
yarnLock = "${src}/frontend/yarn.lock";
offlineCache = fetchYarnDeps {
inherit yarnLock;
hash = "sha256-KKNk4lrM7unMFClkY6F3nqhKx5xfx87Ac+rug9sOwvI=";
};
# For Node.js v17+, this is necessary.
NODE_OPTIONS = "--openssl-legacy-provider";
installPhase = ''
runHook preInstall
cd deps/listmonk-frontend/frontend
npm run build
mv dist $out
runHook postInstall
'';
doDist = false;
inherit meta;
}

View File

@ -1,46 +0,0 @@
{
"name": "listmonk-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-report": "vue-cli-service build --report",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@tinymce/tinymce-vue": "^3",
"axios": "^0.27.2",
"buefy": "^0.9.10",
"c3": "^0.7.20",
"codeflask": "^1.4.1",
"core-js": "^3.12.1",
"dayjs": "^1.10.4",
"indent.js": "^0.3.5",
"qs": "^6.10.1",
"textversionjs": "^1.1.3",
"tinymce": "^5.10.7",
"turndown": "^7.0.0",
"vue": "^2.6.12",
"vue-i18n": "^8.22.2",
"vue-router": "^3.2.0",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-airbnb": "^5.3.0",
"babel-eslint": "^10.1.0",
"cypress": "10.10.0",
"cypress-file-upload": "^5.0.2",
"eslint": "^7.27.0",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-vue": "^7.9.0",
"sass": "^1.34.0",
"sass-loader": "^10.2.0",
"vue-template-compiler": "^2.6.12"
}
}

View File

@ -26293,8 +26293,6 @@ with pkgs;
lighttpd = callPackage ../servers/http/lighttpd { };
listmonk = callPackage ../servers/mail/listmonk { };
linx-server = callPackage ../servers/web-apps/linx-server { };
livepeer = callPackage ../servers/livepeer { };