CodiMD was renamed to HedgeDoc. The user, group and state directory, will be named hedgedoc instead of codimd, starting with stateVersion "21.03".wip/yesman
parent
e19995e43b
commit
1c55621706
@ -1,60 +0,0 @@ |
||||
import ./make-test-python.nix ({ pkgs, lib, ... }: |
||||
{ |
||||
name = "codimd"; |
||||
|
||||
meta = with lib.maintainers; { |
||||
maintainers = [ willibutz ]; |
||||
}; |
||||
|
||||
nodes = { |
||||
codimdSqlite = { ... }: { |
||||
services = { |
||||
codimd = { |
||||
enable = true; |
||||
configuration.dbURL = "sqlite:///var/lib/codimd/codimd.db"; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
codimdPostgres = { ... }: { |
||||
systemd.services.codimd.after = [ "postgresql.service" ]; |
||||
services = { |
||||
codimd = { |
||||
enable = true; |
||||
configuration.dbURL = "postgres://codimd:\${DB_PASSWORD}@localhost:5432/codimddb"; |
||||
|
||||
/* |
||||
* Do not use pkgs.writeText for secrets as |
||||
* they will end up in the world-readable Nix store. |
||||
*/ |
||||
environmentFile = pkgs.writeText "codimd-env" '' |
||||
DB_PASSWORD=snakeoilpassword |
||||
''; |
||||
}; |
||||
postgresql = { |
||||
enable = true; |
||||
initialScript = pkgs.writeText "pg-init-script.sql" '' |
||||
CREATE ROLE codimd LOGIN PASSWORD 'snakeoilpassword'; |
||||
CREATE DATABASE codimddb OWNER codimd; |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
start_all() |
||||
|
||||
with subtest("CodiMD sqlite"): |
||||
codimdSqlite.wait_for_unit("codimd.service") |
||||
codimdSqlite.wait_for_open_port(3000) |
||||
codimdSqlite.wait_until_succeeds("curl -sSf http://localhost:3000/new") |
||||
|
||||
with subtest("CodiMD postgres"): |
||||
codimdPostgres.wait_for_unit("postgresql.service") |
||||
codimdPostgres.wait_for_unit("codimd.service") |
||||
codimdPostgres.wait_for_open_port(5432) |
||||
codimdPostgres.wait_for_open_port(3000) |
||||
codimdPostgres.wait_until_succeeds("curl -sSf http://localhost:3000/new") |
||||
''; |
||||
}) |
@ -0,0 +1,60 @@ |
||||
import ./make-test-python.nix ({ pkgs, lib, ... }: |
||||
{ |
||||
name = "hedgedoc"; |
||||
|
||||
meta = with lib.maintainers; { |
||||
maintainers = [ willibutz ]; |
||||
}; |
||||
|
||||
nodes = { |
||||
hedgedocSqlite = { ... }: { |
||||
services = { |
||||
hedgedoc = { |
||||
enable = true; |
||||
configuration.dbURL = "sqlite:///var/lib/hedgedoc/hedgedoc.db"; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
hedgedocPostgres = { ... }: { |
||||
systemd.services.hedgedoc.after = [ "postgresql.service" ]; |
||||
services = { |
||||
hedgedoc = { |
||||
enable = true; |
||||
configuration.dbURL = "postgres://hedgedoc:\${DB_PASSWORD}@localhost:5432/hedgedocdb"; |
||||
|
||||
/* |
||||
* Do not use pkgs.writeText for secrets as |
||||
* they will end up in the world-readable Nix store. |
||||
*/ |
||||
environmentFile = pkgs.writeText "hedgedoc-env" '' |
||||
DB_PASSWORD=snakeoilpassword |
||||
''; |
||||
}; |
||||
postgresql = { |
||||
enable = true; |
||||
initialScript = pkgs.writeText "pg-init-script.sql" '' |
||||
CREATE ROLE hedgedoc LOGIN PASSWORD 'snakeoilpassword'; |
||||
CREATE DATABASE hedgedocdb OWNER hedgedoc; |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
start_all() |
||||
|
||||
with subtest("HedgeDoc sqlite"): |
||||
hedgedocSqlite.wait_for_unit("hedgedoc.service") |
||||
hedgedocSqlite.wait_for_open_port(3000) |
||||
hedgedocSqlite.wait_until_succeeds("curl -sSf http://localhost:3000/new") |
||||
|
||||
with subtest("HedgeDoc postgres"): |
||||
hedgedocPostgres.wait_for_unit("postgresql.service") |
||||
hedgedocPostgres.wait_for_unit("hedgedoc.service") |
||||
hedgedocPostgres.wait_for_open_port(5432) |
||||
hedgedocPostgres.wait_for_open_port(3000) |
||||
hedgedocPostgres.wait_until_succeeds("curl -sSf http://localhost:3000/new") |
||||
''; |
||||
}) |
Loading…
Reference in new issue