mirror of
https://github.com/offen/website.git
synced 2024-12-23 13:30:20 +01:00
Merge pull request #28 from offen/local-setup
Remove requirement for local SSL in development
This commit is contained in:
commit
e99da243d3
22
README.md
22
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 <https://local.offen.dev:8080/status> in your browser without any security warnings.
|
||||
Now you should be able to access <http://localhost:8080/status> seeing a successful response.
|
||||
|
||||
### License
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user