Compare commits

..

51 commits

Author SHA1 Message Date
mystieneko
adbfe71716 Merge pull request 'Add updating instructions for Docker' (#4) from theycallhermax/catask:main into main
Reviewed-on: https://codeberg.org/catask-org/catask/pulls/4
2025-03-05 20:08:20 +00:00
theycallhermax
0c17e5aee9 add docker updating instructions 2025-03-05 19:07:53 +00:00
mystie
504c25353c fix readme 2025-03-02 08:45:40 +00:00
mystie
c57385f6b0 update readme 2025-03-02 08:42:42 +00:00
mystieneko
94afd8b4f3 Merge pull request 'Add Docker Compose file' (#3) from theycallhermax/catask:main into main
Reviewed-on: https://codeberg.org/catask-org/catask/pulls/3
2025-03-02 08:41:34 +00:00
theycallhermax
10369dd23c
add favicons folder to catask-data volume 2025-03-02 00:45:10 -05:00
theycallhermax
db1938f95b
fix formatting in docker compose setup file 2025-03-01 23:38:10 -05:00
theycallhermax
21d401f253
uncomment docker section in readme 2025-03-01 23:38:10 -05:00
theycallhermax
252e9879ef
add docker instructions
cleanup docker compose
2025-03-01 23:38:10 -05:00
theycallhermax
dc6b4f7712
revert config.example.json changes 2025-03-01 23:38:10 -05:00
theycallhermax
e888f43ce7
port docker compose to postgres 2025-03-01 23:38:09 -05:00
max
d43b844456
set mariadb root host to %
Co-authored-by: mst <oivan2401@gmail.com>
2025-03-01 23:38:09 -05:00
max
8568df27d4
remove remote access fix 2025-03-01 23:38:09 -05:00
max
a0ab76a1d7
remove remote access fix in docker compose 2025-03-01 23:38:09 -05:00
max
539625fead
add bridge driver to catask network 2025-03-01 23:38:09 -05:00
max
e783ef3380
remove ipam config 2025-03-01 23:38:08 -05:00
max
70e867c978
remove bridge driver in ipam con fig 2025-03-01 23:38:08 -05:00
max
245f0df6eb
configure ipam in networks 2025-03-01 23:38:08 -05:00
max
2df2c2f6c1
apply 127.0.0.1 as catask service's ipv4 address 2025-03-01 23:38:08 -05:00
max
482b7a9397
remove port expose declaration in docker compose as the mariadb image already has this
add static ip address to catask network
2025-03-01 23:38:08 -05:00
max
3105512277
add mariadb fix config to docker-compose 2025-03-01 23:38:07 -05:00
max
7cd936a99e
add remote access fix config for mariadb 2025-03-01 23:38:07 -05:00
max
0c4d9ff6c0
expose mariadb's port 3306 as tcp 2025-03-01 23:38:07 -05:00
max
66e1354dd7
readd networks (again) 2025-03-01 23:38:07 -05:00
max
7727c6eeb2
use short syntax for catask config binds in docker compose 2025-03-01 23:38:07 -05:00
max
c14acdabe8
revert 2d35928e4a3bbb06294e0c659f6fa851b7aa675a
revert readd networks
2025-03-01 23:38:06 -05:00
max
8a37ff2718
readd networks 2025-03-01 23:38:06 -05:00
max
803c97fc61
add healthcheck to mariadb container
wait until mariadb is fully started when starting catask container
remove custom networks in docker compose
2025-03-01 23:38:06 -05:00
max
0a3e4760bc
add custom network for custom host binding 2025-03-01 23:38:06 -05:00
max
a559081639
remove admin password argument in dockerfile 2025-03-01 23:38:06 -05:00
max
7cf9132b31
remove admin password argument in docker compose 2025-03-01 23:38:05 -05:00
max
f099958fb1
bind to 0.0.0.0:8000 in dockerfile entrypoint so that docker port exposing works properly 2025-03-01 23:38:05 -05:00
max
49b4530a2b
connect schema to mariadb container's initdb 2025-03-01 23:38:05 -05:00
max
1fff70f06c
remove .env and config.json file creation in dockerfile 2025-03-01 23:38:05 -05:00
max
0117e2da62
bind to proper files in docker compose 2025-03-01 23:38:05 -05:00
max
60502eca70
revert b62c3d87cb22a5550a649e450bb342a21db02b72
revert get catask configs from volume "subdirectory" in docker compose
2025-03-01 23:38:04 -05:00
max
b2b90ce4f5
get catask configs from volume "subdirectory" in docker compose 2025-03-01 23:38:04 -05:00
max
1dc7d087a7
allow empty root password in mariadb in docker compose 2025-03-01 23:38:04 -05:00
max
4a1de9417a
try to bind volume in docker compose 2025-03-01 23:38:04 -05:00
max
e0d9d1dba0
fix example config not copying to production config in dockerfile 2025-03-01 23:38:03 -05:00
max
6f430a885b
expose port 8000 in docker compose 2025-03-01 23:38:03 -05:00
max
944bb58bb3
add volumes to docker compose
add admin password arg
2025-03-01 23:38:03 -05:00
max
20a373a7ec
revert 196763057f7f531ec1df6b8bc5b62917fe6332a4
revert change db user and password to root
2025-03-01 23:38:02 -05:00
max
df399bd95b
add docker compose 2025-03-01 23:38:02 -05:00
max
d8d6dfda8a
change db user and password to root 2025-03-01 23:38:02 -05:00
max
7310a3cdb5
add dockerfile 2025-03-01 23:38:02 -05:00
mst
867575161a add .env stuff to update.md 2025-03-01 03:19:27 +03:00
mst
307cc6bee0 add database creation instructions 2025-03-01 03:14:31 +03:00
mst
bf80b8795c fix a filesystem error 2025-03-01 02:59:14 +03:00
mst
0d208d09c7 update default port in .env.example 2025-03-01 02:53:40 +03:00
mst
e36e44ea04 move to codeberg 2025-03-01 02:34:46 +03:00
8 changed files with 108 additions and 44 deletions

View file

@ -2,6 +2,6 @@ DB_HOST = 127.0.0.1
DB_NAME = catask
DB_USER =
DB_PASS =
DB_PORT = 3306
DB_PORT = 5432
ADMIN_PASSWORD =
APP_SECRET =

View file

@ -2,17 +2,15 @@
a simple & easy to use Q&A software that makes answering questions easier
<!-- CatAsk is alpha software, therefore bugs are expected to happen-->
## Prerequisites
- PostgreSQL
- Python 3.10+ (3.12+ recommended)
## Install
Clone this repository: `git clone https://git.gay/mst/catask.git`
Clone this repository: `git clone https://codeberg.org/catask-org/catask.git`
<!--### Docker
See [docker.md](https://git.gay/mst/catask/src/branch/main/docker.md)-->
### Docker
See [docker.md](./docker.md) for install instructions
### VPS-specific
Go into the cloned repository, create a virtual environment and activate it:
@ -28,6 +26,14 @@ Go into the cloned repository, create a virtual environment and activate it:
After that, install required packages:
```pip install -r requirements.txt```
Then, create the database and the user for CatAsk:
``` sql
CREATE USER '<DB_USER>' WITH PASSWORD "<DB_PASS>";
```
``` sql
CREATE DATABASE "<DB_NAME>" OWNER '<DB_USER>';
```
### Shared hosting-specific
If your shared hosting provider supports [WSGI](https://w.wiki/_vTN2), [FastCGI](https://w.wiki/9EeQ), or something similar, use it (technically any CGI protocol could work)

View file

@ -70,6 +70,8 @@ pgloader mysql://old_user:old_password@127.0.0.1/old_catask pgsql://new_user:new
...
```
5. modify your .env file to have new database credentials and change database port to 5432 (default for postgres)
## 1.7.0 -> 1.7.x
pull the update: `git pull`
make the following changes in your config.json file:

View file

@ -14,7 +14,7 @@ appName = 'CatAsk'
version = '2.0.0'
# id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9
version_id = '-stable'
repoUrl = "https://git.gay/catask-org/catask"
repoUrl = "https://codeberg.org/catask-org/catask"
homepageUrl = "https://catask.mystie.dev"
docsUrl = "https://docs.catask.mystie.dev"
social = {

View file

@ -1,44 +1,45 @@
name: catask
services:
mariadb:
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
MARIADB_DATABASE: catask
MARIADB_USER: catask
MARIADB_PASSWORD: catask
MARIADB_ROOT_HOST: "%"
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
image: mariadb
networks:
- catask
restart: always
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/1.sql
- db-data:/var/lib/mysql
postgres:
environment:
POSTGRES_DB: catask
POSTGRES_USER: catask
POSTGRES_PASSWORD: catask
healthcheck:
test: ["CMD", "pg_isready", "-U", "catask"]
interval: 1s
timeout: 5s
retries: 10
image: postgres:alpine
networks:
- catask
restart: always
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/catask.sql
- db-data:/var/lib/postgresql/data
catask:
build:
dockerfile: Dockerfile
depends_on:
mariadb:
condition: service_healthy
networks:
- catask
ports:
- "8000:8000"
volumes:
- ./config.json:/catask/config.json
- ./.env:/catask/.env
catask:
build:
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
networks:
- catask
ports:
- "8000:8000"
restart: always
volumes:
- catask-data:/catask/static/emojis
- catask-data:/catask/static/icons/favicon
- ./config.json:/catask/config.json
- ./.env:/catask/.env
networks:
catask:
driver: bridge
catask:
driver: bridge
volumes:
db-data:
db-data:
catask-data:

54
docker.md Normal file
View file

@ -0,0 +1,54 @@
# CatAsk on Docker (or Podman)
## Prerequisites
- Docker + `docker-compose` (or Podman + `podman-compose`)
## Steps
Before starting CatAsk, you must copy the configuration files to their proper places first:
```sh
cp config.example.json config.json
cp .env.example .env
```
Then, paste this into the `.env` file, and replace sections that are marked with `[CHANGE THIS]`.
```env
DB_HOST = postgres
DB_NAME = catask
DB_USER = catask
DB_PASS = catask
DB_PORT = 5432
ADMIN_PASSWORD = [CHANGE THIS]
APP_SECRET = [CHANGE THIS]
```
You may now start CatAsk:
```sh
docker compose up
```
If you have done everything correctly, going to `http://localhost:8000` in your browser should show a question box screen. You may now log in with your admin password, and configure the instance.
## Updating
1. Stop the Docker container
```sh
docker compose down
```
2. Follow the [`UPDATE.md`](./UPDATE.md) file to see what to add or remove to your `config.json` or `.env`.
3. Remove the Docker image
```sh
docker rmi catask_catask
```
4. Restart CatAsk
```sh
docker compose up
```

View file

@ -443,6 +443,7 @@ def emoji(md):
def listEmojis() -> list:
emojis = []
emoji_base_path = Path.cwd() / 'static' / 'emojis'
os.makedirs(emoji_base_path, exist_ok=True)
# Iterate over files that are directly in the emoji base path (not in subdirectories)
for file in emoji_base_path.iterdir():

View file

@ -1,6 +1,6 @@
flask
python-dotenv
psycopg
psycopg[binary,pool]
humanize
mistune
bleach