@hasna/shortlinks 0.1.24 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -149,32 +149,28 @@ shortlinks domain buy new-short-domain.ai --dry-run
149
149
 
150
150
  This package does not install or call any removed `connect-*` packages.
151
151
 
152
- ## PostgreSQL Runtime
152
+ ## Storage modes
153
153
 
154
- Production serving can use a shortlinks-owned PostgreSQL database without any shared table-sync package:
154
+ The client resolves ONE `Store` from the environment there is no DSN on any client:
155
155
 
156
- ```bash
157
- export HASNA_SHORTLINKS_STORE=postgres
158
- export HASNA_SHORTLINKS_DATABASE_URL=postgres://shortlinks:password@db.example.com:5432/shortlinks
159
- export HASNA_SHORTLINKS_DATABASE_SSL=true
156
+ - **local** (default): on-box SQLite. Every command, MCP tool, and SDK call reads
157
+ and writes the local database.
158
+ - **self_hosted / cloud**: set `HASNA_SHORTLINKS_API_URL` + `HASNA_SHORTLINKS_API_KEY`
159
+ (and optionally `HASNA_SHORTLINKS_STORAGE_MODE`) to route every call to the cloud
160
+ `/v1` HTTP API with a bearer key. `self_hosted` and `cloud` are identical client
161
+ code; only the URL/key differ.
160
162
 
161
- shortlinks postgres status
162
- shortlinks postgres plan --schema-sql
163
- shortlinks postgres migrate
164
- shortlinks --store postgres serve --host 127.0.0.1 --port 8787 --default-host has.na
163
+ ```bash
164
+ # Route the client to the self-hosted cloud API (bearer key, never a DSN):
165
+ export HASNA_SHORTLINKS_API_URL=https://shortlinks.hasna.xyz
166
+ export HASNA_SHORTLINKS_API_KEY=hsk_...
167
+ export HASNA_SHORTLINKS_STORAGE_MODE=self_hosted
168
+ shortlinks doctor
165
169
  ```
166
170
 
167
- The canonical production runtime secret path is `hasna/xyz/opensource/shortlinks/prod/postgres`. Use the URL environment variables above rather than writing shared runtime config files into the shortlinks data directory.
168
-
169
- ## AWS Origin
170
-
171
- For an apex domain that needs stable A records, `infra/aws-ec2-user-data.sh` bootstraps a small EC2 redirect origin with:
172
-
173
- - `@hasna/shortlinks` installed through Bun
174
- - direct reads and click writes against the app-owned `shortlinks` PostgreSQL database
175
- - Caddy terminating HTTPS and proxying to `shortlinks serve`
176
-
177
- The script reads the connection settings from AWS Secrets Manager through the instance role; it does not contain secret values.
171
+ The cloud server (`shortlinks-serve`, run on ECS Fargate) is the only component
172
+ that holds a Postgres connection, and it opens its pool server-side through the
173
+ sanctioned storage kit — the raw RDS DSN is never distributed to clients.
178
174
 
179
175
  ## Development
180
176