Skip to content

Commit 575725e

Browse files
committed
feat: release uplotr 0.2.0 public beta
0 parents  commit 575725e

147 files changed

Lines changed: 17660 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.git
2+
.github
3+
.next
4+
node_modules
5+
.env
6+
.env.*
7+
!.env.example
8+
!.env.prod.example
9+
*.log
10+
.DS_Store
11+
tsconfig.tsbuildinfo

‎.env.example‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Database
2+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/lorawan_tracker?schema=public"
3+
4+
# AUTH_SECRET is used to sign session cookies (JWT)
5+
AUTH_SECRET="change_this_to_a_long_random_string_min_32_chars"
6+
7+
# OFF | OPTIONAL | REQUIRED. Keep REQUIRED on internet-facing instances.
8+
AUTH_MODE="REQUIRED"
9+
10+
# Secures the scheduled retention cleanup endpoint.
11+
CRON_SECRET="change_this_to_another_long_random_string"
12+
13+
# Optional map configuration. OPENFREEMAP requires no token.
14+
MAP_PROVIDER="OPENFREEMAP"
15+
# MAPBOX_TOKEN="pk..."

‎.env.prod.example‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Docker Compose constructs DATABASE_URL from this database password.
2+
DB_PASSWORD="change_this_database_password"
3+
4+
# AUTH_SECRET is used to sign session cookies (JWT)
5+
AUTH_SECRET="change_this_to_a_long_random_string_min_32_chars"
6+
7+
CRON_SECRET="change_this_to_another_long_random_string"
8+
MAP_PROVIDER="OPENFREEMAP"
9+
10+
# Webhook Auth
11+
# OFF | OPTIONAL | REQUIRED
12+
# Default fallback: OFF in development, REQUIRED in production
13+
AUTH_MODE="REQUIRED"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bug report
2+
description: Report a reproducible problem in uplotr.
3+
title: "[Bug]: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Please remove secrets, API keys, exact coordinates, and private payloads before posting.
9+
- type: input
10+
id: version
11+
attributes:
12+
label: uplotr version
13+
placeholder: v0.2.0-beta.1 or commit SHA
14+
validations: { required: true }
15+
- type: dropdown
16+
id: deployment
17+
attributes:
18+
label: Deployment
19+
options: [Docker Compose, Vercel, Local development, Other]
20+
validations: { required: true }
21+
- type: textarea
22+
id: steps
23+
attributes: { label: Steps to reproduce }
24+
validations: { required: true }
25+
- type: textarea
26+
id: expected
27+
attributes: { label: Expected behavior }
28+
validations: { required: true }
29+
- type: textarea
30+
id: logs
31+
attributes: { label: Sanitized logs or screenshots }

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions and ideas
4+
url: https://github.com/iblh/uplotr/discussions
5+
about: Use Discussions for support questions and open-ended ideas.
6+
- name: Security report
7+
url: https://github.com/iblh/uplotr/security/advisories/new
8+
about: Privately report a suspected vulnerability.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Feature request
2+
description: Suggest an improvement for the open-source project.
3+
title: "[Feature]: "
4+
labels: [enhancement]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem to solve
10+
description: Describe the user problem before proposing a solution.
11+
validations: { required: true }
12+
- type: textarea
13+
id: proposal
14+
attributes: { label: Proposed direction }
15+
- type: dropdown
16+
id: area
17+
attributes:
18+
label: Area
19+
options: [Ingestion, Map and replay, Device management, Deployment, Documentation, Accessibility, Other]

‎.github/dependabot.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule: { interval: weekly }
6+
groups:
7+
production-dependencies: { dependency-type: production }
8+
development-dependencies: { dependency-type: development }
9+
- package-ecosystem: github-actions
10+
directory: /
11+
schedule: { interval: weekly }
12+
- package-ecosystem: docker
13+
directory: /
14+
schedule: { interval: weekly }
15+
ignore:
16+
- dependency-name: node
17+
update-types: [version-update:semver-major]

‎.github/pull_request_template.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## What changed
2+
3+
## Why
4+
5+
## Verification
6+
7+
- [ ] `pnpm lint`
8+
- [ ] `pnpm typecheck`
9+
- [ ] `pnpm test`
10+
- [ ] Documentation updated when behavior or APIs changed
11+
- [ ] No secrets, private coordinates, or raw production payloads included

‎.github/workflows/ci.yml‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
quality:
15+
runs-on: ubuntu-latest
16+
services:
17+
postgres:
18+
image: postgres:16-alpine
19+
env:
20+
POSTGRES_USER: uplotr
21+
POSTGRES_PASSWORD: uplotr_test
22+
POSTGRES_DB: uplotr_test
23+
ports: ['5432:5432']
24+
options: >-
25+
--health-cmd "pg_isready -U uplotr -d uplotr_test"
26+
--health-interval 5s --health-timeout 5s --health-retries 10
27+
env:
28+
DATABASE_URL: postgresql://uplotr:uplotr_test@localhost:5432/uplotr_test?schema=public
29+
INTEGRATION_DATABASE_URL: postgresql://uplotr:uplotr_test@localhost:5432/uplotr_test?schema=public
30+
AUTH_SECRET: ci-only-session-secret-with-at-least-32-characters
31+
AUTH_MODE: REQUIRED
32+
CRON_SECRET: ci-only-cron-secret-with-at-least-32-characters
33+
steps:
34+
- uses: actions/checkout@v7
35+
- uses: pnpm/action-setup@v6
36+
- uses: actions/setup-node@v7
37+
with:
38+
node-version: 22
39+
cache: pnpm
40+
- run: pnpm install --frozen-lockfile
41+
- run: pnpm exec prisma migrate deploy
42+
- run: pnpm lint
43+
- run: pnpm typecheck
44+
- run: pnpm test
45+
- run: pnpm test:integration
46+
- run: pnpm audit --audit-level=high
47+
- run: pnpm build
48+
- run: pnpm exec playwright install --with-deps chromium
49+
- run: pnpm test:e2e --project=desktop-chromium
50+
51+
docker:
52+
runs-on: ubuntu-latest
53+
needs: quality
54+
env:
55+
AUTH_SECRET: ci-only-session-secret-with-at-least-32-characters
56+
AUTH_MODE: REQUIRED
57+
CRON_SECRET: ci-only-cron-secret-with-at-least-32-characters
58+
DB_PASSWORD: uplotr_compose_test
59+
steps:
60+
- uses: actions/checkout@v7
61+
- uses: docker/setup-buildx-action@v4
62+
- uses: docker/build-push-action@v7
63+
with:
64+
context: .
65+
push: false
66+
load: true
67+
tags: ghcr.io/iblh/uplotr:latest
68+
cache-from: type=gha
69+
cache-to: type=gha,mode=max
70+
- name: Smoke test Docker Compose from an empty database
71+
run: |
72+
docker compose up -d --wait --wait-timeout 120
73+
74+
cookie_jar="${RUNNER_TEMP}/uplotr-ci-cookies.txt"
75+
curl --fail --silent --show-error \
76+
--cookie-jar "${cookie_jar}" \
77+
--header 'Content-Type: application/json' \
78+
--data '{"username":"compose-admin","password":"correct-horse-battery-staple","mapProvider":"OPENFREEMAP"}' \
79+
http://127.0.0.1:3000/api/auth/setup >/dev/null
80+
81+
api_key="$(curl --fail --silent --show-error \
82+
--cookie "${cookie_jar}" \
83+
--header 'Content-Type: application/json' \
84+
--data '{"name":"Compose smoke test"}' \
85+
http://127.0.0.1:3000/api/keys | jq -er '.key')"
86+
87+
curl --fail --silent --show-error \
88+
--header "Authorization: Bearer ${api_key}" \
89+
--header 'Content-Type: application/json' \
90+
--data '{"device_id":"compose-smoke-device","lat":37.7749,"lon":-122.4194,"battery":88}' \
91+
http://127.0.0.1:3000/api/v1/ingest >/dev/null
92+
93+
curl --fail --silent --show-error \
94+
--cookie "${cookie_jar}" \
95+
http://127.0.0.1:3000/api/devices | \
96+
jq -e 'any(.[]; .externalId == "compose-smoke-device")' >/dev/null
97+
- name: Show Compose logs on failure
98+
if: failure()
99+
run: docker compose logs --no-color
100+
- name: Stop Docker Compose
101+
if: always()
102+
run: docker compose down --volumes
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish container
2+
3+
on:
4+
push:
5+
tags: ['v*.*.*']
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
id-token: write
18+
steps:
19+
- uses: actions/checkout@v7
20+
- name: Normalize image name
21+
run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
22+
- uses: sigstore/cosign-installer@v4
23+
- uses: docker/setup-buildx-action@v4
24+
- uses: docker/login-action@v4
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Extract image metadata
30+
id: meta
31+
uses: docker/metadata-action@v6
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
tags: |
35+
type=raw,value=latest
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
- name: Build and publish
39+
id: publish
40+
uses: docker/build-push-action@v7
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max
48+
- name: Sign image digest
49+
env:
50+
TAGS: ${{ steps.meta.outputs.tags }}
51+
DIGEST: ${{ steps.publish.outputs.digest }}
52+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

0 commit comments

Comments
 (0)