Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/tests/web-apps/pdfding/basic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

# create admin
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(${toString port})
machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")

cookie_jar = "/tmp/cookies.txt"
Expand Down
4 changes: 3 additions & 1 deletion nixos/tests/web-apps/pdfding/postgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
testScript =
{ nodes, ... }:
let
inherit (nodes.machine.services.pdfding) port;
stateDir = "/var/lib/pdfding";
in
# py
Expand All @@ -41,6 +42,7 @@

# create admin
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(${toString port})

machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")

Expand Down Expand Up @@ -74,7 +76,7 @@
interactive.nodes.machine =
{ config, ... }:
let
port = config.services.pdfding.port;
inherit (config.services.pdfding) port;
in
{
# not needed, only for manual interactive debugging
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/web-apps/pdfding/s3-backups.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ in

# create admin
machine.wait_for_unit("multi-user.target")
machine.wait_for_open_port(${toString port})
machine.succeed("DJANGO_SUPERUSER_PASSWORD=admin pdfding-manage createsuperuser --no-input --username admin --email admin@localhost")

# login
Expand Down
11 changes: 5 additions & 6 deletions pkgs/by-name/pd/pdfding/frontend.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
stdenv,
fetchpatch2,
fetchNpmDeps,
fetchzip,
fetchFromGitHub,
Expand All @@ -10,8 +9,8 @@
nodejs,
}:
let
pdfjsVersion = "5.4.394"; # see update script
pdfjsHash = "sha256-pd7xwfvR9U1bHT5eblszYU3YJQwQwhuyDDiNj+fnyaQ=";
pdfjsVersion = "5.5.207"; # see update script
pdfjsHash = "sha256-HikisEa6L+BqsG6imgWhV+4J46BluU5zqU1nFZAG0eM=";
pdfjs = fetchzip {
url = "https://github.com/mozilla/pdf.js/releases/download/v${pdfjsVersion}/pdfjs-${pdfjsVersion}-dist.zip";
hash = pdfjsHash;
Expand All @@ -28,18 +27,18 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "pdfding-frontend";
version = "1.5.1";
version = "1.7.1";
src = fetchFromGitHub {
owner = "mrmn2";
repo = "PdfDing";
tag = "v${finalAttrs.version}";
hash = "sha256-PXkD+2k8/LmMWzZAj8qEK4mLoOKS4mDWcqe8AgoCdBU=";
hash = "sha256-T3Y9eWwBVxGPISZ3EZndAR6mwsq4g67RRCPpoZPuh+0=";
};
Comment on lines +30 to 36
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could inherit these from the main package.

Copy link
Copy Markdown
Member Author

@phanirithvij phanirithvij Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to update the update script as well, let's merge it for now as it is a security fix. I will rework it later.


npmDeps = fetchNpmDeps {
inherit (finalAttrs) src;
name = "pdfding-frontend-${finalAttrs.version}-npm-deps";
hash = "sha256-SgL8QhRGONGhJBu6b8HSVqZPzJ+NojhVClBEH5ajCcc=";
hash = "sha256-an4KKKx65ehCm1YAlwLWYAW8pQMgB4HdDERqC/hfQi0=";
};

nativeBuildInputs = [
Expand Down
50 changes: 17 additions & 33 deletions pkgs/by-name/pd/pdfding/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
lib,
callPackage,
fetchFromGitHub,
fetchpatch2,
makeWrapper,
nixosTests,

Expand All @@ -13,30 +12,18 @@ let
in
python.pkgs.buildPythonPackage (finalAttrs: {
pname = "pdfding";
version = "1.5.1";
version = "1.7.1";
src = fetchFromGitHub {
owner = "mrmn2";
repo = "PdfDing";
tag = "v${finalAttrs.version}";
hash = "sha256-PXkD+2k8/LmMWzZAj8qEK4mLoOKS4mDWcqe8AgoCdBU=";
hash = "sha256-T3Y9eWwBVxGPISZ3EZndAR6mwsq4g67RRCPpoZPuh+0=";
};
pyproject = true;

patches = [
# fixes two tests, remove patch in the next version
# https://github.com/mrmn2/PdfDing/pull/248
(fetchpatch2 {
url = "https://github.com/mrmn2/PdfDing/commit/24df5a82ffb1d60162978791b716f67d20128a22.patch?full_index=1";
hash = "sha256-N3FtPQGSOFeUbVcinXK9kJM6hZOn4YdJJVWe4VXb8pE=";
})
];

# remove supervisor from dependencies
postPatch = ''
sed -i 's/supervisor.*$//' pyproject.toml

substituteInPlace pdfding/backup/tests/test_management.py pdfding/backup/tests/test_tasks.py \
--replace-fail "Path(__file__).parents[2]" "Path('$PDFDING_OUT_DIR')"
'';

dependencies =
Expand Down Expand Up @@ -68,6 +55,7 @@ python.pkgs.buildPythonPackage (finalAttrs: {
requests
]
++ qrcode.optional-dependencies.pil
++ django-allauth.optional-dependencies.mfa
++ django-allauth.optional-dependencies.socialaccount;

build-system = with python.pkgs; [ poetry-core ];
Expand Down Expand Up @@ -139,36 +127,31 @@ python.pkgs.buildPythonPackage (finalAttrs: {
pythonRelaxDeps = [
"django"
"django-allauth"
"django-htmx"
"gunicorn"
"markdown"
"nh3"
"pypdf"
"ruamel-yaml"
"whitenoise"
];

nativeCheckInputs = with python.pkgs; [
checkInputs = with python.pkgs; [
fido2
pytest-django
pytestCheckHook
];

# from .github/workflows/tests.yaml
pytestFlags = [
"--ignore=e2e"
nativeCheckInputs = with python.pkgs; [
pytestCheckHook
];

disabledTests = [
# broken tests in 1.5.0
"test_adjust_file_paths_to_ws_collection"
"test_oidc_callback" # AssertionError: 200 != 401
];
# from .github/workflows/tests.yaml
pytestFlags = [ "--ignore=e2e" ];

/*
fix two breaking tests by providing full out path
AssertionError: Calls not found
AssertionError: 'add_file_to_minio' does not contain all of ...
*/
preCheck = ''
# dev.py is required for tests, restore it
mv dev.py.bak $PDFDING_OUT_DIR/core/settings/dev.py

export DATA_DIR=$PWD/pdfding

# tests should run in pdfding directory
pushd pdfding
'';
Expand All @@ -177,6 +160,8 @@ python.pkgs.buildPythonPackage (finalAttrs: {
# come out of the pdfding directory
popd

unset DATA_DIR

# remove dev.py
rm $PDFDING_OUT_DIR/core/settings/dev.py
'';
Expand All @@ -199,7 +184,6 @@ python.pkgs.buildPythonPackage (finalAttrs: {
homepage = "https://pdfding.com";
license = lib.licenses.agpl3Only;
mainProgram = "pdfding-manage";
maintainers = with lib.maintainers; [ phanirithvij ];
platforms = lib.platforms.unix;
teams = with lib.teams; [ ngi ];
};
Expand Down
Loading