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

Add env var for pointing app at lexbox #1768

Merged
Merged
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
17 changes: 15 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# https://docs.docker.com/compose/compose-file
# https://github.com/compose-spec/compose-spec/blob/master/spec.md
version: '3.5'

# networks:
# lexbox:
# name: lexbox_default
# external: true
# default:

services:
ui-builder:
build:
Expand Down Expand Up @@ -37,14 +44,20 @@ services:
- mail
- ld-api
- lfmerge
# networks:
# - default
# - lexbox
environment:
- WAIT_HOSTS=db:27017, mail:25
- WAIT_HOSTS=lf-db:27017, mail:25
- XDEBUG_MODE=develop,debug
- LDAPI_BASE_URL=http://ld-api:3000/api/v2/
# Uncomment this to test getting the LD project list from LexBox
# To use LexBox locally (in docker) you'll also need to uncomment the networks here and at the top of the file
#- LEX_BOX_HOST=https://staging.languagedepot.org #lexbox-api:5158
- ENVIRONMENT=development
- WEBSITE=localhost
- DATABASE=scriptureforge
- MONGODB_CONN=mongodb://db:27017
- MONGODB_CONN=mongodb://lf-db:27017
- MAIL_HOST=mail
- GOOGLE_CLIENT_ID=bogus-development-token
- GOOGLE_CLIENT_SECRET=bogus-development-token
Expand Down
5 changes: 5 additions & 0 deletions docker/deployment/app-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ spec:
secretKeyRef:
key: LANGUAGE_DEPOT_API_TOKEN
name: ld-api
- name: LEX_BOX_HOST
valueFrom:
secretKeyRef:
key: LEX_BOX_HOST
name: ld-api
- name: FACEBOOK_CLIENT_ID
valueFrom:
secretKeyRef:
Expand Down
1 change: 1 addition & 0 deletions docker/deployment/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ metadata:
data:
LANGUAGE_DEPOT_API_TOKEN: ''
LDAPI_BASE_URL: ''
LEX_BOX_HOST: ''

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ public static function getUserProjects($username, $password, array $mockResponse
}
$client = new Client(["handler" => $handler]);

$url = "https://admin.languagedepot.org/api/user/" . $username . "/projects";
$host = getenv("LEX_BOX_HOST") ?: "https://admin.languagedepot.org";
$url = $host . "/api/user/" . $username . "/projects";
$postData = [
"json" => ["password" => $password],
// Also supported:
// "form_params" => ["password" => $password],
"headers" => ["Authorization" => "Bearer " . LANGUAGE_DEPOT_API_TOKEN],
];

Expand Down
Loading