File tree Expand file tree Collapse file tree 3 files changed +45
-4
lines changed
modules/services/web-apps Expand file tree Collapse file tree 3 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 182182 message = "Either `services.wakapi.passwordSalt` or `services.wakapi.passwordSaltFile` must be set." ;
183183 }
184184 {
185- assertion = cfg . passwordSalt != null -> cfg . passwordSaltFile != null ;
185+ assertion = ! ( cfg . passwordSalt != null && cfg . passwordSaltFile != null ) ;
186186 message = "Both `services.wakapi.passwordSalt` `services.wakapi.passwordSaltFile` should not be set at the same time." ;
187187 }
188188 {
189- assertion = cfg . smtpPassword != null -> cfg . smtpPasswordFile != null ;
189+ assertion = ! ( cfg . smtpPassword != null && cfg . smtpPasswordFile != null ) ;
190190 message = "Both `services.wakapi.smtpPassword` `services.wakapi.smtpPasswordFile` should not be set at the same time." ;
191191 }
192192 {
193- assertion = cfg . db . createLocally -> cfg . db . dialect != null ;
193+ assertion = cfg . database . createLocally -> cfg . settings . db . dialect != null ;
194194 message = "`services.wakapi.database.createLocally` is true, but a database dialect is not set!" ;
195195 }
196196 ] ;
197197
198198 warnings = [
199- ( lib . optionalString ( cfg . db . createLocall -> cfg . db . dialect != "postgres" ) ''
199+ ( lib . optionalString ( cfg . database . createLocally -> cfg . settings . db . dialect != "postgres" ) ''
200200 You have enabled automatic database configuration, but the database dialect is not set to "posgres".
201201
202202 The Wakapi module only supports for PostgreSQL. Please set `services.wakapi.database.createLocally`
Original file line number Diff line number Diff line change @@ -1108,6 +1108,7 @@ in {
11081108 vscode-remote-ssh = handleTestOn [ "x86_64-linux" ] ./vscode-remote-ssh.nix { } ;
11091109 vscodium = discoverTests ( import ./vscodium.nix ) ;
11101110 vsftpd = handleTest ./vsftpd.nix { } ;
1111+ wakapi = handleTest ./wakapi.nix { } ;
11111112 warzone2100 = handleTest ./warzone2100.nix { } ;
11121113 wasabibackend = handleTest ./wasabibackend.nix { } ;
11131114 wastebin = handleTest ./wastebin.nix { } ;
Original file line number Diff line number Diff line change 1+ import ./make-test-python.nix (
2+ { lib , ... } :
3+ {
4+ name = "Wakapi" ;
5+
6+ nodes . machine = {
7+ services . wakapi = {
8+ enable = true ;
9+ settings = {
10+ server . port = 3000 ; # upstream default, set explicitly in case upstream changes it
11+
12+ db = {
13+ dialect = "postgres" ; # `createLocally` only supports postgres
14+ host = "/run/postgresql" ;
15+ port = 5432 ; # service will fail if port is not set
16+ name = "wakapi" ;
17+ user = "wakapi" ;
18+ } ;
19+ } ;
20+
21+ database . createLocally = true ;
22+
23+ # Created with `cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1`
24+ # Prefer passwordSaltFile in production.
25+ passwordSalt = "NpqCY7eY7fMoIWYmPx5mAgr6YoSlXSuI" ;
26+ } ;
27+ } ;
28+
29+ # Test that the service is running and that it is reachable.
30+ # This is not very comprehensive for a test, but it should
31+ # catch very basic mistakes in the module.
32+ testScript = ''
33+ machine.wait_for_unit("wakapi.service")
34+ machine.wait_for_open_port(3000)
35+ machine.succeed("curl --fail http://localhost:3000")
36+ '' ;
37+
38+ meta . maintainers = [ lib . maintainers . NotAShelf ] ;
39+ }
40+ )
You can’t perform that action at this time.
0 commit comments