forget-cancellare-vecchi-toot/README.markdown

96 lines
2.4 KiB
Markdown
Raw Normal View History

2017-08-31 23:51:59 +02:00
# Forget
2017-08-07 22:35:57 +02:00
2017-08-29 18:46:57 +02:00
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1780ac6071c04cbd9ccf75de0891e798)](https://www.codacy.com/app/codl/forget?utm_source=github.com&utm_medium=referral&utm_content=codl/forget&utm_campaign=badger)
2017-08-31 23:51:59 +02:00
Forget is a post deleting service for Twitter and Mastodon. It lives at <https://forget.codl.fr>.
[![](assets/screenshot.png)](https://forget.codl.fr)
## Running your own
### Requirements
* Postgresql
* Redis
* Python 3.6+
* Yarn or NPM
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
### Set up venv
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
Setting up a venv will isolate Forget from your system's libraries and allow you to install
dependencies locally as a normal user. It's not necessary but it is recommended!
2017-08-07 22:35:57 +02:00
```
2017-08-31 23:51:59 +02:00
$ python -m venv venv
2017-08-07 22:35:57 +02:00
$ source venv/bin/activate
2017-08-31 23:51:59 +02:00
```
If you're using `zsh` or `fish` as a shell, substitute `venv/bin/activate` with `venv/bin/activate.zsh` or `venv/bin/activate.fish`, respectively.
You will need to "activate" the venv in every new terminal before you can use pip or any python tools included in dependencies (honcho, flask...)
### Download and install dependencies
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
```
2017-08-07 22:35:57 +02:00
$ pip install -r requirements.txt
2017-08-31 21:09:52 +02:00
$ yarn || npm install
2017-08-31 23:51:59 +02:00
```
Wow!! Exciting
### Create and complete config file
Gotta set up those, paths, and stuff.
```
2017-08-07 22:35:57 +02:00
$ cp config.example.py config.py
$ $EDITOR config.py
2017-08-31 23:51:59 +02:00
```
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
### Set up database schema
If you haven't started postgresql yet now would be a great time to do that.
```
$ createdb forget # if you havent created the DB yet
2017-08-08 15:40:28 +02:00
$ env FLASK_APP=forget.py flask db upgrade
2017-08-31 23:51:59 +02:00
```
### Build static assets
2017-08-08 15:40:28 +02:00
2017-08-31 23:51:59 +02:00
Gonna do it...!
```
2017-08-11 15:11:13 +02:00
$ doit
2017-08-31 23:51:59 +02:00
```
Done did it.
2017-08-11 15:11:13 +02:00
2017-08-31 23:51:59 +02:00
### Running
The included `Procfile` will run the app server and the background worker.
`honcho`, a `Procfile` runner, is included as a dependency:
```
2017-08-07 22:35:57 +02:00
$ honcho start
2017-08-31 23:51:59 +02:00
```
2017-08-12 01:54:19 +02:00
2017-08-31 23:51:59 +02:00
The application server will listen on `http://127.0.0.1:42157`.
You'll want to use your favourite web server to proxy traffic to it.
<small>This author suggests Caddy.</small>
### Development
For development, you may want to use `Procfile.dev`, which starts flask in debug mode and rebuilds the static assets automatically when they change
```
2017-08-12 01:54:19 +02:00
$ honcho -f Procfile.dev start
2017-08-07 22:35:57 +02:00
```
2017-08-31 23:51:59 +02:00
Or you could just look at `Procfile.dev` and run those things manually. It's up to you.
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
---
2017-08-07 22:35:57 +02:00
2017-08-31 23:51:59 +02:00
If you're having trouble with Forget, or if you're not having trouble but you just want to tell me you like it, you can drop me a note at [@codl](https://twitter.com/codl) or [codl@codl.fr](mailto:codl@codl.fr). Thanks for reading this readme.