somaro — manual for coding agents (v0) What it is: a place where a small app keeps running once put up. Static sites are served as files. Server apps run in a sandbox, sleep after 30 idle minutes and wake on the next request (the first visitor waits a moment). The only persistent path inside an app is /workspace; everything else is reset on restart. Everything under /workspace, whatever the file, is backed up off the machine every hour; SQLite there is the simplest database. Each app gets a public URL. Testnet hosts: a host may be a testnet, a place to try things and not to keep them. There every app is deleted, with its /workspace data, its variables and its backups, a fixed time after its first deploy (the host says how long: 24 hours on somaro's own). The proposal has a "testnet" line that says so; the deploy's result, "somaro status" and "somaro apps" say the app's date; "somaro passport" says what the host is. A redeploy does not move the date. The time starts at the first deploy that comes up: one that fails starts none, and until one has come up a failed deploy, "somaro env set" and "somaro status" say until when the name is held instead; an hour of fixing a build is not taken from the app's time. On a testnet that says so, a guardian moves the date (see the guardian below): the "testnet" line then names two times, and under the date of an app whose passport has no guardian the deploy's result and "somaro status" say "a guardian keeps it ...". There the apps of a passport with a guardian live the longer time from their first deploy. When the person presses the button, the dates of the apps the passport has move, and an app that is running is restarted once so that it reads its new date; an app deployed after that has the longer time from the start. Nothing else extends a date. After the date the name is free: deploy again and the app is made anew, empty, with a date of its own. A person who opens the app in a browser first gets a short notice from the host that says when the app is deleted and says that the app follows, and is then sent on to the app; a request that is not a person opening a page (curl, fetch, a webhook, an API's client) never gets it. A static site has its date and its notice like any app. These pages of the host are in Korean for a browser set to Korean and in English for every other: the notice, the page at an address no app has, and the page of an app that is coming back. An app in a container can read its date in the environment as SOMARO_EXPIRES_AT (RFC 3339, UTC); have it read it at each start and keep it nowhere, since a guardian moves it. When you hand someone the app's address on a testnet, tell them the date. A host that is no testnet says none of this, and its apps have no date. Hosts where an app is temporary until its passport is approved: a host that is no testnet may still give dates (production, somaro's own on mainnet). There only the apps of a passport its operator has not approved have one, and all of the above holds for them: the date, the notice, the held name, SOMARO_EXPIRES_AT. Such a host says "temporary" where a testnet says "testnet": the proposal's line, the key in GET /v1/health and in GET /v1/me (with "app_lifetime_secs", and in /v1/me "approved": true or false for the asking passport), and "somaro passport" says whether this passport is approved. The operator approves a passport (somaro admin allow --no-date); its apps lose their date at once, those up and those to come, and an app that is running is restarted once to read that. Tell the person you work for that an app lives the host's time from its first deploy until their passport is approved, and give them the passport ID (somaro passport prints it) to pass on to the operator, at the address the host names. Say it when you begin; it needs no answer, so go on with the deploy. Such a host may have a guardian keep a passport's apps instead (it says "kept_by": "guardian" beside "app_lifetime_secs"; somaro's own does). There nobody approves: the apps of a passport with a guardian have no date, and "approved" in /v1/me is true for it. Ask the person for a mail address (somaro guardian
, or the call in skill.md); when they press the button in the mail, the passport's apps lose their date at once, those up and those to come. A passport that gives its guardian up, or is released by it, has dates again: each app its first deploy's plus the host's time, a day from then at least. Tell the person, when you begin, that an app lives the host's time from its first deploy unless they verify their email; it needs no answer, so go on with the deploy. What the host keeps of a deploy: the host writes down each deploy with its passport, the app's name, the time, the address the request came from and the client's User-Agent, and it keeps the files that were uploaded, also after the app is removed, until newer uploads take their room. The host's operator can read them, to find an app that harms others and take it down. Files named like secrets are not uploaded (see Data) and an app's variables are stored sealed: neither is in that record. A secret in a file under another name is uploaded with the rest, and is. What the host keeps of what an app sends: for each app the host counts how many connections it opens outward, to which addresses and ports, and which of them its firewall dropped. It keeps the count and the addresses, not what was sent in them. It also counts how much CPU time, memory and network it uses and how many processes it runs. The host's operator can read the counts, to find an app that attacks others, scans a network, tries to send mail or mines. An app may use half a CPU and 128 processes. What is not here yet: the host is building paid plans (a fixed price for a month: more apps that stay awake, more room, the full picture of visits) and custom domains, and has planned domains an agent can buy (a host that sells them says so: "domains"."sold" in GET /v1/plans), and database administration (a history of a database, gone back to by the moment). None works today and no date or price is set: do not offer them. /skill.md has the list with each one's state, and /coming.json the same for a program. GET /v1/plans (unsigned) lists the tiers, what each would unlock, and whether this server sells them yet ("sold"). A passport its operator gave a plan sees it in GET /v1/me ("plan") and in "somaro passport", with its end; some days before the end "said" tells it, and the person should hear it from you. Where "sold" is true the list has "pay": the token, the network and the address a plan is paid to. A plan is bought by a payment and by nobody's signature: POST /v1/passports//plan?tier= answers 402 Payment Required with the price (x402 version 2); the same request with the payment in the PAYMENT-SIGNATURE header gives the plan for 30 days from then, or 30 days more where the passport has that tier. A host may take more than one token: "pay" then has "tokens", each with what a whole one pays in dollars (the host's word, following no market), and the 402 offers each. A dollar token is paid with the scheme "exact", its own transfer authorization; HPP with the scheme "upto", a Permit2 transfer the facilitator sends, for which the payer needs no ETH and no approval made before (its EIP-2612 permit goes with the payment). Whoever pays need not be the passport. "somaro pay " does it from a wallet's key file (SOMARO_WALLET), saying the price in every token first and paying only with --yes, in the host's first token or the one "--in " names: never pay for a person without their word. Nothing renews by itself and nothing is refunded. A person at a wallet in a browser pays at /pay/?plan=1 (the address without it is the passport's account: its plan, its domains and its receipts, for a browser signed in as its guardian): there a token with no authorization of its own (HPP) is sent by the wallet as a plain transfer, after the wallet signs a text that says which passport it is for, and a host whose "pay"."transfer" says "gas_covered" sends a wallet with no ETH the transfer's gas. A custom domain is a name the person already has, under which an app answers; a plan has a number of them. "somaro domain " (GET /v1/apps//domains) lists an app's and says whether this server serves them at all ("on"); most do not yet. Where it does, "somaro domain add " (POST the same path with {"domain":"..."}) answers with the one DNS record the person makes at their domain's provider, and "somaro domain " says when the name has arrived; "somaro domain rm " takes it away. With no plan, or over its number, the name's visitors are sent on to the app's own address. The app is told the name as its Host. Its own address answers as well, so a search engine finds the same pages twice: give each page a to the custom domain's address, or answer a Host that is not the custom domain with the header X-Robots-Tag: noindex. A domain bought through the host is another thing: the host registers a name for the person at its registrar, points it at itself and serves an app under it, with nothing for the person to set. A host sells them where "domains"."sold" in GET /v1/plans is true; a passport with a guardian has one, on any plan and on none. The person buys it, on the host's page; an agent finds the name and has the page's link mailed. Never ask the person for a name, an address or a phone for a domain, and never type them anywhere: who a domain is registered to goes from the person's browser to the registrar, the host takes none of it from an agent (a request that carries any is refused) and keeps none itself. "somaro domain quote [ ...]" (GET /v1/domains/quote?name=, signed, a name a call) says for each name whether it is free and the first year's price, the registrar's and the host's fee: that is the price to bring the person. A renewal is charged at the registrar's price at that time and the host's fee, is usually more than the first year, and is told to the person by mail before each renewal; "renew_usd_today" in the answer is what one would cost today, for a person who asks, and no promise of a later year's price. A taken name is said as taken and no more, so check a few and bring the person the free ones with their first year's prices. With the person's word for one, "somaro domain buy --app " (POST /v1/domain/link, signed, with {"name","app"}) has the host mail the passport's guardian a link: it signs the person's browser in, once and for half an hour, and opens the page with the domain, the app and the price there, where they type who the domain is registered to and pay from a wallet in the browser (the tokens paid by "exact"; HPP the token is not taken for a domain). A registered domain is not refunded. The registrar mails the registrant to confirm the address, and suspends a domain whose mail is not answered within 15 days. "somaro domain bought" (GET /v1/passports//domains) lists the passport's domains, each with its app or "parked", its end and its state, and any order that is paid and not done: one "not registered yet" is finished by the person entering the registrant on the page, with no second payment; one owed was paid and could not be done, and the host's operator settles it. Nothing renews by itself: the guardian is mailed 60, 30 and 7 days before the end, and "somaro domain renew " (POST .../domains//renew, 402 over x402 as a plan's is) says a year's price and with --yes pays from the wallet's key file (--in picks the token), or with no wallet has the page's link mailed. A year more is sold only before the domain's end: an ended domain stops answering, and the registrar brings it back only by a way and at a price of its own, for some weeks, which the person asks of the host's contact address. A bought domain is its passport's and not its app's: "somaro domain move --app " (POST .../domains//move with {"app"}) points it at another app of the passport, "somaro domain park " (POST .../domains//park) at none, and removing its app parks it, with its end kept. A service running on the person's machine can be shown at an app's address for a while, without putting it up, where the host says so ("links" in GET /v1/plans is an object, with what a link may take by the passport's standing: its life, links at once, bytes a second and a day, and whether a browser is shown the host's page first). "somaro link [--name ]" (the CLI's alone; the curl way has no link) prints the address and serves each request to it from the local port while the command runs: HTTP only, with WebSockets and streamed answers. It ends when the command stops, at the end of its life, or after a time with no request, and the address then answers 404 as a name with no app. Nothing is copied to the host or kept there. A browser is shown the host's page first, saying it is someone's own computer; a program gets the service's answer. To keep what a link shows, put the folder up as an app: the same name can be an app once the link has ended. An app keeps files (uploads, saved pages, images, video) in somaro files, object storage (S3-compatible), where the host says so ("files" in GET /v1/plans is an object, with what a passport's files may hold by its standing, over all its apps, and its largest file). At its start the app has AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL_S3 (/s3), AWS_REGION (auto) and S3_BUCKET (its name) in its environment; any S3 library takes them, with path-style addressing (boto3: Config(s3={"addressing_style": "path"}); JavaScript v3: forcePathStyle: true; Go v2: UsePathStyle). A maker who set AWS_* for an S3 of their own is given none of these. Put, get with ranges, head, list, copy, delete, multipart and presigned URLs work; a file is 16 MiB at most (5 MB with no verified email). A write is answered once the store holds it, sealed under the app's key; a read is fetched from the store. Files are private: the app reads them with its keys or hands out a presigned URL. One put with ACL public-read, or under the prefix public/, is public where the passport has a verified email, served to anyone at /f// (every app), and at the app's address /.somaro/files/ for an app with a server or a site with a date. An HTML, SVG or XML file is served as a download. Writes past a fair rate are slowed with S3's SlowDown (503) and Retry-After, which SDKs wait out by themselves; when the host is busy the rate is shared among passports by standing. A removed app's files go with it. "somaro files " (GET /v1/apps//files) prints the app's keys, for a migration from this machine with any S3 tool; the secret is a password. "somaro files ls [prefix] | put [key] | get [file|-] | rm " handles a few files by hand. An app's visitors can sign in with Google through the host, where the host says so ("login" in GET /v1/plans is true): nothing is registered at Google for the app, and it needs no library or secret. Link to /.somaro/login?next=/path on the app's own address. When the visitor comes back, every request of theirs has X-Somaro-User-Id (theirs at this app alone, stable), X-Somaro-User-Email, X-Somaro-User-Email-Verified ("true"), X-Somaro-User-Name (percent-encoded UTF-8) and X-Somaro-User-Picture; no X-Somaro-User-Id means nobody is signed in, and a visitor cannot send these headers themselves. To ask for sign-in on a page, redirect to that link when the header is missing. Sign out is a POST to /.somaro/logout?next=/path (a form with a button); it ends the sign-in at this app only, and the next sign-in there asks Google which account; to offer "use another account" at any time, link to /.somaro/login?next=/path&account=choose. A page's script reads GET /.somaro/me: 200 with the visitor, or 401. Sign-in lasts 7 days. The paths under /.somaro/ are the host's and never reach the app. Where the app runs on the person's computer there is no host: use a fixed test user when PUBLIC_URL is unset. An app with its own sign-in keeps it; to move, match its users by email address. The visitor is shown a page of the host's that names the app and says it is not somaro's; on a free app it waits a few seconds, which a plan takes away. An app deployed before the host had sign-in has it from its next deploy; a static site has it not. "somaro visitor " (POST /v1/apps//test-visitor, the app's passport's alone) answers {"cookie", "try", "visitor", "expires_at"}: the cookie signs a request to the app in as a test visitor of the host's making for 15 minutes, with X-Somaro-User-Test: true beside the other headers, so an agent tries the signed-in side without Google. What the host counts of an app's visitors: "somaro stats " (or GET /v1/apps//stats?since=7d) says how many pages were opened and by about how many different visitors, by day, with the pages, the sites they came from, utm_source, countries, devices, browsers and systems; crawlers, agents and tools are counted apart. So an app needs no third party's script to know its visits. A passport reads the short picture: the last 7 days, page views and visitors by day, the 5 top pages and referring sites ("full": false, and "more" says what else is counted). Everything is counted and kept for every app; the full picture is the paid plan's, which is not there yet, and until then the host's operator gives it to a passport. The host keeps the counts for 90 days and nothing of a visitor: no address, no user agent, no cookie, nothing of a query but utm_source. Visitors are told apart within a day by a hash that is dropped at once. An app in a container is counted by somaro-init, which stands before it (the app's own port and answers are as they were); one deployed before the host counted is counted from its next deploy, a static site too, and a worker has no visitors: the "note" of the answer says which of these an app is. The path /.somaro/visits with the host's key is the host's; without the key it is the app's like any other. The host counts what is asked of the server. A single-page app changes its pages in the browser and asks for none of them, so only the page a visit began on is counted. For such an app put one line in the page's HTML: The host answers that path itself (and POST /.somaro/v, where the script tells each route the visitor goes to): the routes are then page views of the same visitor. With data-hash on the tag the part after # is a route too. The script sets no cookie and keeps nothing in the browser; a route's query is not kept. An app that renders its pages on the server needs none of this, and one that has no script is counted as before. The "made with somaro" mark. A host may mark the pages of its free apps (its skill.md says whether it does): a small mark in the bottom right corner that leads to the host's site, with a link to report the app, and that a visitor closes for the page that is open (the next one has it again; nothing is kept in the browser). For it the host adds one line at the end of an HTML page a browser opens, and answers that path itself, at the app's own address. It is the one thing of an app's answer the host changes. A page is added to only when a browser says it is opening it as a page (Sec-Fetch-Dest: document), it answers 200 as text/html: the host asks the app for such a page unpacked, unpacks one the app packs all the same, and passes on as it is anything it cannot add to. An API answer, a file, a part of a page a script asked for, a program's request and a stream are never touched. The script draws the mark apart from the page's own styles and carries the route counting of the paragraph before, so a single-page app on such a host needs no line of its own. A passport with a plan has no mark and no line, within a minute of the payment for an app that runs; an app deployed before the host marked pages has none until its next deploy. Flow (always propose first): 1. somaro env set KEY=value if the app needs settings at its first start (works before the app exists; reserves the name) 2. somaro deploy shows what would happen; changes nothing on the server 3. read the proposal; fix warnings if any 4. somaro deploy --yes writes the generated files, uploads, builds, starts 5. somaro status / somaro logs when something is off Deploy flags: --name (default: the directory name), --always-on, --worker, --memory , --disk , --detach, --json, --trusted. The proposal's last line is the exact command to run next, flags included. Any command followed by --help prints its own usage lines. Without the CLI: an app goes up with curl and tar alone, and nothing is installed. The host's skill.md gives the commands, for a POSIX shell and for PowerShell, with its address in them; this is what they do. is the host's address. POST /v1/passports makes a passport that is a token. The answer is the text of a curl config file, given once: keep it as ~/.somaro//token, the server's name (somaro.ai): a token is good on the server that made it alone PUT /v1/apps/ its body a gzipped tar of the app's folder (curl -T): answers with the proposal as text and changes nothing on the server PUT /v1/apps/?yes the same archive: deploys, prints each step, and ends with "ok: is up at
" or with "failed:", the cause and the fix Every call reads the file with curl -K, so the token is never on a command line. The file is the passport, and what this manual says of looking after a passport holds for it: Never make a second token on a machine that has the file (the command in skill.md does nothing where it exists), never print it, paste it or commit it. A token goes with every request, so whoever reads the file or one request has the account; the CLI's passport is a key that never leaves the machine, for whoever wants that. A machine that uses both ways has two passports, and the apps of one are not the other's: choose one way and stay with it, or make them one by the address that guards the first (below: the second asks for it, the person presses the button, and both files are keys to it). Where a host lets in by invitation, the call that makes the token makes the passport, which waits: the file names its ID, the person sends that to the host's operator, and every call answers not_invited until it is added. On every kind of host the passport comes first: an archive sent with no passport, a proposal or a deploy, is answered "unsigned" and makes nothing. Look for a passport you have already before you make one (the file on this machine, and what an earlier project left). skill.md's steps do this in order. A passport (to the person, their "agentic passport") is the account that holds the apps, and the file on a machine (the CLI's key file, or curl's token file) is a key to it. A passport has one key or several: every machine an agent of the person works on can have one, and each deploys to, updates and removes the passport's apps. What a host counts by a passport (its apps, its dates, its guardian) it counts once, whatever the number of keys. POST /v1/guardian by the key that joins, with the address that guards the passport: the person presses the button in the mail, and the key is a key of that passport, which keeps its ID and holds what both held GET /v1/keys the passport's keys DELETE /v1/keys/ takes one away: a lost machine, an agent no longer used. Not the passport's one key. With the CLI: "somaro guardian
", "somaro passport keys" and "somaro passport remove "; "somaro passport" says the passport and this machine's key. So a second machine joins the passport the first has, and two passports become one: the one the address guards keeps its ID. A passport that has a guardian of its own gives that one up first ("somaro guardian --release", with the person's word). There is no code that joins a key. When "somaro passport" (GET /v1/me) says a key was added and it is not yours or your person's, take it away. A key that was taken away is served nothing: delete its file. A passport all of whose keys are lost is its guardian's to get back (below). The server detects what the app is as "somaro deploy" does on the machine, and the Dockerfile it writes for it stays on the server. Leave out of the archive what the app does not need to run (tar's --exclude): .git, node_modules and caches are dropped on the server in any case, and an archive that holds files named like secrets (see Data) is refused with their names and the --exclude to add; they have reached the server by then, and nothing of a refused archive is kept. The deploy's flags go in the address: ?memory=, ?disk=, ?always-on, ?worker, with ?yes or without. The rest, with the same file; these answer in JSON: GET /v1/apps as "somaro apps --json" GET /v1/apps/ as "somaro status --json" GET /v1/apps//logs?tail=100 GET /v1/apps//stats?since=7d as "somaro stats --json" PUT /v1/apps//env its body {"set": {"KEY": "value"}} or {"unset": ["KEY"]}, from a file outside the app's folder (--data-binary @file) DELETE /v1/apps/ removes the app, with its data GET /v1/me the passport's ID and its allowance POST /v1/guardian asks for a guardian, as a form: --data-urlencode "address=
" DELETE /v1/guardian gives the guardian up POST /v1/reports tells the operator of a fault of the host, as a form: --data-urlencode "text=", and -d app= -d job= when it is about one GET /v1/apps//db its SQLite databases, as "somaro db" GET /v1/apps//db/pull?path= a copy of one, as "somaro db pull": save it with curl's -o POST /v1/apps//backup a restore point now GET /v1/apps//backups the points POST /v1/apps//restore?point= /workspace as it was at the point Only the CLI looks at the folder before anything is sent, and asks an app that has no public address yet ("somaro curl"). Everything else in this manual is the server's and holds for both ways; where it names a command, the call above is its like. What the server keeps of an app (its data, its backups, its log) it gives to the app's passport by these calls: never add a route to the person's app to export its data, which would give it to anyone who finds the address. An app's name is its address, and one passport holds it. Without --name an app takes its directory's name. Where another passport holds that name on this host, the app gets it with a word after a dash (notes-otter). The word is your passport's: the same name at every deploy of that directory, so a later deploy updates the app. The proposal says the name and why; use that name as in every other command. A name given with --name is exact: where another passport holds it the deploy is refused ("error (name_taken)"), and the message says the name that is yours to use. The name of an app that is gone stays its passport's alone for some days (people still hold its address): you take your own back whenever you like, and another's is refused with the date it is free. A few names are the host's own (www, admin, login, status and the like: "error (name_kept)"); a directory called so gets the word after a dash as well. Your app's public address is in the environment as SOMARO_PUBLIC_URL (and as PUBLIC_URL unless you set your own). Use it to build absolute links. The Host header the app sees is internal. A request that came in by the app's address carries a proxy's headers: X-Forwarded-Host (the app's public host name), X-Forwarded-Proto (https or http, as the visitor came) and the visitor's address in X-Real-Ip and first in X-Forwarded-For. A framework told to trust its proxy (Express "trust proxy", Flask's ProxyFix, Django's SECURE_PROXY_SSL_HEADER) builds its links and reads the visitor from them. The host's own check that an app answers comes straight to it, with none of these headers. So an app that sends http on to https sends on only a request whose X-Forwarded-Proto is http: one that sends on every request without "https" there sends the check away too, and its deploy fails with http_error. Other people's apps live under the same parent domain as yours, and a browser lets any of them set a cookie for that parent, which it then sends to your app as well. So keep a login in a cookie nobody else can plant: name it with the __Host- prefix (__Host-session) and set it Secure, with Path=/ and no Domain. A browser takes such a cookie only from your app's own name. Never set a cookie with Domain= the parent, and do not trust one that lacks the prefix: another app may have set it. Two paths at an app's address never reach the app: the host answers them itself, mostly with a 404, and "somaro curl" gets the same. They are /_openrun and /_openrun_webhook, with all under them. Every other path is the app's. So an app serves its own OAuth documents, where an MCP server that signs people in is looked up: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource, with all under it. What deploy does with a directory: - Dockerfile present: used as is; the port comes from EXPOSE (else 5000). - package.json of a server: a Dockerfile is generated (node:24-alpine, npm install, npm run build if there is a build script, your start script, PORT=5000; Next.js with a plain "next start" runs from its standalone output). - requirements.txt or pyproject.toml: a Dockerfile is generated (python:3.12-slim, pip install; gunicorn or uvicorn when they are in the requirements, else "python app.py"; the module is app.py, main.py, server.py or wsgi.py, exposing "app"). gunicorn runs 2 workers. - go.mod: a Dockerfile is generated (built with Go 1.25, which fetches a newer toolchain itself when go.mod asks for one; cgo on; run on Debian as a non-root user with the source beside it in /app). The package built is the top directory, or the one command under cmd/. Read the port from PORT; a fixed port the code listens on (":8080") is used instead. - index.html only: a static site. - index.html beside a package.json that starts nothing (no start script, no "main", no server file): a front end. With a build script (Vite and the like) the static site is what the build wrote to dist/ or build/, under the folder's name. somaro does not run the build: run "npm run build" before each deploy, from the project's folder, not from dist/. Without a build script the folder is the site as it stands. - app.py, main.py or server.py and none of the above: a Python app with nothing to install, started with "python" and that file. No requirements.txt is needed for it. - Anything else (Rust, Ruby, PHP …): bring a Dockerfile that EXPOSEs the port the app listens on. After the first deploy the generated Dockerfile is in your directory and is yours to edit; detection does not run again while it exists (delete it to regenerate, e.g. after adding a second database file). A Dockerfile you wrote yourself is honored as is, USER included; use uid 1000 (or root) and write only under /workspace and /tmp. Redeploys: a *.db present locally is uploaded and seeds /workspace on the app's FIRST start only; later deploys never touch /workspace. Each redeploy starts a fresh container: "somaro logs" shows the output since the last deploy, across sleeps and wakes (each wake is a new start of the process). Wake after sleep takes about a second for a small app (longer for heavy ones). An app whose process dies while it runs (a crash, out of memory) is started again by the next visits: one of them may get "503" with "Retry-After: 1", the one after it gets the page. "somaro logs" shows why it died. Data (★ read this): the directory next to your code is READ-ONLY while the app runs. Files the app writes must live under /workspace (kept across restarts, 1 GB by default) or /tmp (cleared). Everything under /workspace is kept, whatever the file: the whole of it is backed up off the machine every hour ("somaro status" shows when it last was). somaro moves to /workspace and links back: SQLite files (*.db, *.sqlite) and data folders (uploads, data, storage, files, media) present at deploy time, the file in a Prisma schema's datasource, and a literal relative path in sqlite3.connect("x.db") / new Database("x.db"). A path built at run time cannot be detected: open it under /workspace yourself. The proposal lists what it found under "data". - Files named like secrets are left out of the upload, at any depth: .env and .env.*, .envrc, .dev.vars, *.pem, *.key, *.p12, *.pfx, *.jks, id_rsa and its kin, .npmrc, .netrc, .pypirc, .git-credentials, credentials.json, token.json, client_secret*.json, a service account's JSON, secrets.yaml/.json/.toml, *.tfvars, *.tfstate. The proposal names each one it found ("excluded"). That is a list of names and no more: everything else in the directory is uploaded, and .gitignore is deliberately not applied (a build may need what git does not keep). The proposal names what .gitignore names and the upload holds; a file that must stay home goes in .somaroignore. Settings reach the app as environment variables: "somaro env set KEY=value" or "somaro env set --from-file .env"; they are stored sealed and take effect at the app's next start. "somaro env " lists names only. - A home folder, or a folder containing .ssh/.aws, is refused. Your passport file is never uploaded wherever it lives. The port: somaro sets PORT (to 5000) and the app listens on it, on 0.0.0.0. A Dockerfile of your own that EXPOSEs another port gets that one in PORT. The network: an app reaches the internet on every port but 25, and so does a RUN step of its build. It does not reach the host it runs on, another app's container, a private network (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10) or cloud metadata (169.254.0.0/16). What it cannot reach gets no answer, not a refusal: the connection hangs until its own timeout, and nothing in the app's log says why. To send mail, call a mail service's HTTPS API or use its submission on port 587. To call another app of this host, call it by its public address. What an app sends out is bounded: a megabyte a second after a first eight, and 20 new connections a second (a packet that got no answer yet counts as one, so datagrams to a place that never answers do too). What is over is lost on the way, with nothing in the app's log: an upload slows down, and of a burst of connections some time out. What an app answers its visitors is not counted. A host's operator may set other numbers. A failure is told as soon as it is known, with its cause: a crash at start in seconds, an app that never answers after 90 s. deploy shows the most useful part of the log; "somaro logs " has all of it (use it when the shown lines are only a supervisor's noise, e.g. gunicorn's "Worker failed to boot": the real error is earlier). A redeploy that fails leaves the version deployed before it serving, and says so ("previous_serves" with --json); "somaro status" names that version's image, and its history the failure. A visitor of an app that cannot start is told only that it could not. build_failed the image did not build; the last log lines are shown crash_on_boot the process exited during start; its log is shown wrong_port it listens on another port than expected localhost_only it listens on 127.0.0.1 only readonly_write it wrote outside /workspace and /tmp (the root is read-only) out_of_memory it used more than its memory limit; --memory raises it http_error it answers GET / with a 5xx, or sends the host's check on to https; the app is routed only once / succeeds not_listening nothing answered within 90 s Four are the host's doing, not the app's. For all of them run the same deploy again; if it fails the same way again, tell the person you work for (the host needs its operator) and do not change the app for it: push_failed the host could not store the image it built engine_failed the host's engine did not take the app; its words are shown not_recorded the app was started and the host could not write that down cut the host stopped while the deploy ran and undid it: the app is what it was before ("somaro job " says so too) A log line naming a missing setting gets a hint to set it with somaro env. Sleep: server apps stop after 30 idle minutes and wake on the next request. The engine looks for idle apps every 30 minutes, so an app sleeps between 30 and 60 minutes after its last request; somaro status says when its last request was and the window it will sleep in, in UTC and in minutes from now. A sleep cannot be forced; a redeploy restarts the app at once. An app that must keep running (a websocket server, a scheduler) is deployed with --always-on; it never sleeps. An app that serves no web pages at all (a bot that keeps a connection open or polls, a queue consumer) is deployed with --worker: always on, and its URL answers "worker running" instead of failing the start check. An app that stays up needs an allowance: a passport may keep so many apps up at the same time, always on or a worker, and on most hosts that number is none unless the host's operator gave one. "somaro passport" says the number and which apps hold a place, on its line "stays up". Without a free place the deploy answers "error (stay_up)" and nothing was deployed; the proposal says the same before --yes. Then deploy without the flag (the app sleeps and wakes at its next request), free a place (somaro rm the app that holds it, or deploy that app again without the flag), or ask the host's operator for an allowance and give them the passport ID. Most apps need no place. A site or an API wakes at its request. A bot that is sent webhooks (Telegram's setWebhook, Slack's and GitHub's events, Discord's interactions endpoint) wakes at each one: deploy it without the flag. Only what must hold a connection open or act with nobody asking (a Discord gateway bot, a poller, a scheduler) needs --always-on or --worker. "awaiting restore" in somaro status, or "error (awaiting_restore)": the app's server was replaced, and the app's /workspace is still coming back from its backup (its image is then built again). The app is not started before that, and its address answers 503 with a page that says so. Asking for it (any command, a visit) puts it ahead of the apps nobody asks for: wait a minute and ask again. Nothing needs fixing in the app, and a deploy does not hurry it. "deep sleep" in somaro status: nobody asked for the app for long (the host sets how long: days on most hosts, hours on a testnet), so its /workspace was put away in its backup and the app left the host. Nothing is lost: the backup was checked against the app's files before they went. The app comes back as it was at its next request: a visit to its address, a deploy, or a command that needs its files (db, backup, restore, curl). status, logs and env do not wake it. Coming back takes some seconds, longer with many files. A host with room keeps the files beside the backup for a while, and the app is then back sooner; status says so, and nothing depends on it. A browser gets a page that counts the seconds and opens the app when it is back. What the host answers in the app's place carries the header X-Somaro-Wake (waking, failed or restoring); the app's own answer does not. Any other request (a webhook) is held for up to 25 seconds and then answered by the app itself; past that it gets 503 with Retry-After, and a sender that tries again is answered then. A command that could not wait long enough answers "error (awaiting_restore)" and says deep sleep: run it again in a moment. An app that stays up (--always-on, --worker) never goes to deep sleep. The host itself asks an app GET / to see that it answers 200: at each start (somaro's check, User-Agent "somaro-check/1", and the engine's), and about every two minutes while the app is awake (the engine's: it goes straight to the app, so it has no X-Forwarded-Host header, which every request that came in by the app's address has; its User-Agent is Go's default, "Go-http-client/1.1"). Keep GET / free of side effects: a visit counter there counts these checks as visits, and each one is a database write. Count on another route, or leave out a request that has no X-Forwarded-Host header or whose User-Agent starts with "somaro-check". Limits in the sandbox: 0.5 CPU, 256 MB (512 for Next.js), 128 processes, non-root (uid 1000), read-only filesystem except /workspace and /tmp. Write files only there. The host decides them: --memory and --disk choose a size within its bounds (refused with the code memory or disk beyond them), and --trusted, which removes the limits, is taken from the host's admins only (403 trusted). Account: a passport key at ~/.somaro/passport (or $SOMARO_PASSPORT), created on first use. Requests are signed with it; there is no token to copy into a chat, and the file is never uploaded. "somaro passport" shows the allowance (apps per passport, and how many of them may stay up). The server is $SOMARO_API where it is set, and else the address in ~/.somaro/server, which "somaro server
" writes once it has answered ("somaro server" alone says which server that is); a proposal names it in its first line, and says when it did not answer. The passport is the account of the person you work for, and looking after it is your work, not theirs. The host holds no copy and nobody can make the same key again: without the file the apps are still there, and you can no longer update or remove them. So: - Use the passport that is there for every deploy, and never make a second one. - Never delete, move or overwrite the file, and leave ~/.somaro alone when you clean up. - Never print the file, paste it into a chat, commit it or copy it into a project folder. The passport ID (pp_...) is not the key and may be shown. - When a command says "created your passport at ...", tell the person once, in a sentence, where the file is, and that copying that file is how they take their apps to another computer. A guardian is the person you work for, known to the host by a mail address they confirmed. It is how they are known again when this machine's key file is lost: their press adds a new key to their passport (see below). Ask before you give a host their address, and give only the one they tell you: it is theirs, and the host mails it. - "somaro guardian" says whether this passport has a guardian, and whether this host binds them at all (one that sends no mail does not). - "somaro guardian
" has the host mail that address a link. You are shown a number and never the link: tell the person the number. The mail and the page of its link show the same number, which is how they know the mail is about their agent and no other. - The mail is a few lines in one language, and you say which: "--lang ko" or "--lang en" (by curl, -d lang=ko), the one the person prefers. It is the language you speak with them; ask them when you are not sure. An ask that names none is refused, and no mail goes. - Nothing is bound until the person presses the button on that page. The link is good once, for a day; asked again, only the newest is. "somaro guardian" shows when it is done, and "somaro passport" the address from then on, masked (k***@gmail.com). - The press is theirs: never ask for the link or the mail's text, and never open a mailbox for it. - One address guards one passport: the person's agentic passport, the account that holds their apps here. When their address guards one already, your ask is for a key to it: the page of the mailed link tells them that the press lets this agent put up, change and remove that passport's apps, and lists them. After the press your key is a key of their passport, and what your key held before is the passport's too ("somaro passport" says which passport you are a key of now). So tell the person the number, and say what the press gives: it is their apps they open to you. - From the same mailed page the person sees the passport's keys and takes one away, and releases the passport from their address. A key that was taken away is served nothing ("key_removed"): delete its file, and ask anew if the person wants this machine back. A passport its guardian released is told so by "somaro guardian": its apps are temporary again, so say their dates to the person anew. - A passport with a guardian makes more apps than one with none (the refusal "allowance" says both numbers), and its apps are kept longer where the host says so. - One passport has one guardian. For another address it gives this one up first and asks again. - "somaro guardian --release" gives this passport's guardian up. It is the person's to say: ask them first. It needs no mail. The host then holds nothing of their address for this passport, and the address guards one passport fewer. The passport's apps are temporary again: the answer names each with its date, which is never later than the one it had and, where it had more, a day from now at least. Tell the person the dates. A guardian confirmed after that keeps the apps the longer time from their first deploy, as before, and no longer. - The host keeps the address while the passport has an app on it, and for 30 days after its last app is gone; then it forgets it, and the passport has no guardian until it asks again. The page of the link says the same. A person who wants it gone sooner tells you ("somaro guardian --release") or, with no agent at hand, asks the host's operator, who finds it by the address. - On a testnet that keeps a guardian's apps longer, say so when you ask the person for their address, with the two times: it is a reason of theirs to give it, and theirs to say no. - Put it to the person in their own language and by what it does: they verify their email by one button in a mail, and what that gives them. "Guardian" is this command's name, and the person need not learn it: do not pass the word on as it is. Say "verify your email" (in Korean 이메일 인증), and for the address's role "owner email" (in Korean 소유자 이메일), as the mail and its page do. When this machine's key file is lost and the passport has a guardian, a new key gets the passport back: - Look for ~/.somaro/passport first, and ask the person whether they kept a copy: a file that is found is copied here and nothing else is needed. - Otherwise run "somaro guardian
--lang " with the guardian's address, which the person tells you. Their address guards the passport, so the page of the mailed link asks them to add this agent; their press makes this machine's key a key of the passport, at once. Then take the lost machine's key away ("somaro passport remove "), or ask the person to on the same page. "error (not_invited)" means this host serves invited passports only, and this passport is not one yet. The host's operator invites a passport by its ID, and that is the only way in: give the person you work for the passport ID that "somaro passport" prints, to send to the host's operator (the message names the address), and try again once it is added. Keep the passport; a new one would have to be invited again. "error (rate_limited)" means this address or this passport sent more in a minute than the server takes; the message says in how many seconds to try again. Wait that long and repeat the command; do not loop without waiting. "error (busy)" means the host is taking as many uploads at once as it holds, from everyone, or is at other work on this app (another deploy of it, a restore of its files; the message says which), and "error (slow_body)" means an upload stopped arriving and the host gave up waiting for it. None of them changed anything, and none says that the app is broken: wait as long as the message says, or a few seconds, and run the same command again. If slow_body repeats, the connection is too slow for the upload: make it smaller with .somaroignore. "error (stopping)" means the host is being restarted and begins no work on an app (a deploy, a removal, a restore) until it is back, in a minute or a few. Nothing was changed. Wait a minute and run the same command again. "error (old_cli)" means this CLI is older than the host and signs its requests in a way the host no longer takes. Install the current one with the command the message gives, then run the same command again. The passport file and the apps stay as they are: do not make a new passport. "error (wrong_host)" means the request was signed for one host and reached another: something between the CLI and the host changed the name it was sent to. Check the server's address, in SOMARO_API or ~/.somaro/server (it is the host's own address, with nothing in front of it that renames it) and run the command again. "error (replayed)" means the host took this very request once already; a request is good once. Run the command again, which signs a new one. If the first one was a deploy, look at "somaro status " first: it may have been taken. "error (removing)" means an app of this name was removed and the host has not yet cleared what it held of it (its files, its variables); a name is given again only with nothing under it. It takes a few minutes at most: run the same command again then, or deploy under another name with --name. Nothing is wrong with the upload. "error (taken_down)" means the host's operator took the app down, for what it did or what it served. The message and "somaro status " give the time and the operator's reason. The app's address answers 403 with a page that says it was taken down, and the name takes no deploy until the operator puts it back; "somaro env set", "somaro curl" and a restore are refused the same way. The app's status, logs, database and backups are still yours to read, and "somaro rm" removes it. Do not deploy the same thing under another name: tell the person you work for what the reason says, and leave the rest between them and the operator. "error (blocked)" means the operator turned this passport or this address away from the host; the message gives the reason. Do not make a new passport to get round it: tell the person you work for what it says. "error (retired)" means the host handed what this passport held (its apps, their names and their backups) to another passport, on the word of its operator or of the passport's guardian (the message says which), and this one is served nothing more. Most likely the person you work for asked for it, and this machine still has the old file. The apps are deployed to with the passport that holds them now; copying that passport's file to ~/.somaro/passport on this machine is how this machine reaches them again. Do not make a new passport to deploy the same apps a second time: tell the person you work for what the message says. If they asked for nothing of the kind, it is theirs to take up with the operator. "error (guardian_off)" means this host binds no guardians: it sends no mail. Nothing is wrong and nothing is to be done; do not ask again. "error (address_form)", "address_role", "address_reserved", "address_throwaway" and "address_no_mail" mean the address is not one a host takes for a guardian, and the message says why: not an address, a shared one (info@, admin@), one of a domain kept for examples, a throwaway inbox, or a domain that takes no mail. No mail was sent. Ask the person for the address they read their own mail at; do not try spellings or guesses. "error (mail_bound)" means the host has sent its day's mails: of this passport (3 a day), to this address (3 a day that nobody answered: a mail whose button was pressed is not counted), on the asks from this machine's network address (10 a day, whatever passports ask), or of the whole host; the message says which, and the time after which to ask again (set it beside the app's date when you tell the person). Each is a mail in a person's inbox, so they are few. Ask the person to look for the mail they have, in the spam folder too, and ask again a day later if it is gone. Another spelling of the address or another passport gets no more. "error (guardian_bound)" means this passport has a guardian already, at another address (the message shows it masked). With the person's word, give that one up first ("somaro guardian --release") and ask again. "error (lookup)" and "error (mail)" mean the host could not ask whether the address's domain takes mail, or could not send the mail. Nothing was counted: run the same command again in a moment. When the message of "error (mail)" says the host's mail does not go out and that it is its operator's to mend, asking again soon changes nothing: tell the person that the host cannot mail them now, and try once more some hours later. "error (address_refused)" means the mail service did not take a mail to this address. Nothing was sent or counted. Read the address back to the person and ask them for it again; do not try spellings or guesses. "error (too_many_passports)" means this address made as many new passports today as the host takes from one address. A machine has one passport for every app it deploys, at ~/.somaro/passport: use the one that "somaro passport" shows, and do not make another. "error (record)" means the host cannot count just now what it bounds, and takes nothing new until it can: no new passport, no new app. The passport and the apps you have work as before. Try again in a few minutes: do not loop, and do not make a passport to get round it. "error (allowance)" means this passport has as many apps as one passport may have on this host ("somaro passport" says how many, "somaro apps" lists them). Nothing gives a passport more: remove an app that is not needed ("somaro rm --yes") and deploy again, or tell the person you work for. A new passport is not the answer: the person's apps would be under two keys, and the host counts an address's passports together. "error (host_full)" means the host has no room now: it has as many apps as it has room for, or its disk is nearly full. The message says which. Your apps run as they were. An app you already have still takes a deploy when it is apps the host is full of; when it is the disk, no deploy is taken. A name you hold with nothing deployed ("somaro env set" before a deploy, or a first deploy that failed) is not yet an app: it has no place until its deploy gets one. Tell the person you work for, and try again later: do not loop. "error (address_full)" means the passports first seen from your address have, together, as many apps as the host gives one address. Remove one that is not needed, or try again later; a new passport changes nothing. An upload has a size limit (the server says it; about 95 MB packed). Over it, "somaro deploy" stops before uploading and lists what weighs most in the directory. Name what the app does not need at run time (data dumps, media, build output) in a file .somaroignore at the top of the directory and deploy again. What an upload unpacks to has a limit of its own on the host, 1024 MB of files and 50000 files and directories: beyond either the host answers with the code too_large, and the way out is the same. One pattern a line, "#" for a comment: dump.sql a file or directory of that name, at any depth data/ a directory of that name, at any depth *.mp4 "*" stands for any part of one name /build from the top of the directory only docs/big/ a path with "/" inside is from the top too The other forms of .gitignore ("!", "**", "?", "[..]") are not read: a line in one of them is refused with its number and nothing is uploaded. The proposal says how much the file leaves out. .git, node_modules, .next, .venv and caches are never uploaded, with or without it. "no matching app found" (a 404 at an app's address) is the host's answer for an address no app serves. Check, in this order: 1. The name and the address: "somaro status " (by curl, GET /v1/apps/) gives the app's url. A name another passport had first is given a word of yours (notes-otter): use the address it gives. 2. The app's state and date there. On a testnet an app past its date is deleted and is not listed. A deploy that has not come up yet has no container: wait for its job. 3. Listed, and its last deploy said ok: that is the host's fault. Deploy once more; if the address still says it, report it (below). A fault of the host, not of the app: a deploy that says ok while the address answers something else, an answer this manual does not explain, one of the host's four statuses above twice in a row. Tell the host of it: "somaro report "" [--app ] [--job ]" (by curl, the call above). Say what was run, what came back and what was expected, in a few sentences: 4000 bytes at most, five reports a day. Put no secret in it, and nothing of the person's that the fault does not need. Tell the person that you sent it, and its number. The operator reads it; no answer comes back through the host, so go on by what this manual says and do not wait for one. A fault in the app's own code is not one to report. Checking an app without its public address (or while it is pending): "somaro curl [path] [-X POST -d body]" sends one request through somaro and prints the status and body; it wakes a sleeping app. The app gets it as it gets a visitor's, with the User-Agent "somaro-curl/1". The body's Content-Type is application/json when it looks like JSON; -H says another. Other commands: somaro apps · status · logs [--tail N] · env | env set | env unset · rm --yes (removes the app, its /workspace data and its variables) · job · db · db pull · backup · backups · restore --yes · restart · passport · guardian [
] [--lang ] · guardian --release · passport keys | passport remove · report "" · server [
]. "somaro env set" on a running app applies at its next start: "somaro restart " (by curl, POST /v1/apps//restart) starts it again now with what it has (its image, its variables), with no deploy. It waits up to 90 s for the app to answer, and when it does not, gives the last lines of its log. A static site has nothing to restart. Backups: the whole of /workspace, every file and not only the databases, is copied off the machine as one snapshot taken at an instant: every hour unless the host says otherwise, and not when nothing was written since the last one. Nothing to set up. A SQLite database comes back from one as it would after a power cut at the snapshot's instant: every transaction committed before it is there, whole. The backups serve two things. Keeping the data is the host's work and asks nothing of you. If the machine and its disk are lost, the app comes back from its latest backup, so the writes since then (an hour's at most) can be lost with it. "somaro status" has the line: "backup /workspace is backed up off the host every hour · last