An anonymous image board (think 4chan/2chan) which doesn't store any personal information and the threads and attachments are deleted after a certain period. The design allows several image boards to be hosted on the same backend.
In order to run ABC you need to have the following packages installed:
PostgreSQL Go(lang) (Version 1.5+) Although the names of the packages may vary from distribution to distribution for ubuntu/debian you can go with
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install golang
All go libraries come with this source, you don't have to install anything extra.
Inside the project root, run build_server.sh
It will compile and build the binary. After that it will run the automated tests. If the build fails it means that something in the environment (such as a database is not configured)
Run the create_database.sh
create database script to create a database. You should change the name of the database, the db user and it's password!
Run the script run_server.sh
to run the compiled binary. Before that you should check if the configuration of the run_server.sh is correct. It is done via environment variables. The default ones should work if you have created the database with the default settings and your default ports are free. It is recommended to
change the default ports and database credentials
The system configuration is set in the run_server.sh file which creates the environment and runs the already compiled binary.
Setting Name | Description | Example |
---|---|---|
ABC_SERVER_ENDPOINT_URL | Port for the API | 8089 |
ABC_DB_CONN_STRING | Connection script to the SQL driver (currently only postgres is supported) | user=abc_api password=123 dbname=abc_dev_cluster sslmode=disable |
ABC_FILES_DIR | path to the (web) client files which must be hosted | ./client/ |
ABC_FILES_SERVER_URL | Port on which the (web) client files should be posted. | 8088 |
Directory | Description |
---|---|
client | Contains all web client files |
server | Contains all source server files, including the tests |
db/schema/ | Contains schema and permissions for the DB. (Currently only postgres is supported) |
vendor | Contains external golang dependencies |
cdn | Depricated, will be removed |
cdn-client | Depricated, will be removed |
The API uses query parameters and the HTTP GET method. The API command is also passed as a querry parameter. Since query parameters are used, you must url encode the payload.
Fetches the available boards for a board cluster.
- api_key: The api_key identifying the board cluster.
curl http://:<api_port>/api?command=getBoards&api_key=
Fetches the available threads for a board.
- api_key: The api_key identifying the board cluster.
- board_id: The unique id of the board.
curl http://:<api_port>/api?command=getActiveThreadsForBoard&api_key=&board_id=
Gets the posts for a given thread.
- api_key: The api_key identifying the board cluster.
- thread_id: The unique id of the thread.
curl http://:<api_port>/api?command=getPostsForThread&api_key=&thread_id=
Adds a new post to an existing thread.
- api_key: The api_key identifying the board cluster.
- thread_id: The unique id of the thread.
- thread_post_body: Body of the post
- thread_attachment_url: URL of the thread
curl http://:<api_port>/api?command=addPostToThread&api_key=&thread_id=&thread_post_body=&thread_attachment_url=
Creates a new thread to an existing board.
- api_key: The api_key identifying the board cluster.
- board_id: The unique id of the board.
- thread_post_body: Body of the post
- thread_attachment_url: URL of the thread
curl http://:<api_port>/api?command=addThread&api_key=&board_id=&thread_post_body=&thread_attachment_url=