Skip to content

Commit 0fb3fb3

Browse files
authored
Add env var for pointing app at lexbox (#1768)
1 parent 629a88a commit 0fb3fb3

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

docker-compose.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# https://docs.docker.com/compose/compose-file
22
# https://github.com/compose-spec/compose-spec/blob/master/spec.md
33
version: '3.5'
4+
5+
# networks:
6+
# lexbox:
7+
# name: lexbox_default
8+
# external: true
9+
# default:
10+
411
services:
512
ui-builder:
613
build:
@@ -37,14 +44,20 @@ services:
3744
- mail
3845
- ld-api
3946
- lfmerge
47+
# networks:
48+
# - default
49+
# - lexbox
4050
environment:
41-
- WAIT_HOSTS=db:27017, mail:25
51+
- WAIT_HOSTS=lf-db:27017, mail:25
4252
- XDEBUG_MODE=develop,debug
4353
- LDAPI_BASE_URL=http://ld-api:3000/api/v2/
54+
# Uncomment this to test getting the LD project list from LexBox
55+
# To use LexBox locally (in docker) you'll also need to uncomment the networks here and at the top of the file
56+
#- LEX_BOX_HOST=https://staging.languagedepot.org #lexbox-api:5158
4457
- ENVIRONMENT=development
4558
- WEBSITE=localhost
4659
- DATABASE=scriptureforge
47-
- MONGODB_CONN=mongodb://db:27017
60+
- MONGODB_CONN=mongodb://lf-db:27017
4861
- MAIL_HOST=mail
4962
- GOOGLE_CLIENT_ID=bogus-development-token
5063
- GOOGLE_CLIENT_SECRET=bogus-development-token

docker/deployment/app-deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ spec:
138138
secretKeyRef:
139139
key: LANGUAGE_DEPOT_API_TOKEN
140140
name: ld-api
141+
- name: LEX_BOX_HOST
142+
valueFrom:
143+
secretKeyRef:
144+
key: LEX_BOX_HOST
145+
name: ld-api
141146
- name: FACEBOOK_CLIENT_ID
142147
valueFrom:
143148
secretKeyRef:

docker/deployment/secrets.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ metadata:
1818
data:
1919
LANGUAGE_DEPOT_API_TOKEN: ''
2020
LDAPI_BASE_URL: ''
21+
LEX_BOX_HOST: ''
2122

2223
---
2324

src/Api/Model/Languageforge/Lexicon/Command/SendReceiveCommands.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ public static function getUserProjects($username, $password, array $mockResponse
8888
}
8989
$client = new Client(["handler" => $handler]);
9090

91-
$url = "https://admin.languagedepot.org/api/user/" . $username . "/projects";
91+
$host = getenv("LEX_BOX_HOST") ?: "https://admin.languagedepot.org";
92+
$url = $host . "/api/user/" . $username . "/projects";
9293
$postData = [
9394
"json" => ["password" => $password],
95+
// Also supported:
96+
// "form_params" => ["password" => $password],
9497
"headers" => ["Authorization" => "Bearer " . LANGUAGE_DEPOT_API_TOKEN],
9598
];
9699

0 commit comments

Comments
 (0)