Compare commits
35 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
31e72e9b93 | ||
![]() |
52bcad93fb | ||
![]() |
698d36b35f | ||
![]() |
8cbbe87ee7 | ||
![]() |
cdaaf3fa82 | ||
![]() |
ca2ff99f30 | ||
![]() |
e6e8ee7d0a | ||
![]() |
755d599f8f | ||
![]() |
9cdd764271 | ||
![]() |
1d3638d8ac | ||
![]() |
2c8b5199c3 | ||
![]() |
72aab3e74c | ||
![]() |
c9f180d1c0 | ||
![]() |
b08d281e62 | ||
![]() |
07a90a5b92 | ||
![]() |
185eca237c | ||
![]() |
643270ec15 | ||
![]() |
c63020a334 | ||
![]() |
f1f06724cd | ||
![]() |
ed733a8a13 | ||
![]() |
76e061cb8a | ||
![]() |
c200cbc975 | ||
![]() |
c23599f21f | ||
![]() |
4597c5c702 | ||
![]() |
d4c8cb6e27 | ||
![]() |
394e7a1892 | ||
![]() |
9b26e35e26 | ||
![]() |
a6142c50c0 | ||
![]() |
a4845f8f8a | ||
![]() |
150453f3e7 | ||
![]() |
7ce504fcbb | ||
![]() |
00e87af7a3 | ||
![]() |
58fec773b5 | ||
![]() |
a0715ba4b9 | ||
![]() |
b71e337eaa |
8 changed files with 44 additions and 108 deletions
|
@ -2,6 +2,6 @@ DB_HOST = 127.0.0.1
|
||||||
DB_NAME = catask
|
DB_NAME = catask
|
||||||
DB_USER =
|
DB_USER =
|
||||||
DB_PASS =
|
DB_PASS =
|
||||||
DB_PORT = 5432
|
DB_PORT = 3306
|
||||||
ADMIN_PASSWORD =
|
ADMIN_PASSWORD =
|
||||||
APP_SECRET =
|
APP_SECRET =
|
||||||
|
|
16
README.md
16
README.md
|
@ -2,15 +2,17 @@
|
||||||
|
|
||||||
a simple & easy to use Q&A software that makes answering questions easier
|
a simple & easy to use Q&A software that makes answering questions easier
|
||||||
|
|
||||||
|
<!-- CatAsk is alpha software, therefore bugs are expected to happen-->
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
- PostgreSQL
|
- PostgreSQL
|
||||||
- Python 3.10+ (3.12+ recommended)
|
- Python 3.10+ (3.12+ recommended)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
Clone this repository: `git clone https://codeberg.org/catask-org/catask.git`
|
Clone this repository: `git clone https://git.gay/mst/catask.git`
|
||||||
|
|
||||||
### Docker
|
<!--### Docker
|
||||||
See [docker.md](./docker.md) for install instructions
|
See [docker.md](https://git.gay/mst/catask/src/branch/main/docker.md)-->
|
||||||
|
|
||||||
### VPS-specific
|
### VPS-specific
|
||||||
Go into the cloned repository, create a virtual environment and activate it:
|
Go into the cloned repository, create a virtual environment and activate it:
|
||||||
|
@ -26,14 +28,6 @@ Go into the cloned repository, create a virtual environment and activate it:
|
||||||
After that, install required packages:
|
After that, install required packages:
|
||||||
```pip install -r requirements.txt```
|
```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
|
### 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)
|
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)
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,6 @@ 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
|
## 1.7.0 -> 1.7.x
|
||||||
pull the update: `git pull`
|
pull the update: `git pull`
|
||||||
make the following changes in your config.json file:
|
make the following changes in your config.json file:
|
||||||
|
|
|
@ -14,7 +14,7 @@ appName = 'CatAsk'
|
||||||
version = '2.0.0'
|
version = '2.0.0'
|
||||||
# id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9
|
# id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9
|
||||||
version_id = '-stable'
|
version_id = '-stable'
|
||||||
repoUrl = "https://codeberg.org/catask-org/catask"
|
repoUrl = "https://git.gay/catask-org/catask"
|
||||||
homepageUrl = "https://catask.mystie.dev"
|
homepageUrl = "https://catask.mystie.dev"
|
||||||
docsUrl = "https://docs.catask.mystie.dev"
|
docsUrl = "https://docs.catask.mystie.dev"
|
||||||
social = {
|
social = {
|
||||||
|
|
|
@ -1,45 +1,44 @@
|
||||||
name: catask
|
name: catask
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
mariadb:
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: catask
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
|
||||||
POSTGRES_USER: catask
|
MARIADB_DATABASE: catask
|
||||||
POSTGRES_PASSWORD: catask
|
MARIADB_USER: catask
|
||||||
healthcheck:
|
MARIADB_PASSWORD: catask
|
||||||
test: ["CMD", "pg_isready", "-U", "catask"]
|
MARIADB_ROOT_HOST: "%"
|
||||||
interval: 1s
|
healthcheck:
|
||||||
timeout: 5s
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
retries: 10
|
start_period: 10s
|
||||||
image: postgres:alpine
|
interval: 10s
|
||||||
networks:
|
timeout: 5s
|
||||||
- catask
|
retries: 3
|
||||||
restart: always
|
image: mariadb
|
||||||
volumes:
|
networks:
|
||||||
- ./schema.sql:/docker-entrypoint-initdb.d/catask.sql
|
- catask
|
||||||
- db-data:/var/lib/postgresql/data
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./schema.sql:/docker-entrypoint-initdb.d/1.sql
|
||||||
|
- db-data:/var/lib/mysql
|
||||||
|
|
||||||
catask:
|
catask:
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
mariadb:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- catask
|
- catask
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
restart: always
|
volumes:
|
||||||
volumes:
|
- ./config.json:/catask/config.json
|
||||||
- catask-data:/catask/static/emojis
|
- ./.env:/catask/.env
|
||||||
- catask-data:/catask/static/icons/favicon
|
|
||||||
- ./config.json:/catask/config.json
|
|
||||||
- ./.env:/catask/.env
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
catask:
|
catask:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
catask-data:
|
|
54
docker.md
54
docker.md
|
@ -1,54 +0,0 @@
|
||||||
# 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
|
|
||||||
```
|
|
|
@ -443,7 +443,6 @@ def emoji(md):
|
||||||
def listEmojis() -> list:
|
def listEmojis() -> list:
|
||||||
emojis = []
|
emojis = []
|
||||||
emoji_base_path = Path.cwd() / 'static' / '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)
|
# Iterate over files that are directly in the emoji base path (not in subdirectories)
|
||||||
for file in emoji_base_path.iterdir():
|
for file in emoji_base_path.iterdir():
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
flask
|
flask
|
||||||
python-dotenv
|
python-dotenv
|
||||||
psycopg[binary,pool]
|
psycopg
|
||||||
humanize
|
humanize
|
||||||
mistune
|
mistune
|
||||||
bleach
|
bleach
|
||||||
|
|
Loading…
Add table
Reference in a new issue