diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/websites/emilia | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/websites/emilia')
-rw-r--r-- | modules/private/websites/emilia/atelierfringant.nix | 65 | ||||
-rw-r--r-- | modules/private/websites/emilia/moodle.nix | 65 | ||||
-rw-r--r-- | modules/private/websites/emilia/moodle/pause.html | 48 |
3 files changed, 0 insertions, 178 deletions
diff --git a/modules/private/websites/emilia/atelierfringant.nix b/modules/private/websites/emilia/atelierfringant.nix deleted file mode 100644 index b47452f..0000000 --- a/modules/private/websites/emilia/atelierfringant.nix +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.emilia.atelierfringant; | ||
4 | varDir = "/var/lib/ftp/emilia/atelierfringant"; | ||
5 | apacheUser = config.services.httpd.Prod.user; | ||
6 | apacheGroup = config.services.httpd.Prod.group; | ||
7 | in { | ||
8 | options.myServices.websites.emilia.atelierfringant.enable = lib.mkEnableOption "enable Émilia's website"; | ||
9 | |||
10 | config = lib.mkIf cfg.enable { | ||
11 | system.activationScripts.emilia_atelierfringant = { | ||
12 | deps = [ "httpd" ]; | ||
13 | text = '' | ||
14 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/ftp/emilia/atelierfringant | ||
15 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/emilia | ||
16 | ''; | ||
17 | }; | ||
18 | systemd.services.phpfpm-emilia_atelierfringant.after = lib.mkAfter [ "mysql.service" ]; | ||
19 | systemd.services.phpfpm-emilia_atelierfringant.wants = [ "mysql.service" ]; | ||
20 | services.phpfpm.pools.emilia_atelierfringant = { | ||
21 | user = apacheUser; | ||
22 | group = apacheGroup; | ||
23 | settings = { | ||
24 | "listen.owner" = apacheUser; | ||
25 | "listen.group" = apacheGroup; | ||
26 | |||
27 | "pm" = "ondemand"; | ||
28 | "pm.max_children" = "5"; | ||
29 | "pm.process_idle_timeout" = "60"; | ||
30 | |||
31 | "php_admin_value[open_basedir]" = "/var/lib/php/sessions/emilia:${varDir}:/tmp"; | ||
32 | "php_admin_value[session.save_path]" = "/var/lib/php/sessions/emilia"; | ||
33 | }; | ||
34 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
35 | disable_functions = "mail" | ||
36 | ''; | ||
37 | phpPackage = pkgs.php72; | ||
38 | }; | ||
39 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | ||
40 | services.websites.env.production.vhostConfs.emilia_atelierfringant = { | ||
41 | certName = "emilia"; | ||
42 | certMainHost = "atelierfringant.org"; | ||
43 | hosts = ["atelierfringant.org" "www.atelierfringant.org" ]; | ||
44 | root = varDir; | ||
45 | extraConfig = [ | ||
46 | '' | ||
47 | <FilesMatch "\.php$"> | ||
48 | SetHandler "proxy:unix:${config.services.phpfpm.pools.emilia_atelierfringant.socket}|fcgi://localhost" | ||
49 | </FilesMatch> | ||
50 | |||
51 | <Location /xmlrpc.php> | ||
52 | AllowOverride None | ||
53 | Require all denied | ||
54 | </Location> | ||
55 | <Directory ${varDir}> | ||
56 | DirectoryIndex index.php index.htm index.html | ||
57 | Options Indexes FollowSymLinks MultiViews Includes | ||
58 | AllowOverride all | ||
59 | Require all granted | ||
60 | </Directory> | ||
61 | '' | ||
62 | ]; | ||
63 | }; | ||
64 | }; | ||
65 | } | ||
diff --git a/modules/private/websites/emilia/moodle.nix b/modules/private/websites/emilia/moodle.nix deleted file mode 100644 index 779c460..0000000 --- a/modules/private/websites/emilia/moodle.nix +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.emilia.moodle; | ||
4 | env = config.myEnv.websites.emilia; | ||
5 | varDir = "/var/lib/emilia_moodle"; | ||
6 | siteDir = ./moodle; | ||
7 | # php_admin_value[upload_max_filesize] = 50000000 | ||
8 | # php_admin_value[post_max_size] = 50000000 | ||
9 | configFile = '' | ||
10 | <?php // Moodle configuration file | ||
11 | |||
12 | unset($CFG); | ||
13 | global $CFG; | ||
14 | $CFG = new stdClass(); | ||
15 | |||
16 | $CFG->dbtype = 'pgsql'; | ||
17 | $CFG->dblibrary = 'native'; | ||
18 | $CFG->dbhost = '${env.postgresql.host}'; | ||
19 | $CFG->dbname = '${env.postgresql.database}'; | ||
20 | $CFG->dbuser = '${env.postgresql.user}'; | ||
21 | $CFG->dbpass = '${env.postgresql.password}'; | ||
22 | $CFG->prefix = 'mdl_'; | ||
23 | $CFG->dboptions = array ( | ||
24 | 'dbpersist' => 0, | ||
25 | 'dbport' => '${env.postgreesql.port}', | ||
26 | 'dbsocket' => '${env.postgresql.password}', | ||
27 | ); | ||
28 | |||
29 | $CFG->wwwroot = 'https://www.saison-photo.org'; | ||
30 | $CFG->dataroot = '${varDir}'; | ||
31 | $CFG->admin = 'admin'; | ||
32 | |||
33 | $CFG->directorypermissions = 02777; | ||
34 | |||
35 | require_once(__DIR__ . '/lib/setup.php'); | ||
36 | |||
37 | // There is no php closing tag in this file, | ||
38 | // it is intentional because it prevents trailing whitespace problems! | ||
39 | ''; | ||
40 | apacheUser = config.services.httpd.Prod.user; | ||
41 | apacheGroup = config.services.httpd.Prod.group; | ||
42 | in { | ||
43 | options.myServices.websites.emilia.moodle.enable = lib.mkEnableOption "enable Emilia's website"; | ||
44 | |||
45 | config = lib.mkIf cfg.enable { | ||
46 | system.activationScripts.emilia_moodle = '' | ||
47 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} | ||
48 | ''; | ||
49 | services.websites.env.production.vhostConfs.emilia_moodle = { | ||
50 | certName = "emilia"; | ||
51 | certMainHost = "saison-photo.org"; | ||
52 | hosts = [ "saison-photo.org" "www.saison-photo.org" ]; | ||
53 | root = siteDir; | ||
54 | extraConfig = [ | ||
55 | '' | ||
56 | <Directory ${siteDir}> | ||
57 | DirectoryIndex pause.html | ||
58 | Options Indexes FollowSymLinks MultiViews Includes | ||
59 | Require all granted | ||
60 | </Directory> | ||
61 | '' | ||
62 | ]; | ||
63 | }; | ||
64 | }; | ||
65 | } | ||
diff --git a/modules/private/websites/emilia/moodle/pause.html b/modules/private/websites/emilia/moodle/pause.html deleted file mode 100644 index 8b99c59..0000000 --- a/modules/private/websites/emilia/moodle/pause.html +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>Pause</title> | ||
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
6 | <style> | ||
7 | body { | ||
8 | padding-left: 5px; | ||
9 | padding-right: 5px; | ||
10 | text-align: center; | ||
11 | margin: auto; | ||
12 | font: 20px Helvetica, sans-serif; | ||
13 | color: #333; | ||
14 | } | ||
15 | h1 { | ||
16 | margin: 0px; | ||
17 | font-size: 40px; | ||
18 | } | ||
19 | article { | ||
20 | display: block; | ||
21 | max-width: 650px; | ||
22 | margin: 0 auto; | ||
23 | padding-top: 30px; | ||
24 | } | ||
25 | article + article { | ||
26 | border-top: 1px solid lightgrey; | ||
27 | } | ||
28 | article div { | ||
29 | text-align: justify; | ||
30 | } | ||
31 | a { | ||
32 | color: #dc8100; | ||
33 | text-decoration: none; | ||
34 | } | ||
35 | a:hover { | ||
36 | color: #333; | ||
37 | } | ||
38 | </style> | ||
39 | </head> | ||
40 | <body> | ||
41 | <article> | ||
42 | <h1>Site web en pause !</h1> | ||
43 | <div> | ||
44 | <p>Le site et les cours de photographie sont actuellement en pause.</p> | ||
45 | </div> | ||
46 | </article> | ||
47 | </body> | ||
48 | </html> | ||