Skip to content

Commit 29944f7

Browse files
committed
functioning terraform
1 parent 147b56e commit 29944f7

File tree

16 files changed

+104
-57
lines changed

16 files changed

+104
-57
lines changed

.devcontainer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev.env

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:20-bookworm
2+
3+
RUN set -eux; \
4+
apt-get update; \
5+
apt-get install -y --no-install-recommends wget gnupg lsb-release ca-certificates software-properties-common; \
6+
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor >/usr/share/keyrings/hashicorp-archive-keyring.gpg; \
7+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
8+
>/etc/apt/sources.list.d/hashicorp.list; \
9+
apt-get update; \
10+
apt-get install -y terraform; \
11+
terraform -v; \
12+
rm -rf /var/lib/apt/lists/*

.devcontainer/compose.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
services:
22
unitn-oj:
3-
image: node:20-bookworm
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
image: unitn-oj-dev
47
container_name: unitn-oj
58
working_dir: /workspace
69
ports:
710
- "4173:4173"
811
- "8080:8080"
12+
env_file:
13+
- dev.env
914
volumes:
1015
- "..:/workspace"
1116
command: >

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"customizations": {
77
"vscode": {
88
"extensions": [
9+
"jeff-hykin.better-dockerfile-syntax",
910
"ms-vscode.vscode-typescript-next",
1011
"jacano.vscode-pnpm",
1112
"antfu.vite",
@@ -14,7 +15,8 @@
1415
"bradlc.vscode-tailwindcss",
1516
"biomejs.biome",
1617
"hashicorp.terraform",
17-
"marcoroth.turbo-lsp"
18+
"marcoroth.turbo-lsp",
19+
"hashicorp.hcl"
1820
]
1921
}
2022
}

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"useIgnoreFile": true
77
},
88
"files": {
9-
"includes": ["backend/**/*", "frontend/**/*", "tests/**/*"]
9+
"includes": ["backend/**/*", "frontend/**/*", "infra/**/*", "tests/**/*"]
1010
},
1111
"assist": {
1212
"enabled": true,

frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"db:apply:local": "wrangler d1 migrations apply DB --local",
99
"db:seed:local": "wrangler d1 execute DB --local --file d1/seed/dev_seed.sql",
1010
"db:init:local": "pnpm db:apply:local && pnpm db:seed:local",
11-
"db:init": "pnpm db:init:local",
1211
"prepare": "svelte-kit sync",
1312
"build": "vite build",
1413
"preview": "vite preview",

frontend/wrangler.jsonc

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
{
2-
"name": "unitn-oj-frontend",
2+
"name": "unitn-oj-frontend",
33

4-
"compatibility_date": "2024-09-23",
5-
"compatibility_flags": ["nodejs_compat"],
4+
"compatibility_date": "2025-09-06",
5+
"compatibility_flags": ["nodejs_compat"],
66

7-
"pages_build_output_dir": ".svelte-kit/cloudflare",
7+
"pages_build_output_dir": ".svelte-kit/cloudflare",
88

9-
"dev": {
10-
"ip": "0.0.0.0",
11-
"port": 8080,
12-
"local_protocol": "http"
13-
},
9+
"dev": {
10+
"ip": "0.0.0.0",
11+
"port": 8080,
12+
"local_protocol": "http"
13+
},
1414

15-
"d1_databases": [
16-
{
17-
"binding": "DB",
18-
"database_name": "unitn_oj_local",
19-
"database_id": "LOCAL",
20-
"migrations_dir": "d1/migrations"
21-
}
22-
],
15+
"d1_databases": [
16+
{
17+
"binding": "DB",
18+
"database_name": "unitn_oj_local",
19+
"database_id": "LOCAL",
20+
"migrations_dir": "d1/migrations"
21+
}
22+
],
2323

24-
"queues": {
25-
"producers": [
26-
{
27-
"queue": "submissions",
28-
"binding": "QUEUE_SUBMISSIONS"
29-
}
30-
]
31-
},
32-
33-
"vars": {
34-
"APP_ENV": "dev",
35-
"AUTH_ALLOWED_DOMAIN": "studenti.unitn.it",
36-
"AUTH_TOKEN_TTL_SECONDS": "300",
37-
"AUTH_SESSION_TTL_SECONDS": "604800",
38-
"AUTH_SESSION_SECRET": "dev-secret"
39-
}
24+
"queues": {
25+
"producers": [
26+
{
27+
"queue": "unitn-oj-submissions-dev",
28+
"binding": "QUEUE_SUBMISSIONS"
29+
}
30+
]
31+
}
4032
}

infra/terraform/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.terraform
2+
terraform.tfstate.d

infra/terraform/.terraform.lock.hcl

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/terraform/dev.tfvars

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
account_id = "cf_account_id_dev"
2-
zone_id = "cf_zone_id_dev"
31
project_name = "unitn-oj-dev"
4-
queue_name = "unitn-oj-submissions-dev"
2+
queue_name = "unitn-oj-submissions-dev"

0 commit comments

Comments
 (0)