Commit d3cded80 by Guba Sándor

Merge branch 'master' of giccero.cloud.ik.bme.hu:cloud

parents 0c6bca57 915ec04b
......@@ -37,3 +37,5 @@ nosetests.xml
# Other
*.swp
*~
local_settings.py
# Django settings for cloud project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Ory, Mate', 'maat@iit.bme.hu'),
('IK', 'cloud@iit.bme.hu'),
)
MANAGERS = ADMINS
......@@ -113,12 +114,9 @@ INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'one',
'school',
......@@ -128,7 +126,6 @@ INSTALLED_APPS = (
'south',
'djcelery',
'kombu.transport.django',
#'django_bfm',
)
# A sample logging configuration. The only tangible logging
......@@ -178,5 +175,9 @@ import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'
try:
from cloud.local_settings import *
except:
pass
# vim: et sw=4 ai fenc=utf8 smarttab :
from django.contrib import admin
from firewall.models import *
from django import contrib
class AliasInline(contrib.admin.TabularInline):
model = Alias
class HostAdmin(admin.ModelAdmin):
list_display = ('hostname', 'vlan', 'ipv4', 'ipv6', 'pub_ipv4', 'mac', 'shared_ip', 'owner', 'groups_l', 'rules_l', 'description')
ordering = ('hostname',)
list_display = ('hostname', 'vlan', 'ipv4', 'ipv6', 'pub_ipv4', 'mac', 'shared_ip', 'owner', 'groups_l', 'rules_l', 'description', 'reverse')
ordering = ('hostname', )
list_filter = ('owner', 'vlan', 'groups')
search_fields = ('hostname', 'description', 'ipv4', 'ipv6', 'mac')
filter_horizontal = ('groups', 'rules',)
filter_horizontal = ('groups', 'rules', )
inlines = (AliasInline, )
class HostInline(contrib.admin.TabularInline):
model = Host
fields = ('hostname', 'ipv4', 'ipv6', 'pub_ipv4', 'mac', 'shared_ip', 'owner', 'reverse')
class VlanAdmin(admin.ModelAdmin):
list_display = ('vid', 'name', 'rules_l', 'ipv4', 'net_ipv4', 'ipv6', 'net_ipv6', 'description', 'domain', 'snat_ip', 'snat_to_l')
ordering = ('vid',)
ordering = ('vid', )
inlines = (HostInline, )
class RuleAdmin(admin.ModelAdmin):
list_display = ('r_type', 'color_desc', 'description', 'vlan_l', 'owner', 'extra', 'direction', 'accept', 'proto', 'sport', 'dport', 'nat', 'nat_dport')
list_filter = ('r_type', 'vlan', 'owner', 'direction', 'accept', 'proto', 'nat')
class AliasAdmin(admin.ModelAdmin):
list_display = ('alias', 'host')
class SettingAdmin(admin.ModelAdmin):
list_display = ('key', 'value')
admin.site.register(Host, HostAdmin)
admin.site.register(Vlan, VlanAdmin)
admin.site.register(Rule, RuleAdmin)
admin.site.register(Alias, AliasAdmin)
admin.site.register(Setting, SettingAdmin)
admin.site.register(Group)
admin.site.register(Firewall)
#!/usr/bin/env python
#from django.core.management import setup_environ
#from teszt import settings
#setup_environ(settings)
from django.contrib import auth
from firewall import models
from modeldict import *
import os
import subprocess
import re
DNS_SERVER = "152.66.243.60"
import json
class firewall:
......@@ -44,7 +38,7 @@ class firewall:
self.SZABALYOK_NAT.append(s)
def host2vlan(self, host, rule):
if(self.IPV6):
if(self.IPV6 and host.ipv6):
ipaddr = host.ipv6 + "/112"
else:
ipaddr = host.ipv4
......@@ -63,20 +57,20 @@ class firewall:
else:
action = "LOG_DROP"
if(rule.direction == '1'): #HOSTHOZ megy
self.iptables("-A %s_%s -d %s %s %s -g %s" % (vlan, host.vlan, ipaddr, dport_sport, rule.extra, action));
if(rule.direction == '1'): # HOSTHOZ megy
self.iptables("-A %s_%s -d %s %s %s -g %s" % (vlan, host.vlan, ipaddr, dport_sport, rule.extra, action))
else:
self.iptables("-A %s_%s -s %s %s %s -g %s" % (host.vlan, vlan, ipaddr, dport_sport, rule.extra, action));
self.iptables("-A %s_%s -s %s %s %s -g %s" % (host.vlan, vlan, ipaddr, dport_sport, rule.extra, action))
def fw2vlan(self, rule):
dport_sport = self.dportsport(rule)
for vlan in rule.vlan.all():
if(rule.direction == '1'): #HOSTHOZ megy
self.iptables("-A INPUT -i %s %s %s -g %s" % (vlan.interface, dport_sport, rule.extra, "LOG_ACC" if rule.accept else "LOG_DROP"));
if(rule.direction == '1'): # HOSTHOZ megy
self.iptables("-A INPUT -i %s %s %s -g %s" % (vlan.interface, dport_sport, rule.extra, "LOG_ACC" if rule.accept else "LOG_DROP"))
else:
self.iptables("-A OUTPUT -o %s %s %s -g %s" % (vlan.interface, dport_sport, rule.extra, "LOG_ACC" if rule.accept else "LOG_DROP"));
self.iptables("-A OUTPUT -o %s %s %s -g %s" % (vlan.interface, dport_sport, rule.extra, "LOG_ACC" if rule.accept else "LOG_DROP"))
def vlan2vlan(self, l_vlan, rule):
dport_sport = self.dportsport(rule)
......@@ -90,10 +84,10 @@ class firewall:
else:
action = "LOG_DROP"
if(rule.direction == '1'): #HOSTHOZ megy
self.iptables("-A %s_%s %s %s -g %s" % (vlan, l_vlan, dport_sport, rule.extra, action));
if(rule.direction == '1'): # HOSTHOZ megy
self.iptables("-A %s_%s %s %s -g %s" % (vlan, l_vlan, dport_sport, rule.extra, action))
else:
self.iptables("-A %s_%s %s %s -g %s" % (l_vlan, vlan, dport_sport, rule.extra, action));
self.iptables("-A %s_%s %s %s -g %s" % (l_vlan, vlan, dport_sport, rule.extra, action))
def prerun(self):
......@@ -102,9 +96,9 @@ class firewall:
self.iptables(":FORWARD DROP [0:0]")
self.iptables(":OUTPUT DROP [50:6936]")
#inicialize logging
# inicialize logging
self.iptables("-N LOG_DROP")
#windows port scan are silently dropped
# windows port scan are silently dropped
self.iptables("-A LOG_DROP -p tcp --dport 445 -j DROP")
self.iptables("-A LOG_DROP -p udp --dport 137 -j DROP")
self.iptables("-A LOG_DROP -j LOG --log-level 7 --log-prefix \"[ipt][drop]\"")
......@@ -114,8 +108,8 @@ class firewall:
self.iptables("-A LOG_ACC -j ACCEPT")
if not self.IPV6:
#The chain which test is a packet has a valid public destination IP
#(RFC-3330) packages passing this chain has valid destination IP addressed
# The chain which test is a packet has a valid public destination IP
# (RFC-3330) packages passing this chain has valid destination IP addressed
self.iptables("-N r_pub_dIP")
self.iptables("-A r_pub_dIP -d 0.0.0.0/8 -g LOG_DROP")
self.iptables("-A r_pub_dIP -d 169.254.0.0/16 -g LOG_DROP")
......@@ -123,10 +117,10 @@ class firewall:
self.iptables("-A r_pub_dIP -d 192.0.2.0/24 -g LOG_DROP")
self.iptables("-A r_pub_dIP -d 192.168.0.0/16 -g LOG_DROP")
self.iptables("-A r_pub_dIP -d 127.0.0.0/8 -g LOG_DROP")
#self.iptables("-A r_pub_dIP -d 10.0.0.0/8 -g LOG_DROP")
# self.iptables("-A r_pub_dIP -d 10.0.0.0/8 -g LOG_DROP")
#The chain which test is a packet has a valid public source IP
#(RFC-3330) packages passing this chain has valid destination IP addressed
# The chain which test is a packet has a valid public source IP
# (RFC-3330) packages passing this chain has valid destination IP addressed
self.iptables("-N r_pub_sIP")
self.iptables("-A r_pub_sIP -s 0.0.0.0/8 -g LOG_DROP")
self.iptables("-A r_pub_sIP -s 169.254.0.0/16 -g LOG_DROP")
......@@ -134,9 +128,9 @@ class firewall:
self.iptables("-A r_pub_sIP -s 192.0.2.0/24 -g LOG_DROP")
self.iptables("-A r_pub_sIP -s 192.168.0.0/16 -g LOG_DROP")
self.iptables("-A r_pub_sIP -s 127.0.0.0/8 -g LOG_DROP")
#self.iptables("-A r_pub_sIP -s 10.0.0.0/8 -g LOG_DROP")
# self.iptables("-A r_pub_sIP -s 10.0.0.0/8 -g LOG_DROP")
#chain which tests if the destination specified by the DMZ host is valid
# chain which tests if the destination specified by the DMZ host is valid
self.iptables("-N r_DMZ_dIP")
self.iptables("-A r_DMZ_dIP -d 10.2.0.0/16 -j RETURN")
self.iptables("-A r_DMZ_dIP -j r_pub_dIP")
......@@ -185,52 +179,52 @@ class firewall:
self.iptablesnat(":POSTROUTING ACCEPT [1:708]")
#portforward
# portforward
for host in self.hosts.exclude(pub_ipv4=None):
for rule in host.rules.filter(nat=True, direction='1'):
dport_sport = self.dportsport(rule, False)
if host.vlan.snat_ip:
self.iptablesnat("-A PREROUTING -d %s %s %s -j DNAT --to-destination %s:%s" % (host.pub_ipv4, dport_sport, rule.extra, host.ipv4, rule.nat_dport))
#sajat publikus ipvel rendelkezo gepek szabalyai
# sajat publikus ipvel rendelkezo gepek szabalyai
for host in self.hosts.exclude(shared_ip=True):
if(host.pub_ipv4):
self.iptablesnat("-A PREROUTING -d %s -j DNAT --to-destination %s" % (host.pub_ipv4, host.ipv4))
self.iptablesnat("-A POSTROUTING -s %s -j SNAT --to-source %s" % (host.ipv4, host.pub_ipv4))
#alapertelmezett nat szabalyok a vlanokra
# alapertelmezett nat szabalyok a vlanokra
for s_vlan in self.vlans:
if(s_vlan.snat_ip):
for d_vlan in s_vlan.snat_to.all():
self.iptablesnat("-A POSTROUTING -s %s -o %s -j SNAT --to-source %s" % (s_vlan.net_ipv4(), d_vlan.interface, s_vlan.snat_ip))
#bedrotozott szabalyok
self.iptablesnat("-A POSTROUTING -s 10.5.0.0/16 -o vlan0003 -j SNAT --to-source 10.3.255.254") #man elerheto legyen
self.iptablesnat("-A POSTROUTING -s 10.5.0.0/16 -o vlan0008 -j SNAT --to-source 10.0.0.247") #wolf halozat a nyomtatashoz
self.iptablesnat("-A POSTROUTING -s 10.3.0.0/16 -o vlan0002 -j SNAT --to-source %s" % self.pub.ipv4) #kulonben nemmegy a du
# bedrotozott szabalyok
self.iptablesnat("-A POSTROUTING -s 10.5.0.0/16 -o vlan0003 -j SNAT --to-source 10.3.255.254") # man elerheto legyen
self.iptablesnat("-A POSTROUTING -s 10.5.0.0/16 -o vlan0008 -j SNAT --to-source 10.0.0.247") # wolf halozat a nyomtatashoz
self.iptablesnat("-A POSTROUTING -s 10.3.0.0/16 -o vlan0002 -j SNAT --to-source %s" % self.pub.ipv4) # kulonben nemmegy a du
self.iptablesnat("COMMIT")
def ipt_filter(self):
regexp = re.compile('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
regexp_icmp = re.compile('icmp');
regexp_icmp = re.compile('icmp')
#futas elotti dolgok
# futas elotti dolgok
self.prerun()
#tuzfal sajat szabalyai
# tuzfal sajat szabalyai
for f in self.fw:
for rule in f.rules.all():
self.fw2vlan(rule)
#zonak kozotti lancokra ugras
# zonak kozotti lancokra ugras
for s_vlan in self.vlans:
for d_vlan in self.vlans:
self.iptables("-N %s_%s" % (s_vlan, d_vlan))
self.iptables("-A FORWARD -i %s -o %s -g %s_%s" % (s_vlan.interface, d_vlan.interface, s_vlan, d_vlan))
#hosztok szabalyai
# hosztok szabalyai
for i_vlan in self.vlans:
for i_host in i_vlan.host_set.all():
for group in i_host.groups.all():
......@@ -239,23 +233,22 @@ class firewall:
for rule in i_host.rules.all():
self.host2vlan(i_host, rule)
#vlanok kozotti kommunikacio engedelyezese
# vlanok kozotti kommunikacio engedelyezese
for s_vlan in self.vlans:
for rule in s_vlan.rules.all():
self.vlan2vlan(s_vlan, rule)
#zonak kozotti lancokat zarja le
# zonak kozotti lancokat zarja le
for s_vlan in self.vlans:
for d_vlan in self.vlans:
self.iptables("-A %s_%s -g LOG_DROP" % (s_vlan, d_vlan))
#futas utani dolgok
# futas utani dolgok
self.postrun()
if self.IPV6:
self.SZABALYOK = [x for x in self.SZABALYOK if not regexp.search(x)]
self.SZABALYOK = [regexp_icmp.sub('icmpv6', x) for x in self.SZABALYOK]
#####
def __init__(self, IPV6=False):
self.SZABALYOK=[]
......@@ -299,6 +292,12 @@ def ipv6_to_octal(ipv6):
octets.append(int(part[2:], 16))
return '\\' + '\\'.join(['%03o' % x for x in octets])
def ipv4_to_arpa(ipv4, cname=False):
m2 = re.search(r'^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$', ipv4)
if(cname):
return "%s.dns1.%s.%s.%s.in-addr.arpa" % (m2.group(4), m2.group(3), m2.group(2), m2.group(1))
else:
return "%s.%s.%s.%s.in-addr.arpa" % (m2.group(4), m2.group(3), m2.group(2), m2.group(1))
def ipv6_to_arpa(ipv6):
while len(ipv6.split(':')) < 8:
......@@ -318,52 +317,70 @@ def ipv6_to_arpa(ipv6):
# =fqdn:ip:ttl A, PTR
# &fqdn:ip:x:ttl NS
# ZfqdnSOA
# +fqdn:ip:ttl A
# ^ PTR
# C CNAME
# : generic
def dns():
vlans = models.Vlan.objects.all()
regex = re.compile(r'^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$')
DNS = []
DNS.append("=cloud.ik.bme.hu:152.66.243.98:600::\n")
DNS.append(":cloud.ik.bme.hu:28:\040\001\007\070\040\001\100\061\000\002\000\000\000\007\000\000:600\n")
#tarokkknak
DNS.append("^%s.dns1.%s.%s.%s.in-addr.arpa:%s:600::\n" % (75, 243, 66, 152, "se.hpc.iit.bme.hu"))
DNS.append("^%s.dns1.%s.%s.%s.in-addr.arpa:%s:600::\n" % (76, 243, 66, 152, "ce.hpc.iit.bme.hu"))
DNS.append("^%s.dns1.%s.%s.%s.in-addr.arpa:%s:600::\n" % (77, 243, 66, 152, "mon.hpc.iit.bme.hu"))
DNS.append("^%s.dns1.%s.%s.%s.in-addr.arpa:%s:600::\n" % (62, 243, 66, 152, "r.cloud.ik.bme.hu"))
DNS.append("=r.cloud.ik.bme.hu:152.66.243.62:600::\n")
DNS.append("=cloud.ik.bme.hu:152.66.243.98:600::")
DNS.append(":cloud.ik.bme.hu:28:\040\001\007\070\040\001\100\061\000\002\000\000\000\007\000\000:600")
DNS.append("=r.cloud.ik.bme.hu:152.66.243.62:600::")
DNS.append("Z1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa:dns1.ik.bme.hu:support.ik.bme.hu::::::600\n") #soa
DNS.append("&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::dns1.ik.bme.hu:600::\n") #ns
DNS.append("&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::nic.bme.hu:600::\n") #ns
# DNS.append("&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::ns.bme.hu:600::\n") #ns
DNS.append("Z1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa:dns1.ik.bme.hu:support.ik.bme.hu::::::600") # soa
DNS.append("&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::dns1.ik.bme.hu:600::") # ns rekord
DNS.append("&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::nic.bme.hu:600::") # ns rekord
for i_vlan in vlans:
m = regex.search(i_vlan.net4)
if(i_vlan.name != "DMZ" and i_vlan.name != "PUB"):
DNS.append("Z%s.%s.in-addr.arpa:dns1.ik.bme.hu:support.ik.bme.hu::::::600\n" % (m.group(2), m.group(1)))
DNS.append("&%s.%s.in-addr.arpa::dns1.ik.bme.hu:600::\n" % (m.group(2), m.group(1)))
DNS.append("Z%s:dns1.ik.bme.hu:support.ik.bme.hu::::::600\n" % i_vlan.domain)
DNS.append("&%s::dns1.ik.bme.hu:600::\n" % i_vlan.domain)
DNS.append("Z%s.%s.in-addr.arpa:%s:support.ik.bme.hu::::::%s" % (m.group(2), m.group(1), models.settings['dns_hostname'], models.settings['dns_ttl']))
DNS.append("&%s.%s.in-addr.arpa::%s:%s:" % (m.group(2), m.group(1), models.settings['dns_hostname'], models.settings['dns_ttl']))
DNS.append("Z%s:%s:support.ik.bme.hu::::::%s" % (i_vlan.domain, models.settings['dns_hostname'], models.settings['dns_ttl']))
DNS.append("&%s::%s:%s" % (i_vlan.domain, models.settings['dns_hostname'], models.settings['dns_ttl']))
if(i_vlan.name == "WAR"):
DNS.append("Zdns1.%s.%s.%s.in-addr.arpa:dns1.ik.bme.hu:support.ik.bme.hu::::::600\n" % (m.group(3), m.group(2), m.group(1)))
DNS.append("&dns1.%s.%s.%s.in-addr.arpa::dns1.ik.bme.hu:600::\n" % (m.group(3), m.group(2), m.group(1)))
DNS.append("Zdns1.%s.%s.%s.in-addr.arpa:%s:support.ik.bme.hu::::::%s" % (m.group(3), m.group(2), m.group(1), models.settings['dns_hostname'], models.settings['dns_ttl']))
DNS.append("&dns1.%s.%s.%s.in-addr.arpa::%s:%s::" % (m.group(3), m.group(2), m.group(1), models.settings['dns_hostname'], models.settings['dns_ttl']))
for i_host in i_vlan.host_set.all():
ipv4 = ( i_host.pub_ipv4 if i_host.pub_ipv4 and not i_host.shared_ip else i_host.ipv4 )
m2 = regex.search(ipv4)
#ipv4
DNS.append("=%s.%s:%s:600::\n" % (i_host.hostname, i_vlan.domain, ipv4))
DNS.append("^%s.dns1.%s.%s.%s.in-addr.arpa:%s.%s:600::\n" % (m2.group(4), m2.group(3), m2.group(2), m2.group(1), i_host.hostname, i_vlan.domain))
#ipv6
DNS.append(":%s.%s:28:%s:600\n" % (i_host.hostname, i_vlan.domain, ipv6_to_octal(i_host.ipv6)))
DNS.append("^%s:%s.%s:600::\n" % (ipv6_to_arpa(i_host.ipv6), i_host.hostname, i_vlan.domain))
process = subprocess.Popen(['/usr/bin/ssh', 'tinydns@%s' % DNS_SERVER], shell=False, stdin=subprocess.PIPE)
reverse = i_host.reverse if(i_host.reverse and len(i_host.reverse)) else i_host.hostname + u'.' + i_vlan.domain
hostname = i_host.hostname + u'.' + i_vlan.domain
# ipv4
if i_host.ipv4:
# A record
DNS.append("+%s:%s:%s" % (hostname, ipv4, models.settings['dns_ttl']))
# PTR record 4.3.2.1.in-addr.arpa
DNS.append("^%s:%s:%s" % (ipv4_to_arpa(i_host.ipv4), reverse, models.settings['dns_ttl']))
# PTR record 4.dns1.3.2.1.in-addr.arpa
DNS.append("^%s:%s:%s" % (ipv4_to_arpa(i_host.ipv4, cname=True), reverse, models.settings['dns_ttl']))
# ipv6
if i_host.ipv6:
# AAAA record
DNS.append(":%s:28:%s:%s" % (hostname, ipv6_to_octal(i_host.ipv6), models.settings['dns_ttl']))
# PTR record
DNS.append("^%s:%s:%s" % (ipv6_to_arpa(i_host.ipv6), reverse, models.settings['dns_ttl']))
# cname
for i_alias in i_host.alias_set.all():
DNS.append("C%s:%s:%s" % (i_alias.alias, hostname, models.settings['dns_ttl']))
process = subprocess.Popen(['/usr/bin/ssh', 'tinydns@%s' % models.settings['dns_hostname']], shell=False, stdin=subprocess.PIPE)
process.communicate("\n".join(DNS)+"\n")
# print "\n".join(DNS)+"\n"
def prefix_to_mask(prefix):
t = [0,0,0,0]
for i in range(0,4):
t = [0, 0, 0, 0]
for i in range(0, 4):
if prefix > i*8+7:
t[i] = 255
elif i*8 < prefix and prefix <= (i+1)*8:
......@@ -375,14 +392,14 @@ def dhcp():
regex = re.compile(r'^([0-9]+)\.([0-9]+)\.[0-9]+\.[0-9]+\s+([0-9]+)\.([0-9]+)\.[0-9]+\.[0-9]+$')
DHCP = []
#/tools/dhcp3/dhcpd.conf.generated
# /tools/dhcp3/dhcpd.conf.generated
for i_vlan in vlans:
if(i_vlan.dhcp_pool):
m = regex.search(i_vlan.dhcp_pool)
if(m or i_vlan.dhcp_pool == "manual"):
DHCP.append ('''
#%(name)s - %(interface)s
# %(name)s - %(interface)s
subnet %(net)s netmask %(netmask)s {
%(extra)s;
option domain-name "%(domain)s";
......@@ -399,7 +416,7 @@ def dhcp():
'domain': i_vlan.domain,
'router': i_vlan.ipv4,
'ntp': i_vlan.ipv4,
'dnsserver': DNS_SERVER,
'dnsserver': models.settings['rdns_ip'],
'extra': "range %s" % i_vlan.dhcp_pool if m else "deny unknown-clients",
'interface': i_vlan.interface,
'name': i_vlan.name,
......@@ -421,24 +438,9 @@ def dhcp():
# print "\n".join(DHCP)+"\n"
process.communicate("\n".join(DHCP)+"\n")
#ipt_filter()
#ipt_nat()
#process = subprocess.Popen(['/usr/bin/sudo', 'iptables-restore'], shell=False, stdin=subprocess.PIPE)
#process.communicate("\n".join(SZABALYOK)+"\n"+"\n".join(SZABALYOK_NAT)+"\n")
#blabla = firewall()
#process = subprocess.Popen(['/usr/bin/sudo', 'ip6tables-restore'], shell=False, stdin=subprocess.PIPE)
#process.communicate("\n".join(SZABALYOK)+"\n")
#dns()
#dhcp()
i=2
'''
i=2
for mac, name, ipend in [("18:a9:05:64:19:aa", "mega6", 16), ("00:1e:0b:e9:79:1e", "blade1", 21), ("00:22:64:9c:fd:34", "blade2", 22), ("00:1e:0b:ec:65:46", "blade3", 23), ("b4:b5:2f:61:d2:5a", "cloud-man", 1)]:
h1 = models.Host(hostname= name, vlan=models.Vlan.objects.get(vid=3), mac=mac, ipv4="10.3.1.%d" % ipend, ipv6="2001:738:2001:4031:3:1:%d:0" % ipend, owner=auth.models.User.objects.get(username="bd"))
try:
......@@ -450,9 +452,3 @@ for mac, name, ipend in [("18:a9:05:64:19:aa", "mega6", 16), ("00:1e:0b:e9:79:1e
print "nemok %s" % name
'''
#try:
# h1.save()
# h1.groups.add(models.Group.objects.get(name="irodai gep"))
# h1.save()
#except:
# print "nemsikerult"
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Alias'
db.create_table('firewall_alias', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('host', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['firewall.Host'])),
('hostname', self.gf('django.db.models.fields.CharField')(unique=True, max_length=40)),
))
db.send_create_signal('firewall', ['Alias'])
# Changing field 'Host.ipv6'
db.alter_column('firewall_host', 'ipv6', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39, unique=True, null=True))
def backwards(self, orm):
# Deleting model 'Alias'
db.delete_table('firewall_alias')
# User chose to not deal with backwards NULL issues for 'Host.ipv6'
raise RuntimeError("Cannot reverse this migration. 'Host.ipv6' and its values cannot be restored.")
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'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'}),
'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'})
},
'firewall.alias': {
'Meta': {'object_name': 'Alias'},
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Host']"}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'nat_dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'r_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'sport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'firewall_vlan_related'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['firewall.Rule']"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Alias.hostname'
db.delete_column('firewall_alias', 'hostname')
# Adding field 'Alias.alias'
db.add_column('firewall_alias', 'alias',
self.gf('django.db.models.fields.CharField')(default=None, unique=True, max_length=40),
keep_default=False)
def backwards(self, orm):
# User chose to not deal with backwards NULL issues for 'Alias.hostname'
raise RuntimeError("Cannot reverse this migration. 'Alias.hostname' and its values cannot be restored.")
# Deleting field 'Alias.alias'
db.delete_column('firewall_alias', 'alias')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'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'}),
'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'})
},
'firewall.alias': {
'Meta': {'object_name': 'Alias'},
'alias': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Host']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'nat_dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'r_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'sport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'firewall_vlan_related'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['firewall.Rule']"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Host.reverse'
db.add_column('firewall_host', 'reverse',
self.gf('django.db.models.fields.CharField')(max_length=40, unique=True, null=True, blank=True),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Host.reverse'
db.delete_column('firewall_host', 'reverse')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'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'}),
'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'})
},
'firewall.alias': {
'Meta': {'object_name': 'Alias'},
'alias': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Host']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'nat_dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'r_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'sport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'firewall_vlan_related'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['firewall.Rule']"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Host', fields ['reverse']
db.delete_unique('firewall_host', ['reverse'])
def backwards(self, orm):
# Adding unique constraint on 'Host', fields ['reverse']
db.create_unique('firewall_host', ['reverse'])
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'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'}),
'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'})
},
'firewall.alias': {
'Meta': {'object_name': 'Alias'},
'alias': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Host']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'nat_dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'r_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'sport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'firewall_vlan_related'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['firewall.Rule']"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Setting'
db.create_table('firewall_setting', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('key', self.gf('django.db.models.fields.CharField')(max_length=32)),
('value', self.gf('django.db.models.fields.CharField')(max_length=200)),
))
db.send_create_signal('firewall', ['Setting'])
def backwards(self, orm):
# Deleting model 'Setting'
db.delete_table('firewall_setting')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'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': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'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', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'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', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'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'}),
'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'})
},
'firewall.alias': {
'Meta': {'object_name': 'Alias'},
'alias': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'host': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Host']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'firewall.firewall': {
'Meta': {'object_name': 'Firewall'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'})
},
'firewall.host': {
'Meta': {'object_name': 'Host'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Group']", 'null': 'True', 'blank': 'True'}),
'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'mac': ('firewall.fields.MACAddressField', [], {'unique': 'True', 'max_length': '17'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
'pub_ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'reverse': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Rule']", 'null': 'True', 'blank': 'True'}),
'shared_ip': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'vlan': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['firewall.Vlan']"})
},
'firewall.rule': {
'Meta': {'object_name': 'Rule'},
'accept': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'direction': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'extra': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'nat_dport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
'r_type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'sport': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'vlan': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'})
},
'firewall.setting': {
'Meta': {'object_name': 'Setting'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'value': ('django.db.models.fields.CharField', [], {'max_length': '200'})
},
'firewall.vlan': {
'Meta': {'object_name': 'Vlan'},
'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'dhcp_pool': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'domain': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interface': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'ipv4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'ipv6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}),
'net4': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'net6': ('django.db.models.fields.GenericIPAddressField', [], {'unique': 'True', 'max_length': '39'}),
'prefix4': ('django.db.models.fields.IntegerField', [], {'default': '16'}),
'prefix6': ('django.db.models.fields.IntegerField', [], {'default': '80'}),
'rules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'firewall_vlan_related'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['firewall.Rule']"}),
'snat_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True', 'blank': 'True'}),
'snat_to': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['firewall.Vlan']", 'null': 'True', 'blank': 'True'}),
'vid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'})
}
}
complete_apps = ['firewall']
\ No newline at end of file
......@@ -7,6 +7,13 @@ from django.utils.translation import ugettext_lazy as _
from firewall.fields import *
from south.modelsinspector import add_introspection_rules
from django.core.validators import MinValueValidator, MaxValueValidator
from modeldict import ModelDict
class Setting(models.Model):
key = models.CharField(max_length=32)
value = models.CharField(max_length=200)
settings = ModelDict(Setting, key='key', value='value', instances=False)
class Rule(models.Model):
CHOICES_type = (('host', 'host'), ('firewall', 'firewall'), ('vlan', 'vlan'))
......@@ -97,12 +104,19 @@ class Group(models.Model):
def __unicode__(self):
return self.name
class Alias(models.Model):
host = models.ForeignKey('Host')
alias = models.CharField(max_length=40, unique=True, validators=[val_domain])
class Meta:
verbose_name_plural = 'aliases'
class Host(models.Model):
hostname = models.CharField(max_length=40, unique=True, validators=[val_alfanum])
reverse = models.CharField(max_length=40, validators=[val_domain], blank=True, null=True)
mac = MACAddressField(unique=True)
ipv4 = models.GenericIPAddressField(protocol='ipv4', unique=True)
pub_ipv4 = models.GenericIPAddressField(protocol='ipv4', blank=True, null=True)
ipv6 = models.GenericIPAddressField(protocol='ipv6', unique=True, blank=True)
ipv6 = models.GenericIPAddressField(protocol='ipv6', unique=True, blank=True, null=True)
shared_ip = models.BooleanField(default=False)
description = models.TextField(blank=True)
comment = models.TextField(blank=True)
......@@ -115,7 +129,7 @@ class Host(models.Model):
def __unicode__(self):
return self.hostname
def save(self, *args, **kwargs):
if not self.id and not self.ipv6:
if not self.id and self.ipv6 == "auto":
self.ipv6 = ipv4_2_ipv6(self.ipv4)
if not self.shared_ip and self.pub_ipv4 and Host.objects.exclude(id=self.id).filter(pub_ipv4=self.pub_ipv4):
raise ValidationError("Ha a shared_ip be van pipalva, akkor egyedinek kell lennie a pub_ipv4-nek!")
......
......@@ -3,7 +3,7 @@ from django.core.cache import cache
import os
import time
from firewall.fw import *
from firewall.models import settings
def reload_firewall_lock():
acquire_lock = lambda: cache.add("reload_lock1", "true", 9)
......@@ -25,7 +25,11 @@ class ReloadTask(Task):
return
print "indul"
time.sleep(10)
try:
sleep = float(settings['reload_sleep'])
except:
sleep = 10
time.sleep(sleep)
try:
print "ipv4"
......
#!/usr/bin/python
import base64
import xmltodict
import urllib2
import sys
xml = base64.b64decode(sys.argv[1])
data = xmltodict.parse(xml)
try:
booturl = data["VM"]["TEMPLATE"]["CONTEXT"]["BOOTURL"]
except:
print 'Error'
req=urllib2.Request(booturl)
response = urllib2.urlopen(req)
#!/bin/bash
if [ "$1" != -f ]
then
echo 'Clear ALL PRIVATE DATA ON THE VM. This is used for praparing VM template.'
echo -- '-f switch is required.'
exit 1
fi
rm -rf /opt/webadmin/cloud*
rm .bash_history
rm -f ~/.gitconfig
mysql <<A
DROP USER webadmin@localhost;
A
mysql <<A
DROP DATABASE webadmin;
A
sudo chpasswd <<<'cloud:ezmiez'
- fields:
accept: true
description: ''
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 1
- fields:
accept: true
description: ''
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [2]
model: firewall.rule
pk: 2
- fields:
accept: true
description: ''
direction: '1'
dport: null
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [5]
model: firewall.rule
pk: 3
- fields:
accept: true
description: ssh ik net
direction: '1'
dport: 22
extra: -s 152.66.243.0/24
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 6
- fields:
accept: true
description: icmp
direction: '1'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: icmp
r_type: firewall
sport: null
vlan: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
model: firewall.rule
pk: 12
- fields:
accept: true
description: ''
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: firewall
sport: null
vlan: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
model: firewall.rule
pk: 15
- fields:
accept: true
description: dhcp, time, tftp
direction: '1'
dport: null
extra: -p udp -m multiport --dports 67,69,123
nat: false
nat_dport: null
owner: 1
proto: null
r_type: firewall
sport: null
vlan: [1, 2, 6, 8, 10, 12]
model: firewall.rule
pk: 26
- fields:
accept: true
description: iknet
direction: '0'
dport: null
extra: -d 152.66.243.0/24
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 30
- fields:
accept: true
description: munin
direction: '1'
dport: 4949
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: tcp
r_type: firewall
sport: null
vlan: [2]
model: firewall.rule
pk: 31
- fields:
accept: true
description: "nyomtat\xF3 egyteru"
direction: '0'
dport: null
extra: -d 10.0.0.253
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [9]
model: firewall.rule
pk: 33
- fields:
accept: true
description: 'ssh '
direction: '1'
dport: 22
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 34
- fields:
accept: true
description: vpn
direction: '1'
dport: 3721
extra: ''
nat: false
nat_dport: null
owner: 1
proto: udp
r_type: firewall
sport: null
vlan: [4]
model: firewall.rule
pk: 35
- fields:
accept: true
description: iperf
direction: '1'
dport: 5001
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: tcp
r_type: firewall
sport: null
vlan: [1, 2, 4, 6]
model: firewall.rule
pk: 36
- fields:
accept: true
description: dns
direction: '1'
dport: 53
extra: ''
nat: false
nat_dport: null
owner: 1
proto: udp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 37
- fields:
accept: true
description: ssh
direction: '1'
dport: 532
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: tcp
r_type: firewall
sport: null
vlan: [1, 2, 4, 6]
model: firewall.rule
pk: 38
- fields:
accept: true
description: (pub)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [4, 11]
model: firewall.rule
pk: 39
- fields:
accept: true
description: (dmz)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [6]
model: firewall.rule
pk: 40
- fields:
accept: true
description: (lab)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [4, 8]
model: firewall.rule
pk: 41
- fields:
accept: true
description: (man)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [2]
model: firewall.rule
pk: 42
- fields:
accept: true
description: (hot)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [3, 4, 6, 7]
model: firewall.rule
pk: 43
- fields:
accept: true
description: (vpn)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [3, 4, 5, 6, 7, 8, 10]
model: firewall.rule
pk: 44
- fields:
accept: true
description: (off)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [1, 3, 5, 6, 7, 8, 10]
model: firewall.rule
pk: 45
- fields:
accept: true
description: radius bd
direction: '1'
dport: 1812
extra: ''
nat: false
nat_dport: 0
owner: 1
proto: udp
r_type: host
sport: null
vlan: [3]
model: firewall.rule
pk: 46
- fields:
accept: true
description: http
direction: '1'
dport: 80
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 47
- fields:
accept: true
description: syslog iknet
direction: '1'
dport: 1999
extra: -s 152.66.243.0/24
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10]
model: firewall.rule
pk: 48
- fields:
accept: true
description: pbx
direction: '1'
dport: null
extra: -p tcp -m multiport --dport 80,2000,5060
nat: false
nat_dport: null
owner: 3
proto: null
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 261
- fields:
accept: true
description: pbx
direction: '1'
dport: null
extra: -p udp -m multiport --dport 5000,5060,4569
nat: false
nat_dport: null
owner: 3
proto: null
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 262
- fields:
accept: true
description: "nyomtat\xF3 canon iR2870 (f\xE9nym\xE1sol\xF3)"
direction: '0'
dport: null
extra: -d 10.0.0.251
nat: false
nat_dport: null
owner: 1
proto: null
r_type: host
sport: null
vlan: [9]
model: firewall.rule
pk: 263
- fields:
accept: true
description: nyomtato hp laserjet cp1525
direction: '0'
dport: null
extra: -d 10.0.0.65
nat: false
nat_dport: 0
owner: 1
proto: null
r_type: host
sport: null
vlan: [9]
model: firewall.rule
pk: 264
- fields:
accept: true
description: identd
direction: '1'
dport: 113
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 265
- fields:
accept: true
description: id-81_user-bd tcp 23107->3389
direction: '1'
dport: 33107
extra: ''
nat: true
nat_dport: 3389
owner: 2
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 734
- fields:
accept: true
description: ''
direction: '1'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 750
- fields:
accept: true
description: ''
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 4
proto: null
r_type: host
sport: null
vlan: [8]
model: firewall.rule
pk: 751
- fields:
accept: true
description: id-412-Gabor_BackUp tcp 22005->22
direction: '1'
dport: 32005
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 773
- fields:
accept: true
description: id-412-Gabor_BackUp tcp 23005->3389
direction: '1'
dport: 33005
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 774
- fields:
accept: true
description: id-90_user-bd tcp 23019->3389
direction: '1'
dport: 33019
extra: ''
nat: true
nat_dport: 3389
owner: 2
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 825
- fields:
accept: true
description: dns
direction: '1'
dport: 53
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 849
- fields:
accept: true
description: (war)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [7]
model: firewall.rule
pk: 850
- fields:
accept: true
description: (vm-net)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [10]
model: firewall.rule
pk: 851
- fields:
accept: true
description: https
direction: '1'
dport: 443
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 856
- fields:
accept: true
description: opennebula novnc
direction: '1'
dport: 29876
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [2, 3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 859
- fields:
accept: true
description: smb server
direction: '0'
dport: null
extra: -d 10.0.0.253
nat: false
nat_dport: null
owner: 3
proto: null
r_type: host
sport: null
vlan: [9]
model: firewall.rule
pk: 866
- fields:
accept: true
description: time war
direction: '1'
dport: 123
extra: ''
nat: false
nat_dport: null
owner: 3
proto: udp
r_type: firewall
sport: null
vlan: [7]
model: firewall.rule
pk: 867
- fields:
accept: true
description: ''
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: host
sport: null
vlan: [7]
model: firewall.rule
pk: 870
- fields:
accept: true
description: ''
direction: '0'
dport: 25
extra: ''
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 948
- fields:
accept: true
description: (war2)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [4, 11]
model: firewall.rule
pk: 949
- fields:
accept: true
description: (off2)
direction: '0'
dport: null
extra: ''
nat: false
nat_dport: null
owner: 1
proto: null
r_type: vlan
sport: null
vlan: [12]
model: firewall.rule
pk: 950
- fields:
accept: true
description: id-140_user-root tcp 22001 -> 22
direction: '1'
dport: 32001
extra: ''
nat: true
nat_dport: 22
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 964
- fields:
accept: true
description: id-689-DP tcp 22066 -> 22
direction: '1'
dport: 32066
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 967
- fields:
accept: true
description: id-689-DP tcp 23066 -> 3389
direction: '1'
dport: 33066
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 968
- fields:
accept: true
description: id-690-DP tcp 22071 -> 22
direction: '1'
dport: 32071
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 969
- fields:
accept: true
description: id-690-DP tcp 23071 -> 3389
direction: '1'
dport: 33071
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 970
- fields:
accept: true
description: id-694-UI tcp 22073 -> 22
direction: '1'
dport: 32073
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 971
- fields:
accept: true
description: id-694-UI tcp 23073 -> 3389
direction: '1'
dport: 33073
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 972
- fields:
accept: true
description: id-696-VERS tcp 22074 -> 22
direction: '1'
dport: 32074
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 973
- fields:
accept: true
description: id-696-VERS tcp 23074 -> 3389
direction: '1'
dport: 33074
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 974
- fields:
accept: true
description: id-145_user-test tcp 23006 -> 3389
direction: '1'
dport: 33006
extra: ''
nat: true
nat_dport: 3389
owner: 7
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 978
- fields:
accept: true
description: ''
direction: '1'
dport: 33009
extra: ''
nat: true
nat_dport: 3389
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 980
- fields:
accept: true
description: id-708-Hanak-Windows7 tcp 22009 -> 22
direction: '1'
dport: 32009
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 984
- fields:
accept: true
description: id-708-Hanak-Windows7 tcp 23009 -> 3389
direction: '1'
dport: 33009
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 985
- fields:
accept: true
description: levelezhet cronosra
direction: '0'
dport: 25
extra: -d 152.66.243.1
nat: false
nat_dport: null
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [4]
model: firewall.rule
pk: 988
- fields:
accept: true
description: id-156_user-lennon tcp 23013 -> 3389
direction: '1'
dport: 33013
extra: ''
nat: true
nat_dport: 3389
owner: 6
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 994
- fields:
accept: true
description: id-158_user-K7YLW5 tcp 22015 -> 22
direction: '1'
dport: 32015
extra: ''
nat: true
nat_dport: 22
owner: 14
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 996
- fields:
accept: true
description: "id-161_user-root tcp 22017\u2009\u25B8\u200922"
direction: '1'
dport: 32017
extra: ''
nat: true
nat_dport: 22
owner: 1
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 999
- fields:
accept: true
description: "id-165_user-K2JL24 tcp 22021\u2009\u25B8\u200922"
direction: '1'
dport: 32021
extra: ''
nat: true
nat_dport: 22
owner: 11
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 1003
- fields:
accept: true
description: "id-740-one-740 tcp 22030\u2009\u25B8\u200922"
direction: '1'
dport: 32030
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 1021
- fields:
accept: true
description: "id-740-one-740 tcp 23030\u2009\u25B8\u20093389"
direction: '1'
dport: 33030
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 1022
- fields:
accept: true
description: "id-748-Dev tcp 22036\u2009\u25B8\u200922"
direction: '1'
dport: 32036
extra: ''
nat: true
nat_dport: 22
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 1027
- fields:
accept: true
description: "id-748-Dev tcp 23036\u2009\u25B8\u20093389"
direction: '1'
dport: 33036
extra: ''
nat: true
nat_dport: 3389
owner: 5
proto: tcp
r_type: host
sport: null
vlan: [3, 4, 6, 7, 8, 10, 12]
model: firewall.rule
pk: 1028
- fields:
comment: ''
description: ''
dhcp_pool: manual
domain: off.ik.bme.hu
interface: vlan0005
ipv4: 10.5.255.254
ipv6: 2001:738:2001:4031:5:255:254:0
name: 'OFF'
net4: 10.5.0.0
net6: '2001:738:2001:4031:5::'
prefix4: 16
prefix6: 80
rules: [45]
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 5
model: firewall.vlan
pk: 1
- fields:
comment: ''
description: ''
dhcp_pool: 10.3.3.2 10.3.3.254
domain: man.ik.bme.hu
interface: vlan0003
ipv4: 10.3.255.254
ipv6: 2001:738:2001:4031:3:255:254:0
name: MAN
net4: 10.3.0.0
net6: '2001:738:2001:4031:3::'
prefix4: 16
prefix6: 80
rules: [42]
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 3
model: firewall.vlan
pk: 2
- fields:
comment: ''
description: ''
dhcp_pool: 10.4.0.2 10.4.0.254
domain: hot.ik.bme.hu
interface: vlan0004
ipv4: 10.4.255.254
ipv6: 2001:738:2001:4031:4:255:254:0
name: HOT
net4: 10.4.0.0
net6: '2001:738:2001:4031:4::'
prefix4: 16
prefix6: 80
rules: [43]
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 4
model: firewall.vlan
pk: 3
- fields:
comment: ''
description: ''
dhcp_pool: ''
domain: ''
interface: pub
ipv4: 152.66.243.160
ipv6: 2001:738:2001:4030::fffe
name: PUB
net4: 152.66.243.0
net6: '2001:738:2001:4030::'
prefix4: 24
prefix6: 64
rules: [39]
snat_ip: null
snat_to: []
vid: 66
model: firewall.vlan
pk: 4
- fields:
comment: ''
description: ''
dhcp_pool: ''
domain: vpn.ik.bme.hu
interface: vpn
ipv4: 10.1.255.254
ipv6: 2001:738:2001:4031:1:255:254:0
name: VPN
net4: 10.1.0.0
net6: '2001:738:2001:4031:1::'
prefix4: 16
prefix6: 80
rules: [44]
snat_ip: 152.66.243.160
snat_to: [4, 5, 7]
vid: 1
model: firewall.vlan
pk: 5
- fields:
comment: ''
description: ''
dhcp_pool: manual
domain: cloud.ik.bme.hu
interface: vlan0002
ipv4: 10.2.255.254
ipv6: 2001:738:2001:4031:2:255:254:0
name: DMZ
net4: 10.2.0.0
net6: '2001:738:2001:4031:2::'
prefix4: 16
prefix6: 80
rules: [40]
snat_ip: null
snat_to: []
vid: 2
model: firewall.vlan
pk: 6
- fields:
comment: ''
description: ''
dhcp_pool: manual
domain: cloud.ik.bme.hu
interface: vlan0006
ipv4: 152.66.243.126
ipv6: 2001:738:2001:4031:66:243:126:0
name: WAR
net4: 152.66.243.64
net6: '2001:738:2001:4031:66::'
prefix4: 26
prefix6: 80
rules: [850]
snat_ip: null
snat_to: []
vid: 6
model: firewall.vlan
pk: 7
- fields:
comment: ''
description: ''
dhcp_pool: 10.7.0.2 10.7.0.254
domain: lab.ik.bme.hu
interface: vlan0007
ipv4: 10.7.255.254
ipv6: 2001:738:2001:4031:7:255:254:0
name: LAB
net4: 10.7.0.0
net6: '2001:738:2001:4031:7::'
prefix4: 16
prefix6: 80
rules: [41]
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 7
model: firewall.vlan
pk: 8
- fields:
comment: ''
description: "Ketler office h\xE1l\xF3zata a nyomtat\xF3 miatt (a M\xE1t\xE9 erre\
\ azt k\xE9rdezte, hogy a nyomtat\xF3 miatt az \xF6v\xE9?)"
dhcp_pool: ''
domain: ''
interface: vlan0008
ipv4: 10.0.0.247
ipv6: 2001:738:2001:4031:8:0:247:0
name: WOLF
net4: 10.0.0.0
net6: '2001:738:2001:4031:8::'
prefix4: 24
prefix6: 80
rules: []
snat_ip: null
snat_to: []
vid: 8
model: firewall.vlan
pk: 9
- fields:
comment: ''
description: ''
dhcp_pool: manual
domain: vm-net.ik.bme.hu
interface: vlan0009
ipv4: 10.9.255.254
ipv6: 2001:738:2001:4031:9:255:254:0
name: VM-NET
net4: 10.9.0.0
net6: '2001:738:2001:4031:9::'
prefix4: 16
prefix6: 80
rules: [851]
snat_ip: 152.66.243.62
snat_to: [4, 7, 10]
vid: 9
model: firewall.vlan
pk: 10
- fields:
comment: ''
description: mozdonyok
dhcp_pool: ''
domain: ''
interface: vlan0010
ipv4: 152.66.243.166
ipv6: 2001:738:2001:4031:10:255:254:0
name: WAR2
net4: 152.66.243.160
net6: '2001:738:2001:4031:10::'
prefix4: 27
prefix6: 80
rules: [949]
snat_ip: null
snat_to: []
vid: 10
model: firewall.vlan
pk: 11
- fields:
comment: ''
description: ''
dhcp_pool: ''
domain: ''
interface: vlan0011
ipv4: 10.11.255.254
ipv6: 2001:738:2001:4031:11:255:254:0
name: OFF2
net4: 10.11.0.0
net6: '2001:738:2001:4031:11::'
prefix4: 16
prefix6: 80
rules: [950]
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 11
model: firewall.vlan
pk: 12
- fields:
name: irodai gep
rules: [1, 33, 263, 264]
model: firewall.group
pk: 1
- fields:
name: irodai telefon
rules: [30]
model: firewall.group
pk: 3
- fields:
name: mailezhet cronosra
rules: [988]
model: firewall.group
pk: 7
- fields:
name: mailszerver
rules: [948]
model: firewall.group
pk: 6
- fields:
name: minden pub fele
rules: [1, 750]
model: firewall.group
pk: 5
- fields:
name: netezhet
rules: [1, 870]
model: firewall.group
pk: 4
- fields:
name: vpnrol elerheto
rules: [3]
model: firewall.group
pk: 2
- fields:
comment: ''
description: bd gepe
groups: [1, 2]
hostname: bd
ipv4: 10.5.253.6
ipv6: 2001:738:2001:4031:5:253:6:0
location: ''
mac: 00:13:f7:d1:b8:af
owner: 2
pub_ipv4: null
rules: [2]
shared_ip: false
vlan: 1
model: firewall.host
pk: 7
- fields:
comment: "saj\xE1t g\xE9p"
description: "\u0150ry M\xE1t\xE9 laptopja"
groups: [1, 2]
hostname: mate
ipv4: 10.5.253.5
ipv6: 2001:738:2001:4031:5:253:5:0
location: ''
mac: 64:31:50:93:4e:5d
owner: 3
pub_ipv4: null
rules: [2]
shared_ip: false
vlan: 1
model: firewall.host
pk: 8
- fields:
comment: ''
description: Cziva Ricsi telefonja
groups: [3]
hostname: tele8
ipv4: 10.5.253.87
ipv6: 2001:738:2001:4031:5:253:87:0
location: ''
mac: 00:90:78:83:56:76
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 9
- fields:
comment: ''
description: "M\xE1t\xE9 \xE9s bd telefonja"
groups: [3]
hostname: tele6
ipv4: 10.5.253.85
ipv6: 2001:738:2001:4031:5:253:85:0
location: ''
mac: 00:18:f8:84:f9:64
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 10
- fields:
comment: ''
description: az uj fejgep
groups: [2, 4, 6]
hostname: cloud
ipv4: 10.2.0.7
ipv6: 2001:738:2001:4031:2:0:7:0
location: ''
mac: b4:b5:2f:67:ef:76
owner: 4
pub_ipv4: 152.66.243.98
rules: [2, 3, 34, 47, 751, 856, 859]
shared_ip: false
vlan: 6
model: firewall.host
pk: 12
- fields:
comment: ''
description: ''
groups: []
hostname: BLADE-VCETW280200SN
ipv4: 10.3.2.2
ipv6: 2001:738:2001:4031:3:2:2:0
location: ''
mac: 00:1b:78:6e:81:42
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 17
- fields:
comment: ''
description: ''
groups: []
hostname: BLADE-ILOGB8849B4JH
ipv4: 10.3.2.3
ipv6: 2001:738:2001:4031:3:2:3:0
location: ''
mac: 00:22:64:9c:24:96
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 18
- fields:
comment: ''
description: ''
groups: []
hostname: BLADE-VCETW280200SK
ipv4: 10.3.2.4
ipv6: 2001:738:2001:4031:3:2:4:0
location: ''
mac: 00:1b:78:6e:81:3c
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 19
- fields:
comment: ''
description: ''
groups: []
hostname: BLADE-ILOPZ81MP6122
ipv4: 10.3.2.5
ipv6: 2001:738:2001:4031:3:2:5:0
location: ''
mac: 00:1e:0b:ec:13:58
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 20
- fields:
comment: ''
description: ''
groups: []
hostname: BLADE-ILOCZJ80408UH
ipv4: 10.3.2.6
ipv6: 2001:738:2001:4031:3:2:6:0
location: ''
mac: 00:1e:0b:e9:66:78
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 21
- fields:
comment: ''
description: ''
groups: [4]
hostname: mega6
ipv4: 10.3.1.16
ipv6: 2001:738:2001:4031:3:1:16:0
location: ''
mac: 18:a9:05:64:19:aa
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 22
- fields:
comment: ''
description: ''
groups: [4]
hostname: blade1
ipv4: 10.3.1.21
ipv6: 2001:738:2001:4031:3:1:21:0
location: ''
mac: 00:1e:0b:e9:79:1e
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 23
- fields:
comment: ''
description: ''
groups: [4]
hostname: blade2
ipv4: 10.3.1.22
ipv6: 2001:738:2001:4031:3:1:22:0
location: ''
mac: 00:22:64:9c:fd:34
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 24
- fields:
comment: ''
description: ''
groups: [4]
hostname: blade3
ipv4: 10.3.1.23
ipv6: 2001:738:2001:4031:3:1:23:0
location: ''
mac: 00:1e:0b:ec:65:46
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 25
- fields:
comment: ''
description: tarokkkk laptopja
groups: [1]
hostname: tarokkk-off
ipv4: 10.5.253.3
ipv6: 2001:738:2001:4031:5:253:3:0
location: ''
mac: e4:11:5b:41:64:d9
owner: 4
pub_ipv4: null
rules: [2]
shared_ip: false
vlan: 1
model: firewall.host
pk: 27
- fields:
comment: ''
description: tarokkk iptelefonja
groups: [3]
hostname: tele4
ipv4: 10.5.253.83
ipv6: 2001:738:2001:4031:5:253:83:0
location: ''
mac: 00:01:a8:02:2d:2f
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 28
- fields:
comment: ''
description: ''
groups: [2, 4]
hostname: mega5
ipv4: 10.3.1.15
ipv6: 2001:738:2001:4031:3:1:15:0
location: ''
mac: 18:a9:05:61:fc:be
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 30
- fields:
comment: ''
description: ''
groups: [2]
hostname: mega5-ilo
ipv4: 10.3.2.15
ipv6: 2001:738:2001:4031:3:2:15:0
location: ''
mac: 18:a9:05:61:fc:c6
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 35
- fields:
comment: ''
description: ''
groups: []
hostname: mega6-ilo
ipv4: 10.3.2.16
ipv6: 2001:738:2001:4031:3:2:16:0
location: ''
mac: 18:a9:05:64:19:b2
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 36
- fields:
comment: ''
description: adjatok akkountot tipusu gep
groups: [1]
hostname: laborteszt
ipv4: 10.5.253.10
ipv6: 2001:738:2001:4031:5:253:10:0
location: ''
mac: c8:60:00:ca:bb:47
owner: 4
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 105
- fields:
comment: ''
description: "Ny\xEDri G\xE1bor iptelefonja"
groups: [3]
hostname: tele3
ipv4: 10.5.253.82
ipv6: 2001:738:2001:4031:5:253:82:0
location: ''
mac: 00:90:78:83:56:72
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 300
- fields:
comment: ''
description: "konyha \xE9s IL306 iptelefon"
groups: [3]
hostname: tele7
ipv4: 10.5.253.86
ipv6: 2001:738:2001:4031:5:253:86:0
location: IL312
mac: 00:90:78:83:56:75
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 303
- fields:
comment: ''
description: "K\xE1polnai Rich\xE1rd iptelefonja"
groups: [3]
hostname: tele2
ipv4: 10.5.253.81
ipv6: 2001:738:2001:4031:5:253:81:0
location: "az asztal\xE1n XDDDD"
mac: 00:01:a8:02:2d:40
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 304
- fields:
comment: ''
description: L212 iptelefon
groups: [3]
hostname: tele5
ipv4: 10.5.253.84
ipv6: 2001:738:2001:4031:5:253:84:0
location: ''
mac: 00:01:a8:02:2d:47
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 305
- fields:
comment: "K\xE1polnai Rich\xE1rd adminolja"
description: "Deklarat\xEDv Programoz\xE1s hallgat\xF3i shellszerver"
groups: [5]
hostname: dps
ipv4: 152.66.243.72
ipv6: 2001:738:2001:4031:66:243:72:0
location: cloud-os gep
mac: 02:00:98:42:f3:48
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 494
- fields:
comment: "\xC9rintettek: Ny\xEDri G\xE1bor (root), Schnell Henrik, Szebi stb.\r\
\n"
description: "web2grid projektg\xE9p (\xE9s egyebek)\r\n"
groups: [5]
hostname: bvp6
ipv4: 152.66.243.80
ipv6: 2001:738:2001:4031:66:243:80:0
location: cloud-os gep
mac: 02:00:98:42:f3:50
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 497
- fields:
comment: ''
description: cloud-os gep
groups: [4]
hostname: Gabor_BackUp
ipv4: 10.9.1.5
ipv6: 2001:738:2001:4031:9:1:5:0
location: ''
mac: 02:00:0a:09:01:05
owner: 5
pub_ipv4: 152.66.243.62
rules: [773, 774]
shared_ip: true
vlan: 10
model: firewall.host
pk: 501
- fields:
comment: ''
description: ''
groups: [2, 4]
hostname: mega4
ipv4: 10.3.1.14
ipv6: 2001:738:2001:4031:3:1:14:0
location: ''
mac: b4:99:ba:aa:20:44
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 510
- fields:
comment: ''
description: ''
groups: []
hostname: mega4-ilo
ipv4: 10.3.2.14
ipv6: 2001:738:2001:4031:3:2:14:0
location: ''
mac: b4:99:ba:aa:20:46
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 511
- fields:
comment: ''
description: ''
groups: [2, 4]
hostname: mega3
ipv4: 10.3.1.13
ipv6: 2001:738:2001:4031:3:1:13:0
location: ''
mac: b4:99:ba:aa:1b:d6
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 513
- fields:
comment: ''
description: ''
groups: []
hostname: mega3-ilo
ipv4: 10.3.2.13
ipv6: 2001:738:2001:4031:3:2:13:0
location: ''
mac: b4:99:ba:aa:1b:d5
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 514
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-90_user-bd
ipv4: 10.9.1.19
ipv6: 2001:738:2001:4031:9:1:19:0
location: ''
mac: 02:00:0a:09:01:13
owner: 2
pub_ipv4: 152.66.243.62
rules: [825]
shared_ip: true
vlan: 10
model: firewall.host
pk: 524
- fields:
comment: "BD szem\xE9lyes akkountoszt\xF3s g\xE9pe"
description: cloud-os gep
groups: [5]
hostname: kagylo
ipv4: 152.66.243.65
ipv6: 2001:738:2001:4031:66:243:65:0
location: ''
mac: 02:00:98:42:f3:41
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 532
- fields:
comment: ''
description: ''
groups: [2]
hostname: mega1-ilo
ipv4: 10.3.2.11
ipv6: 2001:738:2001:4031:3:2:11:0
location: ''
mac: 18:a9:05:c5:67:ca
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 535
- fields:
comment: ''
description: ''
groups: [2, 4]
hostname: mega1
ipv4: 10.3.1.11
ipv6: 2001:738:2001:4031:3:1:11:0
location: ''
mac: 18:a9:05:c5:67:c8
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 536
- fields:
comment: "Admin: Szeber\xE9nyi Imre"
description: "GridOO labor hallgat\xF3i szerver"
groups: [5]
hostname: ParaHead
ipv4: 152.66.243.90
ipv6: 2001:738:2001:4031:66:243:90:0
location: cloud
mac: 02:00:98:42:f3:5a
owner: 4
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 541
- fields:
comment: ''
description: ''
groups: [2]
hostname: mega2-ilo
ipv4: 10.3.2.12
ipv6: 2001:738:2001:4031:3:2:12:0
location: ''
mac: d8:d3:85:ae:f9:7a
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 544
- fields:
comment: ''
description: ''
groups: [2, 4]
hostname: mega2
ipv4: 10.3.1.12
ipv6: 2001:738:2001:4031:3:1:12:0
location: ''
mac: d8:d3:85:ae:f9:78
owner: 2
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 545
- fields:
comment: ''
description: cloud-os gep
groups: [5]
hostname: store
ipv4: 152.66.243.70
ipv6: 2001:738:2001:4031:66:243:70:0
location: ''
mac: 02:00:98:42:f3:46
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 546
- fields:
comment: ''
description: "Ny\xEDri G\xE1bor laptopja"
groups: [1, 2, 4]
hostname: gabor
ipv4: 10.5.253.7
ipv6: 2001:738:2001:4031:5:253:7:0
location: ''
mac: 00:1C:C4:C9:6C:DD
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 547
- fields:
comment: ''
description: Tarokkk anonim alkoholista szervere.
groups: [5]
hostname: tarokkk
ipv4: 152.66.243.78
ipv6: 2001:738:2001:4031:66:243:78:0
location: ''
mac: 02:00:98:42:f3:4e
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 550
- fields:
comment: ''
description: harmadik emeleti rendezoben levo linksys switch (regi denes fele
halozat resze volt)
groups: [2]
hostname: switch2
ipv4: 10.3.0.3
ipv6: 2001:738:2001:4031:3:254:2:0
location: ''
mac: 00:1e:e5:09:70:19
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 2
model: firewall.host
pk: 554
- fields:
comment: ''
description: "Dud\xE1s \xC1d\xE1m laptop"
groups: [1, 2]
hostname: dudi
ipv4: 10.5.253.8
ipv6: 2001:738:2001:4031:5:253:8:0
location: ''
mac: 00:1d:72:3b:64:b7
owner: 1
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 555
- fields:
comment: ''
description: "Prog2 t\xE1rgyhonlap drupal"
groups: [5]
hostname: infocpp
ipv4: 152.66.243.67
ipv6: 2001:738:2001:4031:66:243:67:0
location: cloud
mac: 02:00:98:42:f3:43
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 596
- fields:
comment: ''
description: cloud-os gep
groups: [5, 6]
hostname: zimbra
ipv4: 152.66.243.68
ipv6: 2001:738:2001:4031:66:243:68:0
location: ''
mac: 02:00:98:42:f3:44
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 612
- fields:
comment: ''
description: TeamConcert Windows 2008 server
groups: [5]
hostname: teamconcert
ipv4: 152.66.243.69
ipv6: 2001:738:2001:4031:66:243:69:0
location: ''
mac: 02:00:98:42:f3:45
owner: 4
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 618
- fields:
comment: ''
description: ''
groups: [5, 7]
hostname: cporta
ipv4: 152.66.243.81
ipv6: 2001:738:2001:4031:66:243:81:0
location: ''
mac: 02:00:98:42:f3:51
owner: 3
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 623
- fields:
comment: ''
description: cloud-os gep
groups: [5, 7]
hostname: ui
ipv4: 152.66.243.73
ipv6: 2001:738:2001:4031:66:243:73:0
location: ''
mac: 02:00:98:42:f3:49
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 630
- fields:
comment: ''
description: cloud-os gep
groups: [5, 7]
hostname: vers
ipv4: 152.66.243.74
ipv6: 2001:738:2001:4031:66:243:74:0
location: ''
mac: 02:00:98:42:f3:4a
owner: 5
pub_ipv4: null
rules: []
shared_ip: false
vlan: 7
model: firewall.host
pk: 631
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-145_user-test
ipv4: 10.9.1.6
ipv6: 2001:738:2001:4031:9:1:6:0
location: ''
mac: 02:00:0a:09:01:06
owner: 7
pub_ipv4: 152.66.243.62
rules: [978]
shared_ip: true
vlan: 10
model: firewall.host
pk: 635
- fields:
comment: "Migr\xE1lva r\xE9gi cloudr\xF3l: 2013-01-22"
description: "Han\xE1k P\xE9ter win7 g\xE9pe"
groups: [4]
hostname: id-708-Hanak-Windows7
ipv4: 10.9.1.9
ipv6: 2001:738:2001:4031:9:1:9:0
location: cloud-os gep
mac: 02:00:0a:09:01:09
owner: 5
pub_ipv4: 152.66.243.62
rules: [984, 985]
shared_ip: true
vlan: 10
model: firewall.host
pk: 640
- fields:
comment: ''
description: lennon laptopja
groups: [1]
hostname: lennon
ipv4: 10.5.253.11
ipv6: 2001:738:2001:4031:5:253:11:0
location: ''
mac: a4:ba:db:d7:96:4c
owner: 6
pub_ipv4: null
rules: []
shared_ip: false
vlan: 1
model: firewall.host
pk: 645
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-156_user-lennon
ipv4: 10.9.1.13
ipv6: 2001:738:2001:4031:9:1:13:0
location: ''
mac: 02:00:0a:09:01:0d
owner: 6
pub_ipv4: 152.66.243.62
rules: [994]
shared_ip: true
vlan: 10
model: firewall.host
pk: 648
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-158_user-K7YLW5
ipv4: 10.9.1.15
ipv6: 2001:738:2001:4031:9:1:15:0
location: ''
mac: 02:00:0a:09:01:0f
owner: 14
pub_ipv4: 152.66.243.62
rules: [996]
shared_ip: true
vlan: 10
model: firewall.host
pk: 650
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-161_user-root
ipv4: 10.9.1.17
ipv6: 2001:738:2001:4031:9:1:17:0
location: ''
mac: 02:00:0a:09:01:11
owner: 1
pub_ipv4: 152.66.243.62
rules: [999]
shared_ip: true
vlan: 10
model: firewall.host
pk: 653
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-165_user-K2JL24
ipv4: 10.9.1.21
ipv6: 2001:738:2001:4031:9:1:21:0
location: ''
mac: 02:00:0a:09:01:15
owner: 11
pub_ipv4: 152.66.243.62
rules: [1003]
shared_ip: true
vlan: 10
model: firewall.host
pk: 657
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-166_user-TFDAZ6
ipv4: 10.9.1.26
ipv6: 2001:738:2001:4031:9:1:26:0
location: ''
mac: 02:00:0a:09:01:1a
owner: 13
pub_ipv4: 152.66.243.62
rules: []
shared_ip: true
vlan: 10
model: firewall.host
pk: 664
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-167_user-TFDAZ6
ipv4: 10.9.1.27
ipv6: 2001:738:2001:4031:9:1:27:0
location: ''
mac: 02:00:0a:09:01:1b
owner: 13
pub_ipv4: 152.66.243.62
rules: []
shared_ip: true
vlan: 10
model: firewall.host
pk: 665
- fields:
comment: ''
description: ''
groups: [4]
hostname: id-169_user-TFDAZ6
ipv4: 10.9.1.29
ipv6: 2001:738:2001:4031:9:1:29:0
location: ''
mac: 02:00:0a:09:01:1d
owner: 13
pub_ipv4: 152.66.243.62
rules: []
shared_ip: true
vlan: 10
model: firewall.host
pk: 667
- fields:
comment: ''
description: cloud-os gep
groups: [4]
hostname: id-740-one-740
ipv4: 10.9.1.30
ipv6: 2001:738:2001:4031:9:1:30:0
location: ''
mac: 02:00:0a:09:01:1e
owner: 5
pub_ipv4: 152.66.243.62
rules: [1021, 1022]
shared_ip: true
vlan: 10
model: firewall.host
pk: 668
- fields:
name: default
rules: [12, 15, 26, 31, 35, 36, 38, 867]
model: firewall.firewall
pk: 1
#!/bin/bash
if [ -z "$SSH_AUTH_SOCK" ]
then
cat <<A
Use SSH authentication agent forwarding ("ssh -A cloud@host").
On the client side you can use "ssh-add [filename]" to let the agent know more keys.
In .ssh/config you can also use "ForwardAgent yes" setting.
A
exit 1
fi
if ! git config user.name
then
echo -n "Your name: "
read NAME
git config --global user.name "$NAME"
fi
mysql <<A
DROP USER webadmin@localhost;
A
mysql <<A
DROP DATABASE webadmin;
A
set -e
mysql <<A
CREATE USER webadmin@localhost IDENTIFIED BY 'asjklddfjklqjf';
CREATE DATABASE webadmin CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON webadmin.* TO webadmin@localhost;
A
cd /opt/webadmin/
mv cloud cloud.$(date +%s) || true
git clone 'ssh://git@giccero.cloud.ik.bme.hu/cloud'
cd cloud
./manage.py syncdb --noinput
./manage.py migrate
./manage.py createsuperuser --email=cloud@ik.bme.hu
./manage.py loaddata /home/cloud/user.yaml 2>/dev/null || true
./manage.py loaddata /home/cloud/fw.yaml
./manage.py loaddata /home/cloud/one.yaml
./manage.py update
- fields: {name: wifi, nat: true, public: false}
model: one.network
pk: 1
- fields: {CPU: 1, RAM: 102, name: small}
model: one.instancetype
pk: 1
- fields: {access_type: ssh, created_at: !!timestamp '2013-01-24 23:06:00+00:00', disk: 1, instance_type: 1, name: tty, network: 1, owner: 1}
model: one.template
pk: 1
- fields: {name: Copy of ttylinux - kvm}
model: one.disk
pk: 1
- fields:
comment: ''
description: ''
dhcp_pool: manual
domain: wifi.ik.bme.hu
interface: fake
ipv4: 192.168.255.254
ipv6: 2001:738:2001:4031:168:255:254:0
name: 'wifi'
net4: 192.168.0.0
net6: '2001:738:2001:4031:168::'
prefix4: 16
prefix6: 80
snat_ip: 152.66.243.160
snat_to: [4, 7]
vid: 168
model: firewall.vlan
pk: 168
- fields:
date_joined: 2012-11-27 10:33:20+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: true
is_superuser: false
last_login: 2013-01-14 21:41:28+00:00
last_name: ''
password: pbkdf2_sha256$10000$nKZoYcdY1hCp$EUltsuHxLC4hYDMjh0P/3JCqZshnrvYTZpQDcotqjns=
user_permissions: []
username: bd
model: auth.user
pk: 2
- fields:
date_joined: 2012-11-27 10:40:57+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2012-11-27 10:40:57+00:00
last_name: ''
password: pbkdf2_sha256$10000$yQSOV0aqQyKoM$YryBbUnvH8pc3+OcpU6CoxPfxA+H/+s5LIRgKKbtrA=
user_permissions: []
username: mate
model: auth.user
pk: 3
- fields:
date_joined: 2012-11-27 10:41:08+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2012-11-27 10:41:08+00:00
last_name: ''
password: pbkdf2_sha256$10000$aDfLP2f50s9$/J3We6Rbgx5karvbK/xRcGJVPpQHKlPnGSxHMYl7/AgU=
user_permissions: []
username: tarokkk
model: auth.user
pk: 4
- fields:
date_joined: 2012-12-23 18:57:31+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2012-12-23 18:57:31+00:00
last_name: ''
password: pbkdf2_sha256$10000$fJrZiQ78vfDi$obQ8lqeEbWu1gJkUohGaL2VXDB+zHuc7qzrWwmDKye4=
user_permissions: []
username: opennebula
model: auth.user
pk: 5
- fields:
date_joined: 2013-01-14 15:01:51+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: true
is_superuser: true
last_login: 2013-01-14 15:07:27+00:00
last_name: ''
password: pbkdf2_sha256$10000$PxbeA5QOMTNr$hxUBeBD9yU7Gmu75+drJoqgpHFeYtop0w5ovx978Ec8=
user_permissions: []
username: lennon
model: auth.user
pk: 6
- fields:
date_joined: 2013-01-16 12:36:01+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: true
is_superuser: true
last_login: 2013-01-22 15:21:22+00:00
last_name: ''
password: pbkdf2_sha256$10000$gx04X6OpW8kW$iCU3cuhqQcvq7I8tRVkrnES03ty/3vqN8ou4xZgfPBQ=
user_permissions: []
username: test
model: auth.user
pk: 7
- fields:
date_joined: 2013-01-21 18:07:32+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: true
is_superuser: true
last_login: 2013-01-21 18:08:27+00:00
last_name: ''
password: pbkdf2_sha256$10000$1ckVZD48XFt8$7vj20S4x33KDRP/y02PKm8is9zf1FoLHJQ+xf1zhKzw=
user_permissions: []
username: test23
model: auth.user
pk: 9
- fields:
date_joined: 2013-01-21 18:11:21+00:00
email: ''
first_name: ''
groups: []
is_active: true
is_staff: true
is_superuser: true
last_login: 2013-01-22 00:09:01+00:00
last_name: ''
password: pbkdf2_sha256$10000$9gr7ctlRFCS8$A3Ex+7gs0OVU+SzZNvijisjvCQjBT6l0Tl3dGCQ5UEs=
user_permissions: []
username: test77
model: auth.user
pk: 10
- fields:
date_joined: 2013-01-22 23:03:18+00:00
email: orymate@gmail.com
first_name: "M\xE1t\xE9"
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2013-01-23 22:12:20+00:00
last_name: "\u0150ry"
password: '!'
user_permissions: []
username: K2JL24
model: auth.user
pk: 11
- fields:
date_joined: 2013-01-23 08:49:10+00:00
email: bd@doszgep.hu
first_name: "D\xE1niel"
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2013-01-23 11:30:27+00:00
last_name: Bach
password: '!'
user_permissions: []
username: JI1M92
model: auth.user
pk: 12
- fields:
date_joined: 2013-01-23 13:37:22+00:00
email: gubasanyi@gmail.com
first_name: "S\xE1ndor"
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2013-01-24 21:40:05+00:00
last_name: Guba
password: '!'
user_permissions: []
username: TFDAZ6
model: auth.user
pk: 13
- fields:
date_joined: 2013-01-23 15:04:46+00:00
email: madbence@gmail.com
first_name: Bence
groups: []
is_active: true
is_staff: false
is_superuser: false
last_login: 2013-01-23 15:04:46+00:00
last_name: "D\xE1nyi"
password: '!'
user_permissions: []
username: K7YLW5
model: auth.user
pk: 14
<!DOCTYPE html>
<html lang="hu-hu">
<head>
<title>
IK Cloud
</title>
<link href='http://fonts.googleapis.com/css?family=Metrophobic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../../one/static/style.css">
<link rel="icon" type="image/png" href="one/static/favicon.png">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('.wm').click(function(){
if($(this).children('.details').is(':hidden')){
$(this).children('.details')
.css('height',0)
.css('padding','0px 5px')
.show()
.animate({height:160,paddingTop:15,paddingBottom:15},700);
} else {
var that=this;
$(this).children('.details')
.css('height',130)
.css('padding','15px 5px')
.animate({height:0,paddingTop:0,paddingBottom:0},700,function(){
$(that).children('.details').hide();
});
}
})
})
</script>
</head>
<body>
<div id="header">
<div id="loginblock">
<p>
Bejelentkezve: root. <a href="/logout/">Kijelentkezés</a> . <a href="/admin/">Admin</a> .
</p>
</div>
<h1>
<a href="/">IK Cloud</a>
</h1>
</div>
<div id="content">
<div class="boxes">
<div class="contentblock" id="state">
<h2>
Virtuális gépek
</h2>
<ul class="content" id="wm-list">
<div class="wm">
<div class="summary">
<!--<div class="id">161</div>-->
<div class="name wm-on">
<a href="/vm/show/161/" title="root Ubuntu 12.04 server (724)">root Ubuntu 12.04...</a>
</div>
<div class="actions">
<a href="#"><img src="../../one/static/icons/plug.png" alt="plug" /></a>
<a href="#"><img src="../../one/static/icons/control-pause.png" alt="pause" /></a>
<a href="#"><img src="../../one/static/icons/minus-circle.png" alt="delete" /></a>
</div>
<div class="status">
DONE
</div>
<div class="clear"></div>
</div>
<div class="details" style="display: none">
<h3>Részletek</h3>
<ul>
<li class="name">Gép neve: <span class="value">Ubuntyu</span></li>
<li class="os-linux">Operációs rendszer: <span class="value">Ubuntu 12.04 Desktop</span></li>
<li class="type">Instance típus: <span class="value">Small</span></li>
<li class="date">Létrehozás dátuma: <span class="value">2013.01.24. 12:04</span></li>
</ul>
</div>
</div>
<div class="wm">
<div class="summary">
<!--<div class="id">161</div>-->
<div class="name wm-off">
<a href="/vm/show/161/" title="root Ubuntu 12.04 server (724)">root Windows 7...</a>
</div>
<div class="actions">
<a href="#"><img src="../../one/static/icons/control.png" alt="connect" /></a>
<a href="#"><img src="../../one/static/icons/minus-circle.png" alt="delete" /></a>
</div>
<div class="status">
SUSPENDED
</div>
<div class="clear"></div>
<div class="details" style="display: none">asdasd</div>
</div>
<div class="details" style="display: none">
<h3>Részletek</h3>
<ul>
<li class="name">Gép neve: <span class="value">Wendóz</span></li>
<li class="os-win">Operációs rendszer: <span class="value">Windows 7</span></li>
<li class="type">Instance típus: <span class="value">Medium</span></li>
<li class="date">Létrehozás dátuma: <span class="value">2013.01.21. 22:15</span></li>
</ul>
</div>
</div>
<div id="new-wm-tooltip" style="display: none">
<div id="new-wm-tooltip-container">
<p>
Még nem indított egy gépet sem.
</p>
<p>
Válasszon sablont, és iziben használhatja a kiválasztott rendszert.
</p>
</div>
</div>
<div id="new-wm-button" class="wm">
<div class="summary">
<div class="name">Új gép indítása</div>
<div class="clear"></div>
</div>
</div>
<div id="new-wm" style="display: none;">
<form method="post" action="/vm/new/3/">
<div style='display:none'>
<input type='hidden' name='csrfmiddlewaretoken' value='Q01Rek6t07uPWEbTvI9zmz5k6hyCIsvZ'>
</div>
<p>
<input type="submit" value="Ubuntu 12.04 server" class="button widebutton">
</p>
</form>
<form method="post" action="/vm/new/4/">
<div style='display:none'>
<input type='hidden' name='csrfmiddlewaretoken' value='Q01Rek6t07uPWEbTvI9zmz5k6hyCIsvZ'>
</div>
<p>
<input type="submit" value="Windows 7" class="button widebutton">
</p>
</form>
<form method="post" action="/vm/new/7/">
<div style='display:none'>
<input type='hidden' name='csrfmiddlewaretoken' value='Q01Rek6t07uPWEbTvI9zmz5k6hyCIsvZ'>
</div>
<p>
<input type="submit" value="Ubuntu 12.04 Desktop" class="button widebutton">
</p>
</form>
</div>
</ul>
</div>
</div>
<div class="boxes">
<div class="contentblock">
<h2>
Adattár
</h2>
<div class="content">
<ul class="file-list">
<li class="wm">
<div class="summary">
<div class="name filetype-c">hello.c</div>
<div class="actions">
<a href="#"><img src="../../one/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="../../one/static/icons/minus-circle.png" alt="delete" /></a>
<a href="#"><img src="../../one/static/icons/download-cloud.png" alt="download" /></a>
</div>
<div class="info">1 Kb</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Típus: <span class="value">text/plain</span></li>
</ul>
</div>
</li>
<li class="wm">
<div class="summary">
<div class="name filetype-image">suna.jpg</div>
<div class="actions">
<a href="#"><img src="../../one/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="../../one/static/icons/minus-circle.png" alt="delete" /></a>
<a href="#"><img src="../../one/static/icons/download-cloud.png" alt="download" /></a>
</div>
<div class="info">1 Kb</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Típus: <span class="value">image/jpg</span></li>
</ul>
</div>
</li>
<li class="wm">
<div class="summary">
<div class="name filetype-folder">poresz</div>
<div class="actions">
<a href="#"><img src="../../one/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="../../one/static/icons/minus-circle.png" alt="delete" /></a>
</div>
<div class="info">katalógus</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Fájlok: <span class="value">666 db</span></li>
</ul>
</div>
</li>
<li class="file-details wm">
<div class="summary">
<div class="name filetype-more">Mutasd a régebbi fájlokat!</div>
<div class="clear"></div>
</div>
</li>
<li class="file-upload wm">
<div class="summary">
<div class="name filetype-up">Fájlfeltöltés</div>
<div class="clear"></div>
</div>
</li>
</ul>
</div>
</div>
<div class="contentblock" id="state">
<h2>
A cluster állapota
</h2>
<div class="content">
<p>
<a href="http://cloud.ik.bme.hu/"><img src="/stat/cpu.png" alt="aktuális terhelés"> <img src="/stat/ram.png" alt="aktuális memóriafoglaltság"></a>
</p>
</div>
</div>
</div>
</div>
<div id="modal" style="display: none">
<div id="shadow"></div>
<div id="modal-container">
<div></div>
</div>
</div>
</body>
</html>
......@@ -7,16 +7,18 @@ from django.db import transaction
from django.db.models.signals import post_save
from django import forms
from django.utils.translation import ugettext_lazy as _
from one.util import keygen
from school.models import Person
from firewall.models import Host, Rule, Vlan
from firewall.tasks import reload_firewall_lock
from one.util import keygen
from school.models import Person
import subprocess, tempfile, os, stat, re
pwgen = User.objects.make_random_password
"""
User creation hook: create cloud details object
"""
def create_user_profile(sender, instance, created, **kwargs):
if created:
d = UserCloudDetails(user=instance)
......@@ -24,13 +26,22 @@ def create_user_profile(sender, instance, created, **kwargs):
d.save()
post_save.connect(create_user_profile, sender=User)
"""
Cloud related details of a user
"""
class UserCloudDetails(models.Model):
user = models.ForeignKey(User, null=False, blank=False, unique=True)
smb_password = models.CharField(max_length=20)
ssh_key = models.ForeignKey('SshKey', null=True)
ssh_private_key = models.TextField()
user = models.ForeignKey(User, null=False, blank=False, unique=True, verbose_name=_('user'))
smb_password = models.CharField(max_length=20,
verbose_name=_('Samba password'),
help_text=_('Generated password for accessing store from Windows.'))
ssh_key = models.ForeignKey('SshKey', null=True, verbose_name=_('SSH key (public)'),
help_text=_('Generated SSH public key for accessing store from Linux.'))
ssh_private_key = models.TextField(verbose_name=_('SSH key (private)'),
help_text=_('Generated SSH private key for accessing store from Linux.'))
"""
Delete old SSH key pair and generate new one.
"""
def reset_keys(self):
pri, pub = keygen()
self.ssh_private_key = pri
......@@ -41,9 +52,15 @@ class UserCloudDetails(models.Model):
self.ssh_key = SshKey(user=self.user, key=pub)
self.ssh_key.save()
"""
Generate new Samba password.
"""
def reset_smb(self):
self.smb_password = pwgen()
"""
Generate key pair and Samba password if needed.
"""
def clean(self):
super(UserCloudDetails, self).clean()
if not self.ssh_key:
......@@ -51,6 +68,9 @@ class UserCloudDetails(models.Model):
if not self.smb_password or len(self.smb_password) == 0:
self.reset_smb()
"""
Validate OpenSSH keys (length and type).
"""
class OpenSshKeyValidator(object):
valid_types = ['ssh-rsa', 'ssh-dsa']
......@@ -74,13 +94,16 @@ class OpenSshKeyValidator(object):
except:
raise ValidationError(_('Invalid OpenSSH public key.'))
"""
SSH public key (in OpenSSH format).
"""
class SshKey(models.Model):
user = models.ForeignKey(User, null=False, blank=False)
key = models.CharField(max_length=2000, verbose_name=_('SSH key'),
help_text=_('<a href="/info/ssh/">SSH public key in OpenSSH format</a> used for shell login '
'(2048+ bit RSA preferred). Example: <code>ssh-rsa AAAAB...QtQ== '
'john</code>.'), validators=[OpenSshKeyValidator()])
def __unicode__(self):
try:
keycomment = self.key.split(None, 2)[2]
......@@ -89,10 +112,15 @@ class SshKey(models.Model):
return u"%s (%s)" % (keycomment, self.user)
"""
Virtual disks automatically synchronized with OpenNebula.
"""
class Disk(models.Model):
name = models.CharField(max_length=100, unique=True, verbose_name=_('name'))
"""
Get and register virtual disks from OpenNebula.
"""
@classmethod
def update(cls):
import subprocess
......@@ -121,12 +149,17 @@ class Disk(models.Model):
class Meta:
ordering = ['name']
"""
Virtual networks automatically synchronized with OpenNebula.
"""
class Network(models.Model):
name = models.CharField(max_length=100, unique=True, verbose_name=_('name'))
nat = models.BooleanField()
public = models.BooleanField()
nat = models.BooleanField(verbose_name=_('NAT'), help_text=_('If network address translation is done.'))
public = models.BooleanField(verbose_name=_('public'), help_text=_('If internet gateway is available.'))
"""
Get and register virtual networks from OpenNebula.
"""
@classmethod
def update(cls):
import subprocess
......@@ -154,56 +187,84 @@ class Network(models.Model):
class Meta:
ordering = ['name']
"""
Instance types in OCCI configuration (manually synchronized).
"""
class InstanceType(models.Model):
name = models.CharField(max_length=100, unique=True,
verbose_name=_('name'))
CPU = models.IntegerField()
RAM = models.IntegerField()
CPU = models.IntegerField(help_text=_('CPU cores.'))
RAM = models.IntegerField(help_text=_('Mebibytes of memory.'))
def __unicode__(self):
return u"%s" % self.name
"""
Virtual machine template specifying OS, disk, type and network.
"""
class Template(models.Model):
name = models.CharField(max_length=100, unique=True,
verbose_name=_('név'))
access_type = models.CharField(max_length=10, choices=[('rdp', 'rdp'), ('nx', 'nx'), ('ssh', 'ssh')])
disk = models.ForeignKey(Disk)
instance_type = models.ForeignKey(InstanceType)
network = models.ForeignKey(Network)
owner = models.ForeignKey(User)
created_at = models.DateTimeField(auto_now_add=True)
verbose_name=_('name'))
access_type = models.CharField(max_length=10,
choices=[('rdp', 'rdp'), ('nx', 'nx'), ('ssh', 'ssh')],
verbose_name=_('access method'))
disk = models.ForeignKey(Disk, verbose_name=_('disk'))
instance_type = models.ForeignKey(InstanceType, verbose_name=_('instance type'))
network = models.ForeignKey(Network, verbose_name=_('network'))
owner = models.ForeignKey(User, verbose_name=_('owner'))
created_at = models.DateTimeField(auto_now_add=True, verbose_name=_('created at'))
def __unicode__(self):
return self.name
class Meta:
verbose_name = _('sablon')
verbose_name_plural = _('sablonok')
verbose_name = _('template')
verbose_name_plural = _('templates')
"""
Virtual machine instance.
"""
class Instance(models.Model):
name = models.CharField(max_length=100, unique=True,
verbose_name=_('név'), null=True, blank=True)
ip = models.IPAddressField(blank=True, null=True)
template = models.ForeignKey(Template)
owner = models.ForeignKey(User)
created_at = models.DateTimeField(auto_now_add=True)
state = models.CharField(max_length=20, choices=[('DEPLOYABLE', 'DEPLOYABLE'), ('PENDING', 'PENDING'), ('DONE', 'DONE'), ('ACTIVE', 'ACTIVE'),('UNKNOWN', 'UNKNOWN'), ('SUSPENDED', 'SUSPENDED'), ('FAILED', 'FAILED')], default='DEPLOYABLE')
active_since = models.DateTimeField(null=True, blank=True)
firewall_host = models.ForeignKey(Host, blank=True, null=True)
pw = models.CharField(max_length=20)
one_id = models.IntegerField(unique=True, blank=True, null=True)
ip = models.IPAddressField(blank=True, null=True, verbose_name=_('IP address'))
template = models.ForeignKey(Template, verbose_name=_('template'))
owner = models.ForeignKey(User, verbose_name=_('owner'))
created_at = models.DateTimeField(auto_now_add=True, verbose_name=_('created_at'))
state = models.CharField(max_length=20,
choices=[('DEPLOYABLE', _('deployable')),
('PENDING', _('pending')),
('DONE', _('done')),
('ACTIVE', _('active')),
('UNKNOWN', _('unknown')),
('SUSPENDED', _('suspended')),
('FAILED', _('failed'))], default='DEPLOYABLE')
active_since = models.DateTimeField(null=True, blank=True,
verbose_name=_('active since'),
help_text=_('Time stamp of successful boot report.'))
firewall_host = models.ForeignKey(Host, blank=True, null=True, verbose_name=_('host in firewall'))
pw = models.CharField(max_length=20, verbose_name=_('password'), help_text=_('Original password of instance'))
one_id = models.IntegerField(unique=True, blank=True, null=True, verbose_name=_('OpenNebula ID'))
"""
Get public port number for default access method.
"""
def get_port(self):
proto = self.template.access_type
if self.template.network.nat:
return {"rdp": 23000, "nx": 22000, "ssh": 22000}[proto] + int(self.ip.split('.')[3])
else:
return {"rdp": 3389, "nx": 22, "ssh": 22}[proto]
"""
Get public hostname.
"""
def get_connect_host(self):
if self.template.network.nat:
return 'cloud'
else:
return self.ip
"""
Get access parameters in URI format.
"""
def get_connect_uri(self):
try:
proto = self.template.access_type
......@@ -217,6 +278,10 @@ class Instance(models.Model):
def __unicode__(self):
return self.name
"""
Get and update VM state from OpenNebula.
"""
def update_state(self):
import subprocess
......@@ -241,6 +306,9 @@ class Instance(models.Model):
self.save()
return x
"""
Get age of VM in seconds.
"""
def get_age(self):
from datetime import datetime
age = 0
......@@ -253,8 +321,11 @@ class Instance(models.Model):
@models.permalink
def get_absolute_url(self):
return ('vm_show', None, {'iid':self.id,})
return ('vm_show', None, {'iid':self.id})
"""
Submit a new instance to OpenNebula.
"""
@classmethod
def submit(cls, template, owner):
from django.template.defaultfilters import escape
......@@ -298,8 +369,7 @@ class Instance(models.Model):
"smbpw": escape(details.smb_password),
"sshkey": escape(details.ssh_private_key),
"neptun": escape(owner.username),
"booturl": "http://cloud.ik.bme.hu/b/%s/" % token,
}
"booturl": "http://cloud.ik.bme.hu/b/%s/" % token, }
f.write(tpl)
f.close()
import subprocess
......@@ -332,6 +402,9 @@ class Instance(models.Model):
reload_firewall_lock()
return inst
"""
Delete host in OpenNebula.
"""
def delete(self):
proc = subprocess.Popen(["/opt/occi.sh", "compute",
"delete", "%d"%self.one_id], stdout=subprocess.PIPE)
......@@ -343,8 +416,3 @@ class Instance(models.Model):
class Meta:
verbose_name = _('instance')
verbose_name_plural = _('instances')
# vim: et sw=4 ai fenc=utf8 smarttab :
.contentblock {
background-color: #ccc;
border-radius: 10px;
margin: 5px;
*{margin:0;padding:0;}
.clear{
clear: both;
}
.contentblock p, dl {
padding: 5px;
margin: 0;
a{
text-decoration: none;
}
.contentblock h2 {
background-color: #000;
background-image: url(hexabar.png);
background-position: right center;
background-repeat: no-repeat;
border-radius: 10px;
color: #fff;
font-weight: bold;
padding: 10px;
border-style: none!important;
margin-bottom: 5px;
font-size: 1.3em;
a:link,a:visited{
color:black;
}
/* TABLES */
table {
/*border-left: 1px solid #ccc;
border-right: 1px solid #ccc;*/
background-color: #ccc;
border-radius: 10px;
margin: 5px;
.contentblock
{
background-color:#ccc;
border-radius:4px;
border:1px solid #aaa;
box-shadow:0 0 30px rgba(0,0,0,0.3);
margin:20px;
}
.contentblock p,dl
{
margin:0;
padding:5px;
}
td, th {
border-bottom: 1px solid #bbb;
padding: 5px;
vertical-align: top;
.contentblock h2
{
background-color:#000;
background-image:url(hexabar.png);
background-position:right center;
background-repeat:no-repeat;
border-radius:4px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
color:#eee;
font-size:1.5em;
margin-top:0;
padding:10px;
}
table input,
table select,
table textarea {
min-width: 300px;
border: 1px solid #aaa;
display: block;
#new-wm-tooltip{
position: relative;
}
input[type=submit], .button, .smallbutton {
background-color: #072c61;
padding: 5px;
text-decoration: none;
color: #fff!important;
border: 2px solid #fff;
border-radius: 10px;
min-width: 5em;
margin: 0;
font-size: .9em;
line-height: .9em;
font-weight: bold;
}
.smallbutton {
padding: 1px 5px;
}
p.rightbuttons {
#new-wm-tooltip-container{
margin: 10px 10px 5px 150px;
border-radius: 4px;
border: 1px solid #888;
background: #FFFF66;
box-shadow: 0 0 20px rgba(0,0,0,0.2);
}
#new-wm-tooltip #new-wm-tooltip-container p{
text-align: left;
font-size: 0.8em;
word-spacing: 2px;
}
#new-wm-tooltip-container:after{
content: "";
position: absolute;
left: 300px;
border-width: 15px;
border-style: solid;
border-color: #FFFF66 transparent transparent transparent;
}
.wm .summary{
padding: 15px 5px;
border-top: 1px solid #888;
cursor: pointer;
background-color: #c1c1c1;
}
.wm .details{
border-top: 1px solid #888;
background-color: #d1d1d1;
padding: 15px 5px;
display: none;
}
.wm .details h3{
font-weight: normal;
}
.wm .details ul{
list-style: none;
margin: 10px 3px;
}
.wm .details li{
margin: 12px 0px;
padding: 3px 0px 3px 20px;
border-bottom: 1px dotted #aaa;
background-repeat: no-repeat;
background-position: 0px 4px;
}
.wm .details .name{
float: none;
background-image: url(icons/computer.png);
}
.wm .details .os-win{
background-image: url(icons/windows.png)
}
.wm .details .os-linux{
background-image: url(icons/animal-penguin.png)
}
.wm .details .type{
background-image: url(icons/processor.png)
}
.wm .details .date{
background-image: url(icons/calendar-day.png)
}
.wm .details .value{
float: right;
margin: 7px 0;
}
.wm:hover{
background-color: #b1b1b1;
}
.wm .name{
float: left;
}
.wm .status{
float: right;
}
.wm .id{
float: right;
width: 30px;
}
.file-list{
list-style: none;
}
.file-list .name{
float: left;
}
.file-list .info{
float: right;
width: 60px;
}
.wm .actions{
float: right;
width: 60px;
margin-left: 5px;
}
.wm .actions a{
height: 16px;
width: 16px;
display: block;
float: left;
margin-left: 2px;
}
.wm .actions a:hover{
box-shadow: 0 0 10px rgba(0,0,0,0.4);
background-color: rgba(0,0,0,0.4);
}
.wm .name{
padding-left: 25px;
background-repeat: no-repeat;
background-position: 0 0;
}
.filetype-c {
background-image: url(icons/document-visual-studio.png);
}
.filetype-image {
background-image: url(icons/document-image.png);
}
.filetype-folder {
background-image: url(icons/folder-horizontal.png);
}
.filetype-more {
background-image: url(icons/arrow-circle-double.png);
}
.filetype-up {
background-image: url(icons/upload-cloud.png);
}
#new-wm-button .name{
background-image: url(icons/computer--plus.png);
}
.wm-on{
background-image: url(icons/computer-cloud.png);
}
.wm-off{
background-image: url(icons/computer-off.png);
}
table p.help {
font-size: .85em;
color: #666;
table
{
background-color:#ccc;
border-radius:10px;
margin:5px;
}
th.fieldset {
background-color: #000;
background-image: url(hexabar.png);
background-position: right center;
background-repeat: no-repeat;
border-radius: 10px;
color: #fff;
font-weight: bold;
padding: 10px;
border-style: none!important;
margin-bottom: 5px;
font-size: 1.3em;
}
html {
/* background: #b3b3b3;*/
min-height: 100%;
margin: 0;
padding: 0;
}
body {
min-height: 100%;
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: .9em;
background: #dadada url("site_bgr.png") repeat-x;
background-position: 80px 0;
}
div#header {
margin: 0;
padding: 0;
height: 80px;
background-color: #379acc; /* per www.ik.bme.hu */
background-color: #072c61; /* per www.ik.bme.hu */
padding-left: 200px;
background-image: url(bme_feher2.png);
background-repeat: no-repeat;
background-position: 20px 18px;
border-bottom: 2px solid #fff;
td,th
{
border-bottom:1px solid #bbb;
vertical-align:top;
padding:5px;
}
table input,table select,table textarea
{
min-width:300px;
border:1px solid #aaa;
display:block;
}
div#header a:link,
div#header a:visited {
color: #fff;
input[type=submit],.button,.smallbutton
{
background-color:#072c61;
text-decoration:none;
color:#fff!important;
border:2px solid #fff;
border-radius:10px;
min-width:5em;
font-size:.9em;
line-height:.9em;
font-weight:700;
margin:0;
padding:5px;
}
div#header #loginblock {
position: absolute;
right: 0;
top: 0;
margin: 0;
padding: 7px;
background-color: #000;
background-image: url(hexabar.png);
background-position: center center;
border-radius: 0 0 0 10px;
color: #fff;
font-weight: bold;
}
div#header #loginblock p {
margin: 0;
}
div#header h1 {
margin: 0;
padding: 0 1em;
font-size: 2em;
line-height: 80px;
float: left;
color: #fff;
.smallbutton
{
padding:1px 5px;
}
div#header h1 a {
color: #fff;
text-decoration: none;
p.rightbuttons
{
float:right;
margin:7px 0;
}
div#content {
width: 850px;
margin: 0 auto;
text-align: left;
table p.help
{
font-size:.85em;
color:#666;
}
div.boxes{
width: 420px;
float: left;
th.fieldset
{
background-color:#000;
background-image:url(hexabar.png);
background-position:right center;
background-repeat:no-repeat;
border-radius:10px;
color:#fff;
font-weight:700;
margin-bottom:5px;
font-size:1.3em;
border-style:none!important;
padding:10px;
}
html
{
min-height:100%;
margin:0;
padding:0;
}
body
{
min-height:100%;
font-family:'Metrophobic',sans-serif;
font-size:.9em;
background:#dadada url(site_bgr.png) repeat-x;
background-position:80px 0;
margin:0;
padding:0;
}
#header
{
height:80px;
background-color:#072c61;
background-image:url(bme_feher2.png);
background-repeat:no-repeat;
background-position:20px 18px;
border-bottom:3px solid #0B4599;
box-shadow:0 0 30px rgba(0,0,0,0.4);
margin:0;
padding:0 0 0 200px;
}
div#header #loginblock
{
position:absolute;
right:0;
top:0;
background-color:#000;
background-image:url(hexabar.png);
background-position:center center;
border-radius:0 0 0 10px;
color:#fff;
font-weight:700;
margin:0;
padding:7px;
}
div#header #loginblock p
{
margin:0;
}
div#header h1
{
font-size:2em;
line-height:80px;
float:left;
color:#fff;
margin:0;
padding:0 1em;
}
div#content
{
width:850px;
text-align:left;
margin:0 auto;
}
div.boxes
{
width:420px;
float:left;
}
div.box
{
background-color:#000;
background-image:url(hexa.png);
background-position:center 30%;
background-repeat:no-repeat;
color:#fff;
font-weight:700;
line-height:1.5em;
width:400px;
border-radius:10px;
border-top-width:30px;
margin:10px 420px 10px 10px;
padding:2px;
}
div.box {
background-color: #000;
background-image: url(hexa.png);
background-position: center 30%;
background-repeat: no-repeat;
color: #fff;
font-weight: bold;
line-height: 1.5em;
width: 400px;
margin: 10px;
padding: 2px;
border-radius: 10px;
border-top-width: 30px;
margin-right: 420px;
}
div.box h3 {
color: #fff;
margin: 0;
padding: 3px;
text-align: center;
}
div.box .content {
padding: 5px;
margin: 0;
min-height: 100px;
}
div.box a:link, div.box a:visited {
color: #fff;
}
a:link, a:visited {
color: #892034;
}
#project_running ul a:link, #project_running ul a:visited,
#project_closed ul a:link, #project_closed ul a:visited {
color: #fff;
text-decoration: none;
div.box h3
{
color:#fff;
text-align:center;
margin:0;
padding:3px;
}
/* MESSAGES & ERRORS */
div.box .content
{
min-height:100px;
margin:0;
padding:5px;
}
ul.messagelist {
padding: 0 0 5px 0;
margin: 0;
text-align: left;
ul.messagelist
{
text-align:left;
margin:0;
padding:0 0 5px;
}
ul.messagelist li {
font-size: 12px;
display: block;
padding: 4px 5px 4px 25px;
margin: 0 0 3px 0;
border-bottom: 1px solid #ddd;
color: #666;
background: #ffc url(admin/img/icon_success.gif) 5px .3em no-repeat;
ul.messagelist li
{
font-size:12px;
display:block;
border-bottom:1px solid #ddd;
color:#666;
background:#ffc url(admin/img/icon_success.gif) 5px .3em no-repeat;
margin:0 0 3px;
padding:4px 5px 4px 25px;
}
ul.messagelist li.warning{
background-image: url(admin/img/icon_alert.gif);
ul.messagelist li.warning
{
background-image:url(admin/img/icon_alert.gif);
}
ul.messagelist li.error{
background-image: url(admin/img/icon_error.gif);
ul.messagelist li.error
{
background-image:url(admin/img/icon_error.gif);
}
.errornote {
font-size: 12px !important;
display: block;
padding: 4px 5px 4px 25px;
margin: 0 0 3px 0;
border: 1px solid red;
color: red;
background: #ffc url(admin/img/icon_error.gif) 5px .3em no-repeat;
.errornote
{
font-size:12px!important;
display:block;
border:1px solid red;
color:red;
background:#ffc url(admin/img/icon_error.gif) 5px .3em no-repeat;
margin:0 0 3px;
padding:4px 5px 4px 25px;
}
ul.errorlist {
margin: 0 !important;
padding: 0 !important;
.errorlist li
{
font-size:12px!important;
display:block;
border:1px solid red;
color:#FFF;
background:red url(admin/img/icon_alert.gif) 5px .3em no-repeat;
margin:0 0 3px;
padding:4px 5px 4px 25px;
}
.errorlist li {
font-size: 12px !important;
display: block;
padding: 4px 5px 4px 25px;
margin: 0 0 3px 0;
border: 1px solid red;
color: white;
background: red url(admin/img/icon_alert.gif) 5px .3em no-repeat;
.errorlist li a
{
color:#FFF;
text-decoration:underline;
}
.errorlist li a {
color: white;
text-decoration: underline;
td ul.errorlist li
{
margin:0!important;
}
td ul.errorlist {
margin: 0 !important;
padding: 0 !important;
.errors
{
background:#ffc;
}
td ul.errorlist li {
margin: 0 !important;
.errors input,.errors select,.errors textarea
{
border:1px solid red;
}
.errors {
background: #ffc;
div.system-message
{
background:#ffc;
font-size:.8em;
margin:10px;
padding:6px 8px;
}
.errors input, .errors select, .errors textarea {
border: 1px solid red;
div.system-message p.system-message-title
{
color:red;
background:#ffc url(admin/img/icon_error.gif) 5px .3em no-repeat;
margin:0;
padding:4px 5px 4px 25px;
}
div.system-message {
background: #ffc;
margin: 10px;
padding: 6px 8px;
font-size: .8em;
.description
{
font-size:12px;
padding:5px 0 0 12px;
}
div.system-message p.system-message-title {
padding: 4px 5px 4px 25px;
margin: 0;
color: red;
background: #ffc url(admin/img/icon_error.gif) 5px .3em no-repeat;
#state .content p
{
text-align:center;
}
.description {
font-size: 12px;
padding: 5px 0 0 12px;
input.widebutton
{
font-size:25px;
line-height:1em;
text-align:left;
width:100%;
display:block;
cursor:pointer;
}
#state .content p {
text-align: center;
.icon-delete
{
background-image:url(/static/icons/Edit-delete-2.png);
background-repeat:no-repeat;
padding-left:26px!important;
}
#state .content a img {
border: solid #072C61 2px;
border-radius:10px;
background-color: #fff;
padding: 3px;
div#header a:link,div#header a:visited,div.box a:link,div.box a:visited
{
color:#fff;
}
input.widebutton {
font-size:25px;
line-height:1em;
text-align:left;
width:400px;
display:block;
cursor:pointer;
div#header h1 a,#project_running ul a:link,#project_running ul a:visited,#project_closed ul a:link,#project_closed ul a:visited
{
color:#fff;
text-decoration:none;
}
ul.errorlist,td ul.errorlist
{
margin:0!important;
padding:0!important;
}
.icon-delete {
background-image: url(/static/icons/Edit-delete-2.png);
background-repeat: no-repeat;
padding-left: 26px!important;
#modal{
position: absolute;
width: 100%;
height: 100%;
}
#shadow{
position: absolute;
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.6);
}
#modal-container{
width: 500px;
position: fixed;
left:50%;
top:50%;
margin-left: -270px;
margin-top: -100px;
min-height: 200px;
background-color: #fff;
border-radius: 4px;
padding: 20px;
}
\ No newline at end of file
......@@ -6,6 +6,30 @@
<title>{% block title %}IK Cloud{% endblock %}</title>
<link rel="stylesheet" href="/static/style.css" />
<link rel="icon" type="image/png" href="/static/favicon.png" />
<link rel="icon" type="image/png" href="one/static/favicon.png">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('.wm').click(function(){
if($(this).children('.details').is(':hidden')){
$(this).children('.details')
.css('height',0)
.css('padding','0px 5px')
.show()
.animate({height:160,paddingTop:15,paddingBottom:15},700);
} else {
var that=this;
$(this).children('.details')
.css('height',130)
.css('padding','15px 5px')
.animate({height:0,paddingTop:0,paddingBottom:0},700,function(){
$(that).children('.details').hide();
});
}
})
})
</script>
{{ form.media }}
{% block js %}{% endblock %}
......
......@@ -26,27 +26,91 @@
{% endfor %}
</div>
<div class="boxes">
<div class="contentblock">
<h2>Adattár</h2>
<h2>
Adattár
</h2>
<div class="content">
<ul class="file-list">
<li class="wm">
<div class="summary">
<div class="name filetype-c">hello.c</div>
<div class="actions">
<a href="#"><img src="/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="/static/icons/minus-circle.png" alt="delete" /></a>
<a href="#"><img src="/static/icons/download-cloud.png" alt="download" /></a>
</div>
<div class="info">1 Kb</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>a.out <span class="file-size">4K</span> <span class="file-age">(5 perce)</span> <a href="" class="file-download">Letöltés</a></li>
<li>a.out <span class="file-size">4K</span> <span class="file-age">(5 perce)</span> <a href="" class="file-download">Letöltés</a></li>
<li class="file-details">Tovább</li>
<li class="file-upload">Fájl feltöltése</li>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Típus: <span class="value">text/plain</span></li>
</ul>
</div>
</li>
<li class="wm">
<div class="summary">
<div class="name filetype-image">suna.jpg</div>
<div class="actions">
<a href="#"><img src="/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="/static/icons/minus-circle.png" alt="delete" /></a>
<a href="#"><img src="/static/icons/download-cloud.png" alt="download" /></a>
</div>
<div class="contentblock" id="state">
<h2>A cluster állapota</h2>
<div class="content">
<p>
<a href="http://cloud.ik.bme.hu/">
<img src="/stat/cpu.png" alt="aktuális terhelés" />
<img src="/stat/ram.png" alt="aktuális memóriafoglaltság" />
</a>
</p>
<div class="info">1 Kb</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Típus: <span class="value">image/jpg</span></li>
</ul>
</div>
</li>
<li class="wm">
<div class="summary">
<div class="name filetype-folder">poresz</div>
<div class="actions">
<a href="#"><img src="/static/icons/pencil.png" alt="rename" /></a>
<a href="#"><img src="/static/icons/minus-circle.png" alt="delete" /></a>
</div>
<div class="info">katalógus</div>
<div class="clear"></div>
</div>
<div class="details">
<h3>Részletek</h3>
<ul>
<li>Létrehozva: <span class="value">2012.12.29. 23:12</span></li>
<li>Módosítva: <span class="value">2012.12.29. 23:12</span></li>
<li>Hozzáférés: <span class="value">2012.12.29. 23:12</span></li>
<li>Fájlok: <span class="value">666 db</span></li>
</ul>
</div>
</li>
<li class="file-details wm">
<div class="summary">
<div class="name filetype-more">Mutasd a régebbi fájlokat!</div>
<div class="clear"></div>
</div>
</li>
<li class="file-upload wm">
<div class="summary">
<div class="name filetype-up">Fájlfeltöltés</div>
<div class="clear"></div>
</div>
</li>
</ul>
</div>
</div>
</div>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment