From cbe8546945dd480734fbeaa59d9ea40e22ecaa72 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 19 Jun 2019 16:32:16 +0200 Subject: [PATCH] remove requirement for local SSL --- README.md | 22 +--------------------- docker-compose.yml | 24 +++++++----------------- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 0b05640..2683180 100644 --- a/README.md +++ b/README.md @@ -16,33 +16,13 @@ Project planning and issue tracking is done using [Pivotal Tracker](https://www. ### Developing the application -#### Local cookies and SSL - -In local development __offen__ requires to be served both via SSL (in order to use window.crypto) as well as a `local.offen.dev` host. - -This requires the following steps to be taken: - -1. Edit your `/etc/hosts` to include the following line: - ``` - 127.0.0.1 local.offen.dev - ``` -2. Install and setup [mkcert](https://github.com/FiloSottile/mkcert). Assuming you have Go installed, this looks like: - ``` - $ go get -u github.com/FiloSottile/mkcert - $ mkcert -install - ``` -3. Navigate into the repository root and create a local certificate and key for the `local.offen.dev` host: - ``` - $ mkcert local.offen.dev - ``` - You can test setup by starting the application: ``` $ docker-compose up ``` -Now you should be able to access in your browser without any security warnings. +Now you should be able to access seeing a successful response. ### License diff --git a/docker-compose.yml b/docker-compose.yml index 40bbd4b..e5df372 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,23 +6,19 @@ services: working_dir: /code/kms volumes: - .:/code - - ./local.offen.dev.pem:/code/kms/local.offen.dev.pem - - ./local.offen.dev-key.pem:/code/kms/local.offen.dev-key.pem - $GOPATH/pkg/mod:/go/pkg/mod environment: - GOPATH=/go - KEY_FILE=key.txt ports: - 8081:8081 - command: go run cmd/kms/main.go -key local.offen.dev-key.pem -cert local.offen.dev.pem -port 8081 -origin https://local.offen.dev:9977 + command: go run cmd/kms/main.go -port 8081 -origin http://localhost:9977 server: image: golang:1.12 working_dir: /code/server volumes: - .:/code - - ./local.offen.dev.pem:/code/server/local.offen.dev.pem - - ./local.offen.dev-key.pem:/code/server/local.offen.dev-key.pem - $GOPATH/pkg/mod:/go/pkg/mod environment: - GOPATH=/go @@ -30,7 +26,7 @@ services: - KMS_ENCRYPTION_ENDPOINT=http://kms:8081/encrypt ports: - 8080:8080 - command: go run cmd/server/main.go -origin https://local.offen.dev:9977 -conn postgres://postgres:develop@database:5432/postgres?sslmode=disable -key local.offen.dev-key.pem -cert local.offen.dev.pem -level debug + command: go run cmd/server/main.go -origin http://localhost:9977 -conn postgres://postgres:develop@database:5432/postgres?sslmode=disable -level debug links: - database depends_on: @@ -46,38 +42,32 @@ services: working_dir: /offen/vault volumes: - .:/offen - - ./local.offen.dev.pem:/offen/vault/local.offen.dev.pem - - ./local.offen.dev-key.pem:/offen/vault/local.offen.dev-key.pem command: npm start -- --port 9977 ports: - 9977:9977 environment: - - SERVER_HOST=https://local.offen.dev:8080 - - KMS_HOST=https://local.offen.dev:8081 - - AUDITORIUM_HOST=https://local.offen.dev:9955 + - SERVER_HOST=http://localhost:8080 + - KMS_HOST=http://localhost:8081 + - AUDITORIUM_HOST=http://localhost:9955 script: image: timbru31/node-chrome:slim working_dir: /offen/script volumes: - .:/offen - - ./local.offen.dev.pem:/offen/script/local.offen.dev.pem - - ./local.offen.dev-key.pem:/offen/script/local.offen.dev-key.pem command: npm start -- --port 9966 ports: - 9966:9966 environment: - - VAULT_HOST=https://local.offen.dev:9977 + - VAULT_HOST=http://localhost:9977 auditorium: image: timbru31/node-chrome:slim working_dir: /offen/auditorium volumes: - .:/offen - - ./local.offen.dev.pem:/offen/auditorium/local.offen.dev.pem - - ./local.offen.dev-key.pem:/offen/auditorium/local.offen.dev-key.pem command: npm start -- --port 9955 ports: - 9955:9955 environment: - - VAULT_HOST=https://local.offen.dev:9977 + - VAULT_HOST=http://localhost:9977