No description
Find a file
2022-12-18 12:04:42 +01:00
.idea ignore packed static files 2022-06-26 11:28:46 +02:00
markdownblog implemented nextcloud oauth login 2022-12-18 12:04:42 +01:00
.gitignore attempted enabling HTTPS dev server 2022-06-27 23:33:46 +02:00
docker-compose.yml began working on oauth auth flow 2022-12-16 23:10:18 +01:00
README.md Added setup instructions 2022-06-27 22:19:37 +00:00

MDblog

This project intends to provide an easy blogging solution for people who like the markdown syntax and want an easy way to publish things. I didn't find a minimalistic enough blog that had markdown support so I wrote my own.

Setup

This project has two main branches: master and production. You should always only use the production branch to run in production as the master branch does not use a secure server setup. This project is also Django based. Which means that you will have to run python3 manage.py migrate if you spin up the server for the first time to set up the database. If you are running the production version also make sure to collect the static files via python3 manage.py collectstatic.

Enviroment variables

In order for this project to work you must set up some enviroment variables:

  • POSTGRES_PASSWORD will be the password for the postgres Database.
  • POSTGRES_USER is the user that runs the postgres db.
  • POSTGRES_DB is the name of the database the Django server uses.
  • MD_FILE_PATH path that points to a folder where all markdownfiles are saved.
  • DJANGO_SECRET_KEY the secret key used by Django which should obviously be kept secret
  • DJANGO_DEBUG indicates whether the Django server runs in Debug mode or not. Should be False iff the server runs in production
  • SALT_KEY some type of hash salt the 2fa provider needs. Use a 36 character string.

Docker

After saving the above mentioned enviroment variables in a envvars.env file (or adjusting the docker-compose.yml to use a different .env file) only a docker compose up should be required to bring the project up.

Migrate

To initialize the Database you need to run a Django migration. To do this you enter the docker container via docker exec -it mdblog-web-1 /bin/bash and running the command python3 manage.py migrate. After that the DB should be set up and the project is accessible at 127.0.0.1:8000. If not you can try putting a https:// before the URL.

Create a superuser

You might want to create a user to be able to edit the blog. To do so, you have to enter the container, run python3 manage.py createsuperuser and follow the on screen prompt.

Contributions

Please feel free to write issues and open pull requests!