The Wakaba and Kareha support thread, part 2 (1000)

1 Name: !WAHa.06x36 : 2007-10-11 06:19 ID:K4vOYfq0 [Del]

This thread is for all your simple questions about installing and running Wakaba or Kareha, that just require quick answers. Please don't create new threads for issues like that, post them in here instead.

Before posting, check that the question has not already been answered in this thread, or in the previous thread: http://wakaba.c3.cx/sup/kareha.pl/1141929669/

Questions about "500 Internal Server Errors" go in this thread: http://wakaba.c3.cx/sup/kareha.pl/1109033191/

471 Post deleted by user.

472 Name: Anonymous : 2009-01-03 19:05 ID:Qsh8IyKG [Del]

This is a suggestion regarding security. I assume this is the correct place to post it; otherwise, I can start a new topic.

Please implement proper file content filtering in Wakaba/Kareha. As of right now, Wakaba filters out forbidden file types through an array of forbidden extensions, but this is not necessarily sufficient. For example, a PHP file may be uploaded with extension ".php.7z." If a board allows the 7z extension and if the file is not renamed (as is default in the case of Wakaba), an Apache server may in fact still execute it, resulting in the execution of malicious code. This has actually caused a significant disturbance in a site with which I help out. A simple two-line patch that relies on the UNIX file() utility has been written to address this for the moment.

473 Name: Anonymous : 2009-01-04 02:34 ID:Heaven [Del]

>>472
the default is to not allow any files except jpg, png, or gif images (and rename them). it's possible to make it insecure by configuring it improperly, but it's certainly not the default.

474 Post deleted by moderator.

475 Name: !WAHa.06x36 : 2009-01-04 07:47 ID:Heaven [Del]

Like >>473 says.

Also, I'm really tempted to say that that is in fact a PHP bug, and until they fix it you're better off disabling PHP on your server.

476 Name: LiteralKa!!UIR4DE3n : 2009-01-04 08:55 ID:Heaven [Del]

>>475
Even if it isn't a bug, it's probably caused by shitty/careless PHP coding.

477 Name: Anonymous : 2009-01-04 09:31 ID:Heaven [Del]

>>472 also, remove the +x from your uploads folder.

478 Post deleted by user.

479 Name: Anonymous : 2009-01-05 16:44 ID:Heaven [Del]

>>473

When I say default, I mean Wakaba's behavior when enabling non-prohibited filetypes in config.pl, such as MP3s. I'm pretty sure Wakaba is set up not to rename those after uncommenting the respective lines.

>>476

I am told by the server admin that it is actually a bug with the latest Apache (or perhaps mod_php), possibly affecting only Gentoo. I could not find a citation (beyond this anecdote) to support the claim, but this is seems to be a known issue. It does turn out that if ".php" is found anywhere in the filename, it is still executed by Apache. A PHP file can then be disguised as a 7zip file or MP3 file (e.g., nasty_hax.php.mp3), and be uploaded. If the extension is uncommented config.pl, it gets uploaded. If the server (or PHP interpreter) suffers from the issue, the attacker executes the malicious code and has fun. I have neither tested nor asked about this for other script types. Indeed, renaming files would technically render this exploit moot, but by default Wakaba does not do this with non-pictures. There are Wakaba boards out there that support non-picture uploading, and I have seen only one (Pooshlmer) that renames files.

>>477

Indeed, that is a wise suggestion. In fact, I've just chmod-ed the src/ directories myself.

...and then the pictures could not be accessed by anyone. I set permissions to 644, but no one could see the pictures unless the execute bits were set. I'll have to ask the admin about it myself, unless someone here has an idea.

At any rate, I just thought I'd share the (admittedly nontrivial) suggestion and post about this potential exploit for other people. It completely blindsided us. Having a layer of security at the board software level in case of a future server exploit sounds like the best solution, though I understand leaving it in the hands of the administration rather than adding feature bloat.

Kudos for the script.

480 Name: Anonymous : 2009-01-06 05:41 ID:z/yO4O4M [Del]

it is a mod_mime "feature"

http://shsc.info/FileUploadSecurity

481 Name: !WAHa.06x36 : 2009-01-06 12:17 ID:Heaven [Del]

Well, the core issue is that PHP is broken and will execute files without the +x bit set. This is horribly insecure, and should never have been implemented, but apparently now we're stuck with it.

The best solution is to completely disable PHP. If you have to use it, enable it only for folders known to be safe from uploads and disable it everywhere else.

To add extra protection in Wakaba for it, though, rather than mess with file, it'd be far easier to just dump all files whose filename matches /\.php/. This issue shouldn't affect any CGI languages, since those won't run without +x.

482 Name: Anonymous : 2009-01-06 16:50 ID:Heaven [Del]

>>480

Thank you! That explains loads.

>>481

I personally am not a fan of PHP, myself, but I think the admin wants to run some PHP scripts. Simply using the regular expression on the filename was indeed the first idea that came to mind.

483 Post deleted by moderator.

484 Name: Anonymous : 2009-01-10 02:17 ID:mIwhAJXJ [Del]

I've got a problem somehow related to encoding.
I successfully installed Kareha, but every time I try to make a post I get a white screen with text saying "Software error: Unknown encoding 'utf-8' at wakautils.pl line 613". It doesn't abort the posting though (my messages still appear despite the error), but the flashing is no good.
I didn't do any changes to wakautils.pl since the very install. What could be that?

485 Name: Anonymous : 2009-01-10 09:02 ID:Heaven [Del]

>>484
what version of perl are you using?

486 Name: Anonymous : 2009-01-10 15:58 ID:mIwhAJXJ [Del]

>>485
Nevermind, it's alright now... I really forgot to update my perl.

487 Name: Anonymous : 2009-01-12 14:12 ID:Heaven [Del]

http://wakaba.c3.cx/sup/kareha.pl/1130723862/318

I noticed this issue was never addressed. The CSS typo is still included in the current version of Kareha. I don't know if you forgot about it or if it's intentional...

488 Name: Doesn't Matter : 2009-01-12 19:03 ID:pgXqt2B7 [Del]

Hello, is there any built in way or any code snippets you guys have that would allow my to set an image limit on a threads (like a single on) I could probably manage this myself eventually, but I was wondering if it was done already.

489 Name: Anonymous : 2009-01-12 19:44 ID:Heaven [Del]

>>488
RTFM, it's in the config.

490 Name: Anonymous : 2009-01-13 16:06 ID:Heaven [Del]

I have a problem with kareha, I cannot set a maximum image limit per thread.

I thought IMAGE_REPLIES_PER_THREAD actually meant IMAGE REPLIES PER THREAD! Apparently it doesn't do anything. I am still able to post image replies way beyond the limit. Is there any way to control this problem?

491 Name: !WAHa.06x36 : 2009-01-15 09:33 ID:Heaven [Del]

I think it makes the thread stop bumping when you pass the limit.

Why on earth would you want to limit the number of image replies anyway? That's just annoying, and adds no value to anyone.

492 Name: Anonymous : 2009-01-16 22:24 ID:Heaven [Del]

>>491
It allows me to control the amount of images uploaded so that I don't go over a certain limit. I'm running a small board with limited bandwith and space.

I want to be able to control the space in terms of number of threads. There's no shame in that. Why are you trying to control my methods so much by just waving it off as "I don't like it, therefore, it is bad." ?

493 Name: Anonymous : 2009-01-17 01:31 ID:Heaven [Del]

>>492
There is a configuration option for limiting the threads by filesize, you know.

494 Name: !WAHa.06x36 : 2009-01-17 06:20 ID:Heaven [Del]

>>492

Like the guy says, there's an option already for setting the maximum disk space usage across the entire board. That's what you want to use, not some weird and ineffective limiting of posts per thread.

495 Name: belair!hRu19iIqpw : 2009-01-18 09:00 ID:ZpqTwPRB [Del]

>>479
Wakaba starts off by renaming files uploaded with those filetypes, but restores the name afterward. If you want to use the generated names on files, search wakaba.pl for "externally defined filetype - restore the name" and commment out that entire if block. I'd give the line numbers, but I've done a bunch of other custom stuff in mine, so they won't be accurate.

496 Name: Anonymous : 2009-01-19 04:31 ID:Heaven [Del]

>>495
Should be around line 1075-ish.

497 Name: Lord Pentium!PG1mP76kIY : 2009-01-25 16:09 ID:HZt+w7wb (Image: 1322x257 jpg, 38 kb) [Del]

src/1232928575216.jpg: 1322x257, 38 kb

OK, so I just closed a thread in Kareha, and I ended up getting this error when I tried to reopen it. Is this normal? By the way, I'm using image mode, on a Linux server.

498 Name: Anonymous : 2009-01-25 17:45 ID:Heaven [Del]

>>497 did the thread reopen? That's sometimes an artifact of a page that didn't load completely.

499 Name: Lord Pentium!PG1mP76kIY : 2009-01-25 18:12 ID:HZt+w7wb [Del]

>>498
No, the page didn't reopen. Not even when I refreshed it.

500 Name: wrecky : 2009-01-31 01:02 ID:K5GyfK6N [Del]

Hey I've got a bit of a problem. I've got Kareha pretty much set up but I'd like my .htacess to default to a different page.

Googling gets me the syntax for that (DirectoryIndex etc.) but I don't understand the included example.htaccess file and the directions to change the RewriteRule stuff. Maybe this is more of a general IT question but what am i missing?

501 Name: Anonymous : 2009-01-31 02:12 ID:Heaven [Del]

http://httpd.apache.org/docs/2.2/mod/mod_dir.html

  • > A file written by the user, typically called index.html. The DirectoryIndex directive sets the name of this file. This is controlled by mod_dir.

(In case you simply stopped reading the example.htaccess after the very first line, the mod_rewrite directives at the bottom are purely optional, and have nothing to do with the index page. They only are there to provide better hints to web browsers about the document character set.)

502 Post deleted by user.

503 Post deleted by user.

504 Name: Anonymous : 2009-02-12 01:26 ID:Heaven [Del]

Don't touch config_defaults.pl, ever. That's just where the error was triggered. Your problem is still in config.pl, and you've either removed, commented, or renamed ADMIN_PASS or NUKE_PASS.

505 Post deleted by user.

506 Post deleted by user.

507 Name: Anonymous : 2009-02-12 02:52 ID:cuT0dJ5Z [Del]

Not sure about your verification code error, but to change the title (or anything else), just edit config.pl and let wakaba.pl regenerate your html.

And, yes, wakaba.pl has a purpose; it's what your site runs on...

508 Post deleted by user.

509 Name: Anonymous : 2009-02-13 00:06 ID:rsPTn4Pw [Del]

Can you use the same mysql database for multiple boards? If not, how do you use the same admin table for every board to make global ip bans?

510 Name: Anonymous : 2009-02-13 00:50 ID:Heaven [Del]

511 Name: Anonymous : 2009-02-13 00:50 ID:Heaven [Del]

>>509
Yes.

512 Name: Anonymous : 2009-02-13 01:01 ID:rsPTn4Pw [Del]

Another question:

When you run wakaba.pl, wakaba.html is created. But I'm wondering if there's a way to edit something so when the html file is created, it's named something like board.html, or imageboard.html.

514 Name: Anonymous : 2009-02-13 03:54 ID:rsPTn4Pw [Del]

>>513
Doesn't work, I changed that and it had no affect. Edited the field in config.pl, deleted wakaba.html and re-ran wakaba.pl but it still creates wakaba.html.

515 Name: Anonymous : 2009-02-13 11:55 ID:Heaven [Del]

>>512
Did you try uncommenting it?

516 Name: Anonymous : 2009-02-19 20:47 ID:cFTOKu4F [Del]

is there any way i can disable the ability to post images?

517 Name: Anonymous : 2009-02-20 02:50 ID:Heaven [Del]

>>516
Yes, it's very plainly in the configuration. Look for the word "image".

518 Name: Anonymous : 2009-02-20 10:31 ID:7hjckRG4 [Del]

ok i thought so i just haven't gotten the script yet and it didn't say anything about like if you put it to 1 or 0 so i was just making sure. thanks though

519 Name: Anonymous : 2009-02-20 14:01 ID:7hjckRG4 [Del]

is there any way to have multiple boards?

520 Name: Anonymous : 2009-02-20 20:01 ID:Heaven [Del]

>>519
Multiple wakaba installations.

521 Post deleted by user.

522 Post deleted by user.

523 Name: Anonymous : 2009-02-20 20:45 ID:7hjckRG4 [Del]

im talking about kareha and i mean have things like /board 1/ /board 2/ like different sections where multiple threats and posts can be made sorta like kasuba

524 Name: Anonymous : 2009-02-21 13:40 ID:syDpiyB/ [Del]

i asked people on 4chan and they said i could make a portalish type thing and run multiple karehas off the main page, this is i guess what i want to do, any advice on how to go about doing this?

525 Name: Anonymous : 2009-02-22 11:53 ID:Heaven [Del]

>>523
Multiple kareha installations.

This really isn't that hard.

526 Name: Anonymous : 2009-02-28 10:52 ID:ejO2MH0D [Del]

I've been running my Kareha imageboard for about a month now, and I've been looking to add new CSS. However, I tried just making a new .css file and putting it in the /css folder, and it doesn't work... How do I add new CSS styles to Kareha in image mode?

527 Name: !WAHa.06x36 : 2009-02-28 17:04 ID:Heaven [Del]

>>526

Did you rebuild caches?

528 Name: Anonymous : 2009-02-28 18:27 ID:ejO2MH0D [Del]

>>527
Ah, forgot to do that. Thanks for your help!

529 Name: Anonymous : 2009-03-13 07:36 ID:JU2dsHcj [Del]

http://rokuchan.org/wakaba/wakaba.pl does any one know what the problem is and how to fix it

Software error:

Bad name after comments' at config_defaults.pl line 15.
Compilation failed in require at /home98c/sub009/sc61836-VWOA/rokuchan.org/wakaba/wakaba.pl line 17.
BEGIN failed--compilation aborted at /home98c/sub009/sc61836-VWOA/rokuchan.org/wakaba/wakaba.pl line 17.

530 Name: Anonymous : 2009-03-14 04:27 ID:4GvgoPaI [Del]

>>529
Help please

531 Name: Anonymous : 2009-03-14 09:18 ID:Heaven [Del]

>>529

We aren't psychic, we can't tell what you put in that file that broke it.

532 Name: Anonymous : 2009-03-14 12:16 ID:pYWaltB6 [Del]

Can anyone help me, please? I usually got "Error: No verification code on record - it probably timed out." when trying to post in my oekaki board. I fixed it for posts on main page as this guy said http://wakaba.c3.cx/sup/kareha.pl/1168935423/7 but I still can not fix it for replies.

533 Name: Anonymous : 2009-03-14 23:18 ID:kxn96LP+ [Del]

is there some who can help me please I'm using Futallaby right now and I hate it
I'm >529

534 Name: Anonymous : 2009-03-15 02:16 ID:kxn96LP+ [Del]

>>531
well here is the file I put * over the some stuff like the pw user name and other stuff
here is the txt file
http://rapidshare.com/files/209442147/wkbrokuchan.txt.html

535 Name: Anonymous : 2009-03-15 04:24 ID:Heaven [Del]

>>534
If you'd just uploaded that file to this board, or used a pastebin, I might have had a shred of care to look at it.

536 Post deleted by user.

537 Name: Anonymous : 2009-03-17 00:51 ID:ntQzohlp (Image: 0x0 txt, 7 kb) [Del]

538 Name: Anonymous : 2009-03-17 00:54 ID:ntQzohlp [Del]

there

539 Name: Anonymous : 2009-03-17 05:28 ID:Heaven [Del]

>>537-538
I daresay you're editing the wrong file. Start over, and pay closer attention, you should not be touching config_defaults.pl at all.

540 Name: Anonymous : 2009-03-18 15:16 ID:rD4TCTiC [Del]

Whew. This thread is quite the read.
I'm having an issue where I delete wakaba.html and run (access via browser) wakaba.pl. I am then redirected to wakaba.html, which does not exist. It is not built/rebuild when I access wakaba.pl. Clearing cache results in the same 404. Suggestions?

541 Name: !WAHa.06x36 : 2009-03-18 16:55 ID:Heaven [Del]

>>540

What if you go to admin.pl?task=admin and rebuild it?

542 Name: Anonymous : 2009-03-18 17:19 ID:rD4TCTiC [Del]

>>541 admin.pl isn't in the zip file I downloaded. I can still rebuild from wakaba.pl using wakaba.pl?task=admin (or something close), but the problem persists.

Something interesting I noticed. If I use permissions 755 for folders (res, in particular), line 378 (inside print_page) goes crazy and throws errors saying a temp file can't be created. It works only if I chmod res to 777.

So with chmod 777 to res, I get wakaba.html not found.
With chmod 755 to res, I get Error: Can not write to directory.

543 Name: Anonymous : 2009-03-18 17:31 ID:rD4TCTiC [Del]

>>541 Issue resolved:
Had to mod /var/www to 777. Icky solution, but maybe my live environment will be better configured than my bevelopment environment. Thank you for your help.

544 Name: Anonymous : 2009-03-20 23:21 ID:h8ysqMSD [Del]

I'm wondering why Wakaba doesn't automatically truncate threads beyond a certain point, if it does,, there do I find this option
thanks

545 Name: Anonymous : 2009-03-21 16:54 ID:Heaven [Del]

I have a quick question, does posting (running kareha.pl) cause that script to rebuild all the pages?

546 Name: !WAHa.06x36 : 2009-03-23 03:23 ID:Qldo6KoJ [Del]

>>544

Truncate how?

>>545

Only if index.html does not exist. Also, do not run it from a command line, that will create broken pages.

547 Name: Anonymous : 2009-03-23 04:04 ID:h8ysqMSD [Del]

Hi, I love your scripts ;)
truncate as in, now I have 31 pages of threads after I was testing it..
and I want it to only show say 150 threads at any one time ;)
using Wakaba

Anyway, just wondering if you're going to release your notes.pl script, thanks!

548 Name: Anonymous : 2009-03-23 04:07 ID:h8ysqMSD [Del]

oops, I found the notes.pl script :)
I thought it was just in indefinite testing, sorry

thanks

549 Name: Anonymous : 2009-03-23 07:11 ID:hwEtxFA7 [Del]

How do you get rid of the bee? I cant seem to find it in any of the .pl files. Is there something i comment out to stop embedding of files?

550 Name: Anonymous : 2009-03-23 19:55 ID:Heaven [Del]

> How do you get rid of the bee? I cant seem to find it in any of the .pl files.

remove it from include/rules.html. it's not part of kareha.
people who have the admin password for your board keep adding it through the admin interface.

> Is there something i comment out to stop embedding of files?

yes. fix your php script so people can't inject perl code (so they can't just get the password again), and then change the admin password for your board.

551 Name: Anonymous : 2009-03-24 05:09 ID:Heaven [Del]

>>550
Hm... helpful advice. I would have just recommended getting off of the internet altogether.

552 Name: reaven : 2009-03-24 10:53 ID:0hVTDOzO [Del]

The thing is that it just shows the code on the browser, i think i have properly configured the httpd.config file, and yes i do have perl and i have a correct hashbang. Im using xampp on windows and i dont know what to do, any ideas ?

553 Name: reaven : 2009-03-24 10:56 ID:0hVTDOzO [Del]

>>552
Ops i forgot the beginning:
Apache wont execute wakaba.pl

554 Name: Anonymous : 2009-03-24 20:42 ID:Heaven [Del]

555 Name: !WAHa.06x36 : 2009-03-25 06:06 ID:Heaven [Del]

>>547

Read through config.pl to find the various options for how threads are deleted. By default it happens by number of posts, not threads.

>>552

If code does not run, you have not properly configured the httpd.config file. Beyond that, it's not like we know how your server is set up. You really need to figure out that part yourself. Also, xampp is known to cause all kinds of problems.

556 Name: reaven : 2009-03-25 06:07 ID:0hVTDOzO [Del]

>>554
It works with mod-perl activated, but with that i get this error with wakaba.pl:

[Wed Mar 25 14:06:30 2009] [error] Can't locate config.pl in @INC (@INC contains: . C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/wakaba/wakaba.pl line 16.\nBEGIN failed--compilation aborted at C:/xampp/htdocs/wakaba/wakaba.pl line 16.\n

Internal Server error 500

557 Name: reaven : 2009-03-25 07:17 ID:0hVTDOzO [Del]

559 Name: Anonymous : 2009-03-26 14:36 ID:stUev05v [Del]

Hi, I've got a problem with Oekaki.
I'm using Shi Painter, and everything is OK except one thing: after clicking upload in painting window it shows me a preview in a reply form, and in this preview picture has some constant name. So, my browser saves this picture to cash and next time, when I draw other picture, it shows me the previous one.
Thank you, and sorry for my english.

560 Name: !WAHa.06x36 : 2009-03-30 09:17 ID:Heaven [Del]

>>559

Configure Apache to send no-cache headers for all files in tmp/.

561 Name: Anonymous : 2009-04-01 03:46 ID:H8w5qzS0 [Del]

>>560
Hm... I tried:
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
It didn't work.
What am I doing wrong?

562 Name: !WAHa.06x36 : 2009-04-01 04:23 ID:Heaven [Del]

>>561

That's PHP code.

Look at example.htaccess.

563 Name: Anonymous : 2009-04-01 08:15 ID:Bcll3BAZ [Del]

>>562
In my .htaccess:
<IfModule mod_headers.c>
<Files *.html>
Header add Expires "Mon, 26 Jul 1997 05:00:00 GMT"
Header add Pragma "no-cache"
Header add Cache-Control "max-age=0; must-revalidate; no-cache"
Header unset Vary
</Files>
</IfModule>
Still don't work.

564 Name: Anonymous : 2009-04-01 12:55 ID:Heaven [Del]

>>563
Check your page with wget -S http://blahblah/ or something such as Firebug to see if the headers are really being sent. Probably you don't have mod_headers enabled.

565 Name: Anonymous : 2009-04-01 13:05 ID:KHdhSJOI [Del]

Well, all of a sudden my wakaba install is giving me this error:

Software error:

Malformed UTF-8 character (fatal) at wakautils.pl line 447, <FILE> line 3.

Line 447 is:

    $str=~s!([^\w/._\-])!"%".sprintf("%02x",ord $1)!sge;

which is part of:
sub clean_path($)
{

    my ($str)=@_;
$str=~s!([^\w/._\-])!"%".sprintf("%02x",ord $1)!sge;
return $str;

}

We've edited parts of our script and it's been working just fine for us for quite some time... this is a quite strange error and I'm hoping someone has a clue about what could be causing it. It happens when anyone tries to post or even when I try to rebuild caches. I'm assuming it will happen with anything that calls wakautils.pl.

566 Name: !WAHa.06x36 : 2009-04-02 08:04 ID:K4vOYfq0 [Del]

>>565

Probably some kind of malformed UTF-8 in a filename or something similar.

567 Name: !WAHa.06x36 : 2009-04-02 08:05 ID:K4vOYfq0 [Del]

>>563

You are sending those headers only for html files. Note the <Files *.html>.

568 Name: Anonymous : 2009-04-06 09:56 ID:rm0Z/WaZ [Del]

Is there any option that allows Kareha threads to be numbered like that of Wakaba?

569 Name: !WAHa.06x36 : 2009-04-06 12:40 ID:Heaven [Del]

570 Name: Anonymous : 2009-04-07 05:00 ID:+Ut0XUuI [Del]

Hi. when i'm trying to run wakaba.pl i get a 403 error.
permissions are set to 775.

This thread has been closed. You cannot post in this thread any longer.