-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate the config.yaml generation to PKL
- Loading branch information
1 parent
dca145d
commit 322b6d1
Showing
14 changed files
with
133 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
amends "./modules/main.pkl" | ||
import "./modules/database/mongodb.pkl" | ||
appBaseUrl = "aletheiafact.org" | ||
|
||
var = new { | ||
name = "aletheia-development" | ||
conf { | ||
cors = "*" | ||
recaptcha_sitekey = "6Lc2BtYUAAAAAOUBI-9r1sDJUIfG2nt6C43noOXh" | ||
websocketUrl = "wss://testws.\(appBaseUrl) " | ||
baseUrl = "https://test.\(appBaseUrl)" | ||
db = (mongodb) { | ||
atlas = true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
access_token = read("env:AGENCIA_ACCESS_TOKEN") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bucket = read("env:AWS_SDK_BUCKET") | ||
accessKeyId = read("env:AWS_ACCESS_KEY_ID") | ||
secretAccessKey = read("env:AWS_SECRET_ACCESS_KEY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
atlas = false | ||
connection_uri = read("env:MONGODB_URI") | ||
options = new { | ||
useUnifiedTopology = true | ||
useNewUrlParser = true | ||
retryWrites = true | ||
w = "majority" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
url = read("env:GITLAB_FEATURE_FLAG_URL") | ||
appName = read("env:ENV") | ||
instanceId = read("env:GITLAB_FEATURE_FLAG_INSTANCE_ID") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import "./database/mongodb.pkl" | ||
import "./service/confBase.pkl" | ||
import "./ory.pkl" as oryConfig | ||
|
||
|
||
hidden appBaseUrl: String | ||
|
||
hidden var = new { | ||
name = "service-aletheia" | ||
conf = new { | ||
port = 3000 | ||
recaptcha_sitekey = read("env:RECAPTCHA_SITEKEY") | ||
websocketUrl = read("env:WEBSOCKET_URL") | ||
baseUrl = read("env:BASE_URL") | ||
automatedFactCheckingAPIUrl = read("env:AGENTS_API_URL") | ||
recaptcha_secret = read("env:RECAPTCHA_SECRET") | ||
throttle = new confBase.Throttle { | ||
ttl = 60 | ||
limit = 100 | ||
} | ||
ory = (oryConfig) { | ||
admin_endpoint = "admin" | ||
} | ||
} | ||
} | ||
|
||
services = new Listing { | ||
new { | ||
name = var.name | ||
conf = (confBase) { | ||
...var.conf | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
api_key = read("env:NOVU_API_KEY") | ||
application_identifier = read("env:NOVU_APPLICATION_IDENTIFIER") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
api_key = read("env:OPENAI_API_KEY") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
url = read("env:ORY_SDK_URL") | ||
admin_url = read("env:ORY_SDK_URL") | ||
admin_endpoint: String | ||
access_token = read("env:ORY_ACCESS_TOKEN") | ||
schema_id = read("env:ALETHEIA_SCHEMA_ID") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class BaseService { | ||
name: String | ||
conf: Map<String, Value> | ||
} |
31 changes: 31 additions & 0 deletions
31
deployment/config/config-file/modules/service/confBase.pkl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "../database/mongodb.pkl" as mongoDbConfig | ||
import "../ory.pkl" as oryConfig | ||
import "../feature_flag.pkl" as featureFlagConfig | ||
import "../aws/s3.pkl" as s3Config | ||
import "../novu.pkl" as novuConfig | ||
import "../openai.pkl" as openaiConfig | ||
import "../zenvia.pkl" as zenviaConfig | ||
import "../agencia.pkl" as agenciaConfig | ||
|
||
class Throttle { | ||
ttl: Number | ||
limit: Number | ||
} | ||
|
||
port: Number | ||
cors: String | ||
websocketUrl: String | ||
baseUrl: String | ||
automatedFactCheckingAPIUrl: String | ||
recaptcha_secret: String | ||
recaptcha_sitekey: String | ||
throttle: Throttle | ||
authentication_type = "ory" | ||
db = (mongoDbConfig) {} | ||
ory = (oryConfig) {} | ||
feature_flag = (featureFlagConfig) {} | ||
aws = (s3Config) {} | ||
novu = (novuConfig) {} | ||
openai = (openaiConfig) {} | ||
zenvia = (zenviaConfig) {} | ||
agencia = (agenciaConfig) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
api_url = read("env:ZENVIA_API_URL") | ||
api_token = read("env:ZENVIA_API_TOKEN") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
amends "./modules/main.pkl" | ||
import "./modules/database/mongodb.pkl" | ||
appBaseUrl = "aletheiafact.org" | ||
|
||
var = new { | ||
name = "aletheia-production" | ||
conf { | ||
cors = "*" | ||
recaptcha_sitekey = "6Lc2BtYUAAAAAOUBI-9r1sDJUIfG2nt6C43noOXh" | ||
websocketUrl = "wss://ws.\(appBaseUrl) " | ||
baseUrl = "https://\(appBaseUrl)" | ||
db = (mongodb) { | ||
atlas = true | ||
} | ||
} | ||
} |