From 3c9ef3cede6f5370592f2d8fcaa215dc0d53648b Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Fri, 27 Oct 2023 15:35:33 -0400 Subject: [PATCH 1/4] Add .env.sample file --- .env.sample | 16 ++++++++++++++++ .gitignore | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 .env.sample diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..785719fc --- /dev/null +++ b/.env.sample @@ -0,0 +1,16 @@ +APP_VERSION=3.2-0.11.4 +COMPOSE_PROJECT_NAME=cantus + +#Sets the DEBUG Django setting +#PORT = 8000 for development, PORT = 80 for production +PORT=8000 + +#Postgres authentication variables +POSTGRES_DB=cantus_db +POSTGRES_USER=cantus_admin +#POSTGRES_PASSWORD=**PROVIDE PASSWORD HERE** + +#RabbitMQ authentication variables +RABBIT_VHOST=cantus_ultimus +RABBIT_USER=cantus_admin +#RABBIT_PASSWORD=**PROVIDE PASSWORD HERE** diff --git a/.gitignore b/.gitignore index 310c9ac0..9659cf4c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ IntelliJ Idea files /public/media/* /public/htmlcov/* *.coverage + +.env From a0454ebe46215d8ce5974854115a6c7d1eab0603 Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Fri, 27 Oct 2023 15:36:54 -0400 Subject: [PATCH 2/4] Remove .env from git index --- .env | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 785719fc..00000000 --- a/.env +++ /dev/null @@ -1,16 +0,0 @@ -APP_VERSION=3.2-0.11.4 -COMPOSE_PROJECT_NAME=cantus - -#Sets the DEBUG Django setting -#PORT = 8000 for development, PORT = 80 for production -PORT=8000 - -#Postgres authentication variables -POSTGRES_DB=cantus_db -POSTGRES_USER=cantus_admin -#POSTGRES_PASSWORD=**PROVIDE PASSWORD HERE** - -#RabbitMQ authentication variables -RABBIT_VHOST=cantus_ultimus -RABBIT_USER=cantus_admin -#RABBIT_PASSWORD=**PROVIDE PASSWORD HERE** From 6f056379338a6f584eb6ae5ef1fe96b9e127adfd Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Fri, 27 Oct 2023 15:41:39 -0400 Subject: [PATCH 3/4] Update README for new env structure --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3421a9e6..1cca3164 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ git submodule update --init We use [Docker Compose](https://docs.docker.com/compose/) to containerize each service and keep all our dependencies in order. Cantus Ultimus is compatible with Docker Compose > 2.8. ### The `.env` file -The build process relies on environment variables specified in the `.env` file, which is located at the root of the repository. +The build process relies on environment variables specified in an `.env` file located at the root of the repository. A sample of this file, `.env.sample`, is provided. -You must make two modifications to this file before the docker containers will build. Both `POSTGRES_PASSWORD` and `RABBIT_PASSWORD` should be uncommented and set with secure passwords. +Make a copy of `.env.sample` and name it `.env`. You must make two modifications to this file before the docker containers will build. Both `POSTGRES_PASSWORD` and `RABBIT_PASSWORD` should be uncommented and set with secure passwords. #### Handling `postgres` authentication issues From 77075d48f45cf97925037350b2cc6e0bc5710fcf Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Fri, 27 Oct 2023 15:57:39 -0400 Subject: [PATCH 4/4] Update GitHub actions with additional env variables --- .github/workflows/lint_and_test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 95b2b3f0..2492f664 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -11,10 +11,14 @@ jobs: run-tests: runs-on: ubuntu-latest env: + POSTGRES_DB: test_cu + POSTGRES_USER: admin POSTGRES_PASSWORD: supersecurepassword99 + RABBIT_VHOST: test_cu + RABBIT_USER: admin RABBIT_PASSWORD: supersecurepassword99 steps: - uses: actions/checkout@v3 - run: docker compose build - run: docker compose up -d - - run: docker compose exec -T app python runtests.py cantusdata.test.core \ No newline at end of file + - run: docker compose exec -T app python runtests.py cantusdata.test.core