From: Michael Tremer Date: Wed, 26 Nov 2008 21:02:17 +0000 (+0100) Subject: Added a new framework that stores files in xml files. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65ebcb4b29e7419790cf7a9867193f5fa51cf123;p=ipfire.org.git Added a new framework that stores files in xml files. --- diff --git a/www/data/404.xml b/www/data/404.xml new file mode 100644 index 00000000..e69de29b diff --git a/www/data/500.xml b/www/data/500.xml new file mode 100644 index 00000000..e69de29b diff --git a/www/data/download.xml b/www/data/download.xml new file mode 100644 index 00000000..9ec94c2b --- /dev/null +++ b/www/data/download.xml @@ -0,0 +1,168 @@ + + + + Downloads + + + + Downloads + + + ]]> + + + There are the brand new release 2.3 and the + two good old stables 2.1 and 1.4.9 + ]]> + + Die stabile Version 2.3 sowie die guten alten + Versionen 2.1 und 1.4.9. + ]]> + + + A list of torrent clients is on the right bar. + ]]> + + Eine Reihe von Torrent-Clients findet ihr in der Liste rechts. + ]]> + + + + + + + IPFire 2.3 (Stable) + + + + + + IPFire 2.3 - TORRENT - DISK
+ IPFire 2.3 - HTTP - DISK

+ IPFire 2.3 - HTTP - USB (HDD)
+ IPFire 2.3 - HTTP - USB (FDD) + + ]]>
+
+ + + IPFire 2.1 + + + + + + IPFire 2.1 - TORRENT - DISK
+ IPFire 2.1 - HTTP - DISK

+ IPFire 2.1 - HTTP - USB (HDD)
+ IPFire 2.1 - HTTP - USB (FDD) + + ]]>
+
+ + + IPFire 1.4.9 + + + + + After 4 years, the team has decided to cease support for this release. + ]]> + Nach 4 Jahren produktivem Einsatz hat das Team sich entschlossen den Support für + diese Version einzustellen. + ]]> + + + IPFire 1.4.9 - TORRENT
+ IPFire 1.4.9 - HTTP + + ]]>
+
+ + + Development builds + Entwicklungsversionen + + + Diese Versionen dienen dem Test und sind unter Umständen nicht für den + Produktiveinsatz geeignet. + ]]> + + + IPFire 2.3 - RC1 +   + MD5 +
+ IPFire 2.3 - Beta5 +   + MD5 +
+ IPFire 2.3 - Beta4 +   + MD5 +
+ IPFire 2.3 - Beta3 +
+ IPFire 2.3 - Beta2 +
+ IPFire 2.3 - Beta1 + + ]]>
+
+ +
+ + + + Other Tools]]> + Andere Tools]]> + + +
  • Windows
  • +
  • Linux
  • +
  • Mac OS
  • + + ]]>
    +
    + +
    +
    diff --git a/www/data/index.xml b/www/data/index.xml new file mode 100644 index 00000000..959643cc --- /dev/null +++ b/www/data/index.xml @@ -0,0 +1,131 @@ + + + + Welcome + Willkommen + + + + more security for your network + Sicherheit heute! + + IPFire is a source-based linux firewall distribution + that brings additional features with it. The easy-to-set-up system defeats + its competitiors like IPCop, Smoothwall and Endian-Firewall potty. + A stateful-inspection-firewall with a luxuriant + content-filtering-engine plus + traffic-control (QoS) rounded with latest + vpn-technology and a lot of logging is + foolproof to administer with just a very few clicks. + ]]> + IPFire ist eine aus den Sourcen gebaute Linux-Firewall-Distribution, + die mit zusätzlichen Funktionen aufwarten kann. Das leicht installierte + Grundsystem, kann es an sich mit Konkurrenten wie + z.B. IPCop, Smoothwall oder der Endian-Firewall aufnehmen. + Die Stateful-Inspection-Firewall mit üppigen + Content-Filtering-Funktionen, sowie + Traffic-Kontrolle (QoS), abgerundet durch + VPN-Technologie und breitbandigem Logging, + kann der Administrator umfassend und mit wenigen Knopfdrücken + konfigurieren. + ]]> + + +
    + ]]>
    + + + There is a big number of addons. See the short list below: + ]]> + + Zu diesen Addons gehören: + ]]> + + +
  • - Intrusion-Prevention-System Snort(Guardian) and more security tools Tripwire and Lynis
  • +
  • - File- and printserver for heterogeneous networks (Samba, CUPS, FTP & NFS)
  • +
  • - Voice-over-IP solution with Asterisk and Teamspeak plus traffic prioritization
  • +
  • - Multimedia addons (video- & audio-streaming, jukebox)
  • +
  • - WLan Access Point with hostap and many Atheros Chips
  • +
  • - and many more - List of all Addons
  • + + ]]>
    + +
  • - Intrusion-Prevention-System Snort(Guardian), sowie weitere Securtiy Tools wie Tripwire und Lynis
  • +
  • - Datei- und Druckserver für heterogene Netzwerke (Samba, CUPS, FTP & NFS)
  • +
  • - Voice-over-IP-Lösung mittels Asterisk und Teamspeak, sowie Traffic-Priorisierung
  • +
  • - Multimedia-Addons (Video- & Audio-Streaming, Jukebox)
  • +
  • - WLan Access Point mittels hostap für viele Atheros Chips
  • +
  • - und weiteren Addons - Alle Addons im Wiki
  • + + ]]>
    + +
    +
    + + + + search our wiki]]> + Suche im Wiki]]> + + + + + ]]> + + + + us]]> + Über uns]]> + + IPFire is developed by a group + of free programmers. They set it as their target + to create a secure and easy-going on ressources + firewall and a wide-ranging soho-server + in one piece.]]> + IPFire wird von einer Gruppe von + freien Personen programmiert. Diese haben sich + zum Ziel gesetzt eine sichere und ressourcenschonende + Firewall und einen breit gefächerten SOHO-Server + aus einem Guss zu erstellen. + ]]> + + + + RSS feed]]> + + IPFire - News +
    + news archive]]>
    + IPFire - News +
    + News-Archiv + ]]>
    +
    + + + Internet Relay Chat]]> + Server: irc.freenode.net
    + Channel: #ipfire
    + Web-Chat + ]]>
    +
    +
    +
    diff --git a/www/data/news.xml b/www/data/news.xml new file mode 100644 index 00000000..987c9885 --- /dev/null +++ b/www/data/news.xml @@ -0,0 +1,81 @@ + + + + + 08/11/2008 + news-12 + IPFire 2.3 Final + Get it quick + Dear Community!
    + This day, we released the final version of IPFire 2.3. +
    +
    + Major changes since the first version 2.1 in Oktober 2007 +
    +
      +
    • -DNS-Securityupdate and many more packet updates
    • +
    • -Enhancement of the packet manager
    • +
    • -Improvement of the Quality-of-Service rules - Presets for QoS
    • +
    • -Adjustable Firewall Logging
    • +
    • -Kernel-Modules for better hardware suport
    • +
    • -Change the system statistic to „collectd"
    • +
    • -Better disk handling (S.M.A.R.T. and Standby)
    • +
    • -Status- and Serviceview in the Webinterface
    • +
    • -Proxy and Redirector now work more dynamic
    • +
    +
    +
    + In addition the 2.3 will change the following things +
    +
      +
    • -Kernel update to Linux-2.6.25.19
    • +
    • Update of many more packets (OpenSSL, OpenSSH, Apache, Squid, Snort, collectd, ntfs-3g, Openswan, Updatexlrator, iptables, l7protocols)
    • +
    • -With severall Atheros Chips IPFire is able to work as Wireless Access Point
    • +
    • -Better support of UMTS-3G-Modems
    • +
    • -Use of tmpfs to reduce disk reads and writes
    • +
    • -Better hardware monitoring by the use of lmsensors
    • +
    • -Vnstat Traffic-Accounting replaces ipac-ng
    • +
    +
    +
    + The IPFire Team + ]]>
    + Sehr geehrte Community!
    + Heute wurde die Final Version von IPFire 2.3 veröffentlicht. +
    +
    + Wesentliche Änderungen seit der ersten Version 2.1 im Oktober 2007 +
    +
      +
    • -DNS-Sicherheitsupdate und viele weitere Paket-Aktualisierungen
    • +
    • -Erweiterung des Paketmanagers
    • +
    • -Verfeinerung der Quality-of-Service Regeln - Voreinstellungsmodell für QoS
    • +
    • -Feiner einstellbares Firewall Logging
    • +
    • -Kernel-Module zur Hardwareunterstützung wurden nachgeliefert
    • +
    • -Umstellung der Systemstatistiken auf „collectd"
    • +
    • -Verbessertes Festplatten-Handling (S.M.A.R.T. und Standby)
    • +
    • -Status- und Serviceübersicht im Webinterface
    • +
    • -Proxy und Redirector arbeiten dynamischer zusammen
    • +
    +
    +
    + Mit der 2.3 wird sich zusätzlich folgendes ändern +
    +
      +
    • -Der Kernel wurde auf Linux-2.6.25.19 aktualisiert
    • +
    • Aktualisierungen von weiteren Paketen (OpenSSL, OpenSSH, Apache, Squid, Snort, collectd, ntfs-3g, Openswan, Updatexlrator, iptables, l7protocols)
    • +
    • -Mit einer passenden WLAN-Karte kann der IPFire als Access-Point für WLAN-Clients dienen
    • +
    • -Bessere Unterstützung für UMTS-3G-Modems
    • +
    • -Verwendung von tmpfs zur Reduzierung von Schreibzugriffen
    • +
    • -Verbesserte Hardwareüberwachung durch Lmsensors
    • +
    • -Vnstat Traffic-Accounting ersetzt ipac-ng
    • +
    +
    +
    + Das IPFire-Team + ]]>
    +
    +
    +
    diff --git a/www/footer.inc b/www/footer.inc new file mode 100644 index 00000000..a02c1969 --- /dev/null +++ b/www/footer.inc @@ -0,0 +1,8 @@ +
    + + + + + diff --git a/www/header.inc b/www/header.inc new file mode 100644 index 00000000..94b6783f --- /dev/null +++ b/www/header.inc @@ -0,0 +1,59 @@ + + + + + %(title)s + + + + + + + + + +
    +
    diff --git a/www/index.py b/www/index.py index 3acfdb5d..8463bfe7 100755 --- a/www/index.py +++ b/www/index.py @@ -6,7 +6,7 @@ import cgi sites = ( ("ipfire.org", ("www.ipfire.org", None)), - ("www.ipfire.org", (None, cgi.FieldStorage().getfirst("file") or "index.shtml")), + ("www.ipfire.org", (None, cgi.FieldStorage().getfirst("file") or "index")), ("source.ipfire.org", (None, "source.shtml")), ("tracker.ipfire.org", (None, "tracker.shtml")), ("download.ipfire.org", (None, "download.shtml")), @@ -30,7 +30,7 @@ for (servername, destination) in sites: if destination[0]: location = "http://%s" % destination[0] if destination[1]: - location += "/%s/%s" % (language, destination[1]) + location += "/%s/%s" % (destination[1], language,) break print "Location: %s" % location diff --git a/www/ipfire.py b/www/ipfire.py new file mode 100644 index 00000000..283ed11a --- /dev/null +++ b/www/ipfire.py @@ -0,0 +1,285 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import os +import sys +import cgi + +sys.path.append(os.environ['DOCUMENT_ROOT']) + +import xml.dom.minidom + +class Error404(Exception): + pass + +class Error500(Exception): + pass + +class SItem: + def __init__(self, xml, page, lang): + self.xml = xml + self.page = page + self.lang = lang + + self.data = u"" + + def write(self, s): + self.data += s #.encode("utf-8") + + def read(self): + return self.data + + +class Menu(SItem): + def __init__(self, file, page, lang): + SItem.__init__(self, Xml(file, lang), page, lang) + self.xml.load() + + self.items = XItem(self.xml.dom).childs("Item") + + def __call__(self): + self.write("""") + return self.read() + + +class Body(SItem): + def __init__(self, xml, page, lang): + SItem.__init__(self, xml, page, lang) + + self.paragraphs = XItem(self.xml.dom, "Paragraphs").childs("Paragraph") + + self.news = News("news", self.page, self.lang) + + def __call__(self): + self.write("""
    +
    """) + for paragraph in self.paragraphs: + for heading in paragraph.childs("Heading"): + if heading.attr("lang") in (self.lang, ""): + self.write("

    " + heading.text() + "

    ") + for content in paragraph.childs("Content"): + if content.attr("lang") in (self.lang, ""): + if content.attr("raw"): + self.write(content.text()) + else: + self.write("

    " + content.text() + "

    \n") + self.write("""
    \n""") + + if self.page in ("index", "news",): + self.write(self.news(3)) + self.write("""
    """) + return self.read() + + +class News(SItem): + def __init__(self, file, page, lang): + SItem.__init__(self, Xml(file, lang), page, lang) + self.xml.load() + + self.posts = XItem(self.xml.dom).childs("Posts") + + def __call__(self, limit=None): + a = 1 + for post in self.posts: + self.write("""
    """) + for id in post.childs("Id"): + self.write("""""" % id.text()) + for heading in post.childs("Heading"): + if heading.attr("lang") in (self.lang, ""): + self.write("""

    %s - %s

    """ % (post.childs("Date")[0].text(), heading.text())) + for subtitle in post.childs("Subtitle"): + if subtitle.attr("lang") in (self.lang, ""): + self.write("""""" % \ + subtitle.text()) + for content in post.childs("Content"): + if content.attr("lang") in (self.lang, ""): + if content.attr("raw"): + self.write(content.text()) + else: + self.write("

    " + content.text() + "

    \n") + self.write("""
    """) + a += 1 + if limit and a > limit: + break + return self.read() + + +class Sidebar(SItem): + def __init__(self, xml, page, lang): + SItem.__init__(self, xml, page, lang) + + self.paragraphs = XItem(self.xml.dom, "Sidebar").childs("Paragraph") + + def __call__(self): + self.write("""
    +
    """) + for post in self.paragraphs: + for heading in post.childs("Heading"): + if heading.attr("lang") in (self.lang, ""): + self.write("

    " + heading.text() + "

    ") + for content in post.childs("Content"): + if content.attr("lang") in (self.lang, ""): + if content.attr("raw"): + self.write(content.text()) + else: + self.write("

    " + content.text() + "

    \n") + self.write("""
    """) + return self.read() + + +class XItem: + def __init__(self, dom, node=None): + self.dom = self.node = dom + if node: + self.node = self.dom.getElementsByTagName(node)[0] + self.lang = lang + + def attr(self, name): + return self.node.getAttribute(name).strip() + + def text(self): + ret = "" + for i in self.node.childNodes: + ret = ret + i.data + return ret + + def element(self, name): + return XItem(self.node, name) + + def childs(self, name): + ret = [] + for i in self.node.getElementsByTagName(name): + ret.append(XItem(i)) + return ret + + +class Xml: + def __init__(self, page, lang): + self.page = page + self.lang = lang + + self.path = None + + self.data = None + self.dom = None + + self._config = {} + + def load(self): + self.path = \ + os.path.join(os.environ['DOCUMENT_ROOT'], "data/%s.xml" % self.page) + try: + f = open(self.path) + self.data = f.read() + f.close() + self.dom = \ + xml.dom.minidom.parseString(self.data).getElementsByTagName("Site")[0] + except IOError: + #self.page = "404" + #self.load() + raise Error404 + except: + #self.page = "500" + #self.load() + raise + + def config(self): + elements = ("Title", "Columns",) + for element in elements: + self._config[element.lower()] = "" + + config = XItem(self.dom, "Config") + for element in elements: + for lang in config.childs(element): + if lang.attr("lang") == self.lang: + self._config[element.lower()] = lang.text() + return self._config + + +class Site: + def __init__(self, page, lang="en"): + self.code = "200 - OK" + self.mime = "text/html" + + self.page = page + self.lang = lang + self.xml = Xml(page=page, lang=lang) + + self.data = u"" + + self.menu = Menu("../menu", self.page, self.lang) + + self.config = { "document_name" : page, + "lang" : self.lang, + "menu" : self.menu() } + + try: + self.xml.load() + except Error404: + self.code = "404 - Not found" + #except: + # self.code = "500 - Internal Server Error" + + def write(self, s): + self.data += s #.encode("utf-8") + + def include(self, file): + f = open(file) + data = f.read() + f.close() + self.write(data % self.config) + + def prepare(self): + for key, val in self.xml.config().items(): + self.config[key] = val + + self.config["title"] = "%s - %s" % \ + (os.environ["SERVER_NAME"], self.config["title"],) + + self.body = Body(self.xml, self.page, self.lang) + self.sidebar = Sidebar(self.xml, self.page, self.lang) + + def run(self): + # First, return the http header + print "Status: %s" % self.code + print "Content-Type: %s" % self.mime + print # End header + + # Include the site's header + self.include("header.inc") + + # Import body and side elements + self.write(self.body()) + self.write(self.sidebar()) + + # Include the site's footer + self.include("footer.inc") + + return self.data.encode("utf-8") + + +page = cgi.FieldStorage().getfirst("page") +lang = cgi.FieldStorage().getfirst("lang") + +if not lang: + lang = "en" + +site = Site(page=page, lang=lang) +site.prepare() + +print site.run() diff --git a/www/menu.xml b/www/menu.xml new file mode 100644 index 00000000..8823fc0e --- /dev/null +++ b/www/menu.xml @@ -0,0 +1,21 @@ + + + + Home + Start + + + Downloads + + + Docs + Wiki + + + Forum + + + Development + Entwicklung + +