Elffuss BraidHub

kikocis/osiris public

master · 6.9 KiBRenderedRawPermalink
1# Self-Hosting OSIRIS with Docker
2
3OSIRIS ships as a self-contained Next.js standalone build. This guide covers
4running it with Docker / Docker Compose, deploying it as a [CasaOS](https://casaos.io)
5app, and configuring the optional API keys.
6
7> **TL;DR:** OSIRIS runs fully **without any API keys**. All core feeds
8> (aviation, satellites, fires, earthquakes, weather, news, CVEs) use public
9> keyless sources. Keys only matter for the optional RECON scanner backend and
10> for raising rate limits on a few feeds.
11
12---
13
14## 1. Docker Compose (recommended)
15
16```bash
17git clone https://github.com/simplifaisoul/osiris.git
18cd osiris
19
20# optional: configure keys / scanner backend
21cp .env.template .env # then edit .env
22
23docker compose up -d
24```
25
26Open <http://localhost:3000>.
27
28What the compose file does:
29
30- **`image:` + `build:`** — `image:` points at a prebuilt registry image; the
31 `build:` block is a fallback. `docker compose up -d` uses the registry image
32 if it's available locally or pullable, otherwise builds from the local
33 `Dockerfile`. Run `docker compose pull` to fetch the latest published image.
34- **`env_file: .env` (`required: false`)** — if a `.env` file exists its
35 values are injected into the container; if it's missing, OSIRIS still starts
36 with the keyless feeds.
37- **`ports: ${OSIRIS_PORT:-3000}:3000`** — the web UI. The container always
38 listens on 3000; the published **host** port is `OSIRIS_PORT` (default
39 `3000`). Set `OSIRIS_PORT` in `.env` to remap it, e.g. `OSIRIS_PORT=3005`
40 when 3000 is already in use — no need to edit the compose file.
41- **`restart: unless-stopped`** — survives reboots.
42
43Common commands:
44
45```bash
46docker compose pull # fetch latest published image
47docker compose logs -f # follow logs
48docker compose up -d --build # rebuild locally after pulling new code
49docker compose down # stop & remove
50```
51
52### Pull the prebuilt image from GHCR
53
54A prebuilt multi-arch-friendly image is published to the GitHub Container
55Registry, so you can run OSIRIS without building anything:
56
57```bash
58docker pull ghcr.io/aiacos/osiris:latest # or a pinned tag, e.g. :0.1.0
59docker run -d --name osiris \
60 -p 3005:3000 --env-file .env --restart unless-stopped \
61 ghcr.io/aiacos/osiris:latest
62```
63
64> If the package is **private**, authenticate first with a GitHub token that
65> has `read:packages`:
66> `echo $TOKEN | docker login ghcr.io -u <github-user> --password-stdin`.
67> Make it public from the package's **Settings → Danger Zone → Change
68> visibility** to allow anonymous pulls.
69
70### Plain `docker run`
71
72```bash
73docker build -t osiris:latest .
74docker run -d --name osiris -p 3000:3000 --env-file .env --restart unless-stopped osiris:latest
75```
76
77### Image details
78
79Multi-stage build on `node:22-alpine`, runs as a non-root user (`nextjs`,
80uid 1001), serves Next.js standalone via `node server.js` on port 3000.
81Final image is ~220 MB. Build excludes `node_modules`, `.next`, `.git` and the
82repo's large `*.diff` artifacts via `.dockerignore`.
83
84---
85
86## 2. CasaOS
87
88The compose file includes an `x-casaos:` metadata block (title, description,
89icon, port map, env descriptions) that plain Docker Compose ignores but CasaOS
90reads.
91
92**Install:**
93
941. On the CasaOS host, clone the repo somewhere persistent (e.g.
95 `/DATA/AppData/osiris`).
962. CasaOS dashboard → **`+`** → **Install a customized app** → paste the
97 contents of `docker-compose.yml`.
98 *(or simply run `docker compose up -d` from the cloned directory).*
993. OSIRIS appears on the dashboard with its icon, reachable on host port
100 `3000` (or whatever `OSIRIS_PORT` you set in `.env`).
101
102The app icon is the gold Eye-of-Horus mark in
103`public/casaos-icon.png` (512×512 PNG), referenced by the `icon:` URL in the
104metadata.
105
106> CasaOS stores imported compose files under `/var/lib/casaos/apps/`, so a
107> relative `build:` context may not resolve there. If importing the YAML
108> directly, either build/tag `osiris:latest` first
109> (`docker build -t osiris:latest /path/to/osiris`) or set `image:` to a
110> prebuilt registry image.
111
112---
113
114## 3. API keys & data sources
115
116Copy `.env.template` to `.env` and fill in only what you need.
117
118### What the code actually reads today
119
120| Variable | Purpose | Required for |
121|----------|---------|--------------|
122| `SCANNER_URL` | RECON scanner backend base URL (e.g. `http://scanner:7700`) | RECON toolkit (quick/ssl/headers/rdns/subdomains/tech/whois/geoloc/vuln) |
123| `SCANNER_KEY` | Shared secret; **must equal the backend's `OSIRIS_KEY`** | RECON toolkit |
124
125Without `SCANNER_URL`/`SCANNER_KEY` the RECON endpoints return `503` and the
126rest of OSIRIS works normally. Generate a key with `openssl rand -hex 32`.
127
128### Optional keys (reserved / for higher rate limits)
129
130These are documented for completeness and forward-compatibility. The current
131data routes use **keyless** public feeds, so these are not consumed yet — set
132them only if you extend the relevant route or hit rate limits.
133
134| Variable | Service | How to get it (all free) |
135|----------|---------|--------------------------|
136| `FIRMS_API_KEY` | NASA FIRMS active fires | Enter an email at <https://firms.modaps.eosdis.nasa.gov/api/map_key/> — the `MAP_KEY` is emailed instantly. Limit 5000 req / 10 min. |
137| `OPENSKY_CLIENT_ID` / `OPENSKY_CLIENT_SECRET` | OpenSky aviation | Create an account at <https://opensky-network.org/>, open **Account → API client**, create a client and copy id/secret. **OAuth2 only since March 2025** (username/password auth removed). |
138| `N2YO_API_KEY` | N2YO satellites | Register at <https://www.n2yo.com/login/register/>, then **Profile → generate API key**. Limit 1000 req / hour; key can't be regenerated. |
139| `AIS_API_KEY` | aisstream.io maritime | Sign up at <https://aisstream.io/>, create a key on the **API Keys** page. Used over `wss://stream.aisstream.io/v0/stream`. |
140
141> Keep `.env` out of version control — it is already in `.gitignore`. Only
142> `.env.template` (no secrets) is committed.
143
144### Optional runtime overrides
145
146| Variable | Purpose | Default |
147|----------|---------|---------|
148| `OSIRIS_TELEGRAM_CHANNELS` | Comma-separated list of public Telegram channel usernames (no `@`) to scrape for the **Telegram OSINT** map layer. Overrides the curated default set. | `osintdefender,insiderpaper,aljazeeraenglish,nexta_live,war_monitor` |
149| `OSIRIS_PORT` | Host port the compose file publishes (container itself always listens on 3000). | `3000` |
150
151### Keyless sources (no configuration needed)
152
153Aviation → `adsb.lol` · Satellites → `celestrak.org` (TLE) · Fires →
154NASA FIRMS open-data CSV · Earthquakes → USGS · Weather → NASA EONET · Space
155weather → NOAA SWPC · CVEs → NVD · News → public RSS / HLS streams · CCTV →
156public traffic-authority feeds · Crypto (BTC) → `blockstream.info` · Crypto
157(ETH) → `eth.blockscout.com` ([Blockscout](https://github.com/blockscout/blockscout)
158open-source explorer) · OFAC SDN sanctions → [OpenSanctions](https://www.opensanctions.org)
159mirror (CC-BY 4.0) · Telegram OSINT → public `t.me/s/<channel>` web preview.