vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / sogo.nix
blob84d219659bdb254081d3de9f8e3500da9a2e5e07
1 import ./make-test-python.nix ({ pkgs, ... }: {
2   name = "sogo";
3   meta = with pkgs.lib.maintainers; {
4     maintainers = [ ];
5   };
7   nodes = {
8     sogo = { config, pkgs, ... }: {
9       services.nginx.enable = true;
11       services.mysql = {
12         enable = true;
13         package = pkgs.mariadb;
14         ensureDatabases = [ "sogo" ];
15         ensureUsers = [{
16           name = "sogo";
17           ensurePermissions = {
18             "sogo.*" = "ALL PRIVILEGES";
19           };
20         }];
21       };
23       services.sogo = {
24         enable = true;
25         timezone = "Europe/Berlin";
26         extraConfig = ''
27           WOWorkersCount = 1;
29           SOGoUserSources = (
30             {
31               type = sql;
32               userPasswordAlgorithm = md5;
33               viewURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_users";
34               canAuthenticate = YES;
35               id = users;
36             }
37           );
39           SOGoProfileURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_user_profile";
40           OCSFolderInfoURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_folder_info";
41           OCSSessionsFolderURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_sessions_folder";
42           OCSEMailAlarmsFolderURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_alarms_folder";
43           OCSStoreURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_store";
44           OCSAclURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_acl";
45           OCSCacheFolderURL = "mysql://sogo@%2Frun%2Fmysqld%2Fmysqld.sock/sogo/sogo_cache_folder";
46         '';
47       };
48     };
49   };
51   testScript = ''
52     start_all()
53     sogo.wait_for_unit("multi-user.target")
54     sogo.wait_for_open_port(20000)
55     sogo.wait_for_open_port(80)
56     sogo.succeed("curl -sSfL http://sogo/SOGo")
57   '';