mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-20 13:53:42 -05:00
213 lines
4.6 KiB
Markdown
213 lines
4.6 KiB
Markdown
# Updating
|
|
|
|
## 1.7.x -> 2.0.0
|
|
|
|
### prerequisites
|
|
|
|
1. create an export of your data in **Admin -> Import/Export -> New Export** and download it in case something breaks
|
|
2. install postgresql (if you don't have it): [postgresql.org](https://www.postgresql.org/download/)
|
|
3. install pgloader: [pgloader.readthedocs.io](https://pgloader.readthedocs.io/en/latest/install.html)
|
|
4. start postgresql
|
|
|
|
### performing the upgrade
|
|
|
|
1. create a new postgresql user:
|
|
```sql
|
|
CREATE USER "<username>" WITH PASSWORD "<password>";
|
|
```
|
|
1. create a new postgresql database:
|
|
```sql
|
|
CREATE DATABASE "<db name>" OWNER "<db user>";
|
|
```
|
|
2. run pgloader:
|
|
```sh
|
|
pgloader mysql://old_user:old_password@127.0.0.1/old_catask pgsql://new_user:new_password@127.0.0.1/new_catask
|
|
```
|
|
|
|
3. pull the update: `git pull`
|
|
|
|
4. make the following changes in your config.json file:
|
|
```diff
|
|
...
|
|
"accessibility": {
|
|
"font": "default",
|
|
"userway": {
|
|
"enabled": false,
|
|
"account": "p3mmiCKHVO"
|
|
}
|
|
},
|
|
+ "languages": {
|
|
+ "default": "en_US",
|
|
+ "allowChanging": true
|
|
+ },
|
|
"style": {
|
|
"accentLight": "#b86565",
|
|
"accentDark": "#b86565",
|
|
"bgLight": "#ffffff",
|
|
"bgDark": "#202020",
|
|
"navStyle": "pills",
|
|
"tintColors": true,
|
|
"infoBoxLayout": "row",
|
|
"homepageLayout": "catask",
|
|
"navIcons": true,
|
|
"navIconsOnly": false,
|
|
+ "customCss": "",
|
|
+ "useCustomCss": false,
|
|
+ "overrideBaseStyles": false,
|
|
+ "overrideCatAskStyles": false,
|
|
+ "cardStyle": "compact"
|
|
},
|
|
...
|
|
"ntfy": {
|
|
"enabled": false,
|
|
"host": "https://ntfy.sh",
|
|
"user": "",
|
|
"pass": "",
|
|
"topic": ""
|
|
},
|
|
+ "themeStoreUrl": "https://themes.catask.mystie.dev",
|
|
+ "username": ""
|
|
...
|
|
```
|
|
|
|
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:
|
|
```diff
|
|
...
|
|
"antispam": {
|
|
...
|
|
},
|
|
+ "ntfy": {
|
|
+ "enabled": false,
|
|
+ "host": "https://ntfy.sh",
|
|
+ "user": "",
|
|
+ "pass": "",
|
|
+ "topic": ""
|
|
+ },
|
|
...
|
|
```
|
|
|
|
## 1.6.x -> 1.7.0
|
|
pull the update: `git pull`
|
|
run `pip install -r requirements.txt` again to install newly required packages
|
|
make the following changes in your config.json file:
|
|
```diff
|
|
...
|
|
"instance": {
|
|
...
|
|
},
|
|
+ "accessibility": {
|
|
+ "font": "default",
|
|
+ "userway": {
|
|
+ "enabled": false,
|
|
+ "account": ""
|
|
+ }
|
|
+ },
|
|
"style": {
|
|
...
|
|
"homepageLayout": "...",
|
|
+ "navIcons": true,
|
|
+ "navIconsOnly": false
|
|
},
|
|
+ "antispam": {
|
|
+ "type": "basic",
|
|
+ "enabled": true,
|
|
+ "recaptcha": {
|
|
+ "sitekey": "",
|
|
+ "secretkey": ""
|
|
+ },
|
|
+ "turnstile": {
|
|
+ "sitekey": "",
|
|
+ "secretkey": ""
|
|
+ },
|
|
+ "frc": {
|
|
+ "sitekey": "",
|
|
+ "apikey": ""
|
|
+ }
|
|
+ },
|
|
...
|
|
```
|
|
|
|
after that, log into your mariadb/mysql console and execute these commands:
|
|
```
|
|
USE <catask database name>;
|
|
```
|
|
```
|
|
ALTER TABLE questions ADD COLUMN unread BOOLEAN NOT NULL DEFAULT TRUE;
|
|
```
|
|
|
|
## 1.5.x -> 1.6.x
|
|
|
|
pull the update: `git pull`
|
|
make these changes in your config.json file:
|
|
```diff
|
|
...
|
|
"style": {
|
|
...
|
|
+ "homepageLayout": "catask"
|
|
},
|
|
...
|
|
```
|
|
|
|
after that, log into your mariadb/mysql console and execute these commands:
|
|
```
|
|
USE <catask database name>;
|
|
```
|
|
```
|
|
ALTER TABLE questions ADD COLUMN cw VARCHAR(255) NOT NULL DEFAULT '';
|
|
```
|
|
```
|
|
ALTER TABLE answers ADD COLUMN cw VARCHAR(255) NOT NULL DEFAULT '';
|
|
```
|
|
|
|
## 1.4.x -> 1.5.x
|
|
|
|
pull the update as usual: `git pull`
|
|
run `pip install -r requirements.txt` again to install newly required packages
|
|
make the following changes in your config.json file:
|
|
```diff
|
|
...
|
|
"instance": {
|
|
...
|
|
- "image": "/static/img/ca_screenshot.png",
|
|
+ "image": "/static/icons/favicon/android-chrome-512x512.png",
|
|
...
|
|
},
|
|
+ "style": {
|
|
+ "accentLight": "#6345d9",
|
|
+ "accentDark": "#7259d9",
|
|
+ "bgLight": "#ffffff",
|
|
+ "bgDark": "#202020",
|
|
+ "navStyle": "underline",
|
|
+ "tintColors": false,
|
|
+ "infoBoxLayout": "column"
|
|
+ },
|
|
+ "trimContentAfter": "50",
|
|
...
|
|
```
|
|
|
|
## 1.3.0 -> 1.4.x
|
|
first, pull the update from the repository: `git pull`
|
|
second, you'll need to update the database schema as it was changed slightly in this update, run these queries in mysql/mariadb console:
|
|
```
|
|
USE <catask database name>;
|
|
```
|
|
```
|
|
ALTER TABLE answers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
|
```
|
|
```
|
|
ALTER TABLE questions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
|
```
|
|
after that, open your config file and add `"rules": ""` to `"instance"`, like this:
|
|
```diff
|
|
...
|
|
"instance": {
|
|
...
|
|
"fullBaseUrl": "https://catask.localhost",
|
|
+ "rules": ""
|
|
},
|
|
...
|
|
```
|