diff --git a/TODO.md b/TODO.md index 18409b83..c7d5a89e 100644 --- a/TODO.md +++ b/TODO.md @@ -188,3 +188,19 @@ Multi-tenant WebApps * username maximum as group user in UNIX * forms autocomplete="off", doesn't work in chrome + + + +ln -s /proc/self/fd /dev/fd + + +* http-https/https-only/http-only + + +POST INSTALL +------------ + +* Generate a password-less ssh key, and copy it to the servers you want to orchestrate. +ssh-keygen +ssh-copy-id root@ + diff --git a/orchestra/apps/domains/models.py b/orchestra/apps/domains/models.py index da164077..6d71592b 100644 --- a/orchestra/apps/domains/models.py +++ b/orchestra/apps/domains/models.py @@ -50,6 +50,26 @@ class Domain(models.Model): def subdomains(self): return Domain.objects.filter(name__regex='\.%s$' % self.name) + def clean(self): + self.name = self.name.lower() + + def save(self, *args, **kwargs): + """ create top relation """ + update = False + if not self.pk: + top = self.get_top() + if top: + self.top = top + self.account_id = self.account_id or top.account_id + else: + update = True + super(Domain, self).save(*args, **kwargs) + if update: + for domain in self.subdomains.exclude(pk=self.pk): + # queryset.update() is not used because we want to trigger backend to delete ex-topdomains + domain.top = self + domain.save(update_fields=['top']) + def get_description(self): if self.is_top: num = self.subdomains.count() @@ -167,23 +187,6 @@ class Domain(models.Model): value=record.value ) return result - - def save(self, *args, **kwargs): - """ create top relation """ - update = False - if not self.pk: - top = self.get_top() - if top: - self.top = top - self.account_id = self.account_id or top.account_id - else: - update = True - super(Domain, self).save(*args, **kwargs) - if update: - for domain in self.subdomains.exclude(pk=self.pk): - # queryset.update() is not used because we want to trigger backend to delete ex-topdomains - domain.top = self - domain.save(update_fields=['top']) class Record(models.Model): diff --git a/orchestra/management/commands/setupnginx.py b/orchestra/management/commands/setupnginx.py index 811b0b82..6c15a0e2 100644 --- a/orchestra/management/commands/setupnginx.py +++ b/orchestra/management/commands/setupnginx.py @@ -46,7 +46,7 @@ class Command(BaseCommand): 'server {\n' ' listen 80;\n' ' listen [::]:80 ipv6only=on;\n' - ' rewrite ^/$ /admin;\n' + ' rewrite ^/$ /admin/;\n' ' client_max_body_size 500m;\n' ' location / {\n' ' uwsgi_pass unix:///var/run/uwsgi/app/%(project_name)s/socket;\n'