LoutreOS: ajout timer minecraft overviewer
This commit is contained in:
parent
a9a3785e80
commit
519e402a1b
41
systems/LoutreOS/config-overviewer.py
Normal file
41
systems/LoutreOS/config-overviewer.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
from .observer import JSObserver
|
||||||
|
|
||||||
|
global escape
|
||||||
|
from cgi import escape
|
||||||
|
def signFilter(poi):
|
||||||
|
if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign':
|
||||||
|
return "<pre>" + "\n".join(map(escape, [poi['Text1'], poi['Text2'], poi['Text3'], poi['Text4']])) + "</pre>"
|
||||||
|
|
||||||
|
global json
|
||||||
|
import json
|
||||||
|
def petFilter(poi):
|
||||||
|
if "CustomName" in poi:
|
||||||
|
custom_name = json.loads(poi['CustomName'])
|
||||||
|
if "text" in custom_name:
|
||||||
|
return custom_name["text"]
|
||||||
|
|
||||||
|
processes = 2
|
||||||
|
|
||||||
|
worlds["My world"] = "/var/lib/minecraft/world"
|
||||||
|
|
||||||
|
renders["Vue normale"] = {
|
||||||
|
"world": "My world",
|
||||||
|
"title": "Vue normale",
|
||||||
|
"texturepath": "@CLIENT_JAR@",
|
||||||
|
"rendermode": smooth_lighting,
|
||||||
|
'markers': [dict(name="All signs", filterFunction=signFilter),
|
||||||
|
dict(name="Pets", filterFunction=petFilter, icon="icons/marker_cat.png", createInfoWindow=False, checked=True)],
|
||||||
|
}
|
||||||
|
|
||||||
|
cave_rendermode = [Base(), EdgeLines(), Cave(only_lit=True), DepthTinting()]
|
||||||
|
|
||||||
|
renders["Grottes"] = {
|
||||||
|
"world": "My world",
|
||||||
|
"title": "Grottes",
|
||||||
|
"texturepath": "@CLIENT_JAR@",
|
||||||
|
"rendermode": cave_rendermode,
|
||||||
|
}
|
||||||
|
|
||||||
|
outputdir = "/var/www/minecraft-overviewer"
|
||||||
|
|
||||||
|
observer = JSObserver(outputdir=outputdir)
|
@ -263,6 +263,36 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.minecraft-overviewer =
|
||||||
|
let
|
||||||
|
clientJar = pkgs.fetchurl {
|
||||||
|
url = "https://overviewer.org/textures/1.14";
|
||||||
|
sha256 = "0fij9wac7vj6h0kd3mfhqpn0w9gl8pbs9vs9s085zajm0szpr44k";
|
||||||
|
name = "client.jar";
|
||||||
|
};
|
||||||
|
configFile = pkgs.runCommand "overviewer-config" { CLIENT_JAR = clientJar; } ''
|
||||||
|
substitute ${./config-overviewer.py} $out \
|
||||||
|
--subst-var CLIENT_JAR
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
script = ''
|
||||||
|
${pkgs.minecraft-overviewer}/bin/overviewer.py --config ${configFile}
|
||||||
|
${pkgs.minecraft-overviewer}/bin/overviewer.py --config ${configFile} --genpoi
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
User = "nginx";
|
||||||
|
Group = "nginx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.minecraft-overviewer = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-*-* 04:00:00";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
users.groups.acme.members = [ "matrix-synapse" ];
|
users.groups.acme.members = [ "matrix-synapse" ];
|
||||||
|
|
||||||
security.pam.services.sshd.text = pkgs.lib.mkDefault( pkgs.lib.mkAfter "session optional ${pkgs.pam}/lib/security/pam_exec.so seteuid ${login_mail_alert}/bin/mail_alert.sh" );
|
security.pam.services.sshd.text = pkgs.lib.mkDefault( pkgs.lib.mkAfter "session optional ${pkgs.pam}/lib/security/pam_exec.so seteuid ${login_mail_alert}/bin/mail_alert.sh" );
|
||||||
|
Loading…
Reference in New Issue
Block a user