aboutsummaryrefslogtreecommitdiff
path: root/nixos/tests
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2019-07-31 18:09:27 +0200
committertalyz <kim.lindberger@gmail.com>2019-09-06 16:54:22 +0200
commitcbdf94c0f3ff3edba7452f30c3185e4a5b7965f6 (patch)
tree00bf43ca15b949d0efb4da36c86cbdf38ff05551 /nixos/tests
parent7648b4f8ba8020fda347ab7a18a24997a8cd6d39 (diff)
nixos/gitlab: Add support for storing secrets in files
Add support for storing secrets in files outside the nix store, since files in the nix store are world-readable and secrets therefore can't be stored safely there. The old string options are kept, since they can potentially be handy for testing purposes, but their descriptions now state that they shouldn't be used in production. The manual section is updated to use the file options rather than the string options and the tests now test both.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/gitlab.nix42
1 files changed, 6 insertions, 36 deletions
diff --git a/nixos/tests/gitlab.nix b/nixos/tests/gitlab.nix
index ac733461932..5768e5081ca 100644
--- a/nixos/tests/gitlab.nix
+++ b/nixos/tests/gitlab.nix
@@ -29,44 +29,14 @@ import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
services.gitlab = {
enable = true;
- databasePassword = "dbPassword";
- inherit initialRootPassword;
+ databasePasswordFile = pkgs.writeText "dbPassword" "xo0daiF4";
+ initialRootPasswordFile = pkgs.writeText "rootPassword" initialRootPassword;
smtp.enable = true;
secrets = {
- secret = "secret";
- otp = "otpsecret";
- db = "dbsecret";
-
- # nix-shell -p openssl --run "openssl genrsa 2048"
- jws = ''
- -----BEGIN RSA PRIVATE KEY-----
- MIIEpAIBAAKCAQEA13/qEio76OWUtWO0WIz9lWnsTWOU8Esv4sQHDq9PCEFsLt21
- PAXrlWhLjjWcxGfsrDwnh7YErGHYL62BMSxMdFJolaknlQK/O/V8UETDe45VoHM+
- Znk270RfUcfYFgiihnXUZXVmL0om9TsQSk646wCcjCY9LxtxUyKNhvT7KjgYw2aX
- z34aw7M+Js3T2p1TjZPSC82GtmtKkJEKFMi5EjprLTDE7EdcU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MATY4Lh6y/Px0W6w5vis8lk+5Ny6cNUevHQ0LNuJS+yu6ywl+1vrbrnqroM
- f3LvpcPeGLSoX8jl1VDQi7aFgG6LoKly1xJLbdsH4NPutB9PgBbbTghx9GgmI88L
- rPA2M6UCgYBOmkYJocNgxg6B1/n4Tb9fN1Q/XuJrFDE6NxVUoke+IIyMPRH7FC3m
- VMYzu+b7zTVJjaBb1cmJemxl/xajziWDofJYPefhdbOVU7HXtmJFY0IG3pVxU1zW
- 3bmDj5QAtCUDpuuNa6GEIT0YR4+D/V7o3DmlZ0tVIwKJmVJoQ2f5dw==
- -----END RSA PRIVATE KEY-----
- '';
+ secretFile = pkgs.writeText "secret" "Aig5zaic";
+ otpFile = pkgs.writeText "otpsecret" "Riew9mue";
+ dbFile = pkgs.writeText "dbsecret" "we2quaeZ";
+ jwsFile = pkgs.runCommand "oidcKeyBase" {} "${pkgs.openssl}/bin/openssl genrsa 2048 > $out";
};
};
};