Skip to content

Commit 7f2ffba

Browse files
committed
Merge branch 'master' into dev2019
2 parents a16aa85 + 9305641 commit 7f2ffba

File tree

3 files changed

+77
-67
lines changed

3 files changed

+77
-67
lines changed

.gitignore

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# symantic web symlinks
2-
docroot/cc.licenserdf
3-
docroot/license_rdf
42
docroot/rdf
3+
docroot/license_rdf
4+
docroot/cc.licenserdf
55

66
# repositories
7-
python_src/cc.engine/
8-
python_src/cc.i18n/
9-
python_src/cc.license/
10-
python_src/cc.licenserdf/
117
python_src/rdfadict/
8+
python_src/cc.licenserdf/
9+
python_src/cc.license/
10+
python_src/cc.i18n/
11+
python_src/cc.engine/
1212

1313
# transstats.csv symlink
1414
transstats.csv

config/creativecommons.org.conf

+1-2
Original file line numberDiff line numberDiff line change
@@ -671,5 +671,4 @@
671671
#RewriteRule . /index.php [L]
672672

673673
</VirtualHost>
674-
675-
# vim: syntax=apache ts=4 sw=4 sts=4 sr et
674+
# vim: ft=apache ts=4 sw=4 sts=4 sr et:

config/livelicenses/000-default.conf

+70-59
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<VirtualHost *:8080>
22
ServerName licenses.productionwww.creativecommons.uk0.bigv.io
3-
#ServerName creativecommons.org
43
DocumentRoot /var/www/creativecommons.org/docroot
54

65
# CloudFlare doesn't like ranges - 20150804-rob.
76
Header set Accept-Ranges none
87

9-
# We're (ultimately) proxied through varnish, so drop idle connections quickly
10-
KeepAlive Off
8+
# We're (ultimately) proxied through varnish, so drop idle connections
9+
# quickly
10+
KeepAlive Off
1111

1212
# For munin
1313
<IfModule mod_status.c>
14-
<Location /server-status>
15-
SetHandler server-status
16-
Require local
17-
</Location>
14+
<Location /server-status>
15+
SetHandler server-status
16+
Require local
17+
</Location>
1818
</IfModule>
1919

2020
# Only allow connections from wwwlive
@@ -36,13 +36,13 @@
3636

3737
<Location /server-status>
3838
SetHandler server-status
39-
Order deny,allow
40-
Deny from all
41-
Allow from 127.0.0.1
39+
Order deny,allow
40+
Deny from all
41+
Allow from 127.0.0.1
4242
</Location>
4343

44-
# ScriptAlias "/update-translations" "/var/www/cci18n-webhook/app/webhook.php"
45-
# ScriptAlias "/update-legalcode" "/var/www/ccorg-webhook/app/webhook.php"
44+
#ScriptAlias "/update-translations" "/var/www/cci18n-webhook/app/webhook.php"
45+
#ScriptAlias "/update-legalcode" "/var/www/ccorg-webhook/app/webhook.php"
4646

4747
#----------
4848
# Main (general configs)
@@ -76,9 +76,9 @@
7676
DirectoryIndex deed
7777
DefaultType text/html
7878
AddDefaultCharset utf-8
79-
Require all granted
79+
Require all granted
8080
</Location>
81-
81+
8282
# Always serve up deeds as text/html, even when the country code
8383
# extension makes Apache think it's something else, like .pl being
8484
# a perl script instead of Poland, but not if it's a CSS file.
@@ -95,7 +95,7 @@
9595
### ------------------------- ####
9696
## BEGIN mod_rewrite section ##
9797
### ------------------------- ####
98-
98+
9999
RewriteEngine on
100100

101101
# LogLevel alert rewrite:trace1
@@ -105,16 +105,16 @@
105105
# sure to recomment them and restart Apache when done because the file will
106106
# become immense in a hurry.
107107
#----------
108-
108+
109109
#RewriteLog /tmp/rewrite.log
110110
#RewriteLogLevel 5
111-
111+
112112
#----------
113113
# Config
114114
#----------
115-
115+
116116
RewriteMap uppercase int:toupper
117-
117+
118118
#----------
119119
# License engine and legalcode
120120
#----------
@@ -124,8 +124,8 @@
124124
#<Location /ccengine-fcgi>
125125
# DefaultType text/html
126126
# AddDefaultCharset utf-8
127-
#Require local
128-
# Require all granted
127+
#Require local
128+
# Require all granted
129129
# </Location>
130130

131131
<Directory /var/www/creativecommons.org/python_env/bin>
@@ -141,34 +141,44 @@
141141
<Location /cc.engine-cache>
142142
DefaultType text/html
143143
AddDefaultCharset utf-8
144-
#Require all granted
144+
#Require all granted
145145
</Location>
146146

147147
<Directory /var/www/creativecommons.org/python_env/cache>
148148
Require all granted
149149
</Directory>
150150

151151
#RewriteRule "^/discover/gift-guide(.*)$" "/wp-content/themes/creativecommons.org/discover/gift-guide/$1" [PT]
152-
#Alias /discover/gift-guide/ /var/www/cc-wp-theme/creativecommons.org/discover/gift-guide/
152+
#Alias /discover/gift-guide/ /var/www/cc-wp-theme/creativecommons.org/discover/gift-guide/
153153
#Alias /discover/gift-guide /var/www/creativecommons.org/discover/gift-guide
154154
<Directory /var/www/creativecommons.org/discover/gift-guide>
155155
Options Indexes FollowSymLinks MultiViews
156-
# AllowOverride All
157-
# Order allow,deny
158-
# Allow from all
156+
# AllowOverride All
157+
# Order allow,deny
158+
# Allow from all
159159
# Require all granted
160-
# Satisfy Any
160+
# Satisfy Any
161161
</Directory>
162162

163163
<Directory /var/www/creativecommons.org/faq/>
164164
Options Indexes FollowSymLinks MultiViews
165-
# AllowOverride All
166-
# Order allow,deny
167-
# Allow from all
165+
# AllowOverride All
166+
# Order allow,deny
167+
# Allow from all
168168
# Require all granted
169-
# Satisfy Any
169+
# Satisfy Any
170170
</Directory>
171171

172+
173+
# Temporary Korean translation redirects
174+
RewriteRule ^/licenses/by/4.0/legalcode.ko https://creativecommons.org/licenses/by/4.0/legalcode [L,R=307]
175+
RewriteRule ^/licenses/by-sa/4.0/legalcode.ko https://creativecommons.org/licenses/by-sa/4.0/legalcode [L,R=307]
176+
RewriteRule ^/licenses/by-nd/4.0/legalcode.ko https://creativecommons.org/licenses/by-nd/4.0/legalcode [L,R=307]
177+
RewriteRule ^/licenses/by-nc/4.0/legalcode.ko https://creativecommons.org/licenses/by-nc/4.0/legalcode [L,R=307]
178+
RewriteRule ^/licenses/by-nc-sa/4.0/legalcode.ko https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode [L,R=307]
179+
RewriteRule ^/licenses/by-nc-nd/4.0/legalcode.ko https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode [L,R=307]
180+
181+
172182
# Redirect all /license to /choose before we go any deeper
173183
RewriteRule ^/choose$ http://creativecommons.org/choose/ [L,R=301]
174184
RewriteRule ^/license$ http://creativecommons.org/choose/ [L,R=301]
@@ -182,31 +192,32 @@
182192

183193
# Fixes this repercussions of this bug:
184194
# http://code.creativecommons.org/issues/issue898
195+
RewriteRule ^/licenses/cc0/1.0(.*)$ https://creativecommons.org/publicdomain/zero/1.0$1 [L,R=301]
185196
RewriteRule ^/licenses/CC0/1.0(.*)$ https://creativecommons.org/publicdomain/zero/1.0$1 [L,R=301]
186-
# And #694
197+
# And #694
187198
RewriteRule ^/licenses/zero/1.0/(.*)$ https://creativecommons.org/publicdomain/zero/1.0/$1 [L,R=301]
188-
199+
189200
# Address https://github.com/creativecommons/creativecommons.org/issues/563
190201
RewriteRule ^/publicdomain/zero/1.0/deed.en/$ https://creativecommons.org/publicdomain/zero/1.0/deed.en [L,R=301]
191-
202+
192203
# Legalcode rewrites
193-
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
204+
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
194205
RewriteRule ^/legalcode http://creativecommons.org/ [L,R=301]
195206
RewriteRule .*legalcode/$ http://creativecommons.org/ [L,R=301]
196-
RewriteRule ^/licenses/(.*)sampling\+/1.0/(.*)/legalcode$ /legalcode/$1samplingplus_1.0_$2.html [L]
207+
RewriteRule ^/licenses/(.*)sampling\+/1.0/(.*)/legalcode$ /legalcode/$1samplingplus_1.0_$2.html [L]
197208
RewriteRule ^/licenses/(.*)sampling\+/1.0/legalcode$ /legalcode/$1samplingplus_1.0.html [L]
198209
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
199210
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
200211
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode\.([A-Za-z-]+)$ /legalcode/$1_$2_$3_$4.html [L]
201-
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.([A-Za-z-]+)$ /legalcode/$1_$2_$3.html [L]
202-
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode$ /legalcode/$1_$2_$3.html [L]
212+
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.([A-Za-z-]+)$ /legalcode/$1_$2_$3.html [L]
213+
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode$ /legalcode/$1_$2_$3.html [L]
203214
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
204215
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
205216
# Legalcodes can have extensions of the form .fr or .zh-Hant
206-
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z](-[A-Z][a-z][a-z][a-z])?)$ /legalcode/$1_$2_$3.html [L]
217+
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z](-[A-Z][a-z][a-z][a-z])?)$ /legalcode/$1_$2_$3.html [L]
207218

208219
# License RDF rewrites
209-
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
220+
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
210221
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/license_rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
211222
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
212223
RewriteRule ^/licenses/index.rdf$ /rdf/index.rdf [L,T=application/rdf+xml]
@@ -215,14 +226,14 @@
215226
RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/license_rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
216227
RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
217228
RewriteRule .*rdf/$ http://creativecommons.org/ [L,R=301]
218-
229+
219230
# See if deed is cached before sending to cc.engine
220-
# FIXME: eval memcache as an alternative?
231+
# FIXME: eval memcache as an alternative?
221232
RewriteCond %{REQUEST_URI} ^/licenses
222233
RewriteCond /var/www/creativecommons.org//python_env/cache/%{REQUEST_FILENAME} -s
223234
RewriteRule ^/licenses/(.*) /cc.engine-cache/licenses/$1 [L,PT]
224235

225-
# FIXME: do we really need rewrites for other licenses like GPL, etc?
236+
# FIXME: do we really need rewrites for other licenses like GPL, etc?
226237
RewriteRule (.*)licence(.*) https://creativecommons.org$1license$2 [L,R=301]
227238
RewriteRule ^/(license|choose|characteristic|publicdomain)$ http://creativecommons.org/$1/ [L,R=301]
228239
RewriteRule ^/(license|choose|characteristic|publicdomain)/(.*) /ccengine-fcgi/$1/$2 [PT,L]
@@ -396,11 +407,10 @@
396407

397408
RewriteRule ^/government http://creativecommons.org/publicpolicy [L,R=301]
398409

399-
#----------
410+
#----------
400411
# Redirects to CC.net
401-
#----------
402-
# FIXME: a bunch of these have moved / don't exist anymore
403-
412+
#----------
413+
# FIXME: a bunch of these have moved / don't exist anymore
404414
RewriteRule ^/about/affiliates.*$ http://creativecommons.net/supporters [R=301,L]
405415
RewriteRule ^/about/lessigletter.*$ http://creativecommons.net/letters [L,R=301]
406416
RewriteRule ^/about/supporters$ http://creativecommons.net/supporters [L,R=301]
@@ -414,13 +424,12 @@
414424
#----------
415425
# Miscellaneous
416426
#----------
417-
418427
# Map backwardly named license types to their actual location
419428
RewriteRule ^/licenses/by-nc-nd/1.0/(.*)$ http://creativecommons.org/licenses/by-nd-nc/1.0/$1 [L,R=301]
420429
RewriteRule ^/licenses/by-nd-nc/2.0/(.*)$ http://creativecommons.org/licenses/by-nc-nd/2.0/$1 [L,R=301]
421-
430+
422431
# Map the namespace document and schema URLs
423-
# FIXME: are symlinks cleaner?
432+
# FIXME: are symlinks cleaner?
424433
RewriteRule ^/ns$ /rdf/ns.html [L]
425434
RewriteRule ^/schema.rdf$ /rdf/schema.rdf [L]
426435

@@ -452,7 +461,7 @@
452461
#----------
453462
# WordPress rules here instead of .htaccess
454463
#----------
455-
464+
456465
# NOTE: sometimes Wordpress decides what page to display based on both the
457466
# query string AND the REQUEST_URI. mod_rewrite does not alter the
458467
# REQUEST_URI, and therefore mod_rewrite by itself is not always enough to
@@ -472,33 +481,35 @@
472481
RewriteRule ^/weblog(/archive|)/(\d+)/?$ https://blog.creativecommons.org/$2 [L]
473482
RewriteRule ^/weblog/?$ https://blog.creativecommons.org/ [L]
474483
RewriteRule ^/press-releases/entry/(\d+)/?$ https://blog.creativecommons.org/index.php?p=$1 [L]
475-
484+
476485
# Catch any requests for the general /weblog/archive and also to the
477486
# archives for any particular year/month and then redirect the client
478487
# to the new-style permalink
479488
RewriteRule ^/weblog/archive(/?.*)$ https://blog.creativecommons.org$1 [L,R=301]
480-
489+
481490
# Catch any old permalinks that point to long, ugly post names. The
482491
# CC Permalink Mapper will get this request and redirect the user accordingly.
483492
# But don't do this if someone was trying to access some particular feed
484493
RewriteCond %{REQUEST_URI} !^/([a-z-]+)/\d{4}/\d{2}/feed
485494
RewriteRule ^/([a-z-]+)/\d{4}/\d{2}/([a-zA-Z0-9-]+)/?$ /index.php?post_name=$2&category=$1&roflcopter [L]
486-
495+
487496
# '<some path>/rss' returns an RSS 0.92 feed, which we don't want, so make any
488497
# requests for '<some path>/rss' return an RSS 2 feed.
489-
RewriteRule ^/(.*?)rss/?$ /index.php/$1?feed=rss2 [L]
498+
RewriteRule ^/(.*?)rss/?$ /index.php/$1?feed=rss2 [L]
490499

491500
RewriteRule ^/feed/(.*?)?$ https://blog.creativecommons.org/feed/?$1 [L]
492501

493502
# Get missing upload files from the main site
494-
# NOTE: disable in production - for staging sites only (so media URLs will work)
503+
# NOTE: disable in production - for staging sites only (so media URLs will
504+
# work)
495505
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
496506
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
497507
RewriteRule ^/(wp-content/uploads/.*)$ http://creativecommons.org/$1 [L]
498-
508+
499509
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
500510
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
501-
# Breaks fcgi etc. Needs constraining to dirs where needed if used
502-
# RewriteRule . /index.php [L]
511+
# Breaks fcgi etc. Needs constraining to dirs where needed if used
512+
# RewriteRule . /index.php [L]
503513

504514
</VirtualHost>
515+
# vim: ft=apache ts=4 sw=4 sts=4 sr et:

0 commit comments

Comments
 (0)