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

@ -23,10 +23,7 @@
panicOnChecksumMismatch = true; panicOnChecksumMismatch = true;
}; };
}; };
users = { users.users.root.hashedPasswordFile = "/secrets/user/root-pw";
groups.secrets.gid = 1578;
users.root.hashedPasswordFile = "/secrets/user-root-pw";
};
networking = { networking = {
firewall = { firewall = {
allowedTCPPorts = [ 53 80 ]; allowedTCPPorts = [ 53 80 ];

View file

@ -5,11 +5,16 @@
hostName = "nixos-desktop"; hostName = "nixos-desktop";
}; };
users.users = { users.users = {
data = {
isNormalUser = true;
home = "/home/data";
hashedPasswordFile = "/secrets/user/data-pw";
};
bogale = { bogale = {
isNormalUser = true; isNormalUser = true;
home = "/home/bogale"; home = "/home/bogale";
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
hashedPasswordFile = "/secrets/bogale.passwd"; hashedPasswordFile = "/secrets/user/bogale-pw";
}; };
}; };
} }

View file

@ -2,6 +2,9 @@
{ {
home.stateVersion = "26.05"; home.stateVersion = "26.05";
services.ssh-agent.enable = true; services.ssh-agent.enable = true;
home.packages = with pkgs; [
yt-dlp
];
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
bash = { bash = {

2
marks
View file

@ -12,5 +12,5 @@ nixos-install --flake "/mnt/etc/nixos#nixos" --no-channel-copy --no-root-passwd
systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+7 <LUKS_DEV> systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+7 <LUKS_DEV>
todo: todo:
- mediawiki, wordpress - mediawiki
- email tracking - email tracking

View file

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

View file

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

View file

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

View file

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