Skip to content

Commit

Permalink
provision/*: always declare JAIL_START_EXTRA, JAIL_CONF_EXTRA, JAIL_F…
Browse files Browse the repository at this point in the history
…STAB
  • Loading branch information
msimerson committed Mar 24, 2024
1 parent c2ee636 commit 4f86e4b
Show file tree
Hide file tree
Showing 58 changed files with 105 additions and 13 deletions.
1 change: 1 addition & 0 deletions provision/borg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_borg()
{
Expand Down
1 change: 1 addition & 0 deletions provision/bsd_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include nginx

Expand Down
4 changes: 4 additions & 0 deletions provision/clamav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

. mail-toaster.sh

install_clamav_fangfrisch()
Expand Down
1 change: 1 addition & 0 deletions provision/dcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_dcc_cleanup()
{
Expand Down
13 changes: 8 additions & 5 deletions provision/dhcp.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/sh

. mail-toaster.sh || exit
set -e -u

. mail-toaster.sh

export JAIL_START_EXTRA="devfs_ruleset=7
allow.raw_sockets=1"
export JAIL_CONF_EXTRA="
devfs_ruleset = 7;
allow.raw_sockets = 1;"
export JAIL_FSTAB=""

install_dhcpd()
{
tell_status "installing dhcpd"
stage_pkg_install isc-dhcp44-server || exit
stage_pkg_install isc-dhcp44-server
}

configure_dhcpd()
Expand All @@ -34,11 +37,11 @@ rdr inet6 proto tcp from any to <ext_ips> port { 67 68 } -> $(get_jail_ip6 dhcp)
EO_PF_RDR

if [ ! -d "$ZFS_DATA_MNT/dhcp/etc" ]; then
mkdir -p "$ZFS_DATA_MNT/dhcp/etc" || exit
mkdir -p "$ZFS_DATA_MNT/dhcp/etc"
fi

if [ ! -d "$ZFS_DATA_MNT/dhcp/db" ]; then
mkdir -p "$ZFS_DATA_MNT/dhcp/db" || exit
mkdir -p "$ZFS_DATA_MNT/dhcp/db"
fi

get_public_ip
Expand Down Expand Up @@ -79,7 +82,7 @@ EO_DHCP
start_dhcpd()
{
tell_status "starting dhcpd"
stage_exec service isc-dhcpd start || exit
stage_exec service isc-dhcpd start
}

test_dhcpd()
Expand Down
1 change: 1 addition & 0 deletions provision/dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -e
export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA="
allow.raw_sockets;"
export JAIL_FSTAB=""

install_unbound()
{
Expand Down
1 change: 1 addition & 0 deletions provision/dovecot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
. mail-toaster.sh

export JAIL_START_EXTRA="allow.sysvipc=1"
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB="$ZFS_DATA_MNT/vpopmail/home $ZFS_JAIL_MNT/dovecot/usr/local/vpopmail nullfs rw 0 0"

mt6-include vpopmail
Expand Down
1 change: 1 addition & 0 deletions provision/dspam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include mysql

Expand Down
2 changes: 1 addition & 1 deletion provision/elasticsearch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

set -e
set -e -u

. mail-toaster.sh

Expand Down
4 changes: 4 additions & 0 deletions provision/geoip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

preflight_check() {
if [ -z "$MAXMIND_LICENSE_KEY" ]; then
echo "ERROR: edit mail-toaster.conf and set MAXMIND_LICENSE_KEY"
Expand Down
1 change: 1 addition & 0 deletions provision/ghost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_ghost()
{
Expand Down
1 change: 1 addition & 0 deletions provision/gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export JAIL_START_EXTRA="allow.sysvipc=1"
export JAIL_CONF_EXTRA="
allow.sysvipc;
"
export JAIL_FSTAB=""

# https://docs.gitlab.com/ee/install/relative_url.html
# https://gitlab.fechner.net/mfechner/Gitlab-docu/blob/master/install/15.10-freebsd.md
Expand Down
4 changes: 4 additions & 0 deletions provision/gitlab_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

. mail-toaster.sh || exit

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

# https://wiki.freebsd.org/Docker
# https://docs.gitlab.com/runner/install/freebsd.html

Expand Down
1 change: 1 addition & 0 deletions provision/grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_grafana()
{
Expand Down
4 changes: 4 additions & 0 deletions provision/haproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_haproxy()
{
case "$TLS_LIBRARY" in
Expand Down
2 changes: 2 additions & 0 deletions provision/horde.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

. mail-toaster.sh || exit

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB="$ZFS_DATA_MNT/vpopmail/home $ZFS_JAIL_MNT/horde/usr/local/vpopmail nullfs rw 0 0"

mt6-include php
Expand Down
1 change: 1 addition & 0 deletions provision/host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include shell
mt6-include mta
Expand Down
1 change: 1 addition & 0 deletions provision/influxdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_influxdb()
{
Expand Down
1 change: 1 addition & 0 deletions provision/jekyll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_jekyll()
{
Expand Down
2 changes: 1 addition & 1 deletion provision/joomla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
. mail-toaster.sh || exit

export JAIL_START_EXTRA=""
# shellcheck disable=2016
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include php
mt6-include nginx
Expand Down
1 change: 1 addition & 0 deletions provision/knot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include user

Expand Down
4 changes: 4 additions & 0 deletions provision/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_letsencrypt()
{
tell_status "installing ACME.sh & Let's Encrypt"
Expand Down
2 changes: 1 addition & 1 deletion provision/mailtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA="
allow.raw_sockets;"

export JAIL_FSTAB=""

install_mailtest()
{
Expand Down
1 change: 1 addition & 0 deletions provision/mediawiki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include php
mt6-include nginx
Expand Down
1 change: 1 addition & 0 deletions provision/memcached.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_memcached()
{
Expand Down
1 change: 1 addition & 0 deletions provision/minecraft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA="
mount += \"$ZFS_DATA_MNT/minecraft/etc \$path/usr/local/etc/minecraft-server nullfs rw 0 0\";
mount += \"$ZFS_DATA_MNT/minecraft/db \$path/var/db/minecraft-server nullfs rw 0 0\";"
export JAIL_FSTAB=""

install_minecraft()
{
Expand Down
1 change: 1 addition & 0 deletions provision/mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export JAIL_CONF_EXTRA="
allow.raw_sockets;
allow.sysvipc;
allow.mlock;"
export JAIL_FSTAB=""

install_mongodb()
{
Expand Down
1 change: 1 addition & 0 deletions provision/munin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_lighttpd()
{
Expand Down
4 changes: 4 additions & 0 deletions provision/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e

. mail-toaster.sh

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_db_server()
{
for _d in etc db; do
Expand Down
1 change: 1 addition & 0 deletions provision/nagios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA="
allow.raw_sockets;"
export JAIL_FSTAB=""

mt6-include php
mt6-include nginx
Expand Down
1 change: 1 addition & 0 deletions provision/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_nginx()
{
Expand Down
1 change: 1 addition & 0 deletions provision/nictool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

export NICTOOL_VER=${NICTOOL_VER:="2.33"}
export NICTOOL_UPGRADE=""
Expand Down
1 change: 1 addition & 0 deletions provision/nsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include user

Expand Down
1 change: 1 addition & 0 deletions provision/php7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

mt6-include php

Expand Down
19 changes: 16 additions & 3 deletions provision/postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e -u

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

_dkim_private_key="$ZFS_DATA_MNT/postfix/dkim/$TOASTER_MAIL_DOMAIN.private"

Expand Down Expand Up @@ -47,12 +48,12 @@ configure_opendkim()
configure_postfix_main_cf()
{
local _main_cf="$ZFS_DATA_MNT/postfix/etc/main.cf"
if [ -f "$_main_cf" ];
then
if [ -f "$_main_cf" ]; then
tell_status "preserving $_main_cf"
return
fi


stage_exec install -m 0644 /usr/local/etc/postfix/main.cf /data/etc/main.cf
stage_exec postconf -e "myhostname = postfix.$TOASTER_HOSTNAME"
stage_exec postconf -e 'smtp_tls_security_level = may'
stage_exec postconf -e 'smtpd_tls_security_level = may'
Expand All @@ -78,13 +79,25 @@ configure_postfix_main_cf()
fi
}

configure_postfix_master_cf
{
local _master_cf="$ZFS_DATA_MNT/postfix/etc/master.cf"
if [ -f "$_main_cf" ]; then
tell_status "preserving $_master_cf"
else
tell_status "installing $_master_cf"
stage_exec install -m 0644 /usr/local/etc/postfix/master.cf /data/etc/master.cf
fi
}

configure_postfix()
{
stage_sysrc sendmail_enable=NONE
stage_sysrc postfix_enable=YES
stage_sysrc postfix_flags="-c /data/etc"

configure_postfix_main_cf
configure_postfix_master_cf

# postconf will break symlinks to files. To get all of postfix to always
# look at /data/etc for config, symlink the config dir
Expand Down
1 change: 1 addition & 0 deletions provision/prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_prometheus()
{
Expand Down
1 change: 1 addition & 0 deletions provision/puppeteer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

export JAIL_START_EXTRA=""
export JAIL_CONF_EXTRA=""
export JAIL_FSTAB=""

install_puppeteer()
{
Expand Down
Loading

0 comments on commit 4f86e4b

Please sign in to comment.