yet another chatroom script.
Project description
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.
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, you run the server within the venv
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/yacs-run --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 yacs-run --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 yacs-run --config /path/to/config.toml
[Install]
WantedBy=multi-user.target
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yacscript-0.3.2.tar.gz.
File metadata
- Download URL: yacscript-0.3.2.tar.gz
- Upload date:
- Size: 173.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0433ea9d49fe8e8bfa4327c158870debc26fb1fb4f298200cef5b6a9accb3dfb
|
|
| MD5 |
2a2f41dcbb5a15bfedd1d9748dae90f0
|
|
| BLAKE2b-256 |
17942f91ecc3403d023b3d5ae1cbeb295ef55a21938a78c6f63c076d88534029
|
File details
Details for the file yacscript-0.3.2-py3-none-any.whl.
File metadata
- Download URL: yacscript-0.3.2-py3-none-any.whl
- Upload date:
- Size: 176.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7ff97cba6c2aa7a4cb7accdc3bc11decab83742548cca2ece9936d58a8cac8a
|
|
| MD5 |
02730806d6d1cc3e44987f28328bc304
|
|
| BLAKE2b-256 |
4adfc8068ed639a1259102f545c07e4db55a3caf23d7872003e48d2cd6396d8b
|