From d7824519d0053d2978d1b4b4acf6bfb8fd967232 Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Wed, 25 Sep 2024 09:42:09 +0200 Subject: [PATCH] Add links to temporary VM to readme --- DEPLOYMENT.md | 36 ++++++++++++++++++++++++++++++++++++ README.md | 17 +++++++++++++++-- mondey_backend/README.md | 3 ++- 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 DEPLOYMENT.md diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 00000000..3ec346c9 --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,36 @@ +# Deployment + +Some information on how to deploy the website - currently it is deployed on a temporary heicloud VM. + +## Production deployment + +Production docker container images are automatically built by CI. +To deploy the latest version on a virtual machine with docker compose installed, +download [docker-compose.yml](https://raw.githubusercontent.com/ssciwr/mondey/main/docker-compose.yml), then do + +``` +sudo docker compose pull +sudo docker compose up -d +``` + +The location of the database directory, image files directory, SSL keys and secret key should be set +either in env vars or in a file `.env` in the same location as the docker-compose.yml. + +TODO: document these options + +The current status of the containers can be checked with + +``` +sudo docker compose ps +sudo docker compose logs +``` + +### Give users admin rights + +To make an existing user with email `user@domain.com` into an admin, modify the users database, e.g. + +``` +sqlite3 db/users.db +sqlite> UPDATE user SET is_superuser = 1 WHERE email = 'user@domain.com'; +sqlite> .quit +``` diff --git a/README.md b/README.md index a74b694f..b091961a 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,24 @@ Initial development for the MONDEY project. -The static website is automatically built and deployed to +## Frontend + +The frontend is automatically built and deployed as a static website to [ssciwr.github.io/mondey](https://ssciwr.github.io/mondey) on every push to the main branch using this [Github Action](.github/workflows/deploy.yml). -## Component demos +### Component demos - [Milestone](https://ssciwr.github.io/mondey/milestone) - [Milestonegroup](https://ssciwr.github.io/mondey/milestonegroup) + +## Preview + +A preview of the full website including the admin interface backend is temporarily hosted on a heicloud VM during development: + +- [Mondey website](http://129.206.6.74/) +- [Mondey admin](http://129.206.6.74/admin) +- [API documentation](http://129.206.6.74/api/redoc) +- [Swagger UI to interact with API](http://129.206.6.74/api/docs) + +(Note: for now this is unsecured http with public API interfaces for convenience during development, the production server would have https and the api interfaces would not be public) diff --git a/mondey_backend/README.md b/mondey_backend/README.md index c7bc2251..82053bef 100644 --- a/mondey_backend/README.md +++ b/mondey_backend/README.md @@ -28,8 +28,9 @@ The first admin user can only be created by modifying the database directly. After you have registered a user using the swagger UI, you can promote them to an admin user with e.g.: ```bash -sqlite3 users.db +sqlite3 db/users.db sqlite> UPDATE user SET is_superuser = 1 WHERE email = 'youremail@yourdomain.com'; +sqlite> .quit ``` ## Configuration