ddavness / power-mailinabox

A Mail-in-a-Box with extra capabilities and more customizability. Not just for power users!
Creative Commons Zero v1.0 Universal
172 stars 32 forks source link

LXC Container support #53

Open nameduser0 opened 2 years ago

nameduser0 commented 2 years ago

LXC Container support with a few other fixes:

Needs more testing on existing installs - mine's fresh

nameduser0 commented 2 years ago

Okay I'll try to make this more generic and look into autodetection.

Never used docker sorry.

I figured if they were running in a container they're more likely to be a power user anyway.

The bug is described in the commit. Basically if you have a zone domain.com and a domain domain.com and your miab box is called miab.domain.com, the logic means the miab host name will be overwritten in the else clause due to the domain sort order and there being no leading dot in domain.com.

nameduser0 commented 2 years ago

Ran into a problem with docker due to this error:

Updating system packages... Installing system packages... rm: cannot remove '/etc/resolv.conf': Device or resource busy

Described here: https://stackoverflow.com/questions/60549775/device-or-resource-busy-when-i-try-move-etc-resolv-conf-in-ubuntu18-04-how

We're probably 90% of the way there though

nameduser0 commented 2 years ago

I think this is worth another look now and a test if possible. A few additional tweaks:

nameduser0 commented 2 years ago

Have changed the System status checks to look like this. If the service is running it's a warning, only if it isn't running at all is it an error. The first line is only displayed for an LXC container:

System

? The following checks try to connect to each service on your public IP, which may not work on your platform type. ✖ Public DNS (nsd4) is not running (port 53). ? Incoming Mail (SMTP/postfix) is running but is not publicly accessible at PUBLIC_IP:25. ? Outgoing Mail (SMTP 465/postfix) is running but is not publicly accessible at PUBLIC_IP:465. ? Outgoing Mail (SMTP 587/postfix) is running but is not publicly accessible at PUBLIC_IP:587. ? IMAPS (dovecot) is running but is not publicly accessible at PUBLIC_IP:993. ? Mail Filters (Sieve/dovecot) is running but is not publicly accessible at PUBLIC_IP:4190. ? HTTP Web (nginx) is running but is not publicly accessible at PUBLIC_IP:80. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful ? HTTPS Web (nginx) is running but is not publicly accessible at PUBLIC_IP:8443. ✓ SSH disallows password-based login. ✓ System software is up to date.

casesolved-co-uk commented 2 years ago

Any news on this? (I changed my account btw)

casesolved-co-uk commented 2 years ago

There are still a few broken admin page links if the HTTPS port number is changed from 443. I'll fix if you're going to merge.

casesolved-co-uk commented 1 year ago

@ddavness I've rebased onto your latest changes. Are there any more issues with this?

ddavness commented 1 year ago

I'll review this later - as you can understand this is quite a bit of a change, so I'll take a further deep dive on it when I have a proper chunk of time :)