2020-10-31 20:52:10 +01:00
|
|
|
{
|
2022-03-10 21:52:12 +01:00
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
2023-06-27 17:57:42 +02:00
|
|
|
inputs,
|
2022-03-10 21:52:12 +01:00
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old:
|
|
|
|
|
old
|
|
|
|
|
// {
|
2023-06-06 19:59:27 +02:00
|
|
|
# patches = [../../packages/moodle-dl/telegram-format.patch]; TODO?
|
2022-03-10 21:52:12 +01:00
|
|
|
});
|
|
|
|
|
in {
|
2023-02-22 10:02:55 +01:00
|
|
|
age.secrets = {
|
2023-06-27 17:49:50 +02:00
|
|
|
/*
|
2023-02-24 23:10:45 +01:00
|
|
|
moodle-dl-tokens = {
|
2023-06-27 17:57:42 +02:00
|
|
|
file = inputs.secrets + "/zaatar-moodle-dl-tokens.json.age";
|
2023-02-24 23:10:45 +01:00
|
|
|
owner = "moodle-dl";
|
|
|
|
|
group = "moodle-dl";
|
|
|
|
|
mode = "400";
|
|
|
|
|
};
|
2023-06-27 17:49:50 +02:00
|
|
|
*/
|
2023-02-24 23:10:45 +01:00
|
|
|
moodle-dl-basicAuth = {
|
2023-06-27 17:57:42 +02:00
|
|
|
file = inputs.secrets + "/zaatar-moodle-dl-basicAuth.age";
|
2023-02-24 23:10:45 +01:00
|
|
|
owner = "nginx";
|
|
|
|
|
group = "nginx";
|
|
|
|
|
mode = "400";
|
|
|
|
|
};
|
2023-02-22 10:02:55 +01:00
|
|
|
};
|
2020-10-31 20:52:10 +01:00
|
|
|
|
2021-03-30 23:19:40 +02:00
|
|
|
services.moodle-dl = {
|
2023-06-14 22:15:49 +02:00
|
|
|
enable = false;
|
2021-03-30 23:19:40 +02:00
|
|
|
startAt = "hourly";
|
|
|
|
|
package = moodle-dl-package;
|
2023-02-22 10:02:55 +01:00
|
|
|
tokensFile = config.age.secrets.moodle-dl-tokens.path;
|
2021-04-03 15:01:45 +02:00
|
|
|
settings = {
|
2021-03-30 23:19:40 +02:00
|
|
|
telegram = {
|
|
|
|
|
chat_id = "18980945";
|
2021-04-28 06:16:49 +02:00
|
|
|
send_error_msg = false;
|
2021-03-30 23:19:40 +02:00
|
|
|
};
|
|
|
|
|
moodle_domain = "moodle.hu-berlin.de";
|
|
|
|
|
moodle_path = "/";
|
|
|
|
|
download_course_ids = [
|
2021-04-09 15:45:50 +02:00
|
|
|
# WS 2020
|
2021-03-30 23:19:40 +02:00
|
|
|
99881 # Dialektologie
|
|
|
|
|
100183 # Onomastik
|
|
|
|
|
100353 # Sanskrit I
|
|
|
|
|
100692 # Sanskrit Tutorium
|
|
|
|
|
99832 # Germanisch
|
|
|
|
|
99823 # Gotisch
|
|
|
|
|
99813 # Altalbanisch
|
|
|
|
|
98681 # Geistliche Lyrik von Luther bis Lehnert
|
|
|
|
|
99667 # Antike Mythologie
|
|
|
|
|
# 52365 # FSR KlassPhil
|
2021-04-09 15:45:50 +02:00
|
|
|
|
|
|
|
|
# SS 2021
|
|
|
|
|
104850 # Metrik
|
|
|
|
|
103274 # Marc Aurel
|
|
|
|
|
102909 # Sanskrit II
|
2021-04-10 12:25:08 +02:00
|
|
|
104937 # Altirisch
|
|
|
|
|
104925 # Gradierung und Komparation
|
2021-04-10 17:24:32 +02:00
|
|
|
105264 # Was andere Sprachen anders machen
|
|
|
|
|
104991 # Warum klingt Orkisch böse
|
|
|
|
|
105074 # Litauisch
|
2021-04-12 11:10:31 +02:00
|
|
|
103685 # Griechische Sprache und Übersetzung I
|
2021-04-12 18:17:45 +02:00
|
|
|
105455 # Elegia greca
|
2021-04-13 15:09:05 +02:00
|
|
|
105335 # Homerische Epen
|
2021-10-17 20:18:59 +02:00
|
|
|
|
|
|
|
|
# WS 2021
|
|
|
|
|
108122 # Griechisch
|
|
|
|
|
107986 # Altostslavisch
|
|
|
|
|
107792 # Elegie in Rom
|
|
|
|
|
107369 # Tusculanae Disputationes
|
|
|
|
|
108586 # Griechische Religion
|
|
|
|
|
107988 # Balkanindogermanisch
|
2021-10-18 07:24:32 +02:00
|
|
|
108312 # Altnordisch
|
2021-10-19 14:35:12 +02:00
|
|
|
107281 # NLP
|
|
|
|
|
108736 # Grammatiktheorie
|
2021-10-19 14:51:43 +02:00
|
|
|
109438 # Warum klingt Orkisch böse
|
2021-10-19 19:41:04 +02:00
|
|
|
108025 # Poetik der Nordgermanen
|
2021-10-20 08:57:23 +02:00
|
|
|
107280 # Statistik
|
2021-10-20 11:40:26 +02:00
|
|
|
108350 # Attische Redner
|
2021-10-20 16:57:21 +02:00
|
|
|
107461 # Argonautika
|
2021-10-24 08:25:35 +02:00
|
|
|
108283 # Digital Classicist
|
2021-10-28 15:16:16 +02:00
|
|
|
109211 # Altlitauisch
|
|
|
|
|
109185 # Etymologie
|
2022-04-19 23:29:41 +02:00
|
|
|
|
|
|
|
|
# SS 2022
|
|
|
|
|
112606 # Avestisch
|
|
|
|
|
111761 # Griechische Wissenschaftsliteratur
|
|
|
|
|
111515 # H. Furens
|
|
|
|
|
110914 # Apostelgeschichte
|
|
|
|
|
112225 # Gr. Paläographie
|
2022-04-22 12:31:37 +02:00
|
|
|
113275 # ALEW
|
|
|
|
|
112783 # Akzent und Silbenstruktur
|
2022-04-26 20:07:21 +02:00
|
|
|
113493 # Papyrologie
|
2022-10-03 19:14:11 +02:00
|
|
|
|
|
|
|
|
# WS 2022
|
|
|
|
|
115414 # Nonnos
|
2022-10-25 07:39:19 +02:00
|
|
|
116108 # Dialektologie
|
2023-04-15 08:45:50 +02:00
|
|
|
|
|
|
|
|
# SS 2023
|
|
|
|
|
117967 # Archaische Lyrik
|
|
|
|
|
119658 # Dyskolos
|
|
|
|
|
118963 # Antike Biographie
|
2023-04-23 09:37:25 +02:00
|
|
|
92668 # Taa
|
|
|
|
|
120671 # Jiddisch
|
|
|
|
|
120720 # Sorbisch
|
|
|
|
|
118076 # X-Tutorial
|
2023-04-27 13:06:20 +02:00
|
|
|
120631 # Predigten
|
2021-03-30 23:19:40 +02:00
|
|
|
];
|
|
|
|
|
download_submissions = true;
|
|
|
|
|
download_descriptions = true;
|
|
|
|
|
download_links_in_descriptions = false;
|
|
|
|
|
download_databases = false;
|
|
|
|
|
download_forums = false;
|
|
|
|
|
download_linked_files = false;
|
|
|
|
|
download_also_with_cookie = false;
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-10-31 20:52:10 +01:00
|
|
|
|
2021-09-18 15:53:21 +02:00
|
|
|
fileSystems."/export/moodle" = {
|
|
|
|
|
device = config.services.moodle-dl.directory;
|
2022-03-10 21:52:12 +01:00
|
|
|
options = ["bind"];
|
2021-09-18 15:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
2022-03-10 21:52:12 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [2049];
|
2021-09-18 15:53:21 +02:00
|
|
|
|
2022-01-09 10:56:06 +01:00
|
|
|
services.nginx.enable = true;
|
|
|
|
|
|
2023-02-22 10:02:55 +01:00
|
|
|
services.nginx.virtualHosts."moodle.kmein.r" = {
|
|
|
|
|
basicAuthFile = config.age.secrets.moodle-dl-basicAuth.path;
|
2021-12-08 11:39:19 +01:00
|
|
|
locations."/" = {
|
|
|
|
|
root = config.services.moodle-dl.directory;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
autoindex on;
|
|
|
|
|
charset UTF-8;
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-18 15:53:21 +02:00
|
|
|
services.nfs.server = {
|
2020-11-23 11:58:24 +01:00
|
|
|
enable = true;
|
2022-03-10 21:52:12 +01:00
|
|
|
exports = let
|
2023-02-22 10:02:55 +01:00
|
|
|
machines = with (import ../../lib).retiolumAddresses; [kabsa manakish];
|
2022-03-10 21:52:12 +01:00
|
|
|
in ''
|
2021-10-12 11:51:55 +02:00
|
|
|
/export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
|
|
|
|
|
/export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
|
2021-09-18 15:53:21 +02:00
|
|
|
'';
|
2020-11-23 11:58:24 +01:00
|
|
|
};
|
2020-10-31 20:52:10 +01:00
|
|
|
}
|