commit 0c631febfac8bed986f85ee66dd9a4dee216c521 from: Izzy Blacklock date: Thu Sep 07 21:40:52 2023 UTC Initial work on a script to create user and shellname accounts commit - 810af9f68d10dfa736b504f9fe0ffbe9903aa313 commit + 0c631febfac8bed986f85ee66dd9a4dee216c521 blob - /dev/null blob + c16eb33aecf822e6972947862da982ad25fd136a (mode 755) --- /dev/null +++ bin/configNow.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +use strict; +use warnings; + + + +my $ipv4 = '38.87.162.191'; +my $ipv6 = '2602:fccf:1:1191::'; +my $domain = 'user.planetofnix.com'; + +my $shellname = shift; +my $username = shift; +my $password = shift; + + +my $shell = { + mail_domains => qq{$shellname.$domain\n}, + mail_mailname_config => qq{$shellname.$domain\n}, + dns => qq{ +$shellname 3600 IN A $ipv4 + 3600 IN AAAA $ipv6 + 3600 IN MX 10 mail +imap.$shellname 3600 IN CNAME imap +pop.$shellname 3600 IN CNAME pop +pop3.$shellname 3600 IN CNAME pop3 +smtp.$shellname 3600 IN CNAME smtp +mail.$shellname 3600 IN CNAME mail +_xmpp-client._tcp.$shellname 3600 IN SRV 0 5 5222 xmpp +_xmpp-server._tcp.$shellname 3600 IN SRV 0 5 5269 xmpp +}, + acme_client => qq{ +domain $shellname.$domain { + domain key "/etc/ssl/private/$shellname.$domain.key" + domain full chain certificate "/etc/ssl/$shellname.$domain.fullchain.pem" + sign with letsencrypt +} +}, + prosody_config => qq{ +VirtualHost "$shellname.$domain" +ssl = { + certificate = "/etc/prosody/certs/$shellname.$domain.fullchain.pem"; + key = "/etc/prosody/certs/$shellname.$domain.key"; +} +}, +}; + +my $user = { + mail_Virtual => qq{$username\@$shellname.$domain vmail}, + mail_user => qq{$username\@$shellname.$domain: $username\@$shellname.$domain}, + mail_passwd => "$username\@$shellname.$domain:$password"."::::::userdb_quota_rule=*:storage=1G", +}; + +use Data::Dumper; +print Dumper($shell); +print Dumper($user); +