mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-03 05:48:44 +00:00
Update README.md
This commit is contained in:
parent
efabe22615
commit
81e207dcf8
1 changed files with 57 additions and 9 deletions
66
README.md
66
README.md
|
@ -59,6 +59,17 @@ cp .env.example .env
|
||||||
|
|
||||||
For most testing, you'll want to use ngrok. Remember to set the DOMAIN in `.env` to your ngrok domain.
|
For most testing, you'll want to use ngrok. Remember to set the DOMAIN in `.env` to your ngrok domain.
|
||||||
|
|
||||||
|
|
||||||
|
#### With Docker
|
||||||
|
You'll have to install the Docker and docker-compose. When you're ready, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose build
|
||||||
|
docker-compose up
|
||||||
|
docker-compose exec web python manage.py migrate
|
||||||
|
docker-compose exec web python manage.py shell -c 'import init_db'
|
||||||
|
```
|
||||||
|
|
||||||
### Without Docker
|
### Without Docker
|
||||||
You will need postgres installed and running on your computer.
|
You will need postgres installed and running on your computer.
|
||||||
|
|
||||||
|
@ -81,19 +92,56 @@ Initialize the database (or, more specifically, delete the existing database, ru
|
||||||
```
|
```
|
||||||
This creates two users, `mouse` with password `password123` and `rat` with password `ratword`.
|
This creates two users, `mouse` with password `password123` and `rat` with password `ratword`.
|
||||||
|
|
||||||
The application uses Celery and Redis for task management, which must also be configured. (Further instructions pending, sorry!
|
The application uses Celery and Redis for task management, which must also be installed and configured.
|
||||||
|
|
||||||
And go to the app at `localhost:8000`
|
And go to the app at `localhost:8000`
|
||||||
|
|
||||||
#### With Docker
|
|
||||||
You'll have to install the Docker and docker-compose:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose build
|
## Installing in Production
|
||||||
docker-compose up
|
|
||||||
docker-compose exec web python manage.py migrate
|
This project is still young and isn't, at the momoment, very stable, so please procede with caution when running in production.
|
||||||
docker-compose exec web python manage.py shell -c 'import init_db'
|
### Server setup
|
||||||
```
|
- Get a domain name and set up DNS for your server
|
||||||
|
- Set your server up with appropriate firewalls for running a web application (this instruction set is tested again Ubuntu 20.04)
|
||||||
|
- Set up a mailgun account and the appropriate DNS settings
|
||||||
|
- Install Docker and docker-compose
|
||||||
|
### Install and configure BookWyrm
|
||||||
|
- Get the application code:
|
||||||
|
`git clone git@github.com:mouse-reeve/bookwyrm.git`
|
||||||
|
- Switch to the `production` branch
|
||||||
|
`git checkout production`
|
||||||
|
- Create your environment variables file
|
||||||
|
`cp .env.example .env`
|
||||||
|
- Add your domain, email address, mailgun credentials
|
||||||
|
- Set a secure redis password and secret key
|
||||||
|
- Update your nginx configuration in `nginx/defautl.conf`
|
||||||
|
- Replace `your-domain.com` with your domain name
|
||||||
|
- Run the application (this should also set up a Certbot ssl cert for your domain)
|
||||||
|
`docker-compose up --build`
|
||||||
|
Make sure all the images build successfully
|
||||||
|
- When docker has built successfully, stop the process with `CTRL-C`
|
||||||
|
- Comment out the `command: certonly...` line in `docker-compose.yml`
|
||||||
|
- Run docker-compose in the background
|
||||||
|
`docker-compose up -d`
|
||||||
|
- Initialize the database
|
||||||
|
`./fr-dev initdb`
|
||||||
|
- Congrats! You did it, go to your domain and enjoy the fruits of your labors
|
||||||
|
### Configure your instance
|
||||||
|
- Register a user account in the applcation UI
|
||||||
|
- Make your account a superuser (warning: do *not* use django's `createsuperuser` command)
|
||||||
|
- On your server, open the django shell
|
||||||
|
`./fr-dev shell`
|
||||||
|
- Load your user and make it a superuser
|
||||||
|
```python
|
||||||
|
from bookwyrm import models
|
||||||
|
user = models.User.objects.get(id=1)
|
||||||
|
user.is_admin = True
|
||||||
|
user.is_staff = True
|
||||||
|
user.is_superuser = True
|
||||||
|
user.save()
|
||||||
|
```
|
||||||
|
- Go to the admin panel (`/admin/bookwyrm/sitesettings/1/change` on your domain) and set your instance name, description, code of conduct, and toggle whether registration is open on your instance
|
||||||
|
|
||||||
|
|
||||||
## Project structure
|
## Project structure
|
||||||
|
|
Loading…
Reference in a new issue