mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Update user guide
This commit is contained in:
parent
6384dbcd93
commit
36d356c97a
2 changed files with 48 additions and 2 deletions
|
@ -10,7 +10,7 @@ Microblog.pub is a "modern" Python application with "old-school" server-rendered
|
||||||
|
|
||||||
- [Poetry](https://python-poetry.org/) is used for dependency management.
|
- [Poetry](https://python-poetry.org/) is used for dependency management.
|
||||||
- Most of the code is asynchronous, using [asyncio](https://docs.python.org/3/library/asyncio.html).
|
- Most of the code is asynchronous, using [asyncio](https://docs.python.org/3/library/asyncio.html).
|
||||||
- SQLite3 is the default database.
|
- SQLite3 for data storage
|
||||||
|
|
||||||
The server has 3 components:
|
The server has 3 components:
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ inv -l
|
||||||
|
|
||||||
### Media storage
|
### Media storage
|
||||||
|
|
||||||
The uploads are stored in the `data/` directory, using a simple content-addressed storage (file contents hash is BLOB filename).
|
The uploads are stored in the `data/` directory, using a simple content-addressed storage system (file contents hash is BLOB filename).
|
||||||
Files metadata are stored in the database.
|
Files metadata are stored in the database.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
|
@ -234,3 +234,49 @@ All the data generated by the server is located in the `data/` directory:
|
||||||
- Uploaded media
|
- Uploaded media
|
||||||
|
|
||||||
Restoring is as easy as adding your backed up `data/` directory into a fresh deployment.
|
Restoring is as easy as adding your backed up `data/` directory into a fresh deployment.
|
||||||
|
|
||||||
|
## Tasks
|
||||||
|
|
||||||
|
### Pruning old data
|
||||||
|
|
||||||
|
You should prune old data from time to time to free disk space.
|
||||||
|
|
||||||
|
The default retention for the inbox data is 15 days.
|
||||||
|
|
||||||
|
It's configurable via the `inbox_retention_days` config item in `profile.toml`:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
inbox_retention_days = 30
|
||||||
|
```
|
||||||
|
|
||||||
|
Data owned by the server will never be deleted (at least for now), along with:
|
||||||
|
|
||||||
|
- bookmarked objects
|
||||||
|
- liked objects
|
||||||
|
- shared objects
|
||||||
|
- inbox objects mentioning the local actor
|
||||||
|
- objects related to local conversations (i.e. direct messages, replies)
|
||||||
|
|
||||||
|
For now, it's recommended to make a backup before running the task in case it deletes unwanted data.
|
||||||
|
|
||||||
|
You should shutdown the server before running the task.
|
||||||
|
|
||||||
|
#### Python edition
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# shutdown supervisord
|
||||||
|
cp -r data/microblogpub.db data/microblogpub.db.bak
|
||||||
|
poetry run inv prune-old-data
|
||||||
|
# relaunch supervisord and ensure it works as expected
|
||||||
|
rm data/microblogpub.db.bak
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Docker edition
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose stop
|
||||||
|
cp -r data/microblogpub.db data/microblogpub.db.bak
|
||||||
|
make prune-old-data
|
||||||
|
docker compose up -d
|
||||||
|
rm data/microblogpub.db.bak
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue