Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11723748
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
55 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/core/letsencrypt-renew/files/letsencrypt-renewal b/roles/core/letsencrypt-renew/files/letsencrypt-renewal.sh
similarity index 98%
rename from roles/core/letsencrypt-renew/files/letsencrypt-renewal
rename to roles/core/letsencrypt-renew/files/letsencrypt-renewal.sh
index aa39e42..eef1a63 100755
--- a/roles/core/letsencrypt-renew/files/letsencrypt-renewal
+++ b/roles/core/letsencrypt-renew/files/letsencrypt-renewal.sh
@@ -1,31 +1,31 @@
#!/bin/sh
# -------------------------------------------------------------
# Let's encrypt
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-08-24
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/letsencrypt-renew/files/letsencrypt-renewal
+# Source file: roles/core/letsencrypt-renew/files/letsencrypt-renewal.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
nginx_test() {
nginx_output="$(nginx -t 2>&1)"
nginx_returncode="$?"
if [ "$nginx_returncode" -eq 0 ] && [ -n "$(echo "${nginx_output}" | grep warn)" ]; then
return 2;
else
return "$nginx_returncode";
fi;
}
letsencrypt renew && nginx_test && service nginx restart
diff --git a/roles/core/motd/files/motd b/roles/core/motd/files/motd.sh
similarity index 92%
rename from roles/core/motd/files/motd
rename to roles/core/motd/files/motd.sh
index 378a5e5..9357ed1 100644
--- a/roles/core/motd/files/motd
+++ b/roles/core/motd/files/motd.sh
@@ -1,23 +1,23 @@
#!/bin/sh
# -------------------------------------------------------------
# MOTD
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-10
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/motd/files/motd
+# Source file: roles/core/motd/files/motd.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
if [ -f /etc/motd ]; then
cat /etc/motd
else
echo "No MOTD."
fi
diff --git a/roles/core/motd/init.sls b/roles/core/motd/init.sls
index c2685ee..cccd7c3 100644
--- a/roles/core/motd/init.sls
+++ b/roles/core/motd/init.sls
@@ -1,26 +1,26 @@
# -------------------------------------------------------------
# Salt — MOTD
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-04-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
motd:
file.managed:
{% if grains['os'] == 'Debian' or grains['os'] == 'Ubuntu' %}
- name: /etc/motd.tail
{% else %}
- name: /etc/motd
{% endif %}
- source: salt://roles/core/motd/files/{{ grains['id'] }}
# Fixes T858
get_rid_of_scaleway_motd:
file.absent:
- name: /etc/update-motd.d/50-scw
/usr/local/bin/motd:
file.managed:
- - source: salt://roles/core/motd/files/motd
+ - source: salt://roles/core/motd/files/motd.sh
- mode: 755
diff --git a/roles/core/network/files/eglide_ipv6 b/roles/core/network/files/eglide_ipv6.sh
similarity index 96%
rename from roles/core/network/files/eglide_ipv6
rename to roles/core/network/files/eglide_ipv6.sh
index 3c2e65d..24f4930 100644
--- a/roles/core/network/files/eglide_ipv6
+++ b/roles/core/network/files/eglide_ipv6.sh
@@ -1,46 +1,46 @@
#!/bin/sh
# -------------------------------------------------------------
# IPv6 connectivity
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/network/files/eglide_ipv6
+# Source file: roles/core/network/files/eglide_ipv6.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
IFCONFIG=/sbin/ifconfig
IP=/sbin/ip
ROUTE=/sbin/route
# -------------------------------------------------------------
# Hurricane Electric tunnel
# nasqueron-3.tunnel.tserv10.par1.ipv6.he.net
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$IFCONFIG sit0 up
$IFCONFIG sit0 inet6 tunnel ::216.66.84.42
$IFCONFIG sit1 up
$IFCONFIG sit1 inet6 add 2001:470:1f12:896::2/64
$ROUTE -A inet6 add ::/0 dev sit1
# -------------------------------------------------------------
# Canonical IP
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$IFCONFIG sit1 inet6 add 2001:470:1f13:896::c0de:15:11fe/64
# -------------------------------------------------------------
# Additional IP addresses
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% for n in range (1, 26) %}
$IP addr add 2001:470:1f13:896::{{ '%x' | format(n) }}/64 dev sit1 preferred_lft 0}
{% endfor %}
diff --git a/roles/core/network/init.sls b/roles/core/network/init.sls
index 0b7de68..923c939 100644
--- a/roles/core/network/init.sls
+++ b/roles/core/network/init.sls
@@ -1,20 +1,20 @@
# -------------------------------------------------------------
# Salt — Network
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# IPv6
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if grains['os'] == 'Debian' or grains['os'] == 'Ubuntu' %}
network_ipv6:
file.managed:
- name : /usr/sbin/ipv6-setup-tunnel
- - source: salt://roles/core/network/files/{{ grains['id'] }}_ipv6
+ - source: salt://roles/core/network/files/{{ grains['id'] }}_ipv6.sh
- template: jinja
- mode: 755
{% endif %}
diff --git a/roles/core/rc/files/rc.local b/roles/core/rc/files/rc.local.sh
similarity index 95%
rename from roles/core/rc/files/rc.local
rename to roles/core/rc/files/rc.local.sh
index 06a4359..b60a2bb 100644
--- a/roles/core/rc/files/rc.local
+++ b/roles/core/rc/files/rc.local.sh
@@ -1,32 +1,32 @@
#!/bin/sh -e
# -------------------------------------------------------------
# rc.local
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
-# Source file: roles/core/rc/files/rc.local
+# Source file: roles/core/rc/files/rc.local.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# IPv6
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/usr/sbin/ipv6-setup-tunnel
# -------------------------------------------------------------
# Return value
#
# Should be 0 on success, not 0 on failure. Current rc process
# requires this value to be set accordingly.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exit 0
diff --git a/roles/core/rc/init.sls b/roles/core/rc/init.sls
index b67125b..f674f4c 100644
--- a/roles/core/rc/init.sls
+++ b/roles/core/rc/init.sls
@@ -1,18 +1,18 @@
# -------------------------------------------------------------
# Salt — RC
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-06-15
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# IPv6
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if grains['os'] == 'Debian' or grains['os'] == 'Ubuntu' %}
rc:
file.managed:
- name : /etc/rc.local
- - source: salt://roles/core/rc/files/rc.local
+ - source: salt://roles/core/rc/files/rc.local.sh
{% endif %}
diff --git a/roles/mailserver/certificates/files/update-smtp-certificates b/roles/mailserver/certificates/files/update-smtp-certificates.sh
similarity index 98%
rename from roles/mailserver/certificates/files/update-smtp-certificates
rename to roles/mailserver/certificates/files/update-smtp-certificates.sh
index fe38c91..cba2148 100755
--- a/roles/mailserver/certificates/files/update-smtp-certificates
+++ b/roles/mailserver/certificates/files/update-smtp-certificates.sh
@@ -1,31 +1,31 @@
#!/bin/sh
# -------------------------------------------------------------
# Deploy mail certificate to SMTP server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-11-03
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/certificates/files/update-smtp-certificates
+# Source file: roles/mailserver/certificates/files/update-smtp-certificates.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
: ${CONTAINER_NAME='mailserver'}
: ${CERT_DIR='/data/letsencrypt/etc/live/mail.nasqueron.org-0001'}
: ${CONTAINER_DIR="/var/lib/lxc/$CONTAINER_NAME/rootfs"}
cp $CERT_DIR/fullchain.pem $CONTAINER_DIR/etc/ssl/certs/mailserver.crt
cp $CERT_DIR/privkey.pem $CONTAINER_DIR/etc/ssl/private/mailserver.key
# Mail servers can read the certificate as root before dropping privileges
chown 0:0 $CONTAINER_DIR/etc/ssl/private/mailserver.key
chmod 400 $CONTAINER_DIR/etc/ssl/private/mailserver.key
lxc-attach -n $CONTAINER_NAME -- service postfix restart
lxc-attach -n $CONTAINER_NAME -- service dovecot restart
diff --git a/roles/mailserver/certificates/init.sls b/roles/mailserver/certificates/init.sls
index 9875730..7105b25 100644
--- a/roles/mailserver/certificates/init.sls
+++ b/roles/mailserver/certificates/init.sls
@@ -1,12 +1,12 @@
# -------------------------------------------------------------
# Salt — Deploy SSL certificate for SMTP server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-11-03
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
smtp_certificates_update_script:
file.managed:
- name: /usr/local/bin/update-smtp-certificates
- - source: salt://roles/mailserver/certificates/files/update-smtp-certificates
+ - source: salt://roles/mailserver/certificates/files/update-smtp-certificates.sh
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
deleted file mode 100755
index 078fb1e..0000000
--- a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# -------------------------------------------------------------
-# Nasqueron mail services
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Project: Nasqueron
-# Created: 2017-01-14
-# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-dns-entries
-# -------------------------------------------------------------
-#
-# <auto-generated>
-# This file is managed by our rOPS SaltStack repository.
-#
-# Changes to this file may cause incorrect behavior
-# and will be lost if the state is redeployed.
-# </auto-generated>
-
-# Parses arguments
-if [ $# -eq 0 ]
-then
- echo "Usage: `basename $0` <domain>"
- exit 1
-fi
-
-DOMAIN=$1
-DIR=/etc/opendkim/keys/$DOMAIN
-
-if [ ! -d "$DIR" ]
-then
- echo "Directory not found: $DIR"
- exit 2
-fi
-
-for f in $DIR/*.txt
-do
- get-dkim-dns-entry $f
-done
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
new file mode 120000
index 0000000..07412c9
--- /dev/null
+++ b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
@@ -0,0 +1 @@
+get-dkim-dns-entries.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries.sh
similarity index 98%
copy from roles/mailserver/dkim/files/bin/get-dkim-dns-entries
copy to roles/mailserver/dkim/files/bin/get-dkim-dns-entries.sh
index 078fb1e..5a96366 100755
--- a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
+++ b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries.sh
@@ -1,38 +1,38 @@
#!/bin/sh
# -------------------------------------------------------------
# Nasqueron mail services
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-14
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-dns-entries
+# Source file: roles/mailserver/dkim/files/bin/get-dkim-dns-entries.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# Parses arguments
if [ $# -eq 0 ]
then
echo "Usage: `basename $0` <domain>"
exit 1
fi
DOMAIN=$1
DIR=/etc/opendkim/keys/$DOMAIN
if [ ! -d "$DIR" ]
then
echo "Directory not found: $DIR"
exit 2
fi
for f in $DIR/*.txt
do
get-dkim-dns-entry $f
done
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-key-table b/roles/mailserver/dkim/files/bin/get-dkim-key-table
deleted file mode 100755
index e590549..0000000
--- a/roles/mailserver/dkim/files/bin/get-dkim-key-table
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# -------------------------------------------------------------
-# Nasqueron mail services
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Project: Nasqueron
-# Created: 2017-01-14
-# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-key-table
-# -------------------------------------------------------------
-#
-# <auto-generated>
-# This file is managed by our rOPS SaltStack repository.
-#
-# Changes to this file may cause incorrect behavior
-# and will be lost if the state is redeployed.
-# </auto-generated>
-
-for d in /etc/opendkim/keys/*
-do
- DOMAIN=`basename $d`
-
- for f in $d/*.private
- do
- SELECTOR=`basename $f .private`
- echo "$SELECTOR._domainkey.$DOMAIN $DOMAIN:$SELECTOR:$f"
- done
-done
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-key-table b/roles/mailserver/dkim/files/bin/get-dkim-key-table
new file mode 120000
index 0000000..c1161ab
--- /dev/null
+++ b/roles/mailserver/dkim/files/bin/get-dkim-key-table
@@ -0,0 +1 @@
+get-dkim-key-table.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-key-table b/roles/mailserver/dkim/files/bin/get-dkim-key-table.sh
similarity index 98%
copy from roles/mailserver/dkim/files/bin/get-dkim-key-table
copy to roles/mailserver/dkim/files/bin/get-dkim-key-table.sh
index e590549..2544e8f 100755
--- a/roles/mailserver/dkim/files/bin/get-dkim-key-table
+++ b/roles/mailserver/dkim/files/bin/get-dkim-key-table.sh
@@ -1,28 +1,28 @@
#!/bin/sh
# -------------------------------------------------------------
# Nasqueron mail services
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-14
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-key-table
+# Source file: roles/mailserver/dkim/files/bin/get-dkim-key-table.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
for d in /etc/opendkim/keys/*
do
DOMAIN=`basename $d`
for f in $d/*.private
do
SELECTOR=`basename $f .private`
echo "$SELECTOR._domainkey.$DOMAIN $DOMAIN:$SELECTOR:$f"
done
done
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-signing-table b/roles/mailserver/dkim/files/bin/get-dkim-signing-table
deleted file mode 100755
index 85be50e..0000000
--- a/roles/mailserver/dkim/files/bin/get-dkim-signing-table
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# -------------------------------------------------------------
-# Nasqueron mail services
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Project: Nasqueron
-# Created: 2017-01-14
-# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-signing-table
-# -------------------------------------------------------------
-#
-# <auto-generated>
-# This file is managed by our rOPS SaltStack repository.
-#
-# Changes to this file may cause incorrect behavior
-# and will be lost if the state is redeployed.
-# </auto-generated>
-
-for d in /etc/opendkim/keys/*
-do
- DOMAIN=`basename $d`
-
- for f in $d/*.private
- do
- SELECTOR=`basename $f .private`
- echo "$DOMAIN $SELECTOR._domainkey.$DOMAIN"
- done
-done
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-signing-table b/roles/mailserver/dkim/files/bin/get-dkim-signing-table
new file mode 120000
index 0000000..949c0ce
--- /dev/null
+++ b/roles/mailserver/dkim/files/bin/get-dkim-signing-table
@@ -0,0 +1 @@
+get-dkim-signing-table.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-signing-table b/roles/mailserver/dkim/files/bin/get-dkim-signing-table.sh
similarity index 98%
copy from roles/mailserver/dkim/files/bin/get-dkim-signing-table
copy to roles/mailserver/dkim/files/bin/get-dkim-signing-table.sh
index 85be50e..bf10d7f 100755
--- a/roles/mailserver/dkim/files/bin/get-dkim-signing-table
+++ b/roles/mailserver/dkim/files/bin/get-dkim-signing-table.sh
@@ -1,28 +1,28 @@
#!/bin/sh
# -------------------------------------------------------------
# Nasqueron mail services
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-14
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/dkim/files/bin/get-dkim-signing-table
+# Source file: roles/mailserver/dkim/files/bin/get-dkim-signing-table.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
for d in /etc/opendkim/keys/*
do
DOMAIN=`basename $d`
for f in $d/*.private
do
SELECTOR=`basename $f .private`
echo "$DOMAIN $SELECTOR._domainkey.$DOMAIN"
done
done
diff --git a/roles/mailserver/systemd-unit/files/lxc-container-mailserver-start b/roles/mailserver/systemd-unit/files/lxc-container-mailserver-start.sh
similarity index 98%
rename from roles/mailserver/systemd-unit/files/lxc-container-mailserver-start
rename to roles/mailserver/systemd-unit/files/lxc-container-mailserver-start.sh
index b3f924c..9f6e35e 100755
--- a/roles/mailserver/systemd-unit/files/lxc-container-mailserver-start
+++ b/roles/mailserver/systemd-unit/files/lxc-container-mailserver-start.sh
@@ -1,48 +1,48 @@
#!/bin/sh
# -------------------------------------------------------------
# Nasqueron mail services
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2015-12-16
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/systemd-unit/files/lxc-container-mailserver-start
+# Source file: roles/mailserver/systemd-unit/files/lxc-container-mailserver-start.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
#Let systemd launch a lxc mail container through /usr/lib/systemd/system/lxc-container-mailserver.service
#Start a lxc container, and create iptable rules
IPTABLES="/usr/sbin/iptables"
LXC_START="/usr/bin/lxc-start"
CONTAINER_NAME="mailserver"
HOST_INTERFACE="ens192"
DOCKER_INTERFACE="docker0"
HOST_IP="212.129.32.223"
CONTAINER_IP="10.0.3.8"
PORTS="25 110 143 465 587"
DOCKER_PORTS="25 143 465 587"
NGINX_PORT="21080"
$LXC_START -n $CONTAINER_NAME -d
#Web rules
for PORT in $PORTS
do
$IPTABLES -t nat -I PREROUTING -i $HOST_INTERFACE -p TCP -d $HOST_IP/32 --dport $PORT -j DNAT --to-destination $CONTAINER_IP:$PORT
done
#Need 80 port for main nginx
$IPTABLES -t nat -I PREROUTING -i $HOST_INTERFACE -p TCP -d $HOST_IP/32 --dport $NGINX_PORT -j DNAT --to-destination $CONTAINER_IP:80
#Docker rules
for PORT in $DOCKER_PORTS
do
$IPTABLES -t nat -I PREROUTING -i $DOCKER_INTERFACE -p TCP -d $HOST_IP/32 --dport $PORT -j DNAT --to-destination $CONTAINER_IP:$PORT
done
diff --git a/roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop b/roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop.sh
similarity index 98%
rename from roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop
rename to roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop.sh
index eb5a291..959b5e1 100755
--- a/roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop
+++ b/roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop.sh
@@ -1,49 +1,49 @@
#!/bin/sh
# -------------------------------------------------------------
# Nasqueron mail services
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2015-12-16
# License: Trivial work, not eligible to copyright
-# Source file: roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop
+# Source file: roles/mailserver/systemd-unit/files/lxc-container-mailserver-stop.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
#Let systemd stop the lxc mail container through /usr/lib/systemd/system/lxc-container-mailserver.service
#Stop the lxc container, and create iptable rules
IPTABLES="/usr/sbin/iptables"
LXC_STOP="/usr/bin/lxc-stop"
CONTAINER_NAME="mailserver"
HOST_INTERFACE="ens192"
DOCKER_INTERFACE="docker0"
HOST_IP="212.129.32.223"
CONTAINER_IP="10.0.3.8"
PORTS="25 110 143 465 587"
DOCKER_PORTS="25 143 465 587"
NGINX_PORT="21080"
#Web rules
for PORT in $PORTS
do
$IPTABLES -t nat -D PREROUTING -i $HOST_INTERFACE -p TCP -d $HOST_IP/32 --dport $PORT -j DNAT --to-destination $CONTAINER_IP:$PORT
done
#Need 80 port for main nginx
$IPTABLES -t nat -D PREROUTING -i $HOST_INTERFACE -p TCP -d $HOST_IP/32 --dport $NGINX_PORT -j DNAT --to-destination $CONTAINER_IP:80
#Docker rules
for PORT in $DOCKER_PORTS
do
$IPTABLES -t nat -D PREROUTING -i $DOCKER_INTERFACE -p TCP -d $HOST_IP/32 --dport $PORT -j DNAT --to-destination $CONTAINER_IP:$PORT
done
$LXC_STOP -n $CONTAINER_NAME
diff --git a/roles/mumble/certificates/files/update-mumble-certificates b/roles/mumble/certificates/files/update-mumble-certificates.sh
similarity index 98%
rename from roles/mumble/certificates/files/update-mumble-certificates
rename to roles/mumble/certificates/files/update-mumble-certificates.sh
index 7e5a1f9..7833fe1 100755
--- a/roles/mumble/certificates/files/update-mumble-certificates
+++ b/roles/mumble/certificates/files/update-mumble-certificates.sh
@@ -1,31 +1,31 @@
#!/bin/sh
# -------------------------------------------------------------
# Deploy Mumble certificate on Murmur
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-11-03
# License: Trivial work, not eligible to copyright
-# Source file: roles/mumble/certificates/files/update-mumble-certificates
+# Source file: roles/mumble/certificates/files/update-mumble-certificates.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
: ${JAIL_HOSTNAME='mumble.nasqueron.org'}
: ${CERT_DIR="/usr/local/etc/letsencrypt/live/$JAIL_HOSTNAME"}
: ${JAIL_DIR="/usr/local/jails/$JAIL_HOSTNAME"}
: ${JAIL_ID=`jls | grep $JAIL_HOSTNAME | awk '{print $1}'`}
cp $CERT_DIR/fullchain.pem $JAIL_DIR/usr/local/etc/ssl/nasqueron.org/mumble.crt
cp $CERT_DIR/privkey.pem $JAIL_DIR/usr/local/etc/ssl/nasqueron.org/mumble.key
# murmur has uid 338
chown 338:0 $JAIL_DIR/usr/local/etc/ssl/nasqueron.org/mumble.key
chmod 400 $JAIL_DIR/usr/local/etc/ssl/nasqueron.org/mumble.key
jexec $JAIL_ID service murmur restart
diff --git a/roles/mumble/certificates/init.sls b/roles/mumble/certificates/init.sls
index e648802..d9d813a 100644
--- a/roles/mumble/certificates/init.sls
+++ b/roles/mumble/certificates/init.sls
@@ -1,13 +1,12 @@
# -------------------------------------------------------------
# Salt — Deploy SSL certificate for Mumble server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-11-03
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
mumble_certificates_update_script:
file.managed:
- name: /usr/local/bin/update-mumble-certificates
- - source: salt://roles/mumble/certificates/files/update-mumble-certificates
-
+ - source: salt://roles/mumble/certificates/files/update-mumble-certificates.sh
diff --git a/roles/paas-docker/systemd-unit/files/docker_start b/roles/paas-docker/systemd-unit/files/docker_start.sh
similarity index 98%
rename from roles/paas-docker/systemd-unit/files/docker_start
rename to roles/paas-docker/systemd-unit/files/docker_start.sh
index ff93d4a..2e04598 100644
--- a/roles/paas-docker/systemd-unit/files/docker_start
+++ b/roles/paas-docker/systemd-unit/files/docker_start.sh
@@ -1,19 +1,19 @@
#!/bin/sh
# -------------------------------------------------------------
# PaaS Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2015-12-29
# License: Trivial work, not eligible to copyright
-# Source file: roles/paas-docker/systemd-unit/files/docker_start
+# Source file: roles/paas-docker/systemd-unit/files/docker_start.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
get-containers-list | xargs docker start
diff --git a/roles/paas-docker/systemd-unit/files/docker_stop b/roles/paas-docker/systemd-unit/files/docker_stop.sh
similarity index 98%
rename from roles/paas-docker/systemd-unit/files/docker_stop
rename to roles/paas-docker/systemd-unit/files/docker_stop.sh
index 4e0cb6f..51ef7c5 100644
--- a/roles/paas-docker/systemd-unit/files/docker_stop
+++ b/roles/paas-docker/systemd-unit/files/docker_stop.sh
@@ -1,20 +1,20 @@
#!/bin/sh
# -------------------------------------------------------------
# PaaS Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2015-12-29
# License: Trivial work, not eligible to copyright
-# Source file: roles/paas-docker/systemd-unit/files/docker_stop
+# Source file: roles/paas-docker/systemd-unit/files/docker_stop.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
get-containers --reverse | xargs docker stop
diff --git a/roles/paas-docker/systemd-unit/files/get-containers-list b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
similarity index 98%
rename from roles/paas-docker/systemd-unit/files/get-containers-list
rename to roles/paas-docker/systemd-unit/files/get-containers-list.sh
index f93da6d..989dedd 100755
--- a/roles/paas-docker/systemd-unit/files/get-containers-list
+++ b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
@@ -1,55 +1,55 @@
#!/usr/bin/env bash
# -------------------------------------------------------------
# PaaS Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-30
# License: Trivial work, not eligible to copyright
-# Source file: roles/paas-docker/systemd-unit/files/get-containers-list
+# Source file: roles/paas-docker/systemd-unit/files/get-containers-list.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
## Read /etc/containers.conf and recover docker’s names into an array.
## get-containers-list [--reverse]
file='/etc/containers.conf'
if [[ ! -f "$file" ]]; then
echo "$file : does not exists "
exit 1
elif [[ ! -r "$file" ]]; then
echo "$file : can not read "
fi
#Get names in an array
# 21:42 <geirha> since bash 4, you can use mapfile instead of that while read loop. mapfile -t array < "$file"
mapfile -t array < "$file"
#Test argument to know in wich order return names
if [[ $1 == "--reverse" ]]; then
for ((i="${#array[*]}"; i > 0; i--)) ; do
echo "${array[i]}"
done
elif [[ -z "$1" ]] ; then
for ((i=0; i < "${#array[*]}"; i++)) ; do
echo "${array[i]}"
done
else
echo "$1 is not a valid argument"
fi
diff --git a/roles/phabricator/arcanist/Makefile b/roles/phabricator/arcanist/Makefile
index dd75d71..bbe901d 100644
--- a/roles/phabricator/arcanist/Makefile
+++ b/roles/phabricator/arcanist/Makefile
@@ -1,5 +1,5 @@
INSTALL=install
PREFIX=/usr/local
install:
- ${INSTALL} files/arc ${PREFIX}/bin/
+ ${INSTALL} files/arc.sh ${PREFIX}/bin/arc
diff --git a/roles/phabricator/arcanist/files/arc b/roles/phabricator/arcanist/files/arc.sh
similarity index 97%
rename from roles/phabricator/arcanist/files/arc
rename to roles/phabricator/arcanist/files/arc.sh
index 4e9b48b..832fdb7 100755
--- a/roles/phabricator/arcanist/files/arc
+++ b/roles/phabricator/arcanist/files/arc.sh
@@ -1,73 +1,73 @@
#!/bin/sh
# -------------------------------------------------------------
# Phabricator — Arcanist Docker container wrapper
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Project: Nasqueron
# Created: 2016-01-01
# Description: Wrapper to run Arcanist as a Docker container
# License: Trivial work, not eligible to copyright
# Image: nasqueron/arcanist
-# Source file: roles/phabricator/arcanist/files/arc
+# Source file: roles/phabricator/arcanist/files/arc.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Parse arguments
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ -t 0 ]; then
# If a stdin entry is available
# launch the container in the
# interactive mode
FLAGS=-it
fi
# Logs are default disabled
PRINT_LOG=0
if [ "$1" = "shell" ]; then
# Launch commands
# in the container bash shell
shift
COMMAND=bash
else
# Launch arc
mkdir -p ~/.arc
COMMAND=arc
if [ "$1" = "call-conduit" ]; then
# Enable log printing
PRINT_LOG=1
# Set a random name for the container
INSTANCE="arc-"`openssl rand -hex 21`
FLAGS="-i -a=stdin --name=$INSTANCE"
fi
fi
if [ -d ~/.arc/ssh ]; then
VOLUME_SSH="-v $HOME/.arc/ssh:/root/.ssh"
else
VOLUME_SSH=""
fi
# -------------------------------------------------------------
# Run container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ $PRINT_LOG -eq 0 ]; then
docker run $FLAGS --rm -v ~/.arc:/opt/config -v $PWD:/opt/workspace $VOLUME_SSH nasqueron/arcanist $COMMAND $*
else
docker run $FLAGS -v ~/.arc:/opt/config -v $PWD:/opt/workspace $VOLUME_SSH nasqueron/arcanist $COMMAND $* > /dev/null
sleep 3
docker logs $INSTANCE
docker rm $INSTANCE >/dev/null
fi
diff --git a/roles/phabricator/containers/Makefile b/roles/phabricator/containers/Makefile
index 4058731..ef83f0d 100644
--- a/roles/phabricator/containers/Makefile
+++ b/roles/phabricator/containers/Makefile
@@ -1,5 +1,7 @@
INSTALL=install
PREFIX=/usr/local
install:
- ${INSTALL} files/run-* ${PREFIX}/bin/
+ ${INSTALL} files/run-wolfphab.sh ${PREFIX}/bin/run-wolfphab
+ ${INSTALL} files/run-devcentral.sh ${PREFIX}/bin/run-devcentral
+ ${INSTALL} files/run-aphlict.sh ${PREFIX}/bin/run-aphlict
diff --git a/roles/phabricator/containers/files/run-aphlict b/roles/phabricator/containers/files/run-aphlict.sh
similarity index 99%
rename from roles/phabricator/containers/files/run-aphlict
rename to roles/phabricator/containers/files/run-aphlict.sh
index dccc890..0076c04 100755
--- a/roles/phabricator/containers/files/run-aphlict
+++ b/roles/phabricator/containers/files/run-aphlict.sh
@@ -1,33 +1,33 @@
#!/bin/sh
# -------------------------------------------------------------
# Phabricator — Aphlict notifications server
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Project: Nasqueron
# Created: 2016-03-28
# Description: Node application to get real time notifications
# through websockets for Phabricator instances.
# License: Trivial work, not eligible to copyright
# Image: nasqueron/aphlict
-# Source file: roles/phabricator/containers/files/run-aphlict
+# Source file: roles/phabricator/containers/files/run-aphlict.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Container parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INSTANCE_NAME=aphlict
# -------------------------------------------------------------
# Container launch
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker run -dt --name $INSTANCE_NAME -p 22280:22280 -p 22281:22281 nasqueron/aphlict
diff --git a/roles/phabricator/containers/files/run-devcentral b/roles/phabricator/containers/files/run-devcentral.sh
similarity index 99%
rename from roles/phabricator/containers/files/run-devcentral
rename to roles/phabricator/containers/files/run-devcentral.sh
index 9d7950f..a03a962 100755
--- a/roles/phabricator/containers/files/run-devcentral
+++ b/roles/phabricator/containers/files/run-devcentral.sh
@@ -1,98 +1,98 @@
#!/bin/sh
# -------------------------------------------------------------
# Phabricator — Nasqueron instance
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Project: Nasqueron
# Created: 2015-04-22
# Description: Phabricator instance for Nasqueron
# License: Trivial work, not eligible to copyright
# Image: nasqueron/phabricator
-# Source file: roles/phabricator/containers/files/run-devcentral
+# Source file: roles/phabricator/containers/files/run-devcentral.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Container parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INSTANCE_NAME=devcentral
PORT=31080
DOMAIN=$INSTANCE_NAME.nasqueron.org
DATA_DIRECTORY=/data/$INSTANCE_NAME
MYSQL_INSTANCE=acquisitariat
# -------------------------------------------------------------
# Phabricator parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHABRICATOR_URL=http://$DOMAIN
PHABRICATOR_TITLE="Nasqueron DevCentral"
PHABRICATOR_ALT_FILE_DOMAIN="https://phabricator-files-for-devcentral-nasqueron.spacetechnology.net"
# -------------------------------------------------------------
# Deployment of our Phabricator code parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REPO_LOGIN=git
REPO_HOST=bitbucket.org
PHABRICATOR_PROD_REPO="ssh://git@bitbucket.org/nasqueron/devcentral-phabricator"
PHABRICATOR_PROD_BRANCH=production
# -------------------------------------------------------------
# Ensure container isn't already running
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker-container-status $INSTANCE_NAME > /dev/null
if [ "$?" -lt 2 ]; then
echo "Container is already running."
echo "To force relaunch, try docker stop $INSTANCE_NAME ; docker rm $INSTANCE_NAME ; $0"
exit 1
fi
# -------------------------------------------------------------
# Container launch
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker run -t -d \
--link $MYSQL_INSTANCE:mysql \
-v $DATA_DIRECTORY/repo:/var/repo \
-v $DATA_DIRECTORY/conf:/opt/phabricator/conf \
-p $PORT:80 \
-e PHABRICATOR_URL=$PHABRICATOR_URL \
-e PHABRICATOR_TITLE="$PHABRICATOR_TITLE" \
-e PHABRICATOR_ALT_FILE_DOMAIN="$PHABRICATOR_ALT_FILE_DOMAIN" \
-e PHABRICATOR_PROD_REPO=$PHABRICATOR_PROD_REPO \
-e PHABRICATOR_PROD_BRANCH=$PHABRICATOR_PROD_BRANCH \
-e PHABRICATOR_USE_MAILGUN=1 \
-e PHABRICATOR_DOMAIN=$DOMAIN \
-e PHABRICATOR_BOT=xessife \
--name $INSTANCE_NAME nasqueron/phabricator
# -------------------------------------------------------------
# DevCentral specific branch deployment
#
# Deploys our version
# As we change static resources, restart php-fpm is a good idea:
# if someone asks the page while we were pulling our version,
# the old celerity map would be kept by APCu.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker exec $INSTANCE_NAME sh -c 'mkdir -p /root/.ssh && \
cp /opt/phabricator/conf/deploy-keys/* /root/.ssh'
docker exec $INSTANCE_NAME ssh -o StrictHostKeyChecking=no ${REPO_LOGIN}@${REPO_HOST}
docker exec $INSTANCE_NAME sh -c 'cd /opt/phabricator && \
git remote add private "$PHABRICATOR_PROD_REPO" && \
git fetch --all && \
git checkout $PHABRICATOR_PROD_BRANCH && \
sv restart php-fpm && sv restart phd'
echo "Deployment done at `date`."
exit 0
diff --git a/roles/phabricator/containers/files/run-wolfphab b/roles/phabricator/containers/files/run-wolfphab.sh
similarity index 99%
rename from roles/phabricator/containers/files/run-wolfphab
rename to roles/phabricator/containers/files/run-wolfphab.sh
index 87b64b8..1d145a4 100755
--- a/roles/phabricator/containers/files/run-wolfphab
+++ b/roles/phabricator/containers/files/run-wolfphab.sh
@@ -1,81 +1,81 @@
#!/bin/sh
# -------------------------------------------------------------
# Phabricator — Wolfplex instance
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Project: Nasqueron
# Created: 2015-10-25
# Description: Phabricator instance for Nasqueron
# License: Trivial work, not eligible to copyright
# Image: nasqueron/phabricator
-# Source file: roles/phabricator/containers/files/run-wolfphab
+# Source file: roles/phabricator/containers/files/run-wolfphab.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Container parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INSTANCE_NAME=wolfphab
PORT=35080
DOMAIN=phabricator.wolfplex.be
DATA_DIRECTORY=/data/$INSTANCE_NAME
MYSQL_INSTANCE=acquisitariat
MYSQL_NAMESPACE=wolfphab
# -------------------------------------------------------------
# Phabricator parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHABRICATOR_URL=https://$DOMAIN
PHABRICATOR_TITLE="Wolfplex Phabricator"
PHABRICATOR_ALT_FILE_DOMAIN="https://phabricator-files-for-wolfplex.nasqueron.org"
# -------------------------------------------------------------
# Ensure container isn't already running
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker-container-status $INSTANCE_NAME > /dev/null
if [ "$?" -lt 2 ]; then
echo "Container is already running."
echo "To force relaunch, try docker stop $INSTANCE_NAME ; docker rm $INSTANCE_NAME ; $0"
exit 1
fi
# -------------------------------------------------------------
# Container launch
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
docker run -t -d \
--link $MYSQL_INSTANCE:mysql \
-v $DATA_DIRECTORY/repo:/var/repo \
-v $DATA_DIRECTORY/conf:/opt/phabricator/conf \
-p $PORT:80 \
-e PHABRICATOR_URL=$PHABRICATOR_URL \
-e PHABRICATOR_TITLE="$PHABRICATOR_TITLE" \
-e PHABRICATOR_ALT_FILE_DOMAIN="$PHABRICATOR_ALT_FILE_DOMAIN" \
-e PHABRICATOR_STORAGE_NAMESPACE="$MYSQL_NAMESPACE" \
--name $INSTANCE_NAME nasqueron/phabricator
docker exec $INSTANCE_NAME sh -c 'cd /opt/phabricator && \
bin/config set mysql.host mysql && \
bin/config set mysql.pass $MYSQL_ENV_MYSQL_ROOT_PASSWORD && \
bin/config set storage.default-namespace $PHABRICATOR_STORAGE_NAMESPACE && \
bin/config set phabricator.base-uri $PHABRICATOR_URL && \
bin/config set security.alternate-file-domain "$PHABRICATOR_ALT_FILE_DOMAIN" && \
bin/config set mailgun.domain $DOMAIN && \
rm -f /etc/nginx/sites-enabled/default && \
chown -R app /var/repo'
# Fixes bug phd doesn't run at the very first container launch
docker exec $INSTANCE_NAME sv restart phd
echo "Deployment done at `date`."
exit 0
diff --git a/roles/shellserver/user-session/Makefile b/roles/shellserver/user-session/Makefile
index 8334a27..4786aa6 100644
--- a/roles/shellserver/user-session/Makefile
+++ b/roles/shellserver/user-session/Makefile
@@ -1,7 +1,8 @@
PREFIX=/usr/local
INSTALL=install
INSTALL_DATA=${INSTALL} -m 0644
install:
${INSTALL_DATA} files/csh.logout /etc/
- ${INSTALL} files/whom files/whom-diff ${PREFIX}/bin/
+ ${INSTALL} files/whom.sh ${PREFIX}/bin/whom
+ ${INSTALL} files/whom-diff.sh ${PREFIX}/bin/whom-diff
diff --git a/roles/shellserver/user-session/files/whom-diff b/roles/shellserver/user-session/files/whom-diff.sh
similarity index 99%
rename from roles/shellserver/user-session/files/whom-diff
rename to roles/shellserver/user-session/files/whom-diff.sh
index 93e34f7..39a7437 100755
--- a/roles/shellserver/user-session/files/whom-diff
+++ b/roles/shellserver/user-session/files/whom-diff.sh
@@ -1,77 +1,77 @@
#!/bin/sh
# -------------------------------------------------------------
# whom-diff
#
# Computes the diff between two `whom` invoke.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Created: 2015-12-30
# Licence: BSD-2-Clause
-# Source file: roles/shellserver/user-session/files/whom-diff
+# Source file: roles/shellserver/user-session/files/whom-diff.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Determines session identifier and directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$SESSION_ID" = "" ]; then
SESSION_ID=`who am I | md5 | cut -c1-8`
fi
DIR=/var/tmp/whom/$USER/$SESSION_ID
# -------------------------------------------------------------
# -s / --session
# Prints the session identifier
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$1" = "--session" ] || [ "$1" = "-s" ]; then
echo $SESSION_ID
exit 0
fi
# -------------------------------------------------------------
# Default mode
# Prints the diff between current `whom` and previous output
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ $# -eq 0 ]; then
# Creates working directory if needed
if [ ! -d $DIR ]; then
mkdir -p $DIR
touch $DIR/old
fi
# Let's diff
cd $DIR
whom > current
diff old current | tail -n +2
mv current old
exit 0
fi
# -------------------------------------------------------------
# -c / --clean
# Cleans directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$1" = "--clean" ] || [ "$1" = "-c" ]; then
rm -rf $DIR
exit $?
fi
# -------------------------------------------------------------
# Usage
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>&2 echo "Usage: $0 [--setup|--clean|-s|-c]"
exit 1
diff --git a/roles/shellserver/user-session/files/whom b/roles/shellserver/user-session/files/whom.sh
similarity index 91%
rename from roles/shellserver/user-session/files/whom
rename to roles/shellserver/user-session/files/whom.sh
index 9a8ce1a..165f492 100755
--- a/roles/shellserver/user-session/files/whom
+++ b/roles/shellserver/user-session/files/whom.sh
@@ -1,20 +1,20 @@
#!/bin/sh
# -------------------------------------------------------------
# Clean alternative to who
# Prints the usernames of connected users by alphabetical order
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Created: 2015-12-30
# Licence: Trivial work, not eligible to copyright
-# Source file: roles/shellserver/user-session/files/whom
+# Source file: roles/shellserver/user-session/files/whom.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
who | awk '{print $1}' | sort | uniq
diff --git a/roles/shellserver/userland-software/files/install-eggdrop b/roles/shellserver/userland-software/files/install-eggdrop.sh
similarity index 99%
rename from roles/shellserver/userland-software/files/install-eggdrop
rename to roles/shellserver/userland-software/files/install-eggdrop.sh
index 48fd017..c2eddc5 100644
--- a/roles/shellserver/userland-software/files/install-eggdrop
+++ b/roles/shellserver/userland-software/files/install-eggdrop.sh
@@ -1,58 +1,58 @@
#!/bin/sh
# -------------------------------------------------------------
# Install an eggdrop
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-11-06
# License: Trivial work, not eligible to copyright
-# Source file: roles/shellserver/userland-software/files/install-eggdrop
+# Source file: roles/shellserver/userland-software/files/install-eggdrop.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# TCL and eggdrop versions
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EGGDROP_VERSION_MAJOR=1.6
EGGDROP_VERSION=1.6.21
TCL_VERSION=8.6
# -------------------------------------------------------------
# Fetch, extract
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
wget ftp://ftp.eggheads.org/pub/eggdrop/source/${EGGDROP_VERSION_MAJOR}/eggdrop${EGGDROP_VERSION}.tar.gz
tar xzf eggdrop${EGGDROP_VERSION}.tar.gz
cd eggdrop${EGGDROP_VERSION}
# -------------------------------------------------------------
# Configure step
#
# This is the tricky part, as we need to provide path to TCL
# header and library files, heavily OS/distro/arch dependant.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ -f /etc/debian_version ]; then
ARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`
CFLAGS="-std=gnu89" ./configure --with-tclinc=/usr/include/tcl${TCL_VERSION}/tcl.h --with-tcllib=/usr/lib/$ARCH/libtcl${TCL_VERSION}.so
elif [ `uname` = "FreeBSD" ]; then
TCL_VERSION_LIB=`echo $TCL_VERSION | tr -d .`
./configure --with-tclinc=/usr/local/include/tcl${TCL_VERSION}/tcl.h -with-tcllib=/usr/local/lib/libtcl${TCL_VERSION_LIB}.so
else
./configure
fi
# -------------------------------------------------------------
# Build, install
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
make config
make
make install
diff --git a/roles/shellserver/userland-software/irc.sls b/roles/shellserver/userland-software/irc.sls
index 4d75302..c470e7f 100644
--- a/roles/shellserver/userland-software/irc.sls
+++ b/roles/shellserver/userland-software/irc.sls
@@ -1,65 +1,65 @@
# -------------------------------------------------------------
# Salt — Provision IRC software
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-04-09
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# IRC clients
# -------------------------------------------------------------
irc_clients:
pkg:
- installed
- pkgs:
- irssi
- irssi-scripts
- weechat
{% if grains['os'] != 'Debian' and grains['os'] != 'Ubuntu' %}
# Reference: supremetechs.com/tag/bitchx-removed-from-debian
- bitchx
{% endif %}
# -------------------------------------------------------------
# Bouncers
# -------------------------------------------------------------
irc_bouncers:
pkg:
- installed
- pkgs:
- znc
# -------------------------------------------------------------
# Bots
# -------------------------------------------------------------
eggdrop_installer:
file.managed:
- name: /usr/local/bin/install-eggdrop
- - source: salt://roles/shellserver/userland-software/files/install-eggdrop
+ - source: salt://roles/shellserver/userland-software/files/install-eggdrop.sh
- mode: 755
# -------------------------------------------------------------
# Misc
# -------------------------------------------------------------
irc_misc:
pkg:
- installed
- pkgs:
- bitlbee
- oidentd
- pisg
oidentd_config:
file.managed:
{% if grains['os'] == 'FreeBSD' %}
- name: /usr/local/etc/oidentd.conf
{% else %}
- name: /etc/oidentd.conf
{% endif %}
- source: salt://roles/shellserver/userland-software/files/oidentd.conf
- mode: 644
diff --git a/roles/shellserver/vhosts/files/vhosts b/roles/shellserver/vhosts/files/vhosts.sh
similarity index 91%
rename from roles/shellserver/vhosts/files/vhosts
rename to roles/shellserver/vhosts/files/vhosts.sh
index 3e7f53a..87b3b6f 100644
--- a/roles/shellserver/vhosts/files/vhosts
+++ b/roles/shellserver/vhosts/files/vhosts.sh
@@ -1,23 +1,23 @@
#!/bin/sh
# -------------------------------------------------------------
# List IP and reverse DNS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2017-01-10
# License: Trivial work, not eligible to copyright
-# Source file: roles/shellserver/vhosts/files/vhosts
+# Source file: roles/shellserver/vhosts/files/vhosts.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
if [ -f /etc/vhosts ]; then
cat /etc/vhosts
else
echo "No vhosts data file found. Please create /etc/vhosts file."
fi
diff --git a/roles/shellserver/vhosts/init.sls b/roles/shellserver/vhosts/init.sls
index fe7f49f..d48e9c1 100644
--- a/roles/shellserver/vhosts/init.sls
+++ b/roles/shellserver/vhosts/init.sls
@@ -1,25 +1,25 @@
# -------------------------------------------------------------
# Salt — vhosts configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2017-01-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Configuration file
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/etc/vhosts:
file.managed:
- source: salt://roles/shellserver/vhosts/files/vhosts.{{ grains['id'] }}
- mode: 644
# -------------------------------------------------------------
# Command file
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/usr/local/bin/vhosts:
file.managed:
- - source: salt://roles/shellserver/vhosts/files/vhosts
+ - source: salt://roles/shellserver/vhosts/files/vhosts.sh
- mode: 755
diff --git a/scripts/byOS/Fedora/new-partition b/scripts/byOS/Fedora/new-partition.sh
similarity index 100%
rename from scripts/byOS/Fedora/new-partition
rename to scripts/byOS/Fedora/new-partition.sh
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Sep 18, 11:19 (13 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2990643
Default Alt Text
(55 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment