img2 is imageboard software
It is similar to kusaba, wakaba, pyib etc, but tries to be more user friendly.
the current release is 0.5.
Features
- Front page showing an aggregate of posts from different boards - so when a slow board gets a new post people will see it.
- Thread-List page showing the subject/start-of-first-post from every thread - so people don't have to hunt down threads they lost.
- Upload any of jpg, gif, png, swf and torrent files - or dont allow anything and just use it as a text board.
- Torrent preview showing files, trackers, seeds/leechers etc.
- Multiple boards supported.
- Import posts from existing kusaba/wakaba (or forks) boards
- Extremely configurable, via control panels, set defaults and override them per-board.
- Mod and Admin account types.
- Mod Log.
- Post expansion when clicking on >>x links, inline thread expansion (showing omitted replies), inline image expansion.
- No external database required - uses SQLite.
- Post forking - start a new thread by forking a post from another one - and the forked post and new thread will be linked/displayed together.
- Ban IPs from posting, Ban file hashes from being posted, Ban DNSBL entries from posting.
Oddities
- Tripcodes are different to the traditional style, and differ between board installations.
- All Mods are global.
- All bans are global, and only prevent posting - not reading the boards.
- img2 is new and relatively unproven. Use at your own risk.
Requirements
- python 2.5
- imagemagick
- linux (*might* work on others though)
- you can use a shared apache with
mod_proxy_http
, or something like lighttpd or nginx - img2 runs as a long running process with an embedded http server. you setup your webserver to proxy requests (except for static content or uploaded files) to img2.
- you need shell access to your server, the ability to run long running processes, and basic linux knowledge.
Installation/Configuration
- checkout the latest release (currently
/branches/0.5
) from svn.
- symlink
static/
and uploaded_files/
from the checkout dir to the web document-root for your chosen domain.
- configure your webserver to send page requests to
127.0.0.1:63331
(or whatever you choose, this is the default...)
- if you are using apache: enable
mod_proxy_http
, and create a .htaccess
in web root containing:
RewriteEngine On
RewriteRule ^(robots\.txt|favicon\.ico)$ /static/$1 [QSA,L]
RewriteCond %{REQUEST_URI} !^/(static|uploaded_files)
RewriteRule ^(.*)$ http://127.0.0.1:63331/$1 [QSA,P,L]
LimitRequestBody 4194304
- if you are using lighttpd: enable
mod_proxy
, and add something like this to your config:
$HTTP["host"] == "img2.example.com" {
server.document-root = <your-doc-root>
$HTTP["url"] =~ "^/(?!static|uploaded_files|favicon\.ico|robots\.txt)" {
proxy.server = ("/" =>
(( "host" => "127.0.0.1",
"port" => 63331,
))
)
}
url.rewrite-once = (
"^/favicon\.ico$" => "/static/favicon.ico",
"^/robots\.txt$" => "/static/robots.txt",
)
server.max-request-size = 4096
$HTTP["url"] =~ "^/(uploaded_files|static)/" {
expire.url = ( "" => "access 1 months" )
}
}
- If you are using nginx: add something like this to your config:
server {
listen 80;
server_name img2.example.com;
rewrite ^/(favicon\.ico|robots\.txt)$ /static/$1;
location / {
root <your-doc-root>;
proxy_pass http://127.0.0.1:63331/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /static {
root <your-doc-root>;
}
location /uploaded_files {
root <your-doc-root>;
}
}
chmod +x bootstrap.py
and then ./bootstrap.py
- This will start img2 listening on port 63331, to use a different port, use the -p <port> argument
- Use Ctrl+C to stop it.
- Use the default login, admin:password, then make a new admin and delete the default account.
- start it in a screen session or setup monit or something for running it long term
File Layout
cache/
- cached pages.
databases/
- database files.
img2/
- python code.
static/
- non-dynamic resources needed for web pages, eg. css.
templates/
- templates, look in img2/util/templates.py for info on the template format.
uploaded_files/
- files for posts.
bootstrap.py
- the script you run to start img2.
readme.html
- this file
Customising Error Pages/CSS/Templates
- For custom error pages edit 403.html, 404.html and 500.html in templates/
- For custom css make a new css file in static/ and change the board settings to use it.
- If you edit templates on pages that get cached (most pages with posts on) your changes won't show up immediately because of the caching. You can disable caching by setting
CACHING = False
in img2/common.py
If you forget your admin password
- Stop img2 and then do
./bootstrap -x
to create a default admin account.
Transfering posts from other software
You can transfer posts from futaba style boards that generate cached html pages. It works for kusaba and wakaba, and probably for kusaba/wakaba forks. You must import one board at a time.
- Create a board to transfer the posts into - using the admin controls.
- Then stop img2.
- Then do
./bootstrap.py -t X Y
where X
is the local path to the directory containing the res/
and src/
folders for the board you want to transfer from, and Y
is the dir of the board (in img2) that you wish to transfer to.
License
- everything except jquery is placed in the public domain
Thanks To