]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/databases/mariadb_replication.nix
Remove open port for mysql replication
[perso/Immae/Config/Nix.git] / modules / private / databases / mariadb_replication.nix
index 5f97e84aa4bea632dbe7b6b944ef618741c5b15f..ca1432f87815b6bf0e6487249071a174ca81f6f7 100644 (file)
@@ -114,6 +114,17 @@ in
           password = ${hcfg.dumpPassword}
         '';
       }
+      {
+        dest = "mysql_replication/${name}/client";
+        permissions = "0400";
+        user = "mysql";
+        group = "mysql";
+        text = ''
+          [client]
+          user = ${hcfg.dumpUser}
+          password = ${hcfg.dumpPassword}
+        '';
+      }
     ]) cfg.hosts);
 
     services.cron = {
@@ -156,6 +167,7 @@ in
       lib.attrsets.nameValuePair "mysql/${name}_my.cnf" {
         text = ''
           [mysqld]
+          skip-networking
           socket = /run/mysqld_${name}/mysqld.sock
           datadir = ${cfg.base}/${name}/mysql/
           log-bin = mariadb-bin