Skip to content

Commit

Permalink
fix: Add an environment variable for gitlab url
Browse files Browse the repository at this point in the history
  • Loading branch information
fleboulch committed May 27, 2024
1 parent 8fe1597 commit e27579e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ POSTGRES_USER=root
SLACK_BOT_USER_O_AUTH_ACCESS_TOKEN=SLACK_BOT_USER_O_AUTH_ACCESS_TOKEN
SLACK_SIGNING_SECRET=SLACK_SIGNING_SECRET
EMAIL_DOMAINS=my-domain.com,ext.my-domain.com
GITLAB_URL=https://my.domain.com
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,16 @@ Create a `.env` file containing the following variables:
![OAuth token](docs/assets/slack/oauth-token.png)

- `EMAIL_DOMAINS`

Email domains of your organization (separated by comma),
for instance `my-domain.com,ext.my-domain.com`.
Used to find Slack users from Gitlab username.
Note that this means your org has to use the same naming scheme for emails and gitlab username.

- `GITLAB_URL`

The gitlab url of your organization

If you want Homer to connect to an **external PostgreSQL database**, you can set
the following variables:

Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { GitlabMergeRequestState } from '@/core/typings/GitlabMergeRequest';
import { getEnvVariable } from '@/core/utils/getEnvVariable';

export const CHANNEL_NOT_FOUND_SLACK_ERROR = 'channel_not_found';
export const EXPIRED_TRIGGER_ID_ERROR_MESSAGE =
'D’oh! It looks like I took too much time to respond for Slack, could you retry your command? :homer-donut:';
export const EXPIRED_TRIGGER_ID_SLACK_ERROR = 'expired_trigger_id';
export const GENERIC_ERROR_MESSAGE =
"D'oh! Something went wrong :homer-stressed: You will probably find more information on the error on <https://app.datadoghq.eu/logs?cols=host%2Cservice&live=true&messageDisplay=inline&query=service%3A%2Ahomer%2A%20%40env%3Asupport&index=%2A&stream_sort=desc|Datadog>.";
export const GITLAB_URL = 'https://git.manomano.tech';
export const GITLAB_URL = getEnvVariable('GITLAB_URL');
export const HOMER_GITLAB_URL = `${GITLAB_URL}/tools/homer`;
export const HTTP_STATUS_NO_CONTENT = 204;
export const HTTP_STATUS_OK = 200;
Expand Down

0 comments on commit e27579e

Please sign in to comment.