2021-07-26 12:00:05 +02:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
|
2023-12-20 04:16:35 +01:00
|
|
|
let
|
|
|
|
# In a real deployment this should naturally not common from the nix store
|
|
|
|
# and be seeded via agenix or as a non-nix managed file.
|
|
|
|
#
|
|
|
|
# These credentials are from the nitter wiki and are expired. We must provide
|
|
|
|
# credentials in the correct format, otherwise nitter fails to start. They
|
|
|
|
# must not be valid, as unauthorized errors are handled gracefully.
|
|
|
|
guestAccountFile = pkgs.writeText "guest_accounts.jsonl" ''
|
|
|
|
{"oauth_token":"1719213587296620928-BsXY2RIJEw7fjxoNwbBemgjJhueK0m","oauth_token_secret":"N0WB0xhL4ng6WTN44aZO82SUJjz7ssI3hHez2CUhTiYqy"}
|
|
|
|
'';
|
|
|
|
in
|
2021-07-26 12:00:05 +02:00
|
|
|
{
|
|
|
|
name = "nitter";
|
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ erdnaxe ];
|
|
|
|
|
|
|
|
nodes.machine = {
|
2023-12-20 04:16:35 +01:00
|
|
|
services.nitter = {
|
|
|
|
enable = true;
|
|
|
|
# Test CAP_NET_BIND_SERVICE
|
|
|
|
server.port = 80;
|
|
|
|
# Provide dummy guest accounts
|
|
|
|
guestAccounts = guestAccountFile;
|
|
|
|
};
|
2021-07-26 12:00:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("nitter.service")
|
2022-06-05 09:35:48 +02:00
|
|
|
machine.wait_for_open_port(80)
|
2021-08-08 15:29:33 +02:00
|
|
|
machine.succeed("curl --fail http://localhost:80/")
|
2021-07-26 12:00:05 +02:00
|
|
|
'';
|
|
|
|
})
|