Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix(models): wrap schema references in new Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
imduchy committed Nov 23, 2022
1 parent a340365 commit 533e9aa
Show file tree
Hide file tree
Showing 14 changed files with 2,456 additions and 372 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/deploy-api.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/deploy-client.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ app.use(passport.session());
// Configure CORS
app.use(
cors({
origin: [/\.onlinetipovacka\.sk$/, /\.westeurope\.azurecontainerapps\.io$/],
origin: [/localhost/, /\.onlinetipovacka\.sk$/, /\.westeurope\.azurecontainerapps\.io$/],
credentials: true,
})
);
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"express": "^4.17.1",
"express-session": "^1.17.1",
"helmet": "^6.0.0",
"mongoose": "6.2.2",
"mongoose": "6.7.3",
"multer": "^1.4.3",
"node-xlsx": "^0.17.2",
"passport": "^0.6.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ router.get('/users', authMiddleware, async (req, res) => {
const query = User.find({ groupId: groupId }).populate({ path: 'bets.game' });

if (season) {
query.where('competitionScore.season').equals(season);
query.$where('competitionScore.season').equals(season);
}

const users = await query;
Expand Down
66 changes: 42 additions & 24 deletions infra/aca.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ resource "azapi_resource" "this" {
})
}

resource "azapi_resource" "aca_client_certificate" {
name = "me-cert-${var.project_name}-${var.environment}"
type = "Microsoft.App/managedEnvironments/certificates@2022-03-01"
parent_id = azapi_resource.this.id
location = var.region
tags = local.default_tags

body = jsonencode({
properties = {
password = "GastonLyla69"
value = filebase64("./client-cert.pfx")
}
})
}

resource "azapi_resource" "aca-api" {
name = "aca-${var.project_name}-api-${var.environment}"
location = var.region
Expand All @@ -38,6 +53,10 @@ resource "azapi_resource" "aca-api" {
allowInsecure = false
targetPort = 3003
transport = "Auto"
# customDomains = [{
# name = "api.onlinetipovacka.sk"
# certificateId = "todo"
# }]
}
registries = [{
identity = "system"
Expand Down Expand Up @@ -146,6 +165,11 @@ resource "azapi_resource" "aca-client" {
allowInsecure = false
targetPort = 3000
transport = "Auto"
customDomains = [{
bindingType = "Disabled"
name = "onlinetipovacka.sk"
certificateId = azapi_resource.aca_client_certificate.id
}]
}
registries = [{
identity = "system"
Expand Down Expand Up @@ -184,32 +208,26 @@ resource "azapi_resource" "aca-client" {
# It's not possible to specify properties within the body attribute
# so we're ignoring all changes. Hopefully this will be solved when
# terraform's azurerm provider starts supporting Azure Container Apps
# body
body
]
}
}

# resource "azapi_update_resource" "update_client" {
# depends_on = [
# azapi_resource.aca-api
# ]
# type = "Microsoft.App/containerApps@2022-06-01-preview"
# resource_id = azapi_resource.aca-client.id
resource "azapi_update_resource" "update_client" {
type = "Microsoft.App/containerApps@2022-06-01-preview"
resource_id = azapi_resource.aca-client.id

# body = jsonencode({
# template = {
# containers = [{
# env = [
# {
# name = "BASE_URL"
# value = jsondecode(azapi_resource.aca-api.output).properties.configuration.ingress.fqdn
# },
# {
# name = "NODE_ENV"
# value = "production"
# }
# ]
# }]
# }
# })
# }
body = jsonencode({
template = {
configuration = {
ingress = {
customDomains = [{
bindingType = "Disabled"
name = "onlinetipovacka.sk"
certificateId = azapi_resource.aca_client_certificate.id
}]
}
}
}
})
}
Binary file added infra/client-cert.pfx
Binary file not shown.
Loading

0 comments on commit 533e9aa

Please sign in to comment.