.env. The install writes it for you:
Terminal
.env
The site’s slug: the
acme in its key, fsk_acme_…. A key filed under another slug is refused,
naming the right one.The site’s public origin:
https:// and the host it answers on, with no path, query or credentials.
A redirect is never followed; plain http:// reaches only localhost or a private service name.fsk_<site>_<key id>_<secret>, as the site showed it. An empty value is refused, never taken as the
public.fss_…, when the key signs. With a secret, the client signs every request it can, uploads by their
SHA-256. Signing requests lists which requests must be signed.Or keep the key in your database
The key and signing secret encrypted in a table the package ships, replaced without touching
.env.The default site
Attract::x() reaches the default
The site
FETCHSKI_ATTRACT_SITE names, or, when that is unset, the one site configured (with the
key in the database, the table’s one row).Attract::site('slug') reaches any other
Its client is made once per slug.
No default, no slug: a clear error
No default site: set FETCHSKI_ATTRACT_SITE, or call Attract::site('<slug>').More sites
- By hand
- From the attract_api_keys table
List them in Leave
config/fetchski-attract.php, beside the env one:config/fetchski-attract.php
api_key out for a public site (the env site always needs its key). api_signing
(none, writes or all) is optional: it only has the client refuse what the key can’t send.Checked at boot, and on demand
At boot, every entry must build anddefault must name a configured site. The first mistake throws
one SiteConfigurationError saying what to fix. (Skipped in unit tests, and with no sites.)
On demand, run the same check, then a call to the site: reachable, the key accepted, and the
clocks within a minute (signatures allow five). It exits 1 on any failure:
Terminal
Terminal
The package’s settings
Next: calling the API
Arguments, answers, lists, jobs and uploads.