···41 namespace: resque:gitlab
42 '';
430000044 gitlabConfig = {
45 # These are the default settings from config/gitlab.example.yml
46 production = flip recursiveUpdate cfg.extraConfig {
···313 };
314 };
3150000000000000316 extraConfig = mkOption {
317 type = types.attrs;
318 default = {};
···467 # JSON is a subset of YAML
468 ln -fs ${pkgs.writeText "gitlab.yml" (builtins.toJSON gitlabConfig)} ${cfg.statePath}/config/gitlab.yml
469 ln -fs ${pkgs.writeText "database.yml" databaseYml} ${cfg.statePath}/config/database.yml
0470 ln -fs ${pkgs.writeText "unicorn.rb" unicornConfig} ${cfg.statePath}/config/unicorn.rb
471472 chown -R ${cfg.user}:${cfg.group} ${cfg.statePath}/
···41 namespace: resque:gitlab
42 '';
4344+ secretsYml = ''
45+ production:
46+ db_key_base: ${cfg.secrets.db_key_base}
47+ '';
48+49 gitlabConfig = {
50 # These are the default settings from config/gitlab.example.yml
51 production = flip recursiveUpdate cfg.extraConfig {
···318 };
319 };
320321+ secrets.db_key_base = mkOption {
322+ type = types.str;
323+ example = "";
324+ description = ''
325+ The db_key_base secrets is used to encrypt variables in the DB. If
326+ you change or lose this key you will be unable to access variables
327+ stored in database.
328+329+ Make sure the secret is at least 30 characters and all random,
330+ no regular words or you'll be exposed to dictionary attacks.
331+ '';
332+ };
333+334 extraConfig = mkOption {
335 type = types.attrs;
336 default = {};
···485 # JSON is a subset of YAML
486 ln -fs ${pkgs.writeText "gitlab.yml" (builtins.toJSON gitlabConfig)} ${cfg.statePath}/config/gitlab.yml
487 ln -fs ${pkgs.writeText "database.yml" databaseYml} ${cfg.statePath}/config/database.yml
488+ ln -fs ${pkgs.writeText "secrets.yml" secretsYml} ${cfg.statePath}/config/secrets.yml
489 ln -fs ${pkgs.writeText "unicorn.rb" unicornConfig} ${cfg.statePath}/config/unicorn.rb
490491 chown -R ${cfg.user}:${cfg.group} ${cfg.statePath}/
+7
nixos/modules/services/misc/gitlab.xml
···62 address = "localhost";
63 port = 25;
64 };
065 extraConfig = {
66 gitlab = {
67 email_from = "gitlab-no-reply@example.com";
···73};
74</programlisting>
75</para>
0000007677<para>Refer to <xref linkend="ch-options" /> for all available configuration
78options for the <literal>services.gitlab</literal> module.</para>
···62 address = "localhost";
63 port = 25;
64 };
65+ secrets.db_key_base = "ei3eeP1ohsh0uu3ad4YeeMeeheengah3AiZee2ohl4Ooj5mie4Ohl0vishoghaes";
66 extraConfig = {
67 gitlab = {
68 email_from = "gitlab-no-reply@example.com";
···74};
75</programlisting>
76</para>
77+78+<para>If you're setting up a new Gitlab instance, generate a new
79+<literal>db_key_base</literal> secret to encrypt sensible data in the
80+database. If you're restoring an existing Gitlab instance, you must
81+specify the <literal>db_key_base</literal> secret from
82+<literal>config/secrets.yml</literal> in your Gitlab state folder.</para>
8384<para>Refer to <xref linkend="ch-options" /> for all available configuration
85options for the <literal>services.gitlab</literal> module.</para>