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/
Hey guys, I'm trying to add spoiler text support to wakaba, and I'm new to perl so this is a lot harder for me than it should be. Is there any reason why adding the following to `sub do_wakabamark($;$$)' is not working?
elsif(/^\[spoiler\]/) # spoilers{
if ($lines[0]=~/^\[spoiler\](.*)/){
while !($lines[0]=~/\[\/spoiler\]$/){
push @spoiler,$1; shift @lines;
}
}
$res.="<span class='spoiler'>".(join "<br />",@spoiler)."</span>";
}
Thanks in advance!!
>>135
Oh and if it matters, I'm getting a regex error in this section for some reason, and I don't understand what that has to do with my changes:
# do ^H
if($]>5.007)
{
my $regexp;
$regexp=qr/(?:&#?[0-9a-zA-Z]+;|[^&<>])(?<!\^H)(??{$regexp})?\^H/;
$line=~s{($regexp)}{"<del>".(substr $1,0,(length $1)/3)."</del>"}gex;
}
>>135
>>136
>>138
Made a bunch of changes and got it working for the most part, but now I can't make the spoilers work if post contains any other text before or after the tags. Here's what I have:
elsif(/.*\[spoiler\].*/) # spoilers
{
my @spoiler;
if ($lines[0]=~/.*\[spoiler\](.*)/){
shift @lines;
while ($lines[0]!~/\[\/spoiler\]$/){
push @spoiler,$lines[0]; shift @lines;
}
shift @lines;
if ($lines[0]=~/\[\/spoiler\]$/){
$lines[0]="";
}
}
$res.="<span class='spoiler'>".(join "<br />",@spoiler)."</span>";
}
Not sure what to do next...
Okay, so I moved it until after WakabaMark finishes messing with the text, and did my best to work around the strange placement of the tags it introduced. Here's my "final" solution (until I get rid of Wakabamark completely and start from scrath):
if($res=~/.*\[spoiler\].*/){
$res=~s/\[spoiler\]*/\<span class\=\'spoiler\'\>/g;
$res=~s/\[\/spoiler\]*/\<\/span\>/g;
$res=~s/\<p\>/ /g;
$res=~s/\<\/p\>/\<br \/\>\<br \/\>/g;
$res=~s/\<br \/>/ /;
$res=~s/\<\/span\>\<br \/\>\<br \/\>/\<\/span\>/g;
}
Protip: Don't do that. It seems like it's easy to write a simple text formatter using a bunch of chained regexes.
It is not.
Every single regex is going to interact with every other regex, in subtle ways you will not predict, and you will open yourself up to mis-formatting and HTML injections. Hunting these down will be painful, and once you are done (which you never really are) you will have an utterly unmaintainable monster.
If you want write a text formatter, you will need to use some kind or other of actual parser.
>>141
Interesting. Well, I'm going to take your advice and keep trying to get spoilers working in a Wakabamark like fashion. Any advice?
Anyone know why both Wakaba and Kareha's generated HTML looks like this? If it matters, it happens under both nginx and lighttpd.
>>143
That's intentional. If you want to read the HTML code, use Firebug or similar.
There is little need for people to read it, and adding linebreaks just makes the code and output bigger for no real benefit.
I can post and it shows that in my admin management menu, but I don't see the posts in wakaba.html
How come they won't show?
>>147
Tried to F5/clear browser cache? If that works, use the included example.htaccess file to avoid the problem.
Is there a way for 2 people from 2 computer locations to share control over a Wakaba board? By control I mean fixing config.pl, changing link on top of the site, adding template style, etc.
How do you add boards?
I'm having minor cache problem with wakaba: new posts won't appear unless the page is refreshed, happened in both Firefox and Chrome. Is there a way to fix this?
How do I get rid of the /wakaba.html part from the main URL, as well as .html extension from every page?
I'd tried to use .htaccess but it doesn't fix the problem permanently: after posting, /wakaba.html returned.
>>155
Sorry I don't know, I have a friend hosted+coded the site and he's away atm. The private test board I set up is on Apache.
Last time I mention about removing /wakaba.html, he only said it can't be done even though I've seen some sites did it. So now I'm searching around. Does the methods for each differ much? It might be a good idea to document them.
>>156
Set Apache's directory index to wakaba.html or change wakaba.html to index.html in the config, then either 1) add rewrite rules to redirect wakaba.html to the board's root directory or 2) modify wakaba.pl to always redirect to the board's root directory.
>>100 uh what? i was using lighttpd on chansluts/male general/tranchan/chanchan/intern3ts/etc for about two years.
Is there anyway to force re generation of thumbnails? My older thumbnails are sized differently than my newer ones due to a different configuration, and I was wondering what I could do to make it more uniform other than resizing them in the browser.
Nope, sorry. Unless you write your own script to do it and update the database.
>>160
Might not even have to update the database now that I think about it. Aren't the file names more or less the same in the thumbs folder and the image folder? I'm guessing I can just run some sort of script that will resize the originals and add "t" to the end.
You need to update the image sizes. I think those are in the database.
>>163
Yes it would. Every thumbnail gets displayed with width and height attributes taken from the database.
>>164
I already changed how thumbnails were displayed in futabastyle.pl. I didn't change the larger ones though, since upscaling looks ugly.
>>165
Did you remove the width and height attributes? That's kind of stupid, because the page is going to bounce around like crazy while loading it, especially on slow connections.
>remove
No, I just set the width of all the reply thumbnails to 127px (apparently the height is adjusted accordingly), and my plan is to have the OP thumbnails display at 250px, which kinda has to be the native res if I don't want them to look like shit.
Try posting a 1x1000 pixel image now.
>>168
That -would- be annoying. Well, either way thumbnails are still resized with a 250px max height using imagemagick by default, so it still won't be that much of a problem
Is it possible to start an online archive for Wakaba board similar to how 4chan did it?
Is anyone else having problems logging into Wakaba on Dreamhost? I noticed they seemed to have broken REMOTE_ADDR which made the login not work at all for me.
Anyone else?
>>171
Works fine for me. Sounds like that is a server-specific issue.
>>135-141
So I FINALLY got spoilers working properly. I don't remember who told me, but the only way to get this to work without completely rewriting wakabamark was to hold off on the spoiler function until AFTER all wakabamark related things were completed. Anyways, I went ahead and put my code right after:
# restore >>1 references hidden in code blocks
$comment=~s/>gt;/> >/g;
...which was on line 846 in my version of wakaba.pl. Next is the actual spoiler code:
# new spoiler code (can't put it in 'do_wakabamark' because of 'do_spans' messing with the order of tags
if($comment=~/.*\[spoiler\].*/){
$comment=~s/\[spoiler\]*/\<span class\=\'spoiler\'\>/g;
$comment=~s/\[\/spoiler\]*/\<\/span\>/g;
$comment=~s/\<span class\=\'spoiler\'\>\<br \/\>/\<span class\=\'spoiler\'\>/g;
$comment=~s/\<\/span\>\<br \/\>/\<\/span\>/g;
}
Hopefully this helped -someone- out.
does anyone know why my kareha isnt generating an rss and backlog? the files are there, theyre just blank. my kareha is installed in imageboard mode if it makes any diff
nevermind i just copied the templates from the non imageboard file
Is there any way make individual posts display SJIS art properly in Wakaba like they Kareha does? Or is this something I'll have to add in myself.
>>179
There's no built-in way to do that, but you achieve it with a few quick additions to the templates.
Find something like this in the templates (it should occur twice, IIRC):
<blockquote>
<var $comment>
Replace it with this:
<blockquote<if $email=~/^aa$/i> class="aa"</if>>
<var $comment>
Then add this to either the global stylesheet in the header template, or to each individual stylesheet:
.aa { font-family: 'MS PGothic', MS Pゴシック, IPAMonaPGothic, Mona; }
Finally, to post with SJIS art, just enter "aa" in the email field. Note that I haven't tested this.
Speaking of CSS, was there any significance to .reply blockquote, blockquote :last-child { margin-bottom: 0em }
in futaba_style.pl? Most seem to consider the way it looks odd, and both 4chan and 2chan are rendered the way Wakaba would be without it.
Probably something about emulating the exact look at Futaba at the time it was written.
>>183
It works you do /aa$/i
as well. I didn't think to add mailto:
.
Im running apache2 on ubuntu, and I am not able to access .pl files from my web browser for some reason I get 403 errors every time. Its my own server, what have i messed up?
I did configure it for .pl and .cgi files in apache2.conf
Ask on an Ubuntu forum. And when you do, actually tell them what you did. People can't read your mind over the internet.
After I was making changes to config.pl in Wakaba 3.0.8 and uploading the revisions, I noticed that I can't get into the management panel without getting a software error, nor can anyone make any posts on the board without getting the same error. It says ADMIN_PASS and NUKE_PASS aren't defined. I didn't make any changes to those passwords while making my revisions and I don't know how to fix it. This is not my imageboard either. I'm just helping a friend and I don't want him to know.
Is there a way to disable WakabaMark rendering when posting SJIS art on Wakaba 3.0.7? i.e. don't bold or italicize asterisk and underscore pairs.
Quick question:
Is there a way to get the management panel to link to actual posts or show its thread? Currently it shows post numbers, name, subject, comment, IP, etc.
No ADMIN_PASS or NUKE_PASS defined in the configuration at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 314.
BEGIN failed--compilation aborted at config_defaults.pl line 125.
Compilation failed in require at wakaba.pl line 17.
BEGIN failed--compilation aborted at wakaba.pl line 17.
Line 17 says
BEGIN { require "config_defaults.pl"; }
Kareha: When I move my board, including all scripts and files to another directory, nothing works right because it doesn't reflect the new path. Everything works fine in admin.pl and elsewhere if I add my /path/ to the address. I've tried rebuilding caches in admin.pl as well as deleting all of the html files and running kareha.pl in a browser to recreate them. I've tried recopying default config and all of the pl files. Is there something I am missing?
How would one go about disabling code formatting in Wakaba? Deleting this
elsif(/^(?: |\t)/) # code sections
{
my @code;
while($lines[0]=~/^(?: |\t)(.*)/) { push @code,$1; shift @lines; }
$res.="".(join "<br />",@code)."";
}
Doesn't seem to do anything but cause wakaba.pl to get stuck in and endless loop and consume 100% of my CPU.
>>193
You shouldn't really touch the parser unless you know what you're doing. That being said, you can probably fix the problem if you also change while($lines[0]!~/^(?:\s*$|1\. |[\*\+\-] |>| |\t)/) { push @text,shift @lines; }
to while($lines[0]!~/^(?:\s*$|1\. |[\*\+\-] |>)/) { push @text,shift @lines; }
.
>>194
That seemed to do it. I can't seem to figure out why though...
Running Kareha, 2ch mode. Every post (regardless of poster) got the same ID, which made me curious. When I saw the IP attached to the posts in admin.pl, it turned out that all posts were made by 127.0.0.1, somehow.
That seems pretty impossible and I have no idea what’s going wrong.
Are you infected with some kind of PHP malware that rewrites links? Check your .htaccess files for mysterious junk.
Yes, the parser is a terrible regex monster, and is not really understandable by anyone, including me. Lesson learned: Don't do parsers as a series of regex transformations, this never turns out well.
So, I've recently created an imageboard, but found out that with my host, I don't have permission to do exec(). Needless to say, this causes problems, because I cannot use the convert command to create thumbnails.
Is there any alternative to imagemagick, or other libraries that use exec() for displaying thumbnails? I like my host otherwise, and would rather not switch if at all possible.
thanks!
>>202
This sounds weird. CGI works by executing a process on the server, so the problem isn't there. It's more likely that exec()
is disabled for PHP, which doesn't affect CGI scripts at all, and that the server is simply missing binaries for imagemagick.
Hello,
I had a a few quick questions regarding the subback page - not sure if I should have started a new thread for this.
I am wanting to do one of two things:
I'm very new to perl, well to programming in general... I think this has to do with "use constant", although I'm not too sure. I've been toying with it, and have had no luck yet.
2. Pagnating the subback page with "older" and "newer".
Any help would be greatly appreciated.
So, my Kareha textboard started giving an error. I haven't made any changes in it in a while so I don't know what it would be. It's okay from the front page, and you can post from the front page, yet if you try to open a whole page the error occurs and it crashes. It says it's looking for a <br> tag, and not finding it.
View the whole thing by loading a thread: http://chansoft.heliohost.org/grey/kareha.pl/1321138418/l50
Please help me find a fix. Thank you.
>>206
Have you changed your template at all?
>>207
By "template" do you mean the .html files in the "includes" folder?
Yes. And you can see it on the board. I had the footer.html changed a while back but I reverted it back to the original.
I need the Kreha last 50 post option but for wakaba. How can I do this?
In order to do the last 50 posts thing in wakaba, I'd need to generate in res 2 files for every thread: 1, the thread as normal and 2, the thread with just the last fifty posts and a link to get back to the original full thread in the "omitted" area. I'd also need to place a link in line with the reply link that points to the <thread number>_l50.html called "Last 50." I know what needs to be done, I just can't code it. If anyone could help: I'd appreciate it.
How exactly would one go about printing the contents of a constant array in futaba_style.pl? I noticed that Wakaba seems to use a template system of its own, and there's no real documentation...
>>211
...Never mind just figured out what was going wrong. I just needed to escape the > with a \
Does anyone know if its possible to move a thread from one board to another in Wakaba? I'm assuming all I have to do is move the data from one comments table to another, but I'm worried that there might be some crazy date/sorting related stuff that will fuck it all up for me.
Anyone a little more matter on the topic hanging around here?
Moving the rows to the other table, and moving any images in src/ and thumb/, and then rebuilding caches should work. You'd probably want a program to do it for you though.
>>214
Is there anything you recommend? I thought I might be able to try it out in the SQL interface, and then add a function to wakaba.pl once I'm sure it works 100%. I just wanted to make sure the thread wouldn't magically render in the wrong order, or post numbers wouldn't collide. Would it be a good idea to change all of those values to make sure nothing gets in the way of each other?
>>213-216
It seems like there's an unintended side effect to simply "moving" the thread over. The post numbers on the new board get bumped up (what would happen if they were lower on the source board? More problems I'd imagine). I guess the only way to avoid this is manually editing each field or changing everything problematically...
I can't seem to figure out where posts
in my ($parent,@replies)=@{$$thread{posts}};
comes from in sub build_cache_page($$@)
Can anyone help me solve this?
Can anyone walk me through this? I'm a bit lost as to what this is doing exactly.
while($row=get_decoded_hashref($sth))
{
if(!$$row{parent})
{
push @threads,{posts=>[@thread]};
@thread=($row); # start new thread
}
else
{
push @thread,$row;
}
}
push @threads,{posts=>[@thread]};
Has anyone here successfully configured Kareha with Nginx so that he can paste his config?
>>220
Last I checked there's really nothing you need to do with nginx specifically other than getting Perl running if you haven't already.
>>221 I have, but links like kareha.pl/1326737060/l50 don't work. They throw 404s.
>>222
Kareha uses the PATH_INFO server variable which apparently doesn't work correctly in nginx (see http://www.saltwaterc.eu/how-to-fix-nginx-and-phpfastcgi-path_info-issue.html).
My suggestion would be to change PATH_INFO to QUERY_STRING and modify templates so that links become kareha.pl?/...
instead of kareha.pl/...
.
>>223
Huh... I wonder why I never had that issue.
I think I had some crazy url rewrites(because of some previous reverse proxying that I did) that may have magically fixed the problem.
Are there any other ways to get this working without having to make the URLs less aesthetic?
>>223,224
Any chance the issue's been fixed recently?
Currently, Wakaba's ban feature only prevents the users from posting. Is there a way to ban them from viewing the board as well?
>>226
That has to be done server-side, e.g., using Apache's mod_rewrite or access control directives.
Okay, here's two recently discovered in wakaba vulnerabilities:
1) deny of service: every time user deletes post with "file only" flag wakaba updates db and rebuilds cache, even if there's no file already. so it's possible to "delete" post unlimited number of times, and each will cause complete cache rebuild and DoS as a result
2) wakaba doesn't check "admin" flag when deleting thread with "archive" flag set. so anyone can forge request and put own threat to archive. Post CP, delete to archive, write abuse. profit.
Archiving will only work if there are folders for the archive, and if they have the correct permissions. Simple solution, don't have an archive.
The potential for DoS is more important.
>>229 well, another simple solution is to add
$archive = 0 unless($admin);
in delete_stuff after
$password="" if ($admin);
>>231
wakachan.org have arch on some boards.
iichan.hk (ex iichan.ru) have arch on almost all boards.
Good thing that, although wakaba distribution includes arch directory, there's nothing in manual about setting permissions for it. So it's safe to assume, i think, that by default you don't have an archive.
Second problem (DoS) also kinda easy to fix. I can post a patch against latest wakaba.pl if anyone interested.
>>232
I just wrote up a small fix for my board. I just made a variable called $hasimage
, and I set it to 1 if if($$row{image})
is true. Then when its time to rebuild caches, I just put a make_error()
inside of if(($fileonly)&&($hasimage==0))
.
After I did all of that I realized I could probably just do a make_error()
as an else statement appended to if($$row{image})
, but both will work just fine I think.
>>233
I'd post a patch, but my wakaba.pl is... pretty different at this point compared to the standard one.