aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-12-30 11:16:18 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-12-30 11:17:58 +0100
commite273ef92ae582984e0896a8c16fab73747c3ab2b (patch)
tree6778c59a5470f8e50c9efc44f7ad02e93a414917
parent5dd28b43ebe7086d52d17d494091fec36508e380 (diff)
downloadNix-e273ef92ae582984e0896a8c16fab73747c3ab2b.tar.gz
Nix-e273ef92ae582984e0896a8c16fab73747c3ab2b.tar.zst
Nix-e273ef92ae582984e0896a8c16fab73747c3ab2b.zip
Prepare production configuration for connexionswing
-rw-r--r--virtual/eldiron.nix22
-rw-r--r--virtual/packages.nix13
2 files changed, 31 insertions, 4 deletions
diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix
index 2d1c50e..e583948 100644
--- a/virtual/eldiron.nix
+++ b/virtual/eldiron.nix
@@ -36,7 +36,6 @@
36 }; 36 };
37 }; 37 };
38 38
39 # FIXME: how to run it? currently set as timer
40 security.acme.certs = { 39 security.acme.certs = {
41 "eldiron" = { 40 "eldiron" = {
42 webroot = "/var/lib/acme/acme-challenge"; 41 webroot = "/var/lib/acme/acme-challenge";
@@ -44,7 +43,7 @@
44 domain = "eldiron.immae.eu"; 43 domain = "eldiron.immae.eu";
45 plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ]; 44 plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
46 postRun = '' 45 postRun = ''
47 "systemctl reload httpd.service" 46 systemctl reload httpd.service
48 ''; 47 '';
49 extraDomains = { 48 extraDomains = {
50 "db-1.immae.eu" = null; 49 "db-1.immae.eu" = null;
@@ -53,11 +52,24 @@
53 "sandetludo.immae.eu" = null; 52 "sandetludo.immae.eu" = null;
54 }; 53 };
55 }; 54 };
55 # "connexionswing" = {
56 # webroot = "/var/lib/acme/acme-challenge";
57 # email = "ismael@bouya.org";
58 # domain = "connexionswing.com";
59 # plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
60 # postRun = ''
61 # systemctl reload httpd.service
62 # '';
63 # extraDomains = {
64 # "www.connexionswing.com" = null;
65 # "sandetludo.com" = null;
66 # "www.sandetludo.com" = null;
67 # };
68 # };
56 }; 69 };
57 70
58 services.ympd = mypkgs.ympd.config // { enable = true; }; 71 services.ympd = mypkgs.ympd.config // { enable = true; };
59 72
60 # FIXME: open_basedir
61 services.phpfpm = { 73 services.phpfpm = {
62 extraConfig = '' 74 extraConfig = ''
63 log_level = notice 75 log_level = notice
@@ -65,6 +77,7 @@
65 poolConfigs = { 77 poolConfigs = {
66 adminer = mypkgs.adminer.phpFpm.pool; 78 adminer = mypkgs.adminer.phpFpm.pool;
67 connexionswing_dev = mypkgs.connexionswing_dev.phpFpm.pool; 79 connexionswing_dev = mypkgs.connexionswing_dev.phpFpm.pool;
80 connexionswing_prod = mypkgs.connexionswing_prod.phpFpm.pool;
68 www = '' 81 www = ''
69 listen = /var/run/phpfpm/www.sock 82 listen = /var/run/phpfpm/www.sock
70 user = wwwrun 83 user = wwwrun
@@ -82,6 +95,7 @@
82 95
83 system.activationScripts = { 96 system.activationScripts = {
84 connexionswing_dev = mypkgs.connexionswing_dev.activationScript; 97 connexionswing_dev = mypkgs.connexionswing_dev.activationScript;
98 connexionswing_prod = mypkgs.connexionswing_prod.activationScript;
85 httpd = '' 99 httpd = ''
86 install -d -m 0755 /var/lib/acme/acme-challenge 100 install -d -m 0755 /var/lib/acme/acme-challenge
87 install -d -m 0755 /var/www 101 install -d -m 0755 /var/www
@@ -104,6 +118,7 @@
104 extraModules = pkgs.lib.lists.unique ( 118 extraModules = pkgs.lib.lists.unique (
105 mypkgs.adminer.apache.modules ++ 119 mypkgs.adminer.apache.modules ++
106 mypkgs.connexionswing_dev.apache.modules ++ 120 mypkgs.connexionswing_dev.apache.modules ++
121 mypkgs.connexionswing_prod.apache.modules ++
107 [ 122 [
108 "macro" 123 "macro"
109 "ldap" 124 "ldap"
@@ -167,7 +182,6 @@
167 hostName = "redirectSSL"; 182 hostName = "redirectSSL";
168 serverAliases = [ "*" ]; 183 serverAliases = [ "*" ];
169 enableSSL = false; 184 enableSSL = false;
170 # FIXME: directory needs to exist
171 documentRoot = "/var/lib/acme/acme-challenge"; 185 documentRoot = "/var/lib/acme/acme-challenge";
172 extraConfig = '' 186 extraConfig = ''
173 RewriteEngine on 187 RewriteEngine on
diff --git a/virtual/packages.nix b/virtual/packages.nix
index cd98b79..ef9feb5 100644
--- a/virtual/packages.nix
+++ b/virtual/packages.nix
@@ -61,6 +61,18 @@ let
61 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" 61 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
62 </FilesMatch> 62 </FilesMatch>
63 63
64 <Directory ${varDir}/medias>
65 Options FollowSymLinks
66 AllowOverride None
67 Require all granted
68 </Directory>
69
70 <Directory ${varDir}/uploads>
71 Options FollowSymLinks
72 AllowOverride None
73 Require all granted
74 </Directory>
75
64 ${if environment == "dev" then '' 76 ${if environment == "dev" then ''
65 <Location /> 77 <Location />
66 Use LDAPConnect 78 Use LDAPConnect
@@ -131,6 +143,7 @@ let
131 # FIXME: can we do better than symlink? 143 # FIXME: can we do better than symlink?
132 # FIXME: imagick optional 144 # FIXME: imagick optional
133 # FIXME: initial sync 145 # FIXME: initial sync
146 # FIXME: backup
134 buildPhase = '' 147 buildPhase = ''
135 export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt 148 export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
136 export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt 149 export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt