tried wordpress, removed

This commit is contained in:
bogale 2026-09-25 23:40:19 +09:00
commit 1031ad5571
8 changed files with 31 additions and 25 deletions

View file

@ -14,8 +14,7 @@
vmail.gid = 1819;
};
users = {
nginx.extraGroups = [ "acme" ];
dovecot2.extraGroups = [ "secrets" ];
nginx.extraGroups = [ "php" "acme" ];
root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+wc+3rahpNa+OMS9gaWgMQIxXIKHy4Beku5LBDt+Ow" ];
php = {
uid = 1568;

View file

@ -12,12 +12,9 @@
rspamd = {
enable = true;
postfix.enable = true;
locals = {
"classifier-bayes.conf".text = "autolearn = true;";
"redis.conf".text = ''
servers = "${config.services.redis.servers.rspamd.unixSocket}";
'';
};
locals."redis.conf".text = ''
servers = "${config.services.redis.servers.rspamd.unixSocket}";
'';
};
dovecot2 = {
enable = true;

View file

@ -31,9 +31,13 @@
serviceConfig.Type = "oneshot";
script = ''
. /secrets/tgbot.env
${pkgs.curl}/bin/curl "https://api.telegram.org/$BOT/sendMessage" \
-X POST -d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | \
${pkgs.jq}/bin/jq '.result.date |= strftime("%Y-%m-%d %H:%M:%S")'
for msg in "''${MESSAGES[@]}"; do
TEXT="''${msg#*:}"
CHAT_ID="''${msg%%:*}"
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/$BOT/sendMessage" \
-d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | ${pkgs.jq}/bin/jq
sleep 1
done
'';
};
network-watchdog = {
@ -43,12 +47,10 @@
};
script = ''
if [ ! -e /run/network.failures ] || \
${pkgs.iputils}/bin/ping -c 1 -W 3 1.1.1.1 &> /dev/null; then
${pkgs.iputils}/bin/ping -c 1 -W 3 1.1.1.1; then
failures=0
else
failures=$((1+$(cat /run/network.failures)))
fi
if [ $failures -gt 0 ]; then
echo "<5>failures = $failures"
fi
if [ $failures -ge 3 ]; then

View file

@ -59,11 +59,9 @@
'';
localNetworks = ''
allow fc00::/64;
allow fc01::/64;
allow fc02::/64;
allow fc01::/120;
allow 10.0.0.0/16;
allow 10.1.0.0/16;
allow 10.2.0.0/16;
allow 10.1.0.0/24;
deny all;
'';
in {
@ -76,7 +74,12 @@
locations = {
"/app/".extraConfig = phpPool "default";
"/git/".proxyPass = "http://127.0.0.1:8039/";
"/priv/".extraConfig = ''${localNetworks} ${phpPool "default"}'';
"/local/".extraConfig = ''${phpPool "default"} ${localNetworks}'';
"/local/net/".extraConfig = ''
allow fc01::/64;
allow 10.1.0.0/16;
deny all;
'';
"/vw/" = {
proxyWebsockets = true;
extraConfig = localNetworks;