s/ssl_update_v4/tls_update_v4/g (and same for v6)
SSL is the old/outdated name. Since 1999, it's called TLS. Changed model field names. Added a schema migration to rename the DB columns. Note: the schema migration also adds/removes the index introduced in cs 32289ebb183907e8618ff251dd5846fd00fe9423
This commit is contained in:
parent
070a1445be
commit
f26ae31882
@ -0,0 +1,142 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from south.utils import datetime_utils as datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
# Renaming field 'Host.ssl_update_ipv6'
|
||||
db.rename_column(u'main_host', 'ssl_update_ipv6', 'tls_update_ipv6')
|
||||
|
||||
# Renaming field 'Host.ssl_update_ipv4'
|
||||
db.rename_column(u'main_host', 'ssl_update_ipv4', 'tls_update_ipv4')
|
||||
|
||||
# Adding index on 'Host', fields ['subdomain', 'domain']
|
||||
db.create_index(u'main_host', ['subdomain', 'domain_id'])
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
# Removing index on 'Host', fields ['subdomain', 'domain']
|
||||
db.delete_index(u'main_host', ['subdomain', 'domain_id'])
|
||||
|
||||
# Renaming field 'Host.tls_update_ipv4'
|
||||
db.rename_column(u'main_host', 'tls_update_ipv4', 'ssl_update_ipv4')
|
||||
|
||||
# Renaming field 'Host.tls_update_ipv6'
|
||||
db.rename_column(u'main_host', 'tls_update_ipv6', 'ssl_update_ipv6')
|
||||
|
||||
|
||||
models = {
|
||||
u'auth.group': {
|
||||
'Meta': {'object_name': 'Group'},
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
|
||||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
|
||||
},
|
||||
u'auth.permission': {
|
||||
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
|
||||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
|
||||
},
|
||||
u'auth.user': {
|
||||
'Meta': {'object_name': 'User'},
|
||||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
|
||||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
|
||||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
|
||||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
|
||||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
|
||||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
|
||||
},
|
||||
u'contenttypes.contenttype': {
|
||||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
|
||||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
|
||||
},
|
||||
u'main.blacklisteddomain': {
|
||||
'Meta': {'object_name': 'BlacklistedDomain'},
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'blacklisted_domains'", 'to': u"orm['auth.User']"}),
|
||||
'domain': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_update': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
|
||||
},
|
||||
u'main.domain': {
|
||||
'Meta': {'object_name': 'Domain'},
|
||||
'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'comment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'domains'", 'to': u"orm['auth.User']"}),
|
||||
'domain': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_update': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
|
||||
'nameserver_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}),
|
||||
'nameserver_update_algorithm': ('django.db.models.fields.CharField', [], {'default': "'HMAC_SHA512'", 'max_length': '16'}),
|
||||
'nameserver_update_secret': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '88'}),
|
||||
'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
|
||||
},
|
||||
u'main.host': {
|
||||
'Meta': {'unique_together': "(('subdomain', 'domain'),)", 'object_name': 'Host', 'index_together': "(('subdomain', 'domain'),)"},
|
||||
'abuse': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'abuse_blocked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'client_faults': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
|
||||
'comment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'hosts'", 'to': u"orm['auth.User']"}),
|
||||
'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['main.Domain']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_update': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
|
||||
'last_update_ipv4': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'last_update_ipv6': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
|
||||
'server_faults': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
|
||||
'subdomain': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'tls_update_ipv4': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'tls_update_ipv6': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'update_secret': ('django.db.models.fields.CharField', [], {'max_length': '64'})
|
||||
},
|
||||
u'main.serviceupdater': {
|
||||
'Meta': {'object_name': 'ServiceUpdater'},
|
||||
'accept_ipv4': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'accept_ipv6': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'comment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'serviceupdater'", 'to': u"orm['auth.User']"}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_update': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
|
||||
'path': ('django.db.models.fields.CharField', [], {'default': "'/nic/update'", 'max_length': '255'}),
|
||||
'secure': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
|
||||
'server': ('django.db.models.fields.CharField', [], {'max_length': '255'})
|
||||
},
|
||||
u'main.serviceupdaterhostconfig': {
|
||||
'Meta': {'object_name': 'ServiceUpdaterHostConfig'},
|
||||
'comment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
|
||||
'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'serviceupdaterhostconfigs'", 'to': u"orm['auth.User']"}),
|
||||
'give_ipv4': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'give_ipv6': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
|
||||
'host': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'serviceupdaterhostconfigs'", 'to': u"orm['main.Host']"}),
|
||||
'hostname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
|
||||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'last_update': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
|
||||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'password': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
|
||||
'service': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['main.ServiceUpdater']"})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['main']
|
@ -165,8 +165,8 @@ class Host(models.Model):
|
||||
last_update_ipv4 = models.DateTimeField(blank=True, null=True)
|
||||
last_update_ipv6 = models.DateTimeField(blank=True, null=True)
|
||||
# how we received the last update for v4/v6 addr
|
||||
ssl_update_ipv4 = models.BooleanField(default=False)
|
||||
ssl_update_ipv6 = models.BooleanField(default=False)
|
||||
tls_update_ipv4 = models.BooleanField(default=False)
|
||||
tls_update_ipv6 = models.BooleanField(default=False)
|
||||
|
||||
last_update = models.DateTimeField(auto_now=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
@ -217,10 +217,10 @@ class Host(models.Model):
|
||||
def poke(self, kind, secure):
|
||||
if kind == 'ipv4':
|
||||
self.last_update_ipv4 = now()
|
||||
self.ssl_update_ipv4 = secure
|
||||
self.tls_update_ipv4 = secure
|
||||
else:
|
||||
self.last_update_ipv6 = now()
|
||||
self.ssl_update_ipv6 = secure
|
||||
self.tls_update_ipv6 = secure
|
||||
self.save()
|
||||
|
||||
def register_client_fault(self, increment=1):
|
||||
|
@ -33,7 +33,7 @@
|
||||
<br>
|
||||
{% if host.last_update_ipv4 %}
|
||||
({{ host.last_update_ipv4|timesince }},
|
||||
{% if not host.ssl_update_ipv4 %}
|
||||
{% if not host.tls_update_ipv4 %}
|
||||
<span class="label label-warning">no {% else %}
|
||||
<span class="label label-success">{% endif %}TLS</span>)
|
||||
{% else %}
|
||||
@ -44,7 +44,7 @@
|
||||
<br>
|
||||
{% if host.last_update_ipv6 %}
|
||||
({{ host.last_update_ipv6|timesince }},
|
||||
{% if not host.ssl_update_ipv6 %}
|
||||
{% if not host.tls_update_ipv6 %}
|
||||
<span class="label label-warning">no {% else %}
|
||||
<span class="label label-success">{% endif %}TLS</span>)
|
||||
{% else %}
|
||||
|
@ -22,13 +22,13 @@
|
||||
<dt>Unavailable / Abuse / Abuse-Blocked:</dt>
|
||||
<dd>{{ hosts_unavailable }} / {{ hosts_abuse }} / {{ hosts_abuse_blocked }}</dd>
|
||||
<dt>ip v4 (tls) / v6 (tls) updated last 2d:</dt>
|
||||
<dd>{{ hosts_ipv4_2d }} ({{ hosts_ipv4_ssl_2d }}) / {{ hosts_ipv6_2d }} ({{ hosts_ipv6_ssl_2d }})</dd>
|
||||
<dd>{{ hosts_ipv4_2d }} ({{ hosts_ipv4_tls_2d }}) / {{ hosts_ipv6_2d }} ({{ hosts_ipv6_tls_2d }})</dd>
|
||||
<dt>ip v4 (tls) / v6 (tls) updated last 2w:</dt>
|
||||
<dd>{{ hosts_ipv4_2w }} ({{ hosts_ipv4_ssl_2w }}) / {{ hosts_ipv6_2w }} ({{ hosts_ipv6_ssl_2w }})</dd>
|
||||
<dd>{{ hosts_ipv4_2w }} ({{ hosts_ipv4_tls_2w }}) / {{ hosts_ipv6_2w }} ({{ hosts_ipv6_tls_2w }})</dd>
|
||||
<dt>ip v4 (tls) / v6 (tls) updated last 2m:</dt>
|
||||
<dd>{{ hosts_ipv4_2m }} ({{ hosts_ipv4_ssl_2m }}) / {{ hosts_ipv6_2m }} ({{ hosts_ipv6_ssl_2m }})</dd>
|
||||
<dd>{{ hosts_ipv4_2m }} ({{ hosts_ipv4_tls_2m }}) / {{ hosts_ipv6_2m }} ({{ hosts_ipv6_tls_2m }})</dd>
|
||||
<dt>ip v4 (tls) / v6 (tls) updated last 2y:</dt>
|
||||
<dd>{{ hosts_ipv4_2y }} ({{ hosts_ipv4_ssl_2y }}) / {{ hosts_ipv6_2y }} ({{ hosts_ipv6_ssl_2y }})</dd>
|
||||
<dd>{{ hosts_ipv4_2y }} ({{ hosts_ipv4_tls_2y }}) / {{ hosts_ipv6_2y }} ({{ hosts_ipv6_tls_2y }})</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
@ -123,20 +123,20 @@ class StatusView(TemplateView):
|
||||
before_2y = t_now - timedelta(days=730)
|
||||
context['hosts_ipv4_2d'] = Host.objects.filter(last_update_ipv4__gt=before_2d).count()
|
||||
context['hosts_ipv6_2d'] = Host.objects.filter(last_update_ipv6__gt=before_2d).count()
|
||||
context['hosts_ipv4_ssl_2d'] = Host.objects.filter(last_update_ipv4__gt=before_2d, ssl_update_ipv4=True).count()
|
||||
context['hosts_ipv6_ssl_2d'] = Host.objects.filter(last_update_ipv6__gt=before_2d, ssl_update_ipv6=True).count()
|
||||
context['hosts_ipv4_tls_2d'] = Host.objects.filter(last_update_ipv4__gt=before_2d, tls_update_ipv4=True).count()
|
||||
context['hosts_ipv6_tls_2d'] = Host.objects.filter(last_update_ipv6__gt=before_2d, tls_update_ipv6=True).count()
|
||||
context['hosts_ipv4_2w'] = Host.objects.filter(last_update_ipv4__gt=before_2w).count()
|
||||
context['hosts_ipv6_2w'] = Host.objects.filter(last_update_ipv6__gt=before_2w).count()
|
||||
context['hosts_ipv4_ssl_2w'] = Host.objects.filter(last_update_ipv4__gt=before_2w, ssl_update_ipv4=True).count()
|
||||
context['hosts_ipv6_ssl_2w'] = Host.objects.filter(last_update_ipv6__gt=before_2w, ssl_update_ipv6=True).count()
|
||||
context['hosts_ipv4_tls_2w'] = Host.objects.filter(last_update_ipv4__gt=before_2w, tls_update_ipv4=True).count()
|
||||
context['hosts_ipv6_tls_2w'] = Host.objects.filter(last_update_ipv6__gt=before_2w, tls_update_ipv6=True).count()
|
||||
context['hosts_ipv4_2m'] = Host.objects.filter(last_update_ipv4__gt=before_2m).count()
|
||||
context['hosts_ipv6_2m'] = Host.objects.filter(last_update_ipv6__gt=before_2m).count()
|
||||
context['hosts_ipv4_ssl_2m'] = Host.objects.filter(last_update_ipv4__gt=before_2m, ssl_update_ipv4=True).count()
|
||||
context['hosts_ipv6_ssl_2m'] = Host.objects.filter(last_update_ipv6__gt=before_2m, ssl_update_ipv6=True).count()
|
||||
context['hosts_ipv4_tls_2m'] = Host.objects.filter(last_update_ipv4__gt=before_2m, tls_update_ipv4=True).count()
|
||||
context['hosts_ipv6_tls_2m'] = Host.objects.filter(last_update_ipv6__gt=before_2m, tls_update_ipv6=True).count()
|
||||
context['hosts_ipv4_2y'] = Host.objects.filter(last_update_ipv4__gt=before_2y).count()
|
||||
context['hosts_ipv6_2y'] = Host.objects.filter(last_update_ipv6__gt=before_2y).count()
|
||||
context['hosts_ipv4_ssl_2y'] = Host.objects.filter(last_update_ipv4__gt=before_2y, ssl_update_ipv4=True).count()
|
||||
context['hosts_ipv6_ssl_2y'] = Host.objects.filter(last_update_ipv6__gt=before_2y, ssl_update_ipv6=True).count()
|
||||
context['hosts_ipv4_tls_2y'] = Host.objects.filter(last_update_ipv4__gt=before_2y, tls_update_ipv4=True).count()
|
||||
context['hosts_ipv6_tls_2y'] = Host.objects.filter(last_update_ipv6__gt=before_2y, tls_update_ipv6=True).count()
|
||||
user_model = get_user_model()
|
||||
context['users_total'] = user_model.objects.count()
|
||||
context['users_active'] = user_model.objects.filter(is_active=True).count()
|
||||
|
Loading…
x
Reference in New Issue
Block a user