Ajout : etc/sv/fanout/ .
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Mon, 22 Apr 2013 12:10:24 +0000 (14:10 +0200)
committerJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Mon, 22 Apr 2013 12:34:12 +0000 (14:34 +0200)
etc/nsd3/zone.d/cyclocoop.org.zone.m4
etc/nsd3/zone.d/heureux-cyclage.org.zone.m4
etc/nsd3/zone.d/wiklou.org.zone.m4
etc/shorewall/macro.d/macro.Fanout [new file with mode: 0644]
etc/shorewall/rules
etc/sv/fanout/local.sh [new file with mode: 0644]
etc/sv/fanout/log/local.sh [new file with mode: 0644]
etc/sv/fanout/log/run [new file with mode: 0644]
etc/sv/fanout/run [new file with mode: 0755]

index 58f1018..66acf5d 100644 (file)
@@ -13,7 +13,7 @@ define(`EXOLIA_IP4', `91.121.51.125')
 define(`EXOLIA_MX_NAME', `mail.cyclocoop.org.')
 
 * hébergeur : gresille.org
-define(`GRESILLE_IP4', `IP4(VM)')
+define(`GRESILLE_IP4', `IP4(LOCAL)')
 
 divert(0)dnl
 $TTL 1d ; TTL (Time To Live) par défaut pour les enregistrements
index f52d872..2a22435 100644 (file)
@@ -9,7 +9,7 @@ MAKE_GETTER(`NAME')
 define(`FQDN', `NAME($1).ZONE_DOMAIN')
 
 * hébergeur : gresille.org
-define(`GRESILLE_IP4', `IP4(VM)')
+define(`GRESILLE_IP4', `IP4(LOCAL)')
 
 * hébergeur : kimsufi.com
 define(`KIMSUFI_IP4', `91.121.198.103')
@@ -40,11 +40,13 @@ bicloud             A IP4(KIMSUFI)
 burette             A IP4(KIMSUFI)
 cartes              A IP4(LAUTRENET)
 demo.burette        A IP4(KIMSUFI)
+fanout              A IP4(GRESILLE)
 formations          A IP4(LAUTRENET)
 git                 A IP4(GRESILLE)
 imap                A IP4(GRESILLE)
 mail                A IP4(LAUTRENET)
 mx                  A IP4(GRESILLE)
+notifications       A IP4(GRESILLE)
 ns                  A IP4(GRESILLE)
 questionnaires      A IP4(GRESILLE)
 remorque         60 A IP4(KIMSUFI)
index 4eda00a..d70fffa 100644 (file)
@@ -9,7 +9,7 @@ MAKE_GETTER(`NAME')
 define(`FQDN', `NAME($1).ZONE_DOMAIN')
 
 * hébergeur : gresille.org
-define(`GRESILLE_IP4', `IP4(VM)')
+define(`GRESILLE_IP4', `IP4(LOCAL)')
 
 * hébergeur : lautre.net
 define(`LAUTRENET_IP4', `80.67.160.70')
diff --git a/etc/shorewall/macro.d/macro.Fanout b/etc/shorewall/macro.d/macro.Fanout
new file mode 100644 (file)
index 0000000..3b58be3
--- /dev/null
@@ -0,0 +1,3 @@
+#ACTION SOURCE  DEST    PROTO   DEST    SOURCE  RATE    USER/
+#                               PORT(S) PORT(S) LIMIT   GROUP
+PARAM   -       -       tcp     1986
index aaed7e5..f3e0c33 100644 (file)
@@ -13,6 +13,7 @@ HTTP(ACCEPT)                  net    $FW
 HTTPS(ACCEPT)                 net    $FW
 Limit(IMAPS,5,60):info        net    $FW         tcp   imaps
 IMAPS(ACCEPT)                 net    $FW
+Fanout(ACCEPT)                net    $FW
 Managesieve(ACCEPT)           net    $FW
 Mosh(ACCEPT)                  net    $FW
 Ping(ACCEPT)                  net    $FW
diff --git a/etc/sv/fanout/local.sh b/etc/sv/fanout/local.sh
new file mode 100644 (file)
index 0000000..a825a0a
--- /dev/null
@@ -0,0 +1,27 @@
+home=/home/fanout
+cd /
+
+"$tool"/local/adduser "$sv" \
+ --disabled-login \
+ --disabled-password \
+ --group \
+ --home "$home" \
+ --shell /bin/false \
+ --system
+
+sudo install -d -m 750 -o "$sv" -g "$sv" \
+ "$home"
+sudo install -d -m 750 -o sys -g sys \
+ "$home"/src
+sudo adduser sys "$sv"
+if sudo test -d "$home"/src/.git
+ then
+       sudo -u sys /bin/sh -c "cd $home/src && git pull -v"
+ else
+       sudo -u sys git clone https://github.com/travisghansen/fanout "$home"/src
+ fi
+
+sudo -u sys make -C "$home"/src
+sudo install -o 755 -o root -g root \
+    "$home"/src/fanout \
+ /usr/local/bin/fanout
diff --git a/etc/sv/fanout/log/local.sh b/etc/sv/fanout/log/local.sh
new file mode 100644 (file)
index 0000000..27e5554
--- /dev/null
@@ -0,0 +1,11 @@
+home=~fanout/log
+"$tool"/local/adduser log-"$sv" \
+ --disabled-login \
+ --disabled-password \
+ --group \
+ --home "$home" \
+ --shell /bin/false \
+ --system
+sudo install -d -m 750 -o log-"$sv" -g log-"$sv" \
+ "$home"/log
+sudo adduser log-"$sv" "$sv"
diff --git a/etc/sv/fanout/log/run b/etc/sv/fanout/log/run
new file mode 100644 (file)
index 0000000..4382b39
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -eux
+sv=${PWD%/log}
+sv=${sv#/etc/sv/}
+eval home="~log-$sv"
+
+cd "$home"
+exec chpst -u log-"$sv":log-"$sv" \
+       svlogd -v -tt "$home"
diff --git a/etc/sv/fanout/run b/etc/sv/fanout/run
new file mode 100755 (executable)
index 0000000..bf65d66
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -eux
+exec 2>&1
+sv=${PWD#/etc/sv/}
+eval "home=~$sv"
+
+exec /usr/bin/chpst \
+ -u "$sv":"$sv" \
+ /usr/local/bin/fanout \
+ --debug-level=INFO \
+ --port=1986