Προγραμματιστές → Διακομιστές εφαρμογών

App Server API

Εκτελέστε την εφαρμογή σας σε έναν NameOcean App Server και διαχειριστείτε την μέσω κώδικα: κάντε push για deploy, επανεκκινήστε τις εφαρμογές, διαβάστε τα αρχεία καταγραφής τους, φυλάξτε τα μυστικά σε μεταβλητές env και δημιουργήστε ή επαναφέρετε αντίγραφα ασφαλείας ολόκληρου του διακομιστή.

Deploy με git

Κάθε App Server διαθέτει ένα αποθετήριο git στο /root/app. Ένα push γράφει εκεί τον κλάδο που στάλθηκε και εκτελεί το .nameocean/deploy.sh, εφόσον υπάρχει στο έργο σας. Το nameocean deploy κάνει όλη τη διαδικασία:

nameocean
$ nameocean deploy 3f9a1c2e
Remote nameocean → ssh://root@3f9a1c2e.nameocean.org:2152/root/app (added)
Pushed main to nameocean (3f9a1c2 Fix checkout)
Pushed main to origin
Restarted 2 apps, nginx reloaded: web running, worker running
  1. Προσθέτει ένα git remote με όνομα nameocean για τον διακομιστή, αν δεν υπάρχει ήδη στο έργο.
  2. Κάνει push τον τρέχοντα κλάδο στο αποθετήριο του διακομιστή.
  3. Τον στέλνει και στο δικό σας remote του έργου (το upstream ή το origin), εκτός αν δώσετε --no-origin.
  4. Επανεκκινεί όλα τα προγράμματα του supervisor και φορτώνει ξανά το nginx, έπειτα καταγράφει το deploy (POST /servers/{server}/deploys) και στέλνει ένα συμβάν server.deployed.

Το push χρησιμοποιεί το κλειδί SSH σας. Αν ο διακομιστής δεν το γνωρίζει ακόμη: nameocean servers ssh-keys add 3f9a1c2e (διαβάζει το ~/.ssh/id_ed25519.pub). Ένα απλό git push κάνει επίσης deploy των αρχείων· καλέστε έπειτα το POST /servers/{server}/deploys για να επανεκκινήσετε τις εφαρμογές.

Endpoints

Δικαιώματα servers:read και servers:write· η δημιουργία διακομιστή απαιτεί επίσης billing:write. Το {server} είναι το id ή το προεπιλεγμένο domain. Όλα βρίσκονται στην τεκμηρίωση του API.

GET /servers/plans · POST /serversΠρογράμματα και τιμές· δημιουργία διακομιστή (η πρώτη απάντηση είναι η τιμή, μετά στείλτε confirm: true). Το δωρεάν πρόγραμμα διατίθεται μία φορά ανά λογαριασμό, απαιτεί κάρτα στον λογαριασμό και είναι δωρεάν για 12 μήνες, μετά μεταφέρεται στο Starter.
DELETE /servers/{server}Delete the server for good (container, disk and data; billing stops). Without "confirm": true it answers what is lost. CLI: nameocean servers delete 3f9a1c2e --yes
POST /servers/{server}/start · stop · restartΕκκίνηση, διακοπή ή επανεκκίνηση του διακομιστή
GET /servers/{server}/apps · POST …/reloadΠρογράμματα supervisor και η κατάστασή τους· επανεκκίνηση όλων και επαναφόρτωση του nginx
GET /servers/{server}/logs?app=web&lines=200Οι τελευταίες γραμμές εξόδου μιας εφαρμογής ή app=nginx
GET /servers/{server}/metrics?period=dayCPU, memory and disk usage over time (hour, day, week or month), as on the dashboard's Overview tab. MCP: server_metrics
GET · PATCH /servers/{server}/envΜεταβλητές env που λαμβάνει κάθε εφαρμογή· οι εφαρμογές επανεκκινούνται μετά από αλλαγή
GET · POST · DELETE /servers/{server}/ssh-keysΚλειδιά που μπορούν να συνδεθούν και να κάνουν push
GET · POST /servers/{server}/backups · POST …/backups/restoreΛίστα αντιγράφων ασφαλείας, άμεση δημιουργία αντιγράφου, επαναφορά ενός στον διακομιστή
POST /servers/{server}/git · GET · POST …/deploysΠροετοιμασία του προορισμού push· το commit που έγινε deploy και το ιστορικό deploy
POST /servers/{server}/deploys/{id}/rollbackBack to a kept release (servers created since 30 November 2026 keep the last 5; deploys with restorable: true), with no build and no downtime. Migrations of newer deploys are not undone. Releases and rollback
POST /servers {"repo"} · GET · POST /servers/{server}/sourceCreate a server that deploys a git repository as soon as it is up, then update it from that repository. Deploy to NameOcean button
GET · POST /servers/{server}/previews · GET · POST · DELETE …/previews/{slug}Previews: a branch pushed to the server runs next to the live site at its own address (servers created since 30 November 2026). Previews
GET /servers/{server}/stack?preview=1Build detection: what the last deploy detected and did (stack, commands, whether supervisor.conf and nginx.conf are NameOcean's or yours); preview runs it on the code on the server now, changing nothing. What is detected
GET /github/installations · GET …/installations/{id}/reposGitHub accounts where the NameOcean app is installed (and install_url to add one); the repositories it can see
GET · PUT · PATCH · DELETE /servers/{server}/github · POST …/github/deployConnect a GitHub repository: every push to its branch deploys the server (fetch, deploy.sh, restart). Change the branch or auto-deploy, disconnect, deploy now
GET /apps · POST /servers {plan, app}Εφαρμογές ενός κλικ (WordPress, n8n, Ghost…) και τα πακέτα που τους ταιριάζουν· δημιουργήστε έναν διακομιστή που εκτελεί μία από αυτές
GET · PATCH /servers/{server}/appΗ έκδοση, η κατάσταση και η διαθέσιμη ενημέρωση της εφαρμογής· ενεργοποιήστε ή απενεργοποιήστε τις νυχτερινές αυτόματες ενημερώσεις
POST /servers/{server}/app/update · restart · retryΕνημέρωση (πρώτα αντίγραφο ασφαλείας, επαναφορά αν δεν ξεκινήσει), επανεκκίνηση ή νέα προσπάθεια μιας αποτυχημένης εγκατάστασης
GET /servers/{server}/app/logs · …/app/credentialsΤα αρχεία καταγραφής του container της εφαρμογής· τα στοιχεία σύνδεσης διαχειριστή, όπως διαβάζονται από τον διακομιστή

Μεταβλητές env

curl
$ curl -X PATCH https://nameocean.net/api/v1/servers/3f9a1c2e/env \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" \
    -d '{"set": {"DATABASE_URL": "postgres://app@127.0.0.1/app"}, "unset": ["DEBUG"]}'

Φυλάσσονται μόνο στον διακομιστή, στο /root/conf/env, ποτέ στη βάση δεδομένων μας. Τις λαμβάνουν τα προγράμματα του supervisor, οι συνεδρίες SSH και το .nameocean/deploy.sh. Η ανάγνωσή τους απαιτεί servers:write, και το AI μέσω MCP βλέπει τα ονόματά τους, όχι τις τιμές τους.

Outbound port 25 is closed on every server: servers share their host's address, so direct SMTP from one would get all of them blocklisted. Send mail through a provider or NameOcean transactional email on port 465 or 587.

Συμβάντα

Τα Webhooks μπορούν να εγγραφούν στο server.*: server.created, server.started, server.stopped, server.restarted, server.restore.started και server.deployed (με το commit και την πληροφορία αν οι εφαρμογές ξεκίνησαν).

When an app crashes, the server says so: NameOcean's event listener (a supervisor event listener, /usr/local/bin/nameocean-events, installed on every app server; it doesn't change your programs) reports a program that exits unexpectedly as server.app_crashed (supervisor restarts it) and one supervisor gave up on as server.app_down, both with the app's name and the last 50 lines of its log, so a coding agent can start fixing it right away. Repeats within 10 minutes are counted, not sent again. The history is in GET /servers/{server}/crashes (30 days), nameocean servers crashes and the MCP tool list_app_crashes.

GitHub connect sends server.github_connected and server.github_disconnected (with a reason: disconnected, or GitHub access lost), and its deploys are server.deployed with source: "github" and the pusher in actor.

Οι εφαρμογές ενός κλικ στέλνουν app.*: app.install.started, app.installed, app.install.failed, app.updated και app.update.failed.

Turn it on and AI agents can search the server's site with one request, GET /.well-known/search?q=… on each of its domains, instead of crawling page after page. NameOcean crawls the public pages through the server's own edge (sitemaps from robots.txt or /sitemap.xml, else links from the home page, depth 3), respects robots.txt, Content-Signal: search=no and noindex, and crawls again every day. The edge answers the path, so the app needs no change. Free, up to 500 pages per server.

The database is never read: only public pages are searchable, plus documents you push yourself, for content the crawler can't see (pages rendered by JavaScript, data behind a form). Pushed documents count towards the 500 pages and a crawl never removes them.

curl
$ curl -X PUT https://nameocean.net/api/v1/servers/3f9a1c2e/search \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" -d '{"inject_tags": true}'
$ curl -X POST https://nameocean.net/api/v1/servers/3f9a1c2e/search/documents \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" \
    -d '{"documents": [{"url": "https://example.com/menu", "title": "Menu", "text": "# Menu\n\nRye bread ..."}]}'
$ curl -s --get https://example.com/.well-known/search --data-urlencode "q=opening hours"

The answer is Markdown passages with their page URLs, best first (Accept: application/json or format=json for JSON); limit (1-50) and lang are optional, and HTTP QUERY with the query as the body works too. It is the same contract as Cloudflare's Search for Agents. With inject_tags the edge also adds the four <meta name="agent:…"> discovery tags to the app's HTML pages (those pages then pass through the edge uncompressed). If the app already answers /.well-known/search itself, turning it on answers 409 endpoint_exists; send force: true to answer it at the edge anyway. Endpoints: GET|PUT|PATCH|DELETE /servers/{server}/search, POST …/search/reindex, GET|POST|DELETE …/search/documents, GET …/search/query?q=; events server.search.indexed and server.search.failed. The crawler identifies itself as NameOcean-AgentSearch/1.0.

Database with point-in-time recovery

One switch gives a server's PostgreSQL continuous backups: every change is archived within a minute to NameOcean's backup server, plus a nightly backup, so the database can go back to any second of the last 7 days after a bad DELETE, a broken migration or a wrong command. Free. If the server has no database yet, NameOcean creates the cluster, an app role and database and sets DATABASE_URL; an existing PostgreSQL is kept as it is (PostgreSQL restarts once to turn on archiving). Only this server's own key reaches its backup repository, and the repository has a size limit (twice the server's disk, at least 10 GB).

Restore as a copy (default): the database as it was at that second starts next to the live one on 127.0.0.1:5433, with the same roles and passwords as then, so you take back the rows you need while the site keeps running. Or in place: the live database goes back to that second, the apps are stopped meanwhile, and the data directory before it stays on the server in /var/lib/pgsql/data.before-restore.

terminal
$ nameocean servers db on 3f9a1c2e
$ nameocean servers db restore 3f9a1c2e --time 2026-12-01T09:30:00Z     # a copy on port 5433
$ ssh -p 2xxx root@3f9a1c2e.nameocean.org "psql -h 127.0.0.1 -p 5433 -U app app -c 'select ...'"
$ curl -X POST https://nameocean.net/api/v1/servers/3f9a1c2e/database/restore \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" \
    -d '{"time": "2026-12-01T09:30:00Z", "mode": "replace"}'

Endpoints: GET|PUT|DELETE /servers/{server}/database, POST|DELETE /servers/{server}/database/restore; MCP tools get_server_database, enable_server_database, restore_server_database, drop_database_copy, disable_server_database; CLI nameocean servers db show|on|off|restore|drop-copy; events server.database.ready, .failed, .backup_failed, .restored, .restore_failed. On the server, nameocean-db info shows the backups. Not for HA pairs (they have their own replication).

Protection: edge cache, Under Attack mode, blocked IPs

Every server's sites are behind NameOcean's edge, which always limits requests per IP (20 per second), cuts slow clients, bans scanners and brute-force sources (CrowdSec) and protects against SYN floods. Three switches per server go on top, in the dashboard's Protection tab, the API, the CLI and MCP. Changes reach both edge hosts within a minute.

  • Edge cache (off by default, free): the edge keeps the responses the app marks cacheable (Cache-Control: public, max-age=…, s-maxage or Expires) and answers them without the app. Responses with Set-Cookie, private or no-store, and requests with an Authorization header, always go to the app. X-Cache: HIT|MISS|EXPIRED|STALE says what happened; while the app is down a cached copy is served. Purge everything or single URLs after a deploy. The cache is on the two edge hosts in Germany: it takes load off the app, it is not a worldwide CDN.
  • Under Attack mode: for a flood. The limit per IP drops to 10 requests per second (burst 60) for the server's sites, and a browser (a GET that asks for text/html) sees a short check page once: a second or two of JavaScript, then a signed cookie for 12 hours. API clients and AI agents skip the page and only get the lower limit. Search engines get a temporary 503 while it is on. Events server.under_attack.enabled and server.under_attack.disabled.
  • Blocked IPs: up to 500 addresses or networks (IPv4 down to /8, IPv6 down to /16) the edge answers with 403 on all of the server's domains.
curl
$ curl -X PATCH https://nameocean.net/api/v1/servers/3f9a1c2e/protection \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" \
    -d '{"cache": true, "block": ["203.0.113.0/24"]}'
$ curl -X POST https://nameocean.net/api/v1/servers/3f9a1c2e/protection/purge \
    -H "Authorization: Bearer $NAMEOCEAN_API_KEY" -H "Content-Type: application/json" -d '{"urls": ["https://example.com/pricing"]}'
$ nameocean servers protection attack 3f9a1c2e on

Endpoints: GET|PATCH /servers/{server}/protection (cache, under_attack, blocked to replace the list, block/unblock to change it) and POST /servers/{server}/protection/purge; MCP tools get_server_protection, update_server_protection, purge_server_cache; CLI nameocean servers protection show|cache|attack|block|unblock|purge.

Από το τερματικό

nameocean
$ nameocean deploy 3f9a1c2e
$ nameocean servers logs 3f9a1c2e --app web -n 200
$ nameocean servers env set 3f9a1c2e DATABASE_URL=postgres://app@127.0.0.1/app
$ nameocean servers restart-apps 3f9a1c2e
$ nameocean servers backups ls 3f9a1c2e
$ nameocean servers search on 3f9a1c2e --tags
$ nameocean servers crashes 3f9a1c2e --log

Από το AI σας

Μέσω MCP ένας βοηθός μπορεί να διαβάζει logs, να επανεκκινεί εφαρμογές, να ορίζει μεταβλητές περιβάλλοντος, να ολοκληρώνει ένα deploy μετά από push, να δημιουργεί αντίγραφα ασφαλείας ενός server και, αφού σας δείξει την τιμή, να δημιουργεί έναν νέο. Η διακοπή, η επανεκκίνηση και η επαναφορά απαιτούν πρώτα την έγκρισή σας.