6 Commits
Author SHA1 Message Date
trentlarson a93a46ba39 fix version in package-lock 2026-08-30 11:08:54 -06:00
Jose Olarte IIIandCursor 9c7c7fa271 bump version to 0.1.4 and add to CHANGELOG
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 15:49:28 +08:00
jose 76d3447d78 Merge pull request 'chore: rename FCM_TOKEN_DATA_DIR env var to NOTIFY_DATA_DIR' (#4) from data-dir-rename into master
Reviewed-on: #4
2026-08-07 06:26:36 +00:00
Jose Olarte III 6e4e1e7f1b chore: rename FCM_TOKEN_DATA_DIR env var to NOTIFY_DATA_DIR
Align the data-directory env name with notify.sqlite; default path remains ./data.
2026-08-04 17:31:14 +08:00
trentlarson a45150e25f bump version to 0.1.3 and add to CHANGELOG 2026-07-30 20:21:03 -06:00
jose d8989f587e Merge pull request 'Convert JSON storage to SQLite' (#3) from sqlite-storage into master
Reviewed-on: #3
2026-07-29 11:40:59 +00:00
6 changed files with 26 additions and 16 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ PORT=3003
# Directory for the SQLite FCM registration database (default: ./data).
# Creates notify.sqlite (plus -wal/-shm while the process is running).
# FCM_TOKEN_DATA_DIR=./data
# NOTIFY_DATA_DIR=./data
# Set to "test-local" to bypass ethr JWT expiry verification in local dev only.
# NODE_ENV=test-local
+10
View File
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.1.4] - 2026.08.07
### Changed
- Renamed `FCM_TOKEN_DATA_DIR` env var to `NOTIFY_DATA_DIR`
## [0.1.3] - 2026.07.30
### Changed
- Persistence changed from file to SQLite
## [0.1.2] - 2026.07.16
### Added
- Validation via Endorser service, with new ENDORSER_URL variable
+11 -11
View File
@@ -13,7 +13,7 @@ Here is one way to generate the contents: `cat your-downloaded-key.json | jq -c
Optionally set `ENDORSER_URL` if you are not using the default production Endorser API (`https://api.endorser.ch`).
Optionally set `FCM_TOKEN_DATA_DIR` if you want the SQLite database somewhere other than `./data`.
Optionally set `NOTIFY_DATA_DIR` if you want the SQLite database somewhere other than `./data`.
```bash
pnpm install
@@ -22,7 +22,7 @@ pnpm run dev
The server starts on `http://localhost:3003` (or the port in `PORT`). Hot-reloads on file changes.
On first use, the service creates `FCM_TOKEN_DATA_DIR` (default `./data`) and the SQLite file `notify.sqlite` with the required schema.
On first use, the service creates `NOTIFY_DATA_DIR` (default `./data`) and the SQLite file `notify.sqlite` with the required schema.
### Authentication
@@ -38,11 +38,11 @@ Set `NODE_ENV=test-local` in `.env` to bypass ethr JWT *expiry* verification dur
| Path | Description |
|---|---|
| `{FCM_TOKEN_DATA_DIR}/notify.sqlite` | Primary SQLite database (default dir: `./data`) |
| `{FCM_TOKEN_DATA_DIR}/notify.sqlite-wal` | WAL journal (present while the process is running) |
| `{FCM_TOKEN_DATA_DIR}/notify.sqlite-shm` | Shared-memory file used with WAL mode |
| `{NOTIFY_DATA_DIR}/notify.sqlite` | Primary SQLite database (default dir: `./data`) |
| `{NOTIFY_DATA_DIR}/notify.sqlite-wal` | WAL journal (present while the process is running) |
| `{NOTIFY_DATA_DIR}/notify.sqlite-shm` | Shared-memory file used with WAL mode |
`FCM_TOKEN_DATA_DIR` defaults to `./data` (relative to the process working directory). The `data/` directory is gitignored.
`NOTIFY_DATA_DIR` defaults to `./data` (relative to the process working directory). The `data/` directory is gitignored.
### Schema (high level)
@@ -62,11 +62,11 @@ There is **no automatic migration** from the old JSON file (`fcm-tokens.json`).
### Backup
Persist or back up the SQLite files under `FCM_TOKEN_DATA_DIR`:
Persist or back up the SQLite files under `NOTIFY_DATA_DIR`:
1. Prefer stopping the service, then copy `notify.sqlite` (and any `-wal` / `-shm` sidecars if present).
2. Or, while the service is running, copy **all three** files (`notify.sqlite`, `-wal`, `-shm`) together so the backup stays consistent under WAL mode.
3. For Docker, mount a volume at the data directory (or set `FCM_TOKEN_DATA_DIR` to a mounted path) so registrations survive container recreation.
3. For Docker, mount a volume at the data directory (or set `NOTIFY_DATA_DIR` to a mounted path) so registrations survive container recreation.
## Production
@@ -77,7 +77,7 @@ pnpm install --prod
pnpm start
```
Ensure `FCM_TOKEN_DATA_DIR` points at a durable location (or accept the default `./data` next to the process cwd).
Ensure `NOTIFY_DATA_DIR` points at a durable location (or accept the default `./data` next to the process cwd).
Or with Docker:
@@ -88,7 +88,7 @@ docker run --env-file notify-wakeup-api.env -p 3003:3003 \
notify-wakeup-api
```
Mount a volume over `/app/data` (or whatever path you set with `FCM_TOKEN_DATA_DIR`) so the SQLite database is not lost when the container is replaced.
Mount a volume over `/app/data` (or whatever path you set with `NOTIFY_DATA_DIR`) so the SQLite database is not lost when the container is replaced.
Required environment variables:
@@ -97,4 +97,4 @@ Required environment variables:
| `FIREBASE_SERVICE_ACCOUNT_JSON` | Inline service account JSON (one line). If unset, falls back to Application Default Credentials. |
| `PORT` | HTTP port (default: `3003`). |
| `ENDORSER_URL` | Endorser API base URL used for auth checks on register/refresh (default: `https://api.endorser.ch`). |
| `FCM_TOKEN_DATA_DIR` | Directory for the SQLite database file `notify.sqlite` (default: `./data`). |
| `NOTIFY_DATA_DIR` | Directory for the SQLite database file `notify.sqlite` (default: `./data`). |
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "notification-wakeup-service",
"version": "0.1.2",
"version": "0.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "notification-wakeup-service",
"version": "0.1.2",
"version": "0.1.4",
"dependencies": {
"@peculiar/asn1-ecc": "^2.7.0",
"@peculiar/asn1-schema": "^2.7.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "notification-wakeup-service",
"version": "0.1.2",
"version": "0.1.4",
"private": true,
"type": "module",
"packageManager": "pnpm@11.4.0",
+1 -1
View File
@@ -3,7 +3,7 @@ import path from "node:path";
import Database from "better-sqlite3";
const dataDir =
process.env.FCM_TOKEN_DATA_DIR ?? path.join(process.cwd(), "data");
process.env.NOTIFY_DATA_DIR ?? path.join(process.cwd(), "data");
const dbFile = path.join(dataDir, "notify.sqlite");
const SCHEMA_SQL = `