@cryptotaxi247 / infra-1 / commits / 2b1aae48

Remove Dead and Deprecated Services

- stop serving the wiki - remove related redirects - remove postgresql as mediawiki was the last user - Redirect all wiki traffic to a wiki page

Graham Christensen committed May 3, 2017 at 08:34 UTC 2b1aae4880e9e6271479db7ab7ebc2e41e8e63ae
1 file changed +1 -90
nixos-org/webserver.nix
+1 -90
@@ -34,13 +34,13 @@ let
34 User-agent: *
35 Disallow: /repos/
36 Disallow: /irc/
37 - Disallow: /wiki/
37 '';
38
39 extraConfig =
40 ''
41 MaxKeepAliveRequests 0
42
43 + Redirect /wiki https://nixos.org/nixos/wiki.html
44 Redirect /binary-cache http://cache.nixos.org
45 Redirect /releases/channels /channels
46 Redirect /tarballs http://tarballs.nixos.org
@@ -118,13 +118,6 @@ in
118 globalRedirect = "http://nixos.org/";
119 }
120
121 - (nixosVHostConfig // {
122 - extraConfig = nixosVHostConfig.extraConfig +
123 - ''
124 - Redirect /wiki https://nixos.org/wiki
125 - '';
126 - })
127 -
121 (nixosVHostConfig // {
122 enableSSL = true;
123 sslServerKey = "${acmeKeyDir}/key.pem";
@@ -136,58 +129,6 @@ in
129 SSLHonorCipherOrder on
130 #SSLOpenSSLConfCmd DHParameters "${./dhparams.pem}"
131 '';
139 - extraSubservices =
140 - [
141 - { serviceType = "mediawiki";
142 - siteName = "Nix Wiki";
143 - logo = "/logo/nix-wiki.png";
144 - #defaultSkin = "nixos";
145 - #skins = [ ./wiki-skins ];
146 - extraConfig =
147 - ''
148 - $wgSiteNotice = "${"'''The NixOS wiki is outdated and is being shut down. If you wish to add or improve NixOS documentation, please grab a ticket from the [https://github.com/NixOS/nixpkgs/milestone/8 Move the wiki!] milestone.'''"}";
149 -
150 - #$wgEmailConfirmToEdit = true;
151 -
152 - #$wgDebugLogFile = "/tmp/mediawiki_debug_log.txt";
153 -
154 - # Disable editing by all users.
155 - $wgGroupPermissions['*']['edit'] = false;
156 - $wgGroupPermissions['user']['edit'] = false;
157 -
158 - # Turn on the mass deletion feature.
159 - require_once("$IP/extensions/Nuke/Nuke.php");
160 -
161 - # Prevent pages with blacklisted links.
162 - require_once("$IP/extensions/SpamBlacklist/SpamBlacklist.php");
163 - $wgSpamBlacklistFiles = array(
164 - "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1"
165 - );
166 -
167 - # Enable DNS blacklisting.
168 - $wgEnableDnsBlacklist = true;
169 - $wgDnsBlacklistUrls = array('xbl.spamhaus.org');
170 -
171 - # Require users to answer a question.
172 - require_once("$IP/extensions/ConfirmEdit/ConfirmEdit.php");
173 - $wgCaptchaTriggers['edit'] = true;
174 - $wgCaptchaTriggers['create'] = true;
175 -
176 - require_once("$IP/extensions/ConfirmEdit/QuestyCaptcha.php");
177 - $wgCaptchaClass = 'QuestyCaptcha';
178 - $arr = array(
179 - "What is the name of the Linux distribution to which this wiki is dedicated?" => "NixOS",
180 - );
181 - foreach ($arr as $key => $value) {
182 - $wgCaptchaQuestions[] = array('question' => $key, 'answer' => $value);
183 - }
184 -
185 - wfLoadSkin('Vector');
186 - '';
187 - enableUploads = true;
188 - uploadDir = "/data/nixos-mediawiki-upload";
189 - }
190 - ];
132 })
133
134 # FIXME: remove
@@ -210,15 +151,6 @@ in
151 { hostName = "planet.nixos.org";
152 documentRoot = "/var/www/planet.nixos.org";
153 }
213 -
214 - # Obsolete, kept for backwards compatibility.
215 - { hostName = "wiki.nixos.org";
216 - extraConfig = ''
217 - RedirectMatch ^/$ https://nixos.org/wiki
218 - Redirect / https://nixos.org/
219 - '';
220 - }
221 -
154 ];
155 };
156
@@ -278,27 +210,6 @@ in
210 ${pkgs.procps}/sbin/sysctl -q -w kernel.shmmax=$((1 * 1024**3))
211 '';
212
281 - services.postgresql = {
282 - enable = true;
283 - package = pkgs.postgresql92;
284 - dataDir = "/data/postgresql";
285 - extraConfig = ''
286 - max_connections = 10
287 - work_mem = 16MB
288 - shared_buffers = 512MB
289 - # We can risk losing some transactions.
290 - synchronous_commit = off
291 - '';
292 - authentication = mkOverride 10 ''
293 - local mediawiki all ident map=mwusers
294 - local all all ident
295 - '';
296 - identMap = ''
297 - mwusers root mediawiki
298 - mwusers wwwrun mediawiki
299 - '';
300 - };
301 -
213 services.venus = {
214 enable = true;
215 outputTheme = ./theme;