Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,59 @@ Connect with other aviation enthusiasts and developers! Join our Discord communi

To deploy Flight Spotlight locally, refer to the [deployment repository](https://github.com/openutm/deployment). It includes detailed instructions and a sample environment file to get you started.

### Run with Docker (recommended)
Flight Spotlight runs as an Express app with Redis and Tile38.

#### 1. Create `.env`
Copy the sample file and adjust values as needed:

```bash
cp env.template .env
```

#### 2. Create the shared Docker network
The compose file expects the external `interop_ecosystem_network` network:

```bash
docker network create interop_ecosystem_network
```

#### 3. Build and start containers

```bash
docker compose up --build
```

#### 4. Open the app

- App: http://localhost:5000

If you are running Flight Passport in Docker, make sure it is also on the
`interop_ecosystem_network` and that `.env` points to `http://flight-passport:9000`.

### Deploy on Render (Standalone, No Docker)

Flight Spotlight runs as a native Node service, and still requires Redis and Tile38.

1. Create a **Redis** instance in Render and note its connection string.
2. Create a **Web Service** for Tile38:
- Type: Docker
- Dockerfile Path: tile38.Dockerfile
- Build Context Directory: .
- Docker Command: (leave blank)
3. Create a **Web Service** from this repo (Environment: **Node**).
4. Set **Build Command**: `npm install`
5. Set **Start Command**: `npm start`
6. Set required env vars (start from `env.template`):
- `PASSPORT_URL` to your Flight Passport Render URL
- `OIDC_DOMAIN` to `<passport-url>/o`
- `BLENDER_BASE_URL` to your Flight Blender Render URL
- `SPOTLIGHT_BASE_URL` to your Spotlight Render URL
- `REDIS_URL` from Render
- `TILE38_SERVER` to the Tile38 service host, `TILE38_PORT=9851`
- `PASSPORT_BLENDER_CLIENT_ID`, `PASSPORT_BLENDER_CLIENT_SECRET`, `PASSPORT_BLENDER_SCOPE`, `PASSPORT_BLENDER_AUDIENCE`
7. Deploy the Spotlight service.

---

## 🛠️ OpenUTM Stack
Expand Down
2 changes: 1 addition & 1 deletion config/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bind 0.0.0.0
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode yes
protected-mode no

# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
Expand Down
20 changes: 16 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
version: "3"
services:
tile38:
platform: linux/amd64
# platform: linux/amd64
image: tile38/tile38
ports:
- "9851:9851"
command: ["tile38-server"]
container_name: "tile38"
networks:
- interop_ecosystem_network

redis-spotlight:
platform: linux/amd64
# platform: linux/amd64
image: redis:latest
ports:
- "6379:6379"
Expand All @@ -19,12 +20,17 @@ services:
container_name: "redis-spotlight"
env_file:
- .env
networks:
- interop_ecosystem_network

spotlight:
platform: linux/amd64
# platform: linux/amd64
command: npm start
env_file:
- .env
environment:
- OIDC_DOMAIN=http://flight-passport:9000/o
- PASSPORT_URL=http://flight-passport:9000
build: .
image: openskiessh/flight-spotlight
container_name: flight-spotlight
Expand All @@ -33,3 +39,9 @@ services:
- tile38
ports:
- "5000:5000"
networks:
- interop_ecosystem_network

networks:
interop_ecosystem_network:
external: true
37 changes: 37 additions & 0 deletions env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Flight Passport / OAUTH credentials (Docker network)
PASSPORT_URL=http://flight-passport:9000

# Blender Details (Docker network)
BLENDER_BASE_URL=http://flight-blender:8000
PASSPORT_BLENDER_CLIENT_ID=Tv5mzMPZ5MdhGWcLQ451WKuUKuKezc9qDiCLT06i
PASSPORT_BLENDER_CLIENT_SECRET=CKQwzzx1MDtJYaRG2EEb3Jb9YLBhoTsd91Arg0WzsBmtTOQapLzU3U5YEolqDpKVHhrtdiTBXGgGxagIQWEO5JYrHyeDWrFarSxaaYgvPPtalevbU7qwzIJw4Q2VhUCk
PASSPORT_BLENDER_SCOPE=flightblender.read flightblender.write
PASSPORT_BLENDER_AUDIENCE=testflight.flightblender.com

# Mapping
MAPBOX_KEY="pk.eyJ1IjoibWFyY2luc2t5dHJhZGUiLCJhIjoiY204cWQ0d3FhMGM1MTJqc2NleTJ4NXJpeiJ9.U2aaygR4CflBJo53RrKaNA"

# Used by Express OpenID Connect
SECRET=XhOCvsdPpQPL2Q74hvDNZw3L4QatShA5CBPdEKfzgc1G3tuwKNVsgSN9MKHrYKL5
# Declaration Status
DEFAULT_APPROVED=1

# OIDC Settings (Passport running on host)
OIDC_DOMAIN=http://flight-passport:9000/o
CLIENT_ID=XfZK2gmmE6LU7Sxj3RM2oYGqiyfX0byLGaFs0tp9
CLIENT_SECRET=VVdr8c6AATy96L7DvsObXdx28uIHlbJ1EUNGbnj7vSadbjLbxWHiDMpqU8vExjFHtdIz1r9z5FSab3KslhWWa9uPllrUCs7593NVjIe56JSKG2s1mkiWh8sEodY2Bbkr
SPOTLIGHT_BASE_URL=http://localhost:5000

# For Docker-network only:
# OIDC_DOMAIN=http://flight-passport:9000/o

# Redis
REDIS_PASSWORD=blender_redis


REDIS_URL=redis://redis-spotlight:6379
# If using rediss:// with a self-signed cert, set to 0 (not recommended for prod).
# REDIS_TLS_REJECT_UNAUTHORIZED=0
TILE38_SERVER=tile38
TILE38_PORT=9851
25 changes: 16 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion routes/redis-client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
const redis = require('redis');

const redis_client = redis.createClient({url:process.env.REDIS_URL});
const redisUrl = process.env.REDIS_URL;
const useTls = Boolean(redisUrl && redisUrl.startsWith('rediss://'));
const rejectUnauthorized = process.env.REDIS_TLS_REJECT_UNAUTHORIZED !== '0';

const redisClientOptions = { url: redisUrl };
if (useTls) {
redisClientOptions.socket = {
tls: true,
rejectUnauthorized,
};
}

const redis_client = redis.createClient(redisClientOptions);
function redis_error_handler(err) {
console.debug(`node-redis version is ${require('redis/package.json').version}`);
console.debug(err);
Expand Down
2 changes: 2 additions & 0 deletions tile38.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM tile38/tile38
CMD ["tile38-server"]
3 changes: 2 additions & 1 deletion views/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
function check_blender_connectivity() {
const blender_ping_url = '/blender_status';
fetch(blender_ping_url)
.then((response) => {
.then((response) => {
console.log(response);
if (response.status == 200) {
return response
}
Expand Down