Move the wiki to https exclusively
Eelco Dolstra committed
Nov 13, 2013 at 15:54 UTC
3033c2fc7d217286676260b3fc563094c13de5c2
1 file changed
+39
-37
nixos-org/webserver.nix
+39
-37
@@ -78,41 +78,6 @@ let
78
Deny from all
79
</Location>
80
'';
81
-
82
- extraSubservices =
83
- [ { serviceType = "mediawiki";
84
- siteName = "Nix Wiki";
85
- logo = "/logo/nix-wiki.png";
86
- #defaultSkin = "nixos";
87
- #skins = [ ./wiki-skins ];
88
- extraConfig =
89
- ''
90
- #$wgEmailConfirmToEdit = true;
91
-
92
- #$wgDebugLogFile = "/tmp/mediawiki_debug_log.txt";
93
-
94
- # Turn on the mass deletion feature.
95
- require_once("$IP/extensions/Nuke/Nuke.php");
96
-
97
- # Prevent pages with blacklisted links.
98
- require_once("$IP/extensions/SpamBlacklist/SpamBlacklist.php");
99
- $wgSpamBlacklistFiles = array(
100
- "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1"
101
- );
102
-
103
- # Use a reCAPTCHA to prevent spam.
104
- require_once("$IP/extensions/ConfirmEdit/ConfirmEdit.php");
105
- require_once("$IP/extensions/ConfirmEdit/ReCaptcha.php");
106
- $wgCaptchaClass = 'ReCaptcha';
107
- $wgReCaptchaPublicKey = '6Ldevd8SAAAAAFR6MwnU01FOWJ3O4II3aRJpMQ8F';
108
- $wgReCaptchaPrivateKey = '${builtins.readFile ./nixos.org-recaptcha-private-key}';
109
- $wgCaptchaTriggers['edit'] = true;
110
- $wgCaptchaTriggers['create'] = true;
111
- '';
112
- enableUploads = true;
113
- uploadDir = "/data/nixos-mediawiki-upload";
114
- }
115
- ];
81
};
82
83
in
@@ -159,7 +124,12 @@ in
124
globalRedirect = "http://nixos.org/";
125
}
126
162
- nixosVHostConfig
127
+ (nixosVHostConfig // {
128
+ extraConfig = nixosVHostConfig.extraConfig +
129
+ ''
130
+ Redirect /wiki https://nixos.org/wiki
131
+ '';
132
+ })
133
134
(nixosVHostConfig // {
135
enableSSL = true;
@@ -172,7 +142,7 @@ in
142
# Required by Catalyst.
143
RequestHeader set X-Forwarded-Port 443
144
'';
175
- extraSubservices = nixosVHostConfig.extraSubservices ++
145
+ extraSubservices =
146
[ { function = import <services/subversion>;
147
id = "nix";
148
urlPrefix = "";
@@ -185,6 +155,38 @@ in
155
logo = "/logo/nixos-lores.png";
156
};
157
}
158
+ { serviceType = "mediawiki";
159
+ siteName = "Nix Wiki";
160
+ logo = "/logo/nix-wiki.png";
161
+ #defaultSkin = "nixos";
162
+ #skins = [ ./wiki-skins ];
163
+ extraConfig =
164
+ ''
165
+ #$wgEmailConfirmToEdit = true;
166
+
167
+ #$wgDebugLogFile = "/tmp/mediawiki_debug_log.txt";
168
+
169
+ # Turn on the mass deletion feature.
170
+ require_once("$IP/extensions/Nuke/Nuke.php");
171
+
172
+ # Prevent pages with blacklisted links.
173
+ require_once("$IP/extensions/SpamBlacklist/SpamBlacklist.php");
174
+ $wgSpamBlacklistFiles = array(
175
+ "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1"
176
+ );
177
+
178
+ # Use a reCAPTCHA to prevent spam.
179
+ require_once("$IP/extensions/ConfirmEdit/ConfirmEdit.php");
180
+ require_once("$IP/extensions/ConfirmEdit/ReCaptcha.php");
181
+ $wgCaptchaClass = 'ReCaptcha';
182
+ $wgReCaptchaPublicKey = '6Ldevd8SAAAAAFR6MwnU01FOWJ3O4II3aRJpMQ8F';
183
+ $wgReCaptchaPrivateKey = '${builtins.readFile ./nixos.org-recaptcha-private-key}';
184
+ $wgCaptchaTriggers['edit'] = true;
185
+ $wgCaptchaTriggers['create'] = true;
186
+ '';
187
+ enableUploads = true;
188
+ uploadDir = "/data/nixos-mediawiki-upload";
189
+ }
190
];
191
})
192