From 7fffe801b03d3026f341a856ce0a20d532c84ca6 Mon Sep 17 00:00:00 2001 From: Alex Tavarez Date: Wed, 23 Jul 2025 15:41:01 -0400 Subject: [PATCH] Added templates to have their variables set through bootstrap role's vars' options directory files --- .../templates/certbot/porkbun.ini.j2 | 2 + .../templates/proftpd/proftpd.conf.j2 | 93 +++++++++++++++++++ .../bootstrap/templates/proftpd/vhost.conf.j2 | 31 +++++++ 3 files changed, 126 insertions(+) create mode 100644 roles/bootstrap/templates/certbot/porkbun.ini.j2 create mode 100644 roles/bootstrap/templates/proftpd/proftpd.conf.j2 create mode 100644 roles/bootstrap/templates/proftpd/vhost.conf.j2 diff --git a/roles/bootstrap/templates/certbot/porkbun.ini.j2 b/roles/bootstrap/templates/certbot/porkbun.ini.j2 new file mode 100644 index 0000000..3f44ebb --- /dev/null +++ b/roles/bootstrap/templates/certbot/porkbun.ini.j2 @@ -0,0 +1,2 @@ +dns_porkbun_secret={{ dns_secret }} +dns_porkbun_key={{ dns_key }} \ No newline at end of file diff --git a/roles/bootstrap/templates/proftpd/proftpd.conf.j2 b/roles/bootstrap/templates/proftpd/proftpd.conf.j2 new file mode 100644 index 0000000..192c9c8 --- /dev/null +++ b/roles/bootstrap/templates/proftpd/proftpd.conf.j2 @@ -0,0 +1,93 @@ +ServerType standalone +ServerName ProFTPd +ServerAdmin ftp@sukaato +ServerIdent on "Currently on the fallback server..." +Protocols ftp +DefaultServer on +Port 21 + +User ftpd +Group nogroup + +TransferLog /var/log/proftpd/transfer.log +SystemLog /var/log/proftpd/proftpd.log + + + LoadModule mod_tls.c + + + + LoadModule mod_ifsession.c + + + + LoadModule mod_auth_file.c + + + + DenyAll + + + + AuthOrder mod_auth_file.c mod_auth_pam.c mod_auth_unix.c + RootLogin off + RequireValidShell off + UseFtpUsers off + PersistentPassword off + AllowEmptyPasswords off + DisplayConnect {{ welcome_msg_path }} + DisplayQuit {{ goodbye_msg_path }} + DisplayFileTransfer {{ transfer_msg_path }} + Umask {{ default_umask }} + MaxClients 35 + MaxClientsPerUser 5 + MaxLoginAttempts 4 + TimeoutSession 28800 + TimeoutNoTransfer 900 + TimeoutStalled 900 + TimeoutIdle 1200 + TimeoutLinger 120 + ListOptions "" maxdepth 3 + AllowOverwrite on + ShowSymlinks on + + + IdentLookups off + + + + QuotaEngine off + + + + Ratios off + + + + DelayEngine on + + + + DenyAll + + + + AllowUser OR {{ users_allowed }} + DenyAll + + + DirFakeUser on ~ + DirFakeGroup on ~ + + DefaultRoot ~ + + + HideFiles ^\. + + + IgnoreHidden on + + + + +Include /etc/proftpd/conf.d/*.conf \ No newline at end of file diff --git a/roles/bootstrap/templates/proftpd/vhost.conf.j2 b/roles/bootstrap/templates/proftpd/vhost.conf.j2 new file mode 100644 index 0000000..9907d4b --- /dev/null +++ b/roles/bootstrap/templates/proftpd/vhost.conf.j2 @@ -0,0 +1,31 @@ + + + ServerName {{ servername }} + ServerAdmin {{ admin_email }} + ServerAlias {{ serveralias }} + ServerIdent on "Welcome to %v!" + Protocols {{ ftp_protocols }} + Port {{ ftp_port }} + {# PassivePorts 49152 65534 #} + DisplayChdir .category.msg + DisplayLogin .welcome.msg + + TLSEngine on + TLSLog /var/log/proftpd/tls.log + TLSProtocol SSLv23 + TLSOptions AllowClientRenegotiations + TLSVerifyClient off + TLSRequired on + TLSRenegotiate required off + + TLSECCertificateFile {{ sec_cert_path }} + TLSCACertificateFile {{ sca_cert_path }} + TLSECCertificateKeyFile {{ key_cert_path }} + + + AuthUserFile {{ ftp_auth_user_path }} + AuthGroupFile {{ ftp_auth_group_path }} + AuthFileOptions SyntaxCheck + + + \ No newline at end of file