Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables to use .env instead of manually exporting it #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
INTEGRAM_PORT=7000
INTEGRAM_BASE_URL=localhost
TRELLO_BOT_TOKEN=
TRELLO_OAUTH_ID=
TRELLO_OAUTH_SECRET=
GITLAB_BOT_TOKEN=
GITLAB_OAUTH_ID=
GITLAB_OAUTH_SECRET=
BITBUCKET_BOT_TOKEN=
BITBUCKET_OAUTH_ID=
BITBUCKET_OAUTH_SECRET=
WEBHOOK_BOT_TOKEN=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
DS_Store
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ How to host Integram on your own server (using your private bots)
```bash
git clone https://github.com/requilence/integram && cd integram
```
- Check the `docker-compose.yml` file for the required ENV vars for each service
- Check the `.env-example` file for the required ENV vars for each service
- E.g. in order to run the Trello integration you will need to export:
- **INTEGRAM_BASE_URL** – the base URL where your Integram host will be accessible, e.g. **https://integram.org**
- **INTEGRAM_PORT** – if set to 443 Integram will use ssl.key/ssl.cert at /go/.conf.
Expand All @@ -49,11 +49,7 @@ How to host Integram on your own server (using your private bots)
- **TRELLO_OAUTH_SECRET** – OAuth Secret

- For more detailed info about other services you should check the corresponding repo at https://github.com/integram-org
- Export the variables you identified in the previous step, for instance on linux this should be something like:
```bash
export INTEGRAM_PORT=xxxx
export ...
```
- Create a new file from `.env-example` and name it `.env`. Update the variables as necessary. [Read more about `.env` and `docker-compose`](https://docs.docker.com/compose/compose-file/#variable-substitution)
- Now you can run the services (linux: careful if you need to sudo this, the exports you just did will not be available) :
```bash
docker-compose -p integram up trello gitlab ## Here you specify the services you want to run
Expand Down
40 changes: 20 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
- INTEGRAM_INSTANCE_MODE=multi-main
- INTEGRAM_CONFIG_DIR=/app/.conf
## required ENV vars
- INTEGRAM_PORT
- INTEGRAM_BASE_URL
- INTEGRAM_PORT=${INTEGRAM_PORT}
- INTEGRAM_BASE_URL=${INTEGRAM_BASE_URL}
trello:
image: integram/trello:latest
restart: always
Expand All @@ -51,16 +51,16 @@ services:
- integram
environment:
- TZ=UTC
- INTEGRAM_PORT=7000
- INTEGRAM_PORT=${INTEGRAM_PORT}
- INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
- INTEGRAM_REDIS_URL=redis:6379
- INTEGRAM_INSTANCE_MODE=multi-service

## required ENV vars
- INTEGRAM_BASE_URL
- TRELLO_BOT_TOKEN
- TRELLO_OAUTH_ID
- TRELLO_OAUTH_SECRET
- INTEGRAM_BASE_URL=${INTEGRAM_BASE_URL}
- TRELLO_BOT_TOKEN=${TRELLO_BOT_TOKEN}
- TRELLO_OAUTH_ID=${TRELLO_OAUTH_ID}
- TRELLO_OAUTH_SECRET=${TRELLO_OAUTH_SECRET}
gitlab:
image: integram/gitlab
restart: always
Expand All @@ -71,16 +71,16 @@ services:
- integram
environment:
- TZ=UTC
- INTEGRAM_PORT=7000
- INTEGRAM_PORT=${INTEGRAM_PORT}
- INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
- INTEGRAM_REDIS_URL=redis:6379
- INTEGRAM_INSTANCE_MODE=multi-service

## required ENV vars
- INTEGRAM_BASE_URL
- GITLAB_BOT_TOKEN
- GITLAB_OAUTH_ID
- GITLAB_OAUTH_SECRET
- INTEGRAM_BASE_URL=${INTEGRAM_BASE_URL}
- GITLAB_BOT_TOKEN=${GITLAB_BOT_TOKEN}
- GITLAB_OAUTH_ID=${GITLAB_OAUTH_ID}
- GITLAB_OAUTH_SECRET=${GITLAB_OAUTH_SECRET}
bitbucket:
image: integram/bitbucket
restart: always
Expand All @@ -91,16 +91,16 @@ services:
- integram
environment:
- TZ=UTC
- INTEGRAM_PORT=7000
- INTEGRAM_PORT=${INTEGRAM_PORT}
- INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
- INTEGRAM_REDIS_URL=redis:6379
- INTEGRAM_INSTANCE_MODE=multi-service

## required ENV vars
- INTEGRAM_BASE_URL
- BITBUCKET_BOT_TOKEN
- BITBUCKET_OAUTH_ID
- BITBUCKET_OAUTH_SECRET
- INTEGRAM_BASE_URL=${INTEGRAM_BASE_URL}
- BITBUCKET_BOT_TOKEN=${BITBUCKET_BOT_TOKEN}
- BITBUCKET_OAUTH_ID=${BITBUCKET_OAUTH_ID}
- BITBUCKET_OAUTH_SECRET=${BITBUCKET_OAUTH_SECRET}
webhook:
image: integram/webhook
restart: always
Expand All @@ -111,11 +111,11 @@ services:
- integram
environment:
- TZ=UTC
- INTEGRAM_PORT=7000
- INTEGRAM_PORT=${INTEGRAM_PORT}
- INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
- INTEGRAM_REDIS_URL=redis:6379
- INTEGRAM_INSTANCE_MODE=multi-service

## required ENV vars
- INTEGRAM_BASE_URL
- WEBHOOK_BOT_TOKEN
- INTEGRAM_BASE_URL=${INTEGRAM_BASE_URL}
- WEBHOOK_BOT_TOKEN=${WEBHOOK_BOT_TOKEN}