mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
http-upload only available on maindomain (for the moment).
This commit is contained in:
parent
1f09abfa51
commit
ada95f8fca
2 changed files with 16 additions and 12 deletions
|
@ -42,16 +42,18 @@ do_post_regen() {
|
||||||
regen_conf_files=$1
|
regen_conf_files=$1
|
||||||
|
|
||||||
# retrieve variables
|
# retrieve variables
|
||||||
|
main_domain=$(cat /etc/yunohost/current_host)
|
||||||
domain_list=$(yunohost domain list --output-as plain --quiet)
|
domain_list=$(yunohost domain list --output-as plain --quiet)
|
||||||
|
|
||||||
# create metronome directories for domains
|
# create metronome directories for domains
|
||||||
for domain in $domain_list; do
|
for domain in $domain_list; do
|
||||||
mkdir -p "/var/lib/metronome/${domain//./%2e}/pep"
|
mkdir -p "/var/lib/metronome/${domain//./%2e}/pep"
|
||||||
# http_upload directory must be writable by metronome and readable by nginx
|
|
||||||
mkdir -p "/var/xmpp-upload/${domain}/upload"
|
|
||||||
chmod g+s "/var/xmpp-upload/${domain}/upload"
|
|
||||||
chown -R metronome:www-data "/var/xmpp-upload/${domain}"
|
|
||||||
done
|
done
|
||||||
|
# http_upload directory must be writable by metronome and readable by nginx
|
||||||
|
mkdir -p "/var/xmpp-upload/${main_domain}/upload"
|
||||||
|
chmod g+s "/var/xmpp-upload/${main_domain}/upload"
|
||||||
|
chown -R metronome:www-data "/var/xmpp-upload/${main_domain}"
|
||||||
|
|
||||||
|
|
||||||
# fix some permissions
|
# fix some permissions
|
||||||
chown -R metronome: /var/lib/metronome/
|
chown -R metronome: /var/lib/metronome/
|
||||||
|
|
|
@ -43,6 +43,7 @@ from yunohost.utils.network import get_public_ip
|
||||||
|
|
||||||
from moulinette import m18n
|
from moulinette import m18n
|
||||||
from yunohost.app import app_ssowatconf
|
from yunohost.app import app_ssowatconf
|
||||||
|
from yunohost.domain import _get_maindomain
|
||||||
from yunohost.service import _run_service_command
|
from yunohost.service import _run_service_command
|
||||||
from yunohost.regenconf import regen_conf
|
from yunohost.regenconf import regen_conf
|
||||||
from yunohost.log import OperationLogger
|
from yunohost.log import OperationLogger
|
||||||
|
@ -639,14 +640,15 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder):
|
||||||
# Set the domain
|
# Set the domain
|
||||||
csr.get_subject().CN = domain
|
csr.get_subject().CN = domain
|
||||||
|
|
||||||
# Include xmpp-upload subdomain in subject alternate names
|
if domain == _get_maindomain():
|
||||||
subdomain="xmpp-upload." + domain
|
# Include xmpp-upload subdomain in subject alternate names
|
||||||
try:
|
subdomain="xmpp-upload." + domain
|
||||||
_check_domain_is_ready_for_ACME(subdomain)
|
try:
|
||||||
logger.info("Subdmain {} is ready for ACME and will be included in the certificate.".format(subdomain))
|
_check_domain_is_ready_for_ACME(subdomain)
|
||||||
csr.add_extensions([crypto.X509Extension("subjectAltName", False, "DNS:" + subdomain)])
|
logger.info("Subdmain {} is ready for ACME and will be included in the certificate.".format(subdomain))
|
||||||
except YunohostError:
|
csr.add_extensions([crypto.X509Extension("subjectAltName", False, "DNS:" + subdomain)])
|
||||||
logger.warning(m18n.n('certmanager_warning_subdomain_dns_record', subdomain=subdomain, domain=domain))
|
except YunohostError:
|
||||||
|
logger.warning(m18n.n('certmanager_warning_subdomain_dns_record', subdomain=subdomain, domain=domain))
|
||||||
|
|
||||||
# Set the key
|
# Set the key
|
||||||
with open(key_file, 'rt') as f:
|
with open(key_file, 'rt') as f:
|
||||||
|
|
Loading…
Add table
Reference in a new issue