Upstream has changed their `yarn.lock` file format to v2.
This introduces complications with nixpkgs, which needs the v1
file format. There is also a number of problems with the v2 version
(e.g. reproducibility or missing integrity fields) which makes the
direct use of v2 lockfile impossible.
Due to this change, we will need to convert the lockfile beforehand
and add it to nixpkgs. Due to issues with reproducibility it isn't
feasable to convert the lockfile within the `pgadmin` derivation.
For this commit I added the converted `yarn.lock` file and will add the
corresponding update script, once #231687 has been merged. (This adds
the tool to convert most of the v2 file to v1 and adds metadata to the
lockfile)
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
since the new release of 7.0, the `generated` directory isn't included
in the tarball anymore. This commit will build the frontend so
pgadmin can function again.
Fixes https://github.com/NixOS/nixpkgs/pull/226675#issuecomment-1529033940
Also this commit will switch to the Github source and will not
need the package.json and yarn.{lock,nix} files anymore, since the
mkYarnModules part has been removed.
Also, since we don't depend on those files anymore and we switched
to Github, the `update.sh` script has been superseeded and isn't
needed anymore.
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
due to upstreams fix on old versions of flask and
flask-security-too, we'll need to pin other older versions, too.
Also fix extra_require bug with requirements.txt
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
By default, pgadmin4 uses SERVER_MODE = True. This requires
access to system directories (e.g. /var/lib/pgadmin). There is
no easy way to change this mode during runtime. One has to change
or add config files withing pgadmin's directory structure to change it
or add a system-wide config file under `/etc/pgadmin`[1].
This isn't always easy to achive or may not be possible at all. For
those usecases this implements a switch in the pgadmin4 derivation and
adds a new top-level package `pgadmin4-desktopmode`. This builds in
DESKTOP MODE and allows the usage of pgadmin4 without the nixOS module
and without access to system-wide directories.
pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
pgadmin4-desktopmode tries to read that as well. This normally fails with
a PermissionError, as the config file is owned by the user of the pgadmin module.
With the check-system-config-dir.patch this will just throw a warning
but will continue and not read the file.
If we run pgadmin4-desktopmode as root
(something one really shouldn't do), it can read the config file and fail,
because of the wrong config for desktopmode.
[1]https://www.pgadmin.org/docs/pgadmin4/latest/config_py.html
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
We test pgadmin in nixosTests, because it needs a running postgresql instance.
This is now unnecessary since we can do so in the package itself.
This reduces the complexity of pgadmin and removes the need for the extra
nixosTests.
Also setting SERVER_MODE in `pkg/pip/setup_pip.py` does not have any effect
on the final package, so we remove it.
In NixOS, we use the module, which expects SERVER_MODE to be true (which it defaults to).
In non-NixOS installations, we will need the directory /var/lib/pgadmin and /var/log/pgadmin
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
pgadmin needs an older version of flask-security-too, which
is incompatible with the update of flask-babel.
This commit pins the version.
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>