-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(nixos/calibre-server): Add new http & auth options
- Loading branch information
1 parent
fa90359
commit 0093c84
Showing
3 changed files
with
94 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import ./make-test-python.nix ( | ||
{ pkgs, lib, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
host = "127.0.0.1"; | ||
port = 8888; | ||
libraryPath = "/var/lib/calibre-data"; | ||
in | ||
{ | ||
name = "calibre-server"; | ||
|
||
nodes.machine = { config, pkgs, ... }: { | ||
services.calibre-server = { | ||
enable = true; | ||
inherit host port; | ||
libraries = [ libraryPath ]; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
machine.start() | ||
machine.execute("mkdir -p ${libraryPath}") | ||
machine.execute("curl -o alice.epub https://www.gutenberg.org/ebooks/11.epub.noimages") | ||
machine.execute("calibredb add /tmp/alice.epub --with-library ${libraryPath}") | ||
machine.wait_for_unit("calibre-server.service") | ||
machine.wait_for_open_port(${toString port}) | ||
machine.succeed("curl --fail http://${host}:${toString port}") | ||
''; | ||
} | ||
) |