1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-01 22:26:24 -07:00
No description
Find a file
Eggbertx 371372645c Show proper omitted post count, add omitted image count to board page
Also show sticky icon for stickied threads, though stickying hasn't been fully implemented yet
2023-02-09 09:55:50 -08:00
.github/workflows Create stale.yml 2022-09-14 13:45:02 -07:00
.vscode Add more manage code 2022-10-31 12:27:41 -07:00
cmd Add GET handler for /post, redirect to site root 2023-02-03 08:02:24 -08:00
devtools Move sounds and non-css images to /html/static 2023-01-26 09:38:04 -08:00
docker Add explanation if Docker boot fails because of missing js dir, 2023-01-01 15:59:54 -08:00
frontend Add lock/unlock option to post dropdown 2023-02-08 12:40:36 -08:00
html Add lock/unlock option to post dropdown 2023-02-08 12:40:36 -08:00
pkg Show proper omitted post count, add omitted image count to board page 2023-02-09 09:55:50 -08:00
sample-configs Remove the no-longer-used PostsPerThreadPage setting 2023-01-09 09:05:18 -08:00
sample-plugins Add lua functions for getting configuration, registering manage page, and loading/parsing templates 2023-01-06 20:13:58 -08:00
sql get rid of duplicate sql files 2022-12-24 14:40:36 -08:00
templates Show proper omitted post count, add omitted image count to board page 2023-02-09 09:55:50 -08:00
vagrant Use more standardized file modes 2022-12-31 17:29:57 -08:00
.deepsource.toml Add test patterns to deepsource file 2022-05-12 19:44:39 -07:00
.gitignore Add selenium tests 2022-09-27 10:42:11 -07:00
build.py condense html/static/* paths to html/static/ in build.py 2023-01-26 09:42:15 -08:00
config.md Add configuration documentation, finish cfg refactoring 2021-08-01 22:44:53 -07:00
go.mod Add lua functions for getting configuration, registering manage page, and loading/parsing templates 2023-01-06 20:13:58 -08:00
go.sum Add lua functions for getting configuration, registering manage page, and loading/parsing templates 2023-01-06 20:13:58 -08:00
LICENSE Add lock/unlock option to post dropdown 2023-02-08 12:40:36 -08:00
README.md Use router package instead of GET parameter for manage pages 2023-01-04 15:33:50 -08:00
version Add lock/unlock option to post dropdown 2023-02-08 12:40:36 -08:00

Gochan

Gochan is an imageboard server with a backend written in Go. It works in a manner similar to Kusaba X, Tinyboard and others. As such, Gochan generates static HTML files which can optionally be served by a separate web server.

Demo installation: https://gochan.org

Installation

Basic installation (from a release)

  1. Extract the .tar.gz or the .zip file into a directory (for example, your home directory)
  2. Copy gochan.example.json to either gochan.json or (if you're in a UNIX-like OS) /etc/gochan/gochan.json and modify it as needed. See the Configuration section for more info.
  3. If you're using nginx, copy gochan-http.nginx, or gochan-fastcgi.nginx if UseFastCGI is set to true to /etc/nginx/sites-enabled/, or the appropriate folder in Windows.
  4. If you're using a Linux distribution with systemd, you can optionally copy gochan.service to /lib/systemd/system/gochan.service and run systemctl enable gochan.service to have it run on startup. Then run systemctl start gochan.service to start it as a background service.
    1. If you aren't using a distro with systemd, you can start a screen session and run /path/to/gochan
  5. Go to http://[gochan url]/manage/staff, log in (default username/password is admin/password), and create a new admin user (and any other staff users as necessary). Then delete the admin user for security.

Installation using Docker

See docker/README.md

Configuration

See config.md

For developers (using Vagrant)

  1. Install Vagrant and Virtualbox. Vagrant lets you create a virtual machine and run a custom setup/installation script to make installation easier and faster.
  2. From the command line, cd into vagrant/ and run vagrant up. By default, MySQL/MariaDB is used, but if you want to test with a different SQL type, run GC_DBTYPE=dbtype vagrant up, replacing "dbtype" with either mysql or postgresql
  3. After it finishes installing the Ubuntu VM, follow the printed instructions.

For developers (using vscode)

  1. Install go, the vs-go extention and gcc (I think, let me know if you need something else)
  2. Install either postgreSQL or mariaDB. Setup a database with an account and enter the ip:post and login information into the gochan.json config. See "Configuration". (Tools like PG admin highly recommended for easy debugging of the database)
  3. Set "DebugMode" to true. This will log all logs to the console and disable some checks.
  4. Open the folder containing everything in vscode (named gochan most likely), go to "Run"
    1. Select "gochan" if you wish to run/debug the website itself
    2. Select "gochan-migrate" if you wish to run/debug the migrator (gochan-migrate development has been put on indefinite hiatus)
  5. (Optional) Change go extention configs. Examples: save all files on start debugging
  6. Press F5 or "Start Debugging" to debug.

Frontend development - (S)CSS or JavaScript

See frontend/README.md for information on working with Sass and developing gochan's JavaScript frontend.

Backend development

Style guide

  • For Go source, follow the standard Go style guide.
  • variables and functions exposed to Go templates should be in camelCase, like Go variables
  • All exported functions and variables should have a documentation comment explaining their functionality, as per go style guides.
  • Unexported functions are preferred to have a documentation comment explaining it, unless it is sufficiently self explanatory or simple.
  • Git commits should be descriptive. Put further explanation in the comment of the commit.
  • Function names should not be too long.
  • Avoid single letter variables except for simple things like iterator ints, use descriptive variables names if possible, within reason.

Roadmap

Near future

  • Make the plugin support actually useful
  • Improve moderation tools, using path routing instead of the action variable
  • Add support for sticky and locked threads
  • Add support for more filetypes (zip,)
  • Improve API support for existing chan browing phone apps

Lower priority

  • Better image fingerpringing and banning system (as opposed to a hash)
  • Rework any legacy structs that uses comma separated fields to use a slice instead.
  • RSS feeds from boards/specific threads/specific usernames+tripcodes (such as newsanon)
  • Pinning a post within a thread even if its not the OP, to prevent its deletion in a cyclical thread.

Later down the line

Possible experimental features:

  • Allow users to be mini-moderators within threads they posted themselves, to prevent spammers/derailers.