X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Fludivine%2Fludivinecassal.nix;h=423bbda4fa6aa5d69f9950c667ffed42a90933ed;hb=85f5ed68104de9edd8f8e532dc0c2de931e3ca1b;hp=e17a64eed0dbdfa09f936e2f04f1a3831155a090;hpb=7ebcaad53a3261d8a4aefd8a64c5c7d9d8ac2fa0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/websites/ludivine/ludivinecassal.nix b/nixops/modules/websites/ludivine/ludivinecassal.nix index e17a64e..423bbda 100644 --- a/nixops/modules/websites/ludivine/ludivinecassal.nix +++ b/nixops/modules/websites/ludivine/ludivinecassal.nix @@ -3,8 +3,12 @@ let ludivinecassal = { config }: rec { environment = config.environment; varDir = "/var/lib/ludivinecassal_${environment}"; - configRoot = - writeText "parameters.yml" '' + keys."${environment}-ludivinecassal" = { + destDir = "/run/keys/webapps"; + user = apache.user; + group = apache.group; + permissions = "0400"; + text = '' # This file is auto-generated during the composer install parameters: database_host: ${config.mysql.host} @@ -14,7 +18,7 @@ let database_password: ${config.mysql.password} database_server_version: ${pkgs.mariadb.mysqlVersion} mailer_transport: smtp - mailer_host: mail.immae.eu + mailer_host: 127.0.0.1 mailer_user: null mailer_password: null secret: ${config.secret} @@ -34,7 +38,9 @@ let sass: ${sass}/bin/sass ruby: ${ruby}/bin/ruby ''; + }; phpFpm = rec { + serviceDeps = [ "mysql.service" "${environment}-ludivinecassal-key.service" ]; socket = "/var/run/phpfpm/ludivinecassal-${environment}.sock"; pool = '' listen = ${socket} @@ -45,7 +51,7 @@ let php_admin_value[upload_max_filesize] = 20M php_admin_value[post_max_size] = 20M ;php_admin_flag[log_errors] = on - php_admin_value[open_basedir] = "${configRoot}:${webappDir}:${varDir}:/tmp" + php_admin_value[open_basedir] = "/run/keys/webapps/${environment}-ludivinecassal:${webappDir}:${varDir}:/tmp" php_admin_value[session.save_path] = "${varDir}/phpSessions" ${if environment == "dev" then '' pm = ondemand @@ -60,10 +66,12 @@ let pm.max_spare_servers = 3 ''}''; }; - apache = { + apache = rec { user = "wwwrun"; group = "wwwrun"; modules = [ "proxy_fcgi" ]; + webappName = "ludivine_${environment}"; + root = "/run/current-system/webapps/${webappName}"; vhostConf = '' SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" @@ -76,7 +84,7 @@ let ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride None Require all granted @@ -119,7 +127,7 @@ let '' else '' Use Stats ludivinecassal.com - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted @@ -149,14 +157,22 @@ let noDev = (environment == "prod"); preInstall = '' export SYMFONY_ENV="${environment}" - ln -sf ${configRoot} app/config/parameters.yml + cp app/config/parameters.yml.dist app/config/parameters.yml + cat >> app/config/parameters.yml <