···4141 namespace: resque:gitlab
4242 '';
43434444+ secretsYml = ''
4545+ production:
4646+ db_key_base: ${cfg.secrets.db_key_base}
4747+ '';
4848+4449 gitlabConfig = {
4550 # These are the default settings from config/gitlab.example.yml
4651 production = flip recursiveUpdate cfg.extraConfig {
···313318 };
314319 };
315320321321+ secrets.db_key_base = mkOption {
322322+ type = types.str;
323323+ example = "";
324324+ description = ''
325325+ The db_key_base secrets is used to encrypt variables in the DB. If
326326+ you change or lose this key you will be unable to access variables
327327+ stored in database.
328328+329329+ Make sure the secret is at least 30 characters and all random,
330330+ no regular words or you'll be exposed to dictionary attacks.
331331+ '';
332332+ };
333333+316334 extraConfig = mkOption {
317335 type = types.attrs;
318336 default = {};
···467485 # JSON is a subset of YAML
468486 ln -fs ${pkgs.writeText "gitlab.yml" (builtins.toJSON gitlabConfig)} ${cfg.statePath}/config/gitlab.yml
469487 ln -fs ${pkgs.writeText "database.yml" databaseYml} ${cfg.statePath}/config/database.yml
488488+ ln -fs ${pkgs.writeText "secrets.yml" secretsYml} ${cfg.statePath}/config/secrets.yml
470489 ln -fs ${pkgs.writeText "unicorn.rb" unicornConfig} ${cfg.statePath}/config/unicorn.rb
471490472491 chown -R ${cfg.user}:${cfg.group} ${cfg.statePath}/
+7
nixos/modules/services/misc/gitlab.xml
···6262 address = "localhost";
6363 port = 25;
6464 };
6565+ secrets.db_key_base = "ei3eeP1ohsh0uu3ad4YeeMeeheengah3AiZee2ohl4Ooj5mie4Ohl0vishoghaes";
6566 extraConfig = {
6667 gitlab = {
6768 email_from = "gitlab-no-reply@example.com";
···7374};
7475</programlisting>
7576</para>
7777+7878+<para>If you're setting up a new Gitlab instance, generate a new
7979+<literal>db_key_base</literal> secret to encrypt sensible data in the
8080+database. If you're restoring an existing Gitlab instance, you must
8181+specify the <literal>db_key_base</literal> secret from
8282+<literal>config/secrets.yml</literal> in your Gitlab state folder.</para>
76837784<para>Refer to <xref linkend="ch-options" /> for all available configuration
7885options for the <literal>services.gitlab</literal> module.</para>