Forum:5.0.0 source code

From NetHackWiki
Jump to navigation Jump to search


I'm intending to start, over Thanksgiving week, on the somewhat arduous task of creating pages for all the 5.0.0 source code files, ensuring we have access to line linking as we have in the past with prior versions. Just a heads up to anyone who watches page creation logs that I'm going to be uploading a bunch of stuff right in a row, and also if anyone has any reason for me to not do this, giving you a chance to speak up! Fuzzyjammies (talk) 01:16, 14 November 2026 (UTC)

I simply had it marked off as a "cross that bridge when we get to it" task, so seems fine by me provided you can 1) set it up for annotations and the like as with the 3.4.3 source code stuff and 2) do the same for the source code of prior versions at some point. --Umbire the Phantom (talk) 02:17, 14 November 2026 (UTC)
Also, note that source code uploads for previous versions were handled by a bot and done years back - perhaps I can work out another bot job in a similar vein with an admin who knows how to work it and save us some legwork... --Umbire the Phantom (talk) 10:37, 14 November 2026 (UTC)
I actually managed to throw together a basic Python script that seems to be working alright and runs directly through my own credentials, so I can use that, if that works! Fuzzyjammies (talk) 19:31, 14 November 2026 (UTC)
Source:NetHack_5.0.0/dat/Arc-fila.lua Here's an example of what my script uploads- pre-tagged with the category, header included and dynamic for folder/page, lines all tagged and ready to go. If this looks good I'll run it through the whole source soon! Fuzzyjammies (talk) 04:38, 15 November 2026 (UTC)
Looks good to me, I'll run it by paxed and see if there's anything else. --Umbire the Phantom (talk) 07:04, 15 November 2026 (UTC)
That's very nice and glorious for you. X0x (talk) 10:35, 14 November 2026 (UTC)
It would be better to run it under a bot account instead of your own, so the edits can be marked done by a bot. This also allows higher API limits and other stuff. --paxed (talk) 09:22, 15 November 2026 (UTC)
Right, makes enough sense now I think about it. --Umbire the Phantom (talk) 09:26, 15 November 2026 (UTC)
Create the bot account and an admin can add it to the bot group. --paxed (talk) 10:20, 15 November 2026 (UTC)
Done-- nh5srcbot is ready to go. Fuzzyjammies (talk) 15:42, 15 November 2026 (UTC)
That's now a bot account. I can't remember whether you need to mark the edits as bot-made or if they get that flag automatically... --paxed (talk) 15:50, 15 November 2026 (UTC)
I'll run a test page and then work accordingly. Thanks for the help! Fuzzyjammies (talk) 16:30, 15 November 2026 (UTC)
Alright, almost every single file is up! The one sticking point was src/objnam.c, which neither I nor the bot can upload; I assume this is because it's huge, as I'm getting hit with a Cloudflare security page, not a wiki error. If someone who can bypass that would like to upload it, here it is, with markup included, on PasteBin: https://pastebin.com/2MJqu0Ux Fuzzyjammies (talk) 18:03, 15 November 2026 (UTC)
Copy. Been talking to paxed and co., they'll also see about adjusting the abuse filters so that authorized bots can get through fine and speed up future jobs involving script bots and the like. --Umbire the Phantom (talk) 18:05, 15 November 2026 (UTC)
Also can confirm that Cloudflare is interfering with trying to upload the text all at once. Perhaps if it was done in fragments... --Umbire the Phantom (talk) 18:09, 15 November 2026 (UTC)
According to dtype, who's currently planebound but reachable via irc: "AbuseFilter 4 ("new users, added external links") warns any account that isn't autoconfirmed when it adds an http link. A bot account created today isn't autoconfirmed, and being in the bot group doesn't change that. change the filter's first condition to !("autoconfirmed" in user_groups) & !("bot" in user_groups). Only an admin can put an account in the bot group, so the filter doesn't need to check those accounts."
Regarding Cloudflare: "src/objnam.c is being blocked by Cloudflare, not by the wiki. Their guess that it's too big is wrong. Cloudflare's own managed WAF rules include "SQLi – String Concatenation – Body" (rule 3b0c61407d0b4f7d87e516472116d2fe), and it blocked all 7 attempts in the last 24 hours. Four came from their browser through api.php, two from the bot (user agent NetHackSourceBot/1.0), and one from the normal edit form. Something in that C file's text matches the rule. i have to see if i can turn off WAF rule, that one is a default" --Umbire the Phantom (talk) 18:12, 15 November 2026 (UTC)
Source:NetHack 5.0.0/src/objnam.c is now up. I saved it directly on the wiki server, so the request never passed through Cloudflare. That is the only reason it went through where your uploads didn't; nothing about the WAF was changed. The text is the upstream src/objnam.c from the NetHack-5.0.0_Released tag, checked line by line against your paste (all 5,700 lines identical), in the same format as the other pages your bot made. Three small fixes from the paste: Windows line endings, a stray space after {{NGPL}}, and the category sort key, which read src/nhlsel.c instead of src/objnam.c.
Why it was blocked: Cloudflare's managed rule "SQLi – String Concatenation – Body" matches something in that file's C code as a SQL injection attempt, so it rejected every save of it, from the browser, the edit form and the bot alike. It is a false positive on the content, not a size limit; larger files such as dat/data.base saved fine. Splitting the page into fragments probably won't help: whichever fragment holds the matching code would be blocked too.
And on the 15 files your bot skipped: those were AbuseFilter 4 giving a warning, not a block. A warned edit goes through if the identical edit is submitted a second time, so a script that retries once on abusefilter-warning would have saved them. --NHW-Host-Bot (talk) 18:13, 15 November 2026 (UTC)
Understood! I'll keep that in mind for if we do this again on the next version release. Thanks for the assist, friendly robot! Fuzzyjammies (talk)