commit
a161b380a9
@ -56,6 +56,8 @@
|
|||||||
|
|
||||||
- [Apache Tika](https://github.com/apache/tika), a toolkit that detects and extracts metadata and text from over a thousand different file types. Available as [services.tika](option.html#opt-services.tika).
|
- [Apache Tika](https://github.com/apache/tika), a toolkit that detects and extracts metadata and text from over a thousand different file types. Available as [services.tika](option.html#opt-services.tika).
|
||||||
|
|
||||||
|
- [Improved File Manager](https://github.com/misterunknown/ifm), or IFM, a single-file web-based file manager.
|
||||||
|
|
||||||
## Backward Incompatibilities {#sec-release-24.11-incompatibilities}
|
## Backward Incompatibilities {#sec-release-24.11-incompatibilities}
|
||||||
|
|
||||||
- `transmission` package has been aliased with a `trace` warning to `transmission_3`. Since [Transmission 4 has been released last year](https://github.com/transmission/transmission/releases/tag/4.0.0), and Transmission 3 will eventually go away, it was decided perform this warning alias to make people aware of the new version. The `services.transmission.package` defaults to `transmission_3` as well because the upgrade can cause data loss in certain specific usage patterns (examples: [#5153](https://github.com/transmission/transmission/issues/5153), [#6796](https://github.com/transmission/transmission/issues/6796)). Please make sure to back up to your data directory per your usage:
|
- `transmission` package has been aliased with a `trace` warning to `transmission_3`. Since [Transmission 4 has been released last year](https://github.com/transmission/transmission/releases/tag/4.0.0), and Transmission 3 will eventually go away, it was decided perform this warning alias to make people aware of the new version. The `services.transmission.package` defaults to `transmission_3` as well because the upgrade can cause data loss in certain specific usage patterns (examples: [#5153](https://github.com/transmission/transmission/issues/5153), [#6796](https://github.com/transmission/transmission/issues/6796)). Please make sure to back up to your data directory per your usage:
|
||||||
|
@ -1405,6 +1405,7 @@
|
|||||||
./services/web-apps/honk.nix
|
./services/web-apps/honk.nix
|
||||||
./services/web-apps/icingaweb2/icingaweb2.nix
|
./services/web-apps/icingaweb2/icingaweb2.nix
|
||||||
./services/web-apps/icingaweb2/module-monitoring.nix
|
./services/web-apps/icingaweb2/module-monitoring.nix
|
||||||
|
./services/web-apps/ifm.nix
|
||||||
./services/web-apps/invidious.nix
|
./services/web-apps/invidious.nix
|
||||||
./services/web-apps/invoiceplane.nix
|
./services/web-apps/invoiceplane.nix
|
||||||
./services/web-apps/isso.nix
|
./services/web-apps/isso.nix
|
||||||
|
81
nixos/modules/services/web-apps/ifm.nix
Normal file
81
nixos/modules/services/web-apps/ifm.nix
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
{ config, lib, pkgs, ...}:
|
||||||
|
let
|
||||||
|
cfg = config.services.ifm;
|
||||||
|
|
||||||
|
version = "4.0.2";
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/misterunknown/ifm/releases/download/v${version}/cdn.ifm.php";
|
||||||
|
hash = "sha256-37WbRM6D7JGmd//06zMhxMGIh8ioY8vRUmxX4OHgqBE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
php = pkgs.php83;
|
||||||
|
in {
|
||||||
|
options.services.ifm = {
|
||||||
|
enable = lib.mkEnableOption ''
|
||||||
|
Improved file manager, a single-file web-based filemanager
|
||||||
|
|
||||||
|
Lightweight and minimal, served using PHP's built-in server
|
||||||
|
'';
|
||||||
|
|
||||||
|
dataDir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Directory to serve throught the file managing service";
|
||||||
|
};
|
||||||
|
|
||||||
|
listenAddress = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "127.0.0.1";
|
||||||
|
description = "Address on which the service is listening";
|
||||||
|
example = "0.0.0.0";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 9090;
|
||||||
|
description = "Port on which to serve the IFM service";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = lib.mkOption {
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Configuration of the IFM service.
|
||||||
|
|
||||||
|
See [the documentation](https://github.com/misterunknown/ifm/wiki/Configuration)
|
||||||
|
for available options and default values.
|
||||||
|
'';
|
||||||
|
example = {
|
||||||
|
IFM_GUI_SHOWPATH = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
systemd.services.ifm = {
|
||||||
|
description = "Improved file manager, a single-file web based filemanager";
|
||||||
|
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
IFM_ROOT_DIR = "/data";
|
||||||
|
} // (builtins.mapAttrs (_: val: toString val) cfg.settings);
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
mkdir -p /tmp/ifm
|
||||||
|
ln -s ${src} /tmp/ifm/index.php
|
||||||
|
${lib.getExe php} -S ${cfg.listenAddress}:${builtins.toString cfg.port} -t /tmp/ifm
|
||||||
|
'';
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
User = "ifm";
|
||||||
|
StandardOutput = "journal";
|
||||||
|
BindPaths = "${cfg.dataDir}:/data";
|
||||||
|
PrivateTmp = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with lib.maintainers; [ litchipi ];
|
||||||
|
}
|
@ -441,6 +441,7 @@ in {
|
|||||||
hydra = handleTest ./hydra {};
|
hydra = handleTest ./hydra {};
|
||||||
i3wm = handleTest ./i3wm.nix {};
|
i3wm = handleTest ./i3wm.nix {};
|
||||||
icingaweb2 = handleTest ./icingaweb2.nix {};
|
icingaweb2 = handleTest ./icingaweb2.nix {};
|
||||||
|
ifm = handleTest ./ifm.nix {};
|
||||||
iftop = handleTest ./iftop.nix {};
|
iftop = handleTest ./iftop.nix {};
|
||||||
incron = handleTest ./incron.nix {};
|
incron = handleTest ./incron.nix {};
|
||||||
incus = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; inherit (pkgs) incus; });
|
incus = pkgs.recurseIntoAttrs (handleTest ./incus { inherit handleTestOn; inherit (pkgs) incus; });
|
||||||
|
36
nixos/tests/ifm.nix
Normal file
36
nixos/tests/ifm.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import ./make-test-python.nix ({ pkgs, ...} :
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "ifm";
|
||||||
|
meta = with pkgs.lib.maintainers; {
|
||||||
|
maintainers = [ litchipi ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
server = rec {
|
||||||
|
services.ifm = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
dataDir = "/data";
|
||||||
|
};
|
||||||
|
|
||||||
|
system.activationScripts.ifm-setup-dir = ''
|
||||||
|
mkdir -p ${services.ifm.dataDir}
|
||||||
|
chmod u+w,g+w,o+w ${services.ifm.dataDir}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
server.wait_for_unit("ifm.service")
|
||||||
|
server.wait_for_open_port(9001)
|
||||||
|
server.succeed("curl --fail http://localhost:9001")
|
||||||
|
|
||||||
|
server.succeed("echo \"testfile\" > testfile && shasum testfile >> checksums")
|
||||||
|
server.succeed("curl --fail http://localhost:9001 -X POST -F \"api=upload\" -F \"dir=\" -F \"file=@testfile\" | grep \"OK\"");
|
||||||
|
server.succeed("rm testfile")
|
||||||
|
server.succeed("curl --fail http://localhost:9001 -X POST -F \"api=download\" -F \"filename=testfile\" -F \"dir=\" --output testfile");
|
||||||
|
server.succeed("shasum testfile >> checksums && shasum --check checksums")
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user