diff --git a/CHANGELOG.md b/CHANGELOG.md index 519d712c..4a2cdc27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,23 @@ In Development Mail: +* Updated to [Roundcube 1.3](https://roundcube.net/news/2017/06/26/roundcube-webmail-1.3.0-released), but unfortunately dropping the Vacation plugin because it has not been supported by its author and is not compatible with Roundcube 1.3. +* Updated to [Z-Push 2.3.7](http://download.z-push.org/final/2.3/z-push-2.3.7.txt). + +Nextcloud: + +* Nextcloud updated to 12.0.0. + +v0.23a (May 31, 2017) +--------------------- + +Corrects a problem in the new way third-party assets are downloaded during setup for the control panel, since v0.23. + +v0.23 (May 30, 2017) +-------------------- + +Mail: + * The default theme for Roundcube was changed to the nicer Larry theme. * Exchange/ActiveSync support has been replaced with z-push 2.3.6 from z-push.org (rather than z-push-contrib). @@ -19,7 +36,7 @@ Control Panel/Management: * Fix an error in the control panel showing rsync backup status. * Fix an error in the control panel related to IPv6 addresses. * TLS certificates for internationalized domain names can now be provisioned from Let's Encrypt automatically. -* Download management web assets (jQuery/Bootstrap) to the static web root directory. +* Third-party assets used in the control panel (jQuery/Bootstrap) are now downloaded during setup and served from the box rather than from a CDN. DNS: diff --git a/README.md b/README.md index 3dbfc32b..78c0394c 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ by me: $ curl -s https://keybase.io/joshdata/key.asc | gpg --import gpg: key C10BDD81: public key "Joshua Tauberer " imported - $ git verify-tag v0.22 + $ git verify-tag v0.23a gpg: Signature made ..... using RSA key ID C10BDD81 gpg: Good signature from "Joshua Tauberer " gpg: WARNING: This key is not certified with a trusted signature! @@ -72,7 +72,7 @@ and on my [personal homepage](https://razor.occams.info/). (Of course, if this r Checkout the tag corresponding to the most recent release: - $ git checkout v0.22 + $ git checkout v0.23a Begin the installation. diff --git a/conf/nginx-top.conf b/conf/nginx-top.conf index 6be9b414..a5822a82 100644 --- a/conf/nginx-top.conf +++ b/conf/nginx-top.conf @@ -7,6 +7,6 @@ ## your own --- please do not ask for help from us. upstream php-fpm { - server unix:/var/run/php5-fpm.sock; + server unix:/var/run/php/php7.0-fpm.sock; } diff --git a/management/dns_update.py b/management/dns_update.py index b3764f7f..76daa40b 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -12,6 +12,11 @@ import dns.resolver from mailconfig import get_mail_domains from utils import shell, load_env_vars_from_file, safe_domain_name, sort_domains +# From https://stackoverflow.com/questions/3026957/how-to-validate-a-domain-name-using-regex-php/16491074#16491074 +# Thanks to Onur Yıldırım +# This regular expression matches domain names according to RFCs, it also accepts fqdn with an leading dot +DOMAIN_RE = "^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}(\.?)$" + def get_dns_domains(env): # Add all domain names in use by email users and mail aliases and ensure # PRIMARY_HOSTNAME is in the list. @@ -144,7 +149,7 @@ def build_zone(domain, all_domains, additional_records, www_redirect_domains, en # Define ns2.PRIMARY_HOSTNAME or whatever the user overrides. # User may provide one or more additional nameservers secondary_ns_list = get_secondary_dns(additional_records, mode="NS") \ - or ["ns2." + env["PRIMARY_HOSTNAME"]] + or ["ns2." + env["PRIMARY_HOSTNAME"]] for secondary_ns in secondary_ns_list: records.append((None, "NS", secondary_ns+'.', False)) @@ -759,6 +764,9 @@ def set_custom_dns_record(qname, rtype, value, action, env): if qname != "_secondary_nameserver": raise ValueError("%s is not a domain name or a subdomain of a domain name managed by this box." % qname) + if not re.search(DOMAIN_RE, qname): + raise ValueError("Invalid name.") + # validate rtype rtype = rtype.upper() if value is not None and qname != "_secondary_nameserver": @@ -767,6 +775,16 @@ def set_custom_dns_record(qname, rtype, value, action, env): v = ipaddress.ip_address(value) # raises a ValueError if there's a problem if rtype == "A" and not isinstance(v, ipaddress.IPv4Address): raise ValueError("That's an IPv6 address.") if rtype == "AAAA" and not isinstance(v, ipaddress.IPv6Address): raise ValueError("That's an IPv4 address.") + elif rtype in ("CNAME", "NS"): + if rtype == "NS" and qname == zone: + raise ValueError("NS records can only be set for subdomains.") + + # ensure value has a trailing dot + if not value.endswith("."): + value = value + "." + + if not re.search(DOMAIN_RE, value): + raise ValueError("Invalid value.") elif rtype in ("CNAME", "TXT", "SRV", "MX", "SSHFP", "CAA"): # anything goes pass diff --git a/management/status_checks.py b/management/status_checks.py index 42fc876a..3ee1c124 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -640,7 +640,7 @@ def check_web_domain(domain, rounded_time, ssl_certificates, env, output): for (rtype, expected) in (("A", env['PUBLIC_IP']), ("AAAA", env.get('PUBLIC_IPV6'))): if not expected: continue # IPv6 is not configured value = query_dns(domain, rtype) - if value == expected: + if normalize_ip(value) == normalize_ip(expected): ok_values.append(value) else: output.print_error("""This domain should resolve to your box's IP address (%s %s) if you would like the box to serve diff --git a/management/templates/custom-dns.html b/management/templates/custom-dns.html index ac530cd2..bd51d151 100644 --- a/management/templates/custom-dns.html +++ b/management/templates/custom-dns.html @@ -39,6 +39,7 @@ + @@ -126,7 +127,7 @@ email The email address of any administrative user here. password That user’s password. qname The fully qualified domain name for the record you are trying to set. It must be one of the domain names or a subdomain of one of the domain names hosted on this box. (Add mail users or aliases to add new domains.) -rtype The resource type. Defaults to A if omitted. Possible values: A (an IPv4 address), AAAA (an IPv6 address), TXT (a text string), CNAME (an alias, which is a fully qualified domain name — don’t forget the final period), MX, SRV, SSHFP or CAA. +rtype The resource type. Defaults to A if omitted. Possible values: A (an IPv4 address), AAAA (an IPv6 address), TXT (a text string), CNAME (an alias, which is a fully qualified domain name — don’t forget the final period), MX, SRV, SSHFP, CAA or NS. value For PUT, POST, and DELETE, the record’s value. If the rtype is A or AAAA and value is empty or omitted, the IPv4 or IPv6 address of the remote host is used (be sure to use the -4 or -6 options to curl). This is handy for dynamic DNS! diff --git a/management/templates/index.html b/management/templates/index.html index 29d1f74a..33ba47a2 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -9,7 +9,7 @@ - + - + @@ -192,7 +192,7 @@ - +