YACS
Yet Another Chatroom Script
Inspired by LE-CHAT-PHP
Featuring
- Multiple channels.
- Admins.
- Files and embedded images/videos.
- BBCode.
- CAPTCHA.
- Vanilla HTML & CSS & JS.
- No Cookies, it's bad for your teeth.
Migrating from Older Versions (IMPORTANT)
If you are upgrading from YACS 0.3.x or earlier, your existing database and resource files may not be compatible with the new release. Use the migrate command to fix things up before starting the server:
# From venv
(.venv) yacscript migrate --config config.toml
# From source
$ uv run yacscript migrate --config config.toml
The migrate command will fix the database schema as well as the resource naming.
It is safe to run migrate multiple times — if there is nothing to migrate, no changes will be made anyway.
Try It Out Right Now!
Join The YACS Demo Server right now with passphrase the-yacs to see YACS in action!
Deployment
1. Deploy with venv (Recommended)
Create a venv with python version 3.13 or greater.
$ python -m venv .venv
# Activate venv in *nix shell (e.g. bash, zsh)
$ source .venv/bin/activate
# Activate venv in pwsh
> . .venv\Scripts\Activate.ps1"
Then, install the package inside venv.
(.venv) pip install yacscript
Create a configuration file and edit it to your liking.
For reference, see the configuration section.
(.venv) vi ./config.toml
Finally, start the server within the venv:
(.venv) yacscript start --config config.toml
In addition to that, you might want to deploy the program as a daemon. Here's an example of a possible simple unit file for systemd.
Assuming you have installed the venv as /path/to/.venv, for example /opt/yacs/.venv, making /path/to/ means /opt/yacs/ for the setup.
[Unit]
Description=YACS Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to
Environment="PATH=/path/to/.venv/bin"
ExecStart=/path/to/.venv/bin/yacscript start --config /path/to/config.toml
[Install]
WantedBy=multi-user.target
2. Deploy from source (with uv)
Deploying from source gives you access to the latest features but may be unstable
To deploy from source, first you need to install uv.
# Install with pip.
$ pip install uv
# Install on macOS and Linux.
$ curl -LsSf https://astral.sh/uv/install.sh | sh
# Install on Windows.
$ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then, clone the repo.
$ git clone https://github.com/valine-dev/yacs.git
$ cd yacs
Create a config file, and edit it to your liking.
For reference, see the configuration section.
$ vi ./config.toml
Finally, run the server, dependencies and venv will be installed along the way.
$ uv run yacscript start --config config.toml
Additionally, it's also possible to make a daemon service out of deployment from source.
An example unit file is shown as below.
[Unit]
Description=YACS Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to/yacs
Environment="PATH=/path/to/yacs/.venv/bin"
# Notice the difference to deploying from package!
ExecStart=/path/to/uv run yacscript start --config /path/to/config.toml
[Install]
WantedBy=multi-user.target
CLI Reference
The yacscript command ships with the following subcommands:
yacscript start --config config.toml— Start the YACS server.yacscript gc --config config.toml— Clean expired resources from disk.yacscript migrate --config config.toml— Migrate your data from older versions.
In which gc and migrate are mostly safe to run.
User Manual
Consult User Manual for guidance.
Configuration
The program comes with a built in config, so you might want to only write fields that you need to deviates from default.
All possible fields are shown below.
[flask]
# here you can configure built-in config values defined by flask
DEBUG = false # DO NOT SET TO `true` WHEN EXPOSING TO PUBLIC!
[app]
# The app itself will only exposed through plain HTTP and it's strongly discorage to do so directly to public web. Use a reverse proxy with TLS in front of the app.
ip = "0.0.0.0"
port = 8080
admin_phrase = "CHANGE_ME_ADMIN"
# set user_phrase to empty will expose chatroom to the public
user_phrase = "CHANGE_ME"
log_level = "INFO"
timeout = 5000 # in milisecond, use for heartbeat
# Set to true only when the app is behind a reverse proxy!
# Make sure X-Forwarded-For and X-Forwarded-Host are properly set!
proxy_fix = false
# For socketio connections
# Do set a propper value in production enviroment
cors_allowed_origins = "https://me.example"
[custom]
title = "The YACS"
motd = "Hello!\nRule No.1"
# These are the emotes that will rendered to the webpage
emoticons = [
"( ゚∀。)",
"Insert Anything",
"⭐"
]
[res]
path = "./resource" # Relative to project's root
size_max = 1024 # In Megabytes
[captcha]
length = 4
max_cache = 60
expire = 120 # Expire time in seconds
[captcha.options]
# you don't want to have all of them turn on, it'll be confusing
numbers = false
lowercase = true
uppercase = false
[db]
path = "./yacs.db"
And, an example config could look like this.
[flask]
DEBUG = false
[app]
admin_phrase = "this-is-admin"
user_phrase = "hello"
[custom]
title = "My YACS Server"
motd = "Hello!\nRule No.1!"
Acknowledgement
YACS will not be possible without following existing projects.
Loicense
Oi mate! Got a loicense for that project Govna? Yes, and it is the best one!
YACS is licensed under WTFPL with NO WARRANTY.
Release files for yacscript 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yacscript-0.4.0.tar.gz | 232.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yacscript-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 467.2 kB
Release files / yacscript-0.4.0.tar.gz
| Download URL | yacscript-0.4.0.tar.gz |
|---|---|
| Size | 232.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97511288e9f0c153ccd4705514e3d0b2b30c766236a3eaed7a7f8921ff6aa4d8
|
|
BLAKE2b-256 checksum How to use checksums |
d0699a4fede84d2fcbd235b5dd0714fe62a909f7ce1cd92c0c76f63347dd7fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / yacscript-0.4.0-py3-none-any.whl
| Download URL | yacscript-0.4.0-py3-none-any.whl |
|---|---|
| Size | 235.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d4af4f8ae275d65365559ec967b6ce0a018155440caea60ed807f3321086da2
|
|
BLAKE2b-256 checksum How to use checksums |
0516c533bef5e119fb48c9821cb0d86dd2b4ebeadf136196170e487bc528df11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|