4Chan Leaked Source Code http://4chan.org/
Find a file
desuwa 545b7812d1 Revert "Update source'"
This reverts commit 6c837f267f.
2025-04-17 16:40:54 -06:00
bin Merge sources 2025-04-17 16:36:48 -06:00
config Initial commit 2025-04-17 16:16:42 -06:00
css Initial commit 2025-04-17 16:16:42 -06:00
forms Initial commit 2025-04-17 16:16:42 -06:00
imgtop Initial commit 2025-04-17 16:16:42 -06:00
js Initial commit 2025-04-17 16:16:42 -06:00
lib Revert "Update source'" 2025-04-17 16:40:54 -06:00
modes Initial commit 2025-04-17 16:16:42 -06:00
plugins Initial commit 2025-04-17 16:16:42 -06:00
reports Merge sources 2025-04-17 16:36:48 -06:00
tasks Initial commit 2025-04-17 16:16:42 -06:00
twister Merge sources 2025-04-17 16:36:48 -06:00
views Initial commit 2025-04-17 16:16:42 -06:00
wordfilters Initial commit 2025-04-17 16:16:42 -06:00
www.4chan Merge sources 2025-04-17 16:36:48 -06:00
admin-test.php Initial commit 2025-04-17 16:16:42 -06:00
admin.php Initial commit 2025-04-17 16:16:42 -06:00
auth-test.php Initial commit 2025-04-17 16:16:42 -06:00
auth.php Initial commit 2025-04-17 16:16:42 -06:00
block_resync_removed Initial commit 2025-04-17 16:16:42 -06:00
boardlist.txt Initial commit 2025-04-17 16:16:42 -06:00
captcha-test.php Initial commit 2025-04-17 16:16:42 -06:00
captcha.php Initial commit 2025-04-17 16:16:42 -06:00
catalog-test.php Initial commit 2025-04-17 16:16:42 -06:00
catalog.php Initial commit 2025-04-17 16:16:42 -06:00
clippy.html Initial commit 2025-04-17 16:16:42 -06:00
derefer.php Initial commit 2025-04-17 16:16:42 -06:00
emotes_xa22.php Initial commit 2025-04-17 16:16:42 -06:00
footer-test.txt Initial commit 2025-04-17 16:16:42 -06:00
footer-ws.txt Initial commit 2025-04-17 16:16:42 -06:00
footer.txt Initial commit 2025-04-17 16:16:42 -06:00
globalmsg.txt Initial commit 2025-04-17 16:16:42 -06:00
header-sys.txt Initial commit 2025-04-17 16:16:42 -06:00
header-test.txt Initial commit 2025-04-17 16:16:42 -06:00
header-ws.txt Initial commit 2025-04-17 16:16:42 -06:00
header.txt Initial commit 2025-04-17 16:16:42 -06:00
imgboard-test.php Initial commit 2025-04-17 16:16:42 -06:00
imgboard.php Initial commit 2025-04-17 16:16:42 -06:00
json-test.php Initial commit 2025-04-17 16:16:42 -06:00
json.php Initial commit 2025-04-17 16:16:42 -06:00
latest.php Initial commit 2025-04-17 16:16:42 -06:00
LICENSE.md Merge sources 2025-04-17 16:36:48 -06:00
note.txt Initial commit 2025-04-17 16:16:42 -06:00
Rakefile Initial commit 2025-04-17 16:16:42 -06:00
README.md Revert "Update source'" 2025-04-17 16:40:54 -06:00
README2.txt Initial commit 2025-04-17 16:16:42 -06:00
rebuildd-test.php Initial commit 2025-04-17 16:16:42 -06:00
rebuildd.php Initial commit 2025-04-17 16:16:42 -06:00
rid.php Initial commit 2025-04-17 16:16:42 -06:00
signin-test.php Initial commit 2025-04-17 16:16:42 -06:00
signin.php Initial commit 2025-04-17 16:16:42 -06:00
title_banners.txt Initial commit 2025-04-17 16:16:42 -06:00
xa24tb.php Initial commit 2025-04-17 16:16:42 -06:00
yotsuba-git-repo-commit-archive.txt Initial commit 2025-04-17 16:16:42 -06:00
yotsuba_config.php Initial commit 2025-04-17 16:16:42 -06:00

Yotsuba Source

Quick Rundown:

Setup php5.6 (end of support 2018) and mysql, then change db_config.php file to

<?php
	define( 'SQLHOST_GLOBAL', 'localhost' );
	define( 'SQLUSER_GLOBAL', 'root' );
	define( 'SQLPASS_GLOBAL', 'passwd' );
	define( 'SQLDB_GLOBAL', 'chan' );
	define( 'SQLHOST', 'localhost' );
	define( 'SQLUSER', 'root' );
	define( 'SQLPASS', 'passwd' );
	define( 'SQLDB', 'chan' );

After setting up php5.6, download phpmyadmin (you need the old 4.9.11 version for this php) and make sure you can login to your mysql

Make all the tables that OP posted before (their pic is missing a bunch tho), then make a table for the board itself, just named as "j" or "test" or whatever

Check the json.php post_json_force_type func for some of the columns you need to add to the board table, that tells you if they should be int or varchar too not all columns are listed there though, but if you have display_errors enabled in php.ini it should give you error about which columns are missing

Edit lib/auth.php and change is_local_auth to always return true which skips captcha/security shit, also have to edit lib/postfilter.php and lib/geoip2.php and make them just return otherwise it'll error about missing libs (display_errors should tell you the lines that are broke)

The harder part is getting directories and virtual hosts setup, afaik there has to be a global copy of yotsuba code at /www/global/yotsuba, but each board is also meant to have its own copy of it too idk where those copies are meant to go but i just put them at /www/[board]/yotsuba

Each board also has files at /www/4chan.org/web/boards/[board]/thread/, /www/4chan.org/web/images/[board]/, /www/4chan.org/web/thumbs/[board]/, that's where the .html gets written to when you make a thread/reply, make sure to create those folders (and also create a /www/perhost/ folder too)

You're meant to point boards.XXXhostname to the4chan.org/web/folder, and thinksys.XXXpoints to a folder with symlinks to all the/www/[board]/yotsuba` dirs

Then you need to fuck with the JS/CSS to point them to the right path, change some urls in the global configs files, probably some other shit i forgot, also change SELF_PATH_POST in global_config.ini to {{PHP_SERVER}}/imgboard.php?mode=post

After all that you can insert a row into your table db, make sure "resto" is 0 and "root" is 1, then you can call /imgboard.php?mode=rebuildall for it to create the thread/index/catalog/etc html files

Once you got JS shit fixed up you should be able to make new posts from there like normal (the files it creates are .html.gz, https://www.solemnwarning.net/post/apache-static-compressed shows how to serve those with apache)