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 two threads:
Also check the documentation: http://wakaba.c3.cx/docs/docs.html
There is also a setup guide by Anon: http://wiki.iiichan.net/index.php?title=Wakaba_and_Kareha_Setup_Guide
Questions about "500 Internal Server Errors" go in this thread: http://wakaba.c3.cx/sup/kareha.pl/1109033191/
> Also, is hotaru still around?
yes, i am still around.
>>341
Perhaps use something like this instead, without the <Files>
block:
Options +ExecCGI
AddHandler cgi-script .pl
Anyone know how to make session cookies or non-persistent cookies in Wakaba?
>>344 here,
Already figured it out on my own. I just ended up adding a few lines to the make_cookies function.
Has anybody written a Futaba-style Catalog mode for Wakaba?
I'm considering writing one myself, but my Perl isn't very good...
>>346
I've written something a little more similar to 4chan's, but I think its close enough. You can copy the relevant code from https://github.com/marlencrabapple/Glaukaba, but I'm not sure if you can just drop it in and have it work. Also, the entire script is pretty much a mess since I started messing with this thing a whole year before I knew what I was doing.
The guys at bunbunmaru (http://bunbunmaru.com/wakaba/general/wakaba.pl?task=cata) made one that may be a little more your speed, and if they're willing to share the code then you should be set.
If neither of those work for you, you can try bothering the guy from http://sovietrussia.org/ since I think he also had a catalog mode in his Wakaba installation.
>>347
I like how you copied my broken signal handling.
You should probably use Plack/PSGI for FastCGI support. Anything else is just ridiculous, and Wakaba seems to leak memory if you run it in a persistent environment without restarting the script regularly. Plack handles that for you.
>>348
I've actually had good luck with it so far. I'm pretty sure its the DB cache that takes up the memory in the first place, and apparently it'll shrink back down given enough time with no DB hits. I was actually looking into a few FastCGI frameworks right before you changed the way you did it, but I thought I might have better luck learning a little more about it before I just switched over. I was hoping that I could eventually "correct" your signal handling too, but I haven't had any issues with random crashes yet, so it hasn't been to pertinent of an issue for me.
Here this is a pretty simple question but it's been pissing me off no end, I'm trying to get a title image to display on my imageboard, the image is uploaded to the /wakaba directory and I've pointed at it in config.pl like so
use constant TITLEIMG => 'header.jpg';
The pic being named header.jpg, obviously. I've googled this many times and this thread just keeps coming up, nothing in documentation anywhere else. Is therre a pixel or size limit on the pic that's not mentioned? Cheers.
Nevermind eh got it wakaba doesn't updayte after I reupload the edited config file straight away, only after a post for some reason.
>>351
It uses a static cache. You need to rebuild them manually for everything to update.
Couldn't write to file "index.html" at wakautils.pl line 1013.
Help?
>>355
Nevermind, fixed by messing with perms.
But now thumbnails aren't showing, has anyone had any luck with ImageMagick on nearlyfreespeech?
>>358
I've tried messing with permissions to no avail. There's no "thmubs" directory being made (hence the picture).
>>359
Make the directory yourself. I think I had a similar problem.
Stupid question, but where is the admin panel?
How do i get it installed in my HTML document at the first place??
>>361
http://www.e-zoos.dik/wakaba.pl?task=admin
>>362
Not entirely sure what you mean.
When I access the pl file through my web browser, am I supposed to see th html code or the actual page?
>>365
First, are you even running a http server? Second, you need Perl installed. Third, you need to configure your http server to pass requests for Perl files to your Perl interpreter.
Looks like >>369 broke the board... I'm surprised that hasn't been fixed yet.
Just wanted to thank you for keeping your software up-to-date and helping your users out, WAHA. Kareha is great. Thanks a bunch!
Running Kareha in Futaba mode. When I delete a post, it still appears in the admin.pl menu as a blank post, i.e. Posted by: 46.105.XXX.XXX - Password: XXXXYYYY - delete post - delete file - ban IP
with no real content beneath it (blank). Is this normal behaviour?
>>378
Didn't think to include an image. This board looks like it's in 2ch mode but it allows image posting. It's confusing me!
This is probably a stupid question, but just how much would a bunch of <if $admin>
's in the regular template slow regular posting down? Obviously, they won't work unless I'm building the pages dynamically for admin users, and of course I already have this all worked out using an almost entirely copypastad version of the normal template for this, but its become a bitch to maintain, and I'd just like to know how bad of an idea combining the two together would be.
>>380
Alternatively, can anyone recommend a good way to benchmark wakaba myself?
>>380<if $admin>
in the templates gets transformed to if ($admin) { ... }
during compilation, so it won't run any slower than a regular if statement in Perl.
>>382
I'm just wondering how much an extra 10 or so of those would effect compilation time.
Benchmark: timing 10000 iterations of fifteen_ifs, five_ifs...
fifteen_ifs: 3 wallclock secs ( 3.13 usr + 0.00 sys = 3.13 CPU) @ 3194.89/s (n=10000)
five_ifs: 2 wallclock secs ( 1.68 usr + 0.00 sys = 1.68 CPU) @ 5952.38/s (n=10000)
Code: http://pastie.org/pastes/7700042/text?key=ofajzssrzghdz6mobzwyg
In other words, the difference is totally insignificant.
please remove my ip from ban-list
when i go to http://wakaba.c3.cx/
i get http 403
In Kareha, is there a simple way to get, say, header.html to automatically include another HTML document? So you could have:
<div id="rules">Some rules here.</div>
<hr />
<div id="navigation">{include nav.html}</div>
Or something. I use the rules.html for my board navigation, and mid.html for announcements. This would make things a mighty sight easier!
>>386
If you're doing it inside of the header and you don't want to mess around to much with the rest of the template, just do something like this
<var include("include/nav.html")>
That should work in Kareha.
I heard that WAHa recommends Kareha over Wakaba for imageboards. Is this true? I use Kareha and was thinking of setting up an imageboard, but I'm not sure if I should choose Wakaba or Kareha. The speed increase seems nice, but if the author recommends against it, I'm more than happy to trust his judgement.
>>388
This is just a guess, but I think he recommends Kareha because most will never need the added speed that Wakaba and a database can bring. That, and 2006-2010 4chan kinda tarnished the imageboard collective... image, so the farther away you get from that paradigm the better, I guess. There's also the fact that Kareha is newer and has more functionality in some ways.
Back when I had to make the choice in 2011, I went with Wakaba, and its worked out for me so far. I've also managed to tack on ~2000 lines of code for some more modern functionality since then too, which is something that would've been a bit more difficult with Kareha, I imagine.
>>379
From what I've gathered (reminding everyone that I know absolutely nothing about programming), the post remains in log.txt
which is why its IP address can still be viewed. It also appears that, while the post is removed from the HTML document, the postcount
number is not lowered.
Make a thread, post two replies. Delete the last reply. Not only will that deleted post still be in log.txt
, but the thread's postcount
remains at 3. Because of this, you can view the post number and IP in admin.pl
, but the post appears to be completely empty.
I'm assuming this behaviour is for one reason only: so that the post numbers contiue to rise up, just like they do in 2ch mode. If we delete that third post then add a reply, the new reply is post #4, not #3. The only difference is that, in 2ch mode, the post will still be visible, but its contents are replaced with 'Post deleted by user.'.
So, AFAIK, it's not a bug, but simply a way of keeping track of the amount of replies the thread has received; it only appears blank because deleted posts aren't visible in Futaba mode, but they are in 2ch mode.
>>386
>>387
Note that any template code inside nav.html
will not be evaluated when doing it this way. If you need this, I believe I posted a hack for it further up in the thread.
>>388
I've heard the same thing, but I don't think it's true. I'd argue that Wakaba is the better choice: it has way better mod tools than Kareha has, SQL makes life easier in the long run and I've encountered weird bugs in Kareha which have resulted in things like cached indexes erroneously displaying single threads and large amounts of posts being wiped.
http://wakaba.c3.cx/sup/css/pseud0ch.css
> .replytext em { font-style: normal; }
Why is this rule here? It stops emphasized text from showing as italic in Pseud0ch.
You're expecting anyone to remember, after all these years?
>>393
I'm surprised I even noticed. It seems all the boards I visit must have fixed it.
How do I get a sage checkbox?
I got it!
<if $thread>No bump <input type="checkbox" name="field_b" value="sage"/></if>
Is there a postcount variable?
I'm making a masterlist of threads and wanted to show the postcount in a table. I've found $curr_replies in wakaba.pl but didn't know how to specify which thread with it.
>>398
Just do "SELECT COUNT(*) FROM ".SQL_TABLE.";"
>>399
But where would I specify the thread number?
>>400
Oh, I thought you wanted ALL of the posts. Try "SELECT COUNT(*) FROM ".SQL_TABLE." WHERE parent=?;"
and just put the thread number in the $sth->execute()
part.
>>401
Sorry, now I'm really confused. I just want to count the number of comments (from the SQL table "comments") for each parent thread.
>>403
Thanks for the additional clarification. I ended up settling for a basic code that needs to be manually adjusted for each new parent thread, but just in case anyone else is interested:
<?php
$con=mysqli_connect("localhost","USER","PASSWORD","TABLENAME");
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result1=mysqli_query($con, "SELECT count(*) as total from comments where parent='1'");
$data1=mysqli_fetch_assoc($result1);
?>
<table>
<tr>
<td>001</td>
<td>
<?php echo $data1['total']; ?>
</td>
</tr>
</table>
>>404
That's not really ideal for multiple reasons. First, why are you using PHP when Wakaba is written in Perl? Second, depending on how many threads you have you could be hitting the database hundreds of times for each user that views the page.
On a side note, thanks to your code, I remembered that my board's thread list does what you wanted, so I thought it might be a good idea to share my code with you, but as I read through I realized I made the same exact mistake as you. Wakaba has a sub routine called count_posts already built in, and I was calling it for each thread
>why are you using PHP when Wakaba is written in Perl?
Because I know more of PHP. My knowledge of Perl is nonexistent; I've never worked with it before.
>you could be hitting the database hundreds of times for each user that views the page
Fair enough. If this were for a popular imageboard, I wouldn't recommend this method. But in a situation where you only have five posters, this manual method works well. Plus, the table from >>404 is a simplified version of the real masterlist table, which contains multiple elements ('type' and 'description') that can't be automatically generated (as they don't exist outside of the masterlist) so I can't just cycle through the parent threads.
>share my code
Oh, I'd definitely be interested in seeing it if you do fix it. Or just the unfixed code. Curious how other people (who know Perl) tackled this problem.
>>406
To be completely honest, I didn't know Perl or PHP when I started messing around with Wakaba, but I've learned a ton because of the time I spent tinkering.
Anyways, it turns out posting my code isn't as simple as copying in pasting the relevant lines, since I don't know just how much I've changed over the last year. I can try implementing it in a plain version of Wakaba sometime tonight, but until then, you can try to track down what you need in my git https://github.com/marlencrabapple/Glaukaba
>>407
I see. Alright, thanks for the link, I'll poke around once I'm done patching up the rest! And wow, a Summer Glau chan. Good taste.
You'll probably have better luck asking at some Apache forum.
I can't seem to get the quote feature to work. I have to type the ">>40" or whatever the number would be. When I click on the post number, doesn't put the quote in the comment box. I am using Wakaba. Here is the link to my imageboard. http://pyroneous.com/wakaba
>>412 It is named wakaba3.js, should I rename it?
>>413
No, just make sure its in the right folder or fix your permissions so that its readable.
How should I get rid of the "Board Look" section?
Is there a way to create hyperlinks with WakabaMark? I'm assuming there is with Markdown.
It's the only reason I ever use HTML formatting, and then I have to add <p>
tags myself.
What can I edit so that I can put a constant PHP header on index.html in Kareha?
>>417
But it would be nice to have hyperlink text, maybe something like [[http://example.com|example]]
.
there would be no point in doing that. it decreases the security of the users and makes hiding spam or malicious urls much simpler.
>>420
You can already do that through the HTML mode, and a lot of spam bots already do (or try to). Plus I doubt many spam bots are set up to use WakabaMark.
It's inconvenient to humans, not robots, and if a human wants to hide a malicious URL that way they already can.
Has anyone made a HTML5 patch/fork before I do it myself?
>>422
Its as simple as changing the doctype for the most part. That said, if you're looking for 100% "valid" html5, then yes, I've done it, along with a ton of other things that might turn you off if you're looking for a barebones experience.
https://github.com/marlencrabapple/Glaukaba
Aside from an option or two missing in global_config.pl, the installation is pretty straightforward, and everything should run as expected. I just installed it myself a week or two ago and it seems to be in a pretty useable state.
I get a software error.
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC
As far as I can tell I have installed the thing in my cpanel, so what gives?
Stupid question: is there a reason why no column is set as the primary key in Wakaba? I don't know much about databases, but it seems like that most of web apps do it.
Hi
i have installed kareha, but there are a few problems i am not sure how to deal with.
Software error: Can't locate captcha.pl in @INC (@INC contains: . /usr/local/lib/perl5/5.8.8/x86_64-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl) at kareha.pl line 15, <FILE> line 7.
BEGIN failed--compilation aborted at kareha.pl line 15, <FILE> line 7.
I temporarily fixed this by commenting the line BEGIN { require 'captcha.pl'; }, but I'd like to fix it properly.
Thanks for your help guise.
How stupid would it be to connect to another db for things like session management? I'm thinking that if I offload something that would be hitting the db pretty often so a separate database server (or a tiny sqlite db) it would decrease access times to my main db server without any consequences. Would there be any noticeable overhead or am I missing something really obvious?
There's no session management, nor any hits to the database at all unless someone posts?
>>429
Sorry I wasn't clear. I'm testing out some stuff I wrote for prevalidating captchas (reCAPTCHA, not the built in one) so you don't have to spend forever uploading an image just to find out you messed up and need to start over. Its pretty simple stuff but of course in most cases it requires an extra db query. After looking into how flood detection and bans are handled its pretty obvious that this would't be that huge of a performance hit, since its pretty much just two extra queries in total, but I'm still curious if offloading it somewhere else (maybe even a simple text file) could improve performance.
besides writing a new .css, what do i have to do to use custom board look?
>>431
In terms of what you HAVE to do that's about it, but you can do a lot more if you really want to.
I'm using waka_utils.pl in another project of mine and I was wondering how safe the templating system is for allowing (paid) users to write their own. If I remember correctly its possible to run code in a template, so I'm kind of wary about just allowing them to access the template system. Is there a way to make it a little more restrictive or am I better off just writing something myself?
>>434
Okay I just tried looking through the compile_template function myself and I think this should take care of it.
if(!$safemode) {
if($closing) {
if($name eq 'if') { $code.='}' }
elsif($name eq 'loop') { $code.='$$_=$__ov{$_} for(keys %__ov);}}' }
}
else {
if($name eq 'var') { $code.='$res.=eval{'.$args.'};' }
elsif($name eq 'const') { my $const=eval $args; $const=~s/(['\\])/\\$1/g; $code.='$res.=\''.$const.'\';' }
elsif($name eq 'if') { $code.='if(eval{'.$args.'}){' }
elsif($name eq 'loop')
{ $code.='my $__a=eval{'.$args.'};if($__a){for(@$__a){my %__v=%{$_};my %__ov;for(keys %__v){$__ov{$_}=$$_;$$_=$__v{$_};}' }
}
}
else {
if(($name eq 'var') and ($args =~ /^\$[a-zA-Z]+$/)) {
$code .= '$res .= eval{' . $args . '};'
}
}
Any obvious gaping holes?
>>435
The only obvious gaping hole I can think of is that you've basically just created an overcomplicated sprintf()
.
>>436
Most of it is part of the templating system already in waka_utils.pl.
I'm trying to wrap my head around the templating system a little more, and I can't quite figure out how the variables passed to the constant value that defines the template are in the same scope as compile_template. How would one access the variables available to compile_template? Are they inside of some magical perl variable? I already checked @_ and all that's in their are the contents of the constant.
>>439
Oh wow I think I got it on my own. I put die %__v->{title}
inside of the my $sub = eval
part and it printed out the value of $title.
How big of a performance hit would it be to change the entire config system from constants to hashes? I'm trying to make it easier to manage multiple boards for less savvy users. Would something like
my $option = sub {
my ($board,$key) = @_;
return BOARDS->{$board}->{$key} || GLOBAL_OPTIONS->{$key};
};
for retrieving a config option be a huge performance hit or security risk?