I am following Setting Up Nextcloud with Docker, Portainer, Cloudflare Tunnel, and Uptime Kuma on a Raspberry Pi (No Port Forwarding Needed)
A prerequisite for fail2ban and since I would like email notifications, but haven’t installed or configured sendmail. How to proceed? I already have potainer installed and fail2ban is active.
you need to check out nextcloud_hardening/etc at main - hhf/nextcloud_hardening - HHF Technology Repository
it has all the config files related to fail2ban with nextcloud. fail2ban is not docker based.
for email
you can use postfix config
Replace the domains and necessary paths:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ihre.domain.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, ihre.hhf.technology, localhost.hhf.technology, localhost
relayhost = smtp.mailserver.de:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
#If you have problems with IPv6, change the line as follows.
#inet_protocols = ipv4
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_use_tls = yes
smtp_enforce_tls = yes
1 Like
if you need dedicate VM setup. i will write later-on
Thanks. I will try to adapt your tutorial and get back to you if I have any issues.
I’m sure there are plenty of other things to occupy your time than writing a dedicated tutorial.
Michael
hope this helps on your journey.