@hasna/shortlinks 0.1.24 → 0.2.1

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
@@ -114,6 +114,12 @@ shortlinks domain add go.example.com --provider cloudflare
114
114
 
115
115
  Generated links use the default domain unless `--domain` is passed.
116
116
 
117
+ Remove a domain (this also deletes all of its links and clicks):
118
+
119
+ ```bash
120
+ shortlinks domain remove go.example.com
121
+ ```
122
+
117
123
  ## Cloudflare
118
124
 
119
125
  Create a dry-run plan:
@@ -149,32 +155,28 @@ shortlinks domain buy new-short-domain.ai --dry-run
149
155
 
150
156
  This package does not install or call any removed `connect-*` packages.
151
157
 
152
- ## PostgreSQL Runtime
158
+ ## Storage modes
153
159
 
154
- Production serving can use a shortlinks-owned PostgreSQL database without any shared table-sync package:
160
+ The client resolves ONE `Store` from the environment there is no DSN on any client:
155
161
 
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
162
+ - **local** (default): on-box SQLite. Every command, MCP tool, and SDK call reads
163
+ and writes the local database.
164
+ - **self_hosted / cloud**: set `HASNA_SHORTLINKS_API_URL` + `HASNA_SHORTLINKS_API_KEY`
165
+ (and optionally `HASNA_SHORTLINKS_STORAGE_MODE`) to route every call to the cloud
166
+ `/v1` HTTP API with a bearer key. `self_hosted` and `cloud` are identical client
167
+ code; only the URL/key differ.
160
168
 
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
169
+ ```bash
170
+ # Route the client to the self-hosted cloud API (bearer key, never a DSN):
171
+ export HASNA_SHORTLINKS_API_URL=https://shortlinks.hasna.xyz
172
+ export HASNA_SHORTLINKS_API_KEY=hsk_...
173
+ export HASNA_SHORTLINKS_STORAGE_MODE=self_hosted
174
+ shortlinks doctor
165
175
  ```
166
176
 
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.
177
+ The cloud server (`shortlinks-serve`, run on ECS Fargate) is the only component
178
+ that holds a Postgres connection, and it opens its pool server-side through the
179
+ sanctioned storage kit — the raw RDS DSN is never distributed to clients.
178
180
 
179
181
  ## Development
180
182