Unverified Commit 314fcfb9 authored by SebastianStork's avatar SebastianStork
Browse files

nixos/outline: fix shellcheck error

parent ed53e9bf
Loading
Loading
Loading
Loading
+28 −14
Original line number Diff line number Diff line
@@ -788,48 +788,62 @@ in
        '';

        script = ''
          export SECRET_KEY="$(head -n1 ${lib.escapeShellArg cfg.secretKeyFile})"
          export UTILS_SECRET="$(head -n1 ${lib.escapeShellArg cfg.utilsSecretFile})"
          SECRET_KEY="$(head -n1 ${lib.escapeShellArg cfg.secretKeyFile})"
          export SECRET_KEY
          UTILS_SECRET="$(head -n1 ${lib.escapeShellArg cfg.utilsSecretFile})"
          export UTILS_SECRET
          ${lib.optionalString (cfg.storage.storageType == "s3") ''
            export AWS_SECRET_ACCESS_KEY="$(head -n1 ${lib.escapeShellArg cfg.storage.secretKeyFile})"
            AWS_SECRET_ACCESS_KEY="$(head -n1 ${lib.escapeShellArg cfg.storage.secretKeyFile})"
            export AWS_SECRET_ACCESS_KEY
          ''}
          ${lib.optionalString (cfg.slackAuthentication != null) ''
            export SLACK_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.slackAuthentication.secretFile})"
            SLACK_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.slackAuthentication.secretFile})"
            export SLACK_CLIENT_SECRET
          ''}
          ${lib.optionalString (cfg.googleAuthentication != null) ''
            export GOOGLE_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.googleAuthentication.clientSecretFile})"
            GOOGLE_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.googleAuthentication.clientSecretFile})"
            export GOOGLE_CLIENT_SECRET
          ''}
          ${lib.optionalString (cfg.azureAuthentication != null) ''
            export AZURE_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.azureAuthentication.clientSecretFile})"
            AZURE_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.azureAuthentication.clientSecretFile})"
            export AZURE_CLIENT_SECRET
          ''}
          ${lib.optionalString (cfg.oidcAuthentication != null) ''
            export OIDC_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.oidcAuthentication.clientSecretFile})"
            OIDC_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.oidcAuthentication.clientSecretFile})"
            export OIDC_CLIENT_SECRET
          ''}
          ${lib.optionalString (cfg.discordAuthentication != null) ''
            export DISCORD_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.discordAuthentication.clientSecretFile})"
            DISCORD_CLIENT_SECRET="$(head -n1 ${lib.escapeShellArg cfg.discordAuthentication.clientSecretFile})"
            export DISCORD_CLIENT_SECRET
          ''}
          ${lib.optionalString (cfg.sslKeyFile != null) ''
            export SSL_KEY="$(head -n1 ${lib.escapeShellArg cfg.sslKeyFile})"
            SSL_KEY="$(head -n1 ${lib.escapeShellArg cfg.sslKeyFile})"
            export SSL_KEY
          ''}
          ${lib.optionalString (cfg.sslCertFile != null) ''
            export SSL_CERT="$(head -n1 ${lib.escapeShellArg cfg.sslCertFile})"
            SSL_CERT="$(head -n1 ${lib.escapeShellArg cfg.sslCertFile})"
            export SSL_CERT
          ''}
          ${lib.optionalString (cfg.slackIntegration != null) ''
            export SLACK_VERIFICATION_TOKEN="$(head -n1 ${lib.escapeShellArg cfg.slackIntegration.verificationTokenFile})"
            SLACK_VERIFICATION_TOKEN="$(head -n1 ${lib.escapeShellArg cfg.slackIntegration.verificationTokenFile})"
            export SLACK_VERIFICATION_TOKEN
          ''}
          ${lib.optionalString (cfg.smtp != null) ''
            export SMTP_PASSWORD="$(head -n1 ${lib.escapeShellArg cfg.smtp.passwordFile})"
            SMTP_PASSWORD="$(head -n1 ${lib.escapeShellArg cfg.smtp.passwordFile})"
            export SMTP_PASSWORD
          ''}

          ${
            if (cfg.databaseUrl == "local") then
              ''
                export DATABASE_URL=${lib.escapeShellArg localPostgresqlUrl}
                DATABASE_URL=${lib.escapeShellArg localPostgresqlUrl}
                export DATABASE_URL
                export PGSSLMODE=disable
              ''
            else
              ''
                export DATABASE_URL=${lib.escapeShellArg cfg.databaseUrl}
                DATABASE_URL=${lib.escapeShellArg cfg.databaseUrl}
                export DATABASE_URL
              ''
          }