r98360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98359‎ | r98360 | r98361 >
Date:19:54, 28 September 2011
Author:laner
Status:deferred
Tags:
Comment:
Adding support for non-text.wm.o domains
Modified paths:
  • /trunk/debs/wikimedia-task-dns-auth/gen-langlist-cnames (modified) (history)
  • /trunk/debs/wikimedia-task-dns-auth/gen-zones (modified) (history)

Diff [purge]

Index: trunk/debs/wikimedia-task-dns-auth/gen-zones
@@ -8,6 +8,7 @@
99 templatedir = '/etc/powerdns/templates'
1010 zonedir = '/etc/powerdns/zones'
1111 langlist = '/etc/powerdns/langlist-cnames'
 12+domainmaplist = '/etc/powerdns/domain-maplist'
1213 dblist = '/etc/powerdns/dblist-cnames'
1314
1415 header = '''; WARNING!
@@ -22,11 +23,24 @@
2324 def fillsubsts():
2425 import time
2526
26 - global substs, langlist
 27+ global substs, langlist, domainmaplist
2728
28 - # $langlist contains a list of CNAMES to the geodns record for
 29+ # domainmaplist is a file with format:
 30+ # <var>:<domainname>
 31+ # For instance:
 32+ # $langlist_wikimedia:wikimedia-lb.wikimedia.org.
 33+ domainmap = open(domainmaplist)
 34+ domainlist = {}
 35+ for map in domainmap:
 36+ var, value = map.split(':')
 37+ domainlist[var] = value
 38+
 39+ # All substs[var] in this loop contain a list of CNAMES to the geodns record for
2940 # all language subdomains
30 - substs['$langlist'] = open(langlist).read()
 41+ for var, value in domainlist.itervalues():
 42+ list = open(langlist).read()
 43+ list = list.replace('$cnamedomain', value)
 44+ substs[var] = list
3145
3246 substs['$toolserverdbs'] = open(dblist).read()
3347
Index: trunk/debs/wikimedia-task-dns-auth/gen-langlist-cnames
@@ -8,6 +8,6 @@
99 LANGLIST=$POWERDNSDIR/langlist
1010 LANGLISTSOURCE=""
1111
12 -[ $LANGLIST -nt $POWERDNSDIR/langlist-cnames ] && < $LANGLIST awk '{ print $1"\t\t\t1H\tIN CNAME\ttext.wikimedia.org."; print"www."$1"\t\t\t1H\tIN CNAME\ttext.wikimedia.org."; print $1".m\t\t\t1H\tIN CNAME\tm.wikimedia.org." }' > $POWERDNSDIR/langlist-cnames
 12+[ $LANGLIST -nt $POWERDNSDIR/langlist-cnames ] && < $LANGLIST awk '{ print $1"\t\t\t1H\tIN CNAME\t\$cnamedomain"; print"www."$1"\t\t\t1H\tIN CNAME\t\$cnamedomain"; print $1".m\t\t\t1H\tIN CNAME\tm.wikimedia.org." }' > $POWERDNSDIR/langlist-cnames
1313
1414 exit 0

Follow-up revisions

RevisionCommit summaryAuthorDate
r98364Follow up to r98360.laner20:27, 28 September 2011

Status & tagging log