Compare commits

...

27 Commits

Author SHA1 Message Date
towards-a-new-leftypol 62e7a4b22e undo instance-config.php settings changes 2024-12-22 00:42:38 -05:00
towards-a-new-leftypol 29d429bd55 retab image.php (use vim, convert tabs to space) 2024-12-22 00:42:38 -05:00
towards-a-new-leftypol 221faac75b Improve posting error handling
- if spamnoticer was contacted, add cleanup callback to error handler if
  something goes wrong during the rest of the process (like thumbnail
  creation for example)

- add another allowed warning (string) that gm may safely report back
  and don't call error if we see it.
2024-12-22 00:42:38 -05:00
towards-a-new-leftypol f5a073f0b1 bunker_like: heading and subtitle font sizes 2024-12-01 13:07:37 +00:00
towards-a-new-leftypol a8be2a3fc3 Up the font sizes for bunker_like a little bit 2024-12-01 12:42:21 +00:00
towards-a-new-leftypol 66fe2659c7 Fix textarea size in bunker_like theme 2024-11-29 04:24:54 -05:00
towards-a-new-leftypol eb89db5246 bunker_like: submit button color 2024-11-27 19:23:13 -05:00
towards-a-new-leftypol 132aa54b84 bunker_like: submit button color 2024-11-27 19:21:31 -05:00
towards-a-new-leftypol 709b4ff32d bunker-like css fix 2024-11-27 19:17:23 -05:00
towards-a-new-leftypol 9f26de080e fix bunker-like css tweaks 2024-11-27 19:15:07 -05:00
towards-a-new-leftypol 7e189349a3 bunker_like: padding adjust 2024-11-27 19:12:41 -05:00
towards-a-new-leftypol 9fe1cf8713 bunker-like: form tweaks 2024-11-27 18:55:25 -05:00
towards-a-new-leftypol c864f3701e bunkerlike form css tweaks (by 1px) 2024-11-27 18:37:38 -05:00
towards-a-new-leftypol 958a58f016 retab 2024-11-27 18:37:28 -05:00
towards-a-new-leftypol 929e00675f bunker_like css form field padding tweak 2024-11-27 18:16:32 -05:00
towards-a-new-leftypol 91a0b3017b bunkerlike - fix form padding 2024-11-27 18:02:21 -05:00
towards-a-new-leftypol df01d50275 Bunker-like theme changes
- change post body font to 'serif'
- change border radius's to 2px (down from 5px, which was silly)
2024-11-27 14:18:25 -05:00
towards-a-new-leftypol d3fa904e11 Replace flag instead of creating a new one 2024-11-27 11:51:20 -05:00
towards-a-new-leftypol f39a7f6282 Add flags 2024-11-27 11:40:13 -05:00
towards-a-new-leftypol 6b7c7b6c6a Add music board and a link to nukechan 2024-09-17 15:41:38 -04:00
towards-a-new-leftypol e9fa6303ac expand.js: don't add weird spacing 2024-09-17 15:41:38 -04:00
towards-a-new-leftypol 8763b2cf40 Fix log.php 2024-08-25 17:24:34 -04:00
towards-a-new-leftypol ab1f4e3ca7 Make headings bolder and brighter for better readability 2024-08-25 15:09:24 -04:00
towards-a-new-leftypol 585029dbca Fix a rebuilding when moving (targetBoard -> originBoard) 2024-08-12 16:54:19 -04:00
towards-a-new-leftypol b989686b2c 8 new banners 2024-08-08 01:25:30 -04:00
towards-a-new-leftypol 66636df702 anti-bot: do not flag missing hash values as spam 2024-07-19 15:40:41 -04:00
towards-a-new-leftypol 3415319698 add banners 2024-07-19 15:22:11 -04:00
23 changed files with 671 additions and 540 deletions

BIN
banners/BANNER _d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
banners/BANNER_58.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
banners/banner_pepe_che.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -295,13 +295,19 @@ function checkSpam(array $extra_salt = array()) {
#print_err("checkSpam start"); #print_err("checkSpam start");
$extra_salt_orig = $extra_salt; $extra_salt_orig = $extra_salt;
/*
if (!isset($_POST['hash'])) { if (!isset($_POST['hash'])) {
print_err("checkSpam: _POST array doesn't have key 'hash', check failed."); print_err("checkSpam: _POST array doesn't have key 'hash', check failed.");
dumpVars($extra_salt_orig); dumpVars($extra_salt_orig);
return true; return true;
} }
*/
$hash = $_POST['hash']; if (isset($_POST['hash'])) {
$hash = $_POST['hash'];
} else {
$hash = "";
}
if (!empty($extra_salt)) { if (!empty($extra_salt)) {
// create a salted hash of the "extra salt" // create a salted hash of the "extra salt"
@ -336,7 +342,12 @@ function checkSpam(array $extra_salt = array()) {
// Use SHA1 for the hash // Use SHA1 for the hash
$_hash = sha1($_hash . $extra_salt); $_hash = sha1($_hash . $extra_salt);
if ($hash != $_hash) { if (empty($hash)) {
print_err("checkSpam: hash is either empty or was never present, check failed. Not flagging as spam however.");
dumpVars($extra_salt_orig);
// Ignore missing hash, because it was missing for some legitimate posters and bots tend to fill in any field.
return false;
} else if ($hash != $_hash) {
print_err("checkSpam: Hash values do not match! submitted hash value from POST data: $hash ; Computed hash value: $_hash"); print_err("checkSpam: Hash values do not match! submitted hash value from POST data: $hash ; Computed hash value: $_hash");
dumpVars($extra_salt_orig); dumpVars($extra_salt_orig);
return true; return true;

View File

@ -24,6 +24,42 @@ register_shutdown_function('fatal_error_handler');
$error_recursion=false; $error_recursion=false;
/*
* Global anything is always a bad idea, but since all of this website's error handling comes
* down to calling this error function and quitting, we have no way of catching exceptions, for example
* during thumbnail creation.
*
* So push things to run in case of a crash into a list, and then run all of them in error.
*
* This will be exclusive to callbacks for posting a post callflow, not mod actions or anything else.
*/
function global_post_cleanup() {
global $post_cleanup_list;
foreach ($post_cleanup_list as $f) {
$f();
}
unset($post_cleanup_list);
}
function push_global_post_cleanup($f) {
global $post_cleanup_list;
if (!isset($post_cleanup_list)) {
$post_cleanup_list = array($f);
} else {
array_push($post_cleanup_list, $f);
}
}
function init_global_post_cleanup() {
global $post_cleanup_list;
$post_cleanup_list = array();
}
function error($message, $priority = true, $debug_stuff = false) { function error($message, $priority = true, $debug_stuff = false) {
global $board, $mod, $config, $db_error, $error_recursion; global $board, $mod, $config, $db_error, $error_recursion;
@ -75,11 +111,14 @@ function error($message, $priority = true, $debug_stuff = false) {
$data['debug']=$debug_stuff; $data['debug']=$debug_stuff;
} }
print json_encode($data); print json_encode($data);
global_post_cleanup();
exit(); exit();
} }
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error'); header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
global_post_cleanup();
die(Element('page.html', array( die(Element('page.html', array(
'config' => $config, 'config' => $config,
'title' => _('Error'), 'title' => _('Error'),

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,7 @@ $config['boards'] = array(
'edu', 'edu',
'ga', 'ga',
'ent', 'ent',
'music',
'777', '777',
'posad', 'posad',
'i', 'i',
@ -50,6 +51,7 @@ $config['categories'] = array(
'edu', 'edu',
'ga', 'ga',
'ent', 'ent',
'music',
'777', '777',
'posad', 'posad',
'i', 'i',
@ -67,7 +69,8 @@ $config['custom_categories'] = array(
'New Multitude' => 'https://newmultitude.org', 'New Multitude' => 'https://newmultitude.org',
'Booru image repository' => 'https://lefty.pictures', 'Booru image repository' => 'https://lefty.pictures',
'Official chat room' => 'https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net', 'Official chat room' => 'https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net',
'Gitea instance' => 'https://git.leftychan.net', 'Nukechan' => 'https://nukechan.net',
#'Gitea instance' => 'https://git.leftychan.net',
'Rules' => 'rules.html', 'Rules' => 'rules.html',
'Search' => 'search.php', 'Search' => 'search.php',
), ),
@ -259,6 +262,7 @@ $config['user_flags'] = array (
'egalitarianism' => 'Egalitarianism', 'egalitarianism' => 'Egalitarianism',
'egoism' => 'Egoism', 'egoism' => 'Egoism',
'eristocracy' => 'Έριστοκρατία', 'eristocracy' => 'Έριστοκρατία',
'Eurasianism' => 'Eurasianism',
'eureka' => 'Eureka', 'eureka' => 'Eureka',
'eurocommunism' => 'Eurocommunism', 'eurocommunism' => 'Eurocommunism',
'farc' => 'Las FARC', 'farc' => 'Las FARC',
@ -285,7 +289,7 @@ $config['user_flags'] = array (
'marxism_blackpilism' => 'Marxism Blackpillism', 'marxism_blackpilism' => 'Marxism Blackpillism',
'mutualism' => 'Mutualism', 'mutualism' => 'Mutualism',
'naxalite' => 'Naxalite', 'naxalite' => 'Naxalite',
'nazbol' => 'Nazbol', 'nazbol' => 'National Bolshevik',
'nazi' => 'Nazi', 'nazi' => 'Nazi',
'ndfp' => 'NDFP', 'ndfp' => 'NDFP',
'palestine' => 'Palestine', 'palestine' => 'Palestine',
@ -312,12 +316,14 @@ $config['user_flags'] = array (
'syndicalism' => 'Syndicalism', 'syndicalism' => 'Syndicalism',
'tankie' => 'Tankie', 'tankie' => 'Tankie',
'technocracy' => 'Technocracy', 'technocracy' => 'Technocracy',
'The_Other_Russia' => 'The Other Russia',
'think' => 'Think', 'think' => 'Think',
'transhumanism' => 'Transhumanism', 'transhumanism' => 'Transhumanism',
'united_farm_workers' => 'United Farm Workers', 'united_farm_workers' => 'United Farm Workers',
'viet_cong' => 'Viet Cong', 'viet_cong' => 'Viet Cong',
'ypg' => 'YPG', 'ypg' => 'YPG',
'yugoslavia' => 'Yugoslavia' 'yugoslavia' => 'Yugoslavia',
'zgang' => 'Z Gang'
); );
@ -591,5 +597,5 @@ $config['filters'][] = array(
'message' => 'New threads are being created too quickly. Wait [at most] 10 minutes' 'message' => 'New threads are being created too quickly. Wait [at most] 10 minutes'
); );
$config['global_message'] = '<span><a href="https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net">Matrix</a></span> &nbsp; <span><a href="ircs://irc.leftychan.net:6697/#leftychan">IRC Chat</a></span> &nbsp; <span><a href="mumble://leftychan.net">Mumble</a></span> &nbsp; <span><a href="https://t.me/+RegtyzzrE0M1NDMx">Telegram</a></span> &nbsp; <span><a href="https://discord.gg/AcZeFKXPmZ">Discord</a></span><br/><br/><span>We will be performing scheduled maintenance from 2-3am UTC, May 30th. The board will be read only during this time.</span>'; $config['global_message'] = '<span><a href="https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net">Matrix</a></span> &nbsp; <span><a href="ircs://irc.leftychan.net:6697/#leftychan">IRC Chat</a></span> &nbsp; <span><a href="mumble://leftychan.net">Mumble</a></span> &nbsp; <span><a href="https://t.me/+RegtyzzrE0M1NDMx">Telegram</a></span> &nbsp; <span><a href="https://discord.gg/AcZeFKXPmZ">Discord</a></span>';
$config['debug'] = false; $config['debug'] = false;

View File

@ -1501,7 +1501,7 @@ function mod_move($originBoard, $postID) {
} else { } else {
deletePost($postID); deletePost($postID);
buildIndex(); buildIndex();
rebuildThemes('post', $targetBoard); rebuildThemes('post', $originBoard);
openBoard($targetBoard); openBoard($targetBoard);
header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']); header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']);

View File

@ -32,11 +32,13 @@ $(document).ready(function(){
thread.find('div.hidden').remove(); thread.find('div.hidden').remove();
var post_in_doc = thread.find('#' + $(this).attr('id')); var post_in_doc = thread.find('#' + $(this).attr('id'));
if(post_in_doc.length == 0) { if(post_in_doc.length == 0) {
/*
if(last_expanded) { if(last_expanded) {
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">'); $(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
} else { } else {
$(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">'); $(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">');
} }
*/
last_expanded = $(this); last_expanded = $(this);
$(document).trigger('new_post', this); $(document).trigger('new_post', this);
} else { } else {

View File

@ -1,6 +1,6 @@
<?php <?php
include 'inc/functions.php'; require_once 'inc/functions.php';
include 'inc/mod/pages.php'; require_once 'inc/mod/pages.php';
if (!isset($_GET['board']) || !preg_match("/{$config['board_regex']}/u", $_GET['board'])) { if (!isset($_GET['board']) || !preg_match("/{$config['board_regex']}/u", $_GET['board'])) {
http_response_code(400); http_response_code(400);

View File

@ -457,6 +457,8 @@ function validate_images(array $post_array) {
function handle_post(){ function handle_post(){
global $config,$dropped_post,$board, $mod,$pdo; global $config,$dropped_post,$board, $mod,$pdo;
init_global_post_cleanup();
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) { if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
error($config['error']['bot']); error($config['error']['bot']);
} }
@ -1036,6 +1038,17 @@ function handle_post(){
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']); $spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
/*
* If we have an error with posting this later, send back the
* delete token to spamnoticer to remove the post from the recent
* posts table. (see error.php for the error cleanup function)
*/
$f_spamnoticer_cleanup_on_err = function() use ($config, $delete_token) {
removeRecentPostFromSpamnoticer($config, array($delete_token));
};
push_global_post_cleanup($f_spamnoticer_cleanup_on_err);
if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) { if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) {
error($config['error']['spam_noticer'] . $spam_noticer_result->reason); error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/zgang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

View File

@ -3,184 +3,220 @@ div.sidearrows {
} }
body { body {
background: #1D1F21; background: #1D1F21;
color: #ACACAC; color: #ACACAC;
font-family: Courier, monospace; font-family: Courier, monospace;
font-size: 13px; font-size: 15px;
}
.theme-catalog .replies {
font-family: serif;
}
div.post div.body {
font-family: serif;
}
span.heading {
font-size: 15px;
}
.theme-catalog .replies .meta,
.theme-catalog .replies .intro,
div.post div.body a,
div.post div.body .toolong {
font-family: Courier, monospace;
} }
/* LINKS */ /* LINKS */
a, a:link, a:visited, .intro a.email span.name { a, a:link, a:visited, .intro a.email span.name {
color: #FFB300; color: #FFB300;
text-decoration: none; text-decoration: none;
} }
a:link:hover, a:visited:hover { a:link:hover, a:visited:hover {
color: #FFB300; color: #FFB300;
text-shadow: 0px 0px 5px #117743; text-shadow: 0px 0px 5px #117743;
} }
div.pages a.selected { div.pages a.selected {
color: #FFB300; color: #FFB300;
} }
/* INTRO */ /* INTRO */
h1, div.title, header div.subtitle { h1, div.title, header div.subtitle {
color: #663E11; color: #FFB300;
font-family: Courier, monospace; font-family: Courier, monospace;
} }
h1 { h1 {
font-size: 24pt; font-size: 18pt;
font-weight: normal; font-weight: bold;
letter-spacing: 0px; letter-spacing: 0px;
} }
header div.subtitle { header div.subtitle {
font-size: 12pt; font-size: 10pt;
} }
/* FORMS AND BUTTONS */ /* FORMS AND BUTTONS */
div.banner { div.banner {
background-color: inherit; background-color: inherit;
color: #ACACAC; color: #ACACAC;
} }
form table { form table {
border: 1px dashed #117743; border: 1px dashed #117743;
padding-right: 1px; padding-right: 1px;
border-radius: 3px;
} }
form table tr th { form table tr th {
background: #282A2E; background: #282A2E;
border: 1px solid #117743; border: 1px solid #117743;
border-radius: 5px; border-radius: 2px;
padding: 3px;
} }
input[type="text"], input[type="password"], textarea, select { input[type="text"], input[type="password"], textarea, select {
border: 1px double #07371F; border: 1px double #07371F;
border-radius: 5px; border-radius: 2px;
background: #282A2E; background: #282A2E;
color: #ACACAC; color: #ACACAC;
font-family: Courier, monospace; font-family: Courier, monospace;
margin: 0 1px;
padding: 3px !important;
box-sizing: border-box;
} }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus { input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
box-shadow: 0px 0px 5px 2px #117743; box-shadow: 0px 0px 5px 2px #117743;
} }
input[type="submit"] { input[type="submit"] {
border: 3px double #07371F; border: 3px double #07371F;
border-radius: 5px; border-radius: 2px;
background: #16171A; background-color: #07371F;
color: #ACACAC; color: #ACACAC;
font-family: Courier, monospace; font-family: Courier, monospace;
font-weight: bold; font-weight: bold;
font-size: 16px;
} }
input[type="submit"]:hover {
border-color: #117743;
background-color: #117743;
}
.dropzone { .dropzone {
background: #16171A; background: #16171A;
border: 3px double #07371F; border: 1px solid #07371F;
color: #ACACAC; color: #ACACAC;
border-radius: 2px;
margin: 0 2px;
} }
.dropzone .file-hint { .dropzone .file-hint {
color: #ACACAC; color: #ACACAC;
font-weight: bold; font-weight: bold;
} }
#quick-reply table { #quick-reply table {
background: #1D1F21 !important; background: #1D1F21 !important;
} }
fieldset { fieldset {
border: 1px dashed #117743; border: 1px dashed #117743;
} }
/* POST IDENTIFIERS */ /* POST IDENTIFIERS */
.intro span.subject { .intro span.subject {
color: #34ED3A; color: #34ED3A;
} }
.intro span.name { .intro span.name {
color: #117743; color: #117743;
} }
.intro span.trip { .intro span.trip {
color: #117743; color: #117743;
} }
.intro a.capcode, p.intro a.nametag { .intro a.capcode, p.intro a.nametag {
color: #FF0000; color: #FF0000;
font-weight: bold; font-weight: bold;
} }
.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name { .intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name {
color: #34ED97; color: #34ED97;
} }
.intro time { .intro time {
font-weight: bold; font-weight: bold;
} }
.intro a.post_no { .intro a.post_no {
color: #ACACAC; color: #ACACAC;
font-weight: bold; font-weight: bold;
} }
/* POST BOXES */ /* POST BOXES */
div.post.reply { div.post.reply {
background: #282A2E; background: #282A2E;
border: 1px solid #117743; border: 1px solid #117743;
border-radius: 5px; border-radius: 2px;
} }
div.post.reply.highlighted { div.post.reply.highlighted {
background: rgba(59, 22, 43, 0.4); background: rgba(59, 22, 43, 0.4);
border: 1px solid #117743; border: 1px solid #117743;
border-radius: 5px; border-radius: 2px;
} }
/* POST CONTENT */ /* POST CONTENT */
div.post.reply div.body a { div.post.reply div.body a {
color: #FFB300; color: #FFB300;
} }
.quote { .quote {
color: #789922; color: #789922;
} }
/* BARS */ /* BARS */
.bar { .bar {
background-color: #151515; background-color: #151515;
} }
.bar.top { .bar.top {
border-bottom: 1px solid #B0790A; border-bottom: 1px solid #B0790A;
} }
.bar.bottom { .bar.bottom {
border-top: 1px solid #B0790A; border-top: 1px solid #B0790A;
} }
div.boardlist { div.boardlist {
color: #ACACAC; color: #ACACAC;
} }
hr { hr {
border: none; border: none;
border-top: 1pt solid #117743; border-top: 1pt solid #117743;
} }
/* CATALOG */ /* CATALOG */
.theme-catalog h1 { .theme-catalog h1 {
color: #ACACAC; color: #ACACAC;
font-size: 18pt; font-size: 18pt;
font-weight: bold; font-weight: bold;
} }
.theme-catalog h1 a { .theme-catalog h1 a {
font-weight: normal; font-weight: normal;
} }
.theme-catalog div.thread, .theme-catalog div.thread:hover { .theme-catalog div.thread, .theme-catalog div.thread:hover {
background: #282A2E; background: #282A2E;
border: 1px solid #117743; border: 1px solid #117743;
border-radius: 5px; border-radius: 2px;
font-size: 10pt; font-size: 11pt;
} }
/* OPTIONS */ /* OPTIONS */
#options_div, #alert_div { #options_div, #alert_div {
background: #1D1F21; background: #1D1F21;
border: 1px dashed #117743; border: 1px dashed #117743;
} }
#options_tablist { #options_tablist {
border-right: 1px dashed #117743; border-right: 1px dashed #117743;
} }
.options_tab_icon { .options_tab_icon {
color: #ACACAC; color: #ACACAC;
} }
.options_tab_icon.active { .options_tab_icon.active {
color: #FFB300; color: #FFB300;
} }
/* FIXES */ /* FIXES */
div.ban { div.ban {
background: #1D1F21; background: #1D1F21;
border: 1px dashed #117743; border: 1px dashed #117743;
} }
@ -225,7 +261,7 @@ table thead th {
} }
.theme-catalog .thread .meta { .theme-catalog .thread .meta {
font-size: 10pt; font-size: 13px;
} }
.theme-catalog .thread.grid-size-small .replies { .theme-catalog .thread.grid-size-small .replies {