From 215e77c226268a59f16343d4704ec0224468c0e7 Mon Sep 17 00:00:00 2001 From: Francois Lesueur Date: Fri, 23 Dec 2022 13:50:27 +0100 Subject: [PATCH] some progress... --- files/provision.sh | 16 +++++++++++++--- .../isp-a/home/clawsmail/addclawsuser.sh | 7 +++++-- .../isp-a/home/clawsmail/claws-mail/accountrc | 2 +- files/snster-kaz/isp-a/home/provision.sh | 18 +++++++++++++----- files/snster-kaz/kaz/prod/dns.conf | 9 +++++++++ .../prod/kaz/config/container-withoutMail.list | 2 +- .../snster-kaz/kaz/prod/kaz/config/dockers.env | 2 +- files/snster-kaz/kaz/prod/provision.sh | 16 ++++++++++++---- 8 files changed, 55 insertions(+), 17 deletions(-) diff --git a/files/provision.sh b/files/provision.sh index 34bd75f..68849e3 100755 --- a/files/provision.sh +++ b/files/provision.sh @@ -186,6 +186,10 @@ EOF #***********FIN CERTIF******************* + # clear apt cache + DEBIAN_FRONTEND=noninteractive apt-get autoremove -y + DEBIAN_FRONTEND=noninteractive apt-get clean + # SNSTER cd git clone https://framagit.org/flesueur/snster.git @@ -202,10 +206,16 @@ EOF # Build SNSTER KAZ ! snster -c /root/snster-kaz -t /root/templates create + snster -c /root/snster-kaz -t /root/templates start + snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x /mnt/snster/root/snster-kaz/kaz/prod/kaz.sh + + # On crée quelques mails + SETUP_MAIL="docker exec -ti mailServ setup" + snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact1@kaz.milxc toto" + snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact2@kaz.milxc toto" + snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact3@kaz.milxc toto" + snster -c /root/snster-kaz -t /root/templates attach kaz-prod -x "${SETUP_MAIL} email add contact4@kaz.milxc toto" - # clear apt cache - DEBIAN_FRONTEND=noninteractive apt-get autoremove -y - DEBIAN_FRONTEND=noninteractive apt-get clean echo "########## ********** End Vagrant $(date +%D-%T)" ) > >(tee ${DebugLog}stdout.log) 2> >(tee ${DebugLog}stderr.log >&2) diff --git a/files/snster-kaz/isp-a/home/clawsmail/addclawsuser.sh b/files/snster-kaz/isp-a/home/clawsmail/addclawsuser.sh index eb57c71..c22d52b 100644 --- a/files/snster-kaz/isp-a/home/clawsmail/addclawsuser.sh +++ b/files/snster-kaz/isp-a/home/clawsmail/addclawsuser.sh @@ -9,8 +9,9 @@ cd `dirname $0` name=$1 domainname=$2 -password=$3 -number=$4 +login=$3 +password=$4 +number=$5 # cp -ar claws-mail ~/.claws-mail @@ -22,6 +23,7 @@ cat claws-mail/accountrc > /tmp/accountrc sed -i -e "s/\$name/$name/" /tmp/accountrc sed -i -e "s/\$domainname/$domainname/" /tmp/accountrc sed -i -e "s/\$number/$number/" /tmp/accountrc +sed -i -e "s/\$login/$login/" /tmp/accountrc cat /tmp/accountrc >> ~/.claws-mail/accountrc if [ ! -f ~/.claws-mail/folderlist.xml ]; then @@ -32,6 +34,7 @@ cat claws-mail/folderlist.xml > /tmp/folderlist.xml sed -i -e "s/\$name/$name/" /tmp/folderlist.xml sed -i -e "s/\$domainname/$domainname/" /tmp/folderlist.xml sed -i -e "s/\$number/$number/" /tmp/folderlist.xml +sed -i -e "s/\$login/$login/" /tmp/folderlist.xml sed -i -e "s/<\/folderlist>//" ~/.claws-mail/folderlist.xml cat /tmp/folderlist.xml >> ~/.claws-mail/folderlist.xml echo "" >> ~/.claws-mail/folderlist.xml diff --git a/files/snster-kaz/isp-a/home/clawsmail/claws-mail/accountrc b/files/snster-kaz/isp-a/home/clawsmail/claws-mail/accountrc index 3d258d3..5a42331 100644 --- a/files/snster-kaz/isp-a/home/clawsmail/claws-mail/accountrc +++ b/files/snster-kaz/isp-a/home/clawsmail/claws-mail/accountrc @@ -15,7 +15,7 @@ use_mail_command=0 mail_command=/usr/sbin/sendmail -t -i use_nntp_auth=0 use_nntp_auth_onconnect=0 -user_id=$name@$domainname +user_id=$login use_apop_auth=0 remove_mail=1 message_leave_time=7 diff --git a/files/snster-kaz/isp-a/home/provision.sh b/files/snster-kaz/isp-a/home/provision.sh index 175a353..db931bb 100644 --- a/files/snster-kaz/isp-a/home/provision.sh +++ b/files/snster-kaz/isp-a/home/provision.sh @@ -13,10 +13,18 @@ chmod +x /clawsmail/genpasswd #client pour tester la messagerie DEBIAN_FRONTEND=noninteractive apt-get install -y claws-mail +# On configure les comptes mail if [ -f /clawsmail/addclawsuser.sh ]; then - su debian /clawsmail/addclawsuser.sh contact1 kaz.milxc toto 1 - su debian /clawsmail/addclawsuser.sh contact2 kaz.milxc toto 2 - su debian /clawsmail/addclawsuser.sh contact3 kaz.milxc toto 3 - su debian /clawsmail/addclawsuser.sh contact4 kaz.milxc toto 4 - su debian /clawsmail/addclawsuser.sh email isp-a.milxc email 4 + su debian /clawsmail/addclawsuser.sh contact1 kaz.milxc contact1@kaz.milxc toto 1 + su debian /clawsmail/addclawsuser.sh contact2 kaz.milxc contact2@kaz.milxc toto 2 + su debian /clawsmail/addclawsuser.sh contact3 kaz.milxc contact3@kaz.milxc toto 3 + su debian /clawsmail/addclawsuser.sh contact4 kaz.milxc contact4@kaz.milxc toto 4 + su debian /clawsmail/addclawsuser.sh email isp-a.milxc email email 5 +fi + +# On place les certifs +if [ -d letsencrypt ]; then + cp -ar letsencrypt /etc/ + cp /etc/letsencrypt/local/rootCA.pem /usr/local/share/ca-certificates/rootCA.crt + /usr/sbin/update-ca-certificates --fresh fi diff --git a/files/snster-kaz/kaz/prod/dns.conf b/files/snster-kaz/kaz/prod/dns.conf index 219fcaa..c8ee9e0 100644 --- a/files/snster-kaz/kaz/prod/dns.conf +++ b/files/snster-kaz/kaz/prod/dns.conf @@ -9,12 +9,21 @@ $ORIGIN kaz.milxc. ) IN NS ns.kaz.milxc. IN MX 10 smtp.kaz.milxc. + IN A 100.80.0.2 ns IN A 100.80.0.2 dmz IN A 100.80.0.2 smtp IN CNAME dmz imap IN CNAME dmz www IN CNAME dmz mail IN CNAME dmz +cloud IN CNAME dmz +tableur IN CNAME dmz +webmail IN CNAME dmz +garradin IN CNAME dmz +wiki IN CNAME dmz +git IN CNAME dmz +office IN CNAME dmz +depot IN CNAME dmz listes IN MX 10 listes listes IN A 100.80.1.2 firewall IN A 100.80.0.1 diff --git a/files/snster-kaz/kaz/prod/kaz/config/container-withoutMail.list b/files/snster-kaz/kaz/prod/kaz/config/container-withoutMail.list index 7d87ccc..d1d47cd 100644 --- a/files/snster-kaz/kaz/prod/kaz/config/container-withoutMail.list +++ b/files/snster-kaz/kaz/prod/kaz/config/container-withoutMail.list @@ -3,7 +3,7 @@ jirafeau ethercalc collabora ethercalc -etherpad +#etherpad ldap quotas web diff --git a/files/snster-kaz/kaz/prod/kaz/config/dockers.env b/files/snster-kaz/kaz/prod/kaz/config/dockers.env index 9321c7d..05b2b08 100644 --- a/files/snster-kaz/kaz/prod/kaz/config/dockers.env +++ b/files/snster-kaz/kaz/prod/kaz/config/dockers.env @@ -4,7 +4,7 @@ ####################################### # prod / dev / local -mode=prod +mode=local ######################################## # choix du domaine diff --git a/files/snster-kaz/kaz/prod/provision.sh b/files/snster-kaz/kaz/prod/provision.sh index 5c8f7a5..1571817 100644 --- a/files/snster-kaz/kaz/prod/provision.sh +++ b/files/snster-kaz/kaz/prod/provision.sh @@ -44,17 +44,25 @@ EOF fi -# On met le KAZGUARD pour la mise au point -echo "export KAZGUARD='true'" >> /root/.bashrc +# On met le GUARD pour la mise au point +echo "export SNSTERGUARD='true'" >> /root/.bashrc # On active fuse-overlayfs pour docker cat >> /etc/docker/daemon.json <> /etc/rc.local +chmod +x /etc/rc.local -./kaz.sh +# On place les certifs +if [ -d letsencrypt ]; then + cp -ar letsencrypt /etc/ + cp /etc/letsencrypt/local/rootCA.pem /usr/local/share/ca-certificates/rootCA.crt + /usr/sbin/update-ca-certificates --fresh +fi + +# ./kaz.sh # clear apt cache DEBIAN_FRONTEND=noninteractive apt-get autoremove -y