2023-03-10 18:31:25 -05:00
|
|
|
# sachet
|
|
|
|
|
|
|
|
sachet is a small file share server.
|
|
|
|
|
|
|
|
## development
|
|
|
|
|
|
|
|
To start sachet in development mode:
|
|
|
|
|
|
|
|
Clone the repo.
|
|
|
|
|
|
|
|
```
|
|
|
|
git clone https://github.com/dogeystamp/sachet
|
|
|
|
cd sachet
|
|
|
|
```
|
|
|
|
|
|
|
|
Create a venv with required dependencies:
|
|
|
|
|
|
|
|
```
|
|
|
|
python -m venv venv
|
|
|
|
source venv/bin/activate
|
|
|
|
python -m pip3 install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
2023-04-30 20:54:26 -04:00
|
|
|
Create a configuration file (and set the secret key!)
|
|
|
|
```
|
|
|
|
cp config.yml.example config.yml
|
|
|
|
vim config.yml
|
|
|
|
```
|
|
|
|
|
2023-03-10 18:31:25 -05:00
|
|
|
Start Flask in development mode:
|
|
|
|
|
|
|
|
```
|
|
|
|
flask --debug --app sachet.server run
|
|
|
|
```
|
|
|
|
|
|
|
|
### tests
|
|
|
|
|
|
|
|
Tests are available with the following command:
|
|
|
|
|
|
|
|
```
|
|
|
|
pytest --cov --cov-report term-missing
|
|
|
|
```
|
2023-03-30 20:20:09 -04:00
|
|
|
|
|
|
|
### linting
|
|
|
|
|
|
|
|
Please use the linter before submitting code.
|
|
|
|
|
|
|
|
```
|
|
|
|
black .
|
|
|
|
```
|
2023-04-30 20:54:26 -04:00
|
|
|
|
|
|
|
## database maintenance
|
|
|
|
|
|
|
|
To clean up the database (remove stale entries):
|
|
|
|
|
|
|
|
```
|
|
|
|
flask --app sachet.server cleanup
|
|
|
|
```
|
|
|
|
|
|
|
|
Otherwise, to upgrade the database after a schema change:
|
|
|
|
|
|
|
|
```
|
|
|
|
flask --app sachet.server db upgrade
|
|
|
|
```
|