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/moodle.nix | |
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/moodle.nix')
-rw-r--r-- | modules/private/websites/emilia/moodle.nix | 65 |
1 files changed, 0 insertions, 65 deletions
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 | } | ||