Search by

sitetus / collector

codemarkt

Read-only single-file PHP collector for the Sitetus monitoring panel: answers the panel's signed pull with an inventory and health envelope, keeps no secret on the server.

Package info

github.com/sitetus/collector-php

pkg:composer/sitetus/collector

Statistics

Installs: 20

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.7.8 2026-11-20 13:15 UTC

This package is auto-updated.

Last update: 2026-11-20 14:42:57 UTC


README

Read-only collector for the Sitetus monitoring panel: a single PHP file you place on your server so the panel can read a package inventory and health facts from inside the site, through signed requests the panel sends. It is optional: the panel works without it; the collector only adds inventory and inside-the-server health data.

The file is generated by the panel for each installation (public key, identifier and a random path baked in) and downloaded as a zip. The Laravel wrapper (sitetus/laravel-collector) installs the same core through Composer.

What this file will not do

A public commitment, enforced by the code and its tests:

  • It never reads or transmits .env or configuration files. Level 2 reports a fixed list of flags and counts only: app.debug, app.env, session cookie flags, the app.url scheme, whether APP_KEY is set, the names of the mail / cache / queue / session drivers, the number of pending jobs and migrations, flags for the public/storage link, the Redis version string; from php.ini only flags and limits, never paths.
  • Where the project sits on the server is reported without a path, an account name or a host name: two yes/no flags (public_html or private_html on its path; the document root being the project root), the hosting panel as one word (cpanel, plesk, directadmin, unknown), and the account the PHP process runs as only as the first 12 characters of a hash keyed with the installation's project key. From /etc/os-release only the ID and VERSION_ID values are sent (for example ubuntu 22.04).
  • Maintenance mode is read from the marker file only as on/off, for how long, and whether a bypass secret exists — never the secret or the file content.
  • It never transmits file contents, logs included — only sizes, counts and ages. Optional modules add relative file names under the web root (at most 50 each), never content. The first 4 KB of .htaccess / .user.ini / web.config in the uploads directory are read locally and reported only as a class: enables PHP / protective / unknown. The bot-traffic module reports counts per bot identity from the access log — never an IP, an address, a referer or a User-Agent string.
  • It never reads database records (only a connection attempt, its latency, the server version and — on MySQL and MariaDB running on the same server — whether the application's database account may connect from the server itself, from one named host or from any host, as the single word local, specific or any; never the account name or the host), collects no personal data, makes no outbound requests on its own, stores no secret on the server and writes nothing except its own nonce file.
  • It never uses a request parameter as a path, command or include target.
  • Modules you did not select are not in the file at all, and the panel cannot push code into it.
  • A request without the signature headers, or with another installation's project key, gets an empty 404, exactly as if the file did not exist. A request that carries this installation's project key but cannot be accepted gets an empty 403 with one fixed word in the X-Sitetus-Error header (see "How it works") — never a body, never anything else about the server. After expires_at, or after 90 days without a valid request, it sleeps: even a correctly signed request gets a 404 until a new package is installed.
  • The code is open source (MIT).

How it works

  • The panel's package puts the file under a random path (public/<random>/index.php).
  • The panel sends a signed request there a few times a day; the file verifies the signature with the embedded public key (Ed25519, or RSA-SHA256 where sodium is unavailable) and answers with a read-only JSON envelope.
  • Every request without the signature headers or with another project key gets a bodyless 404. No secret lives on your server: the public key and the installation identifier are not secrets.
  • When the project key is right and the request is still refused, the answer is a bodyless 403 whose X-Sitetus-Error header names the reason, so the panel can tell you what to fix: unsupported-algo (this PHP cannot verify the file's signature algorithm; X-Sitetus-Supports lists the ones it can), signature (the signature does not verify: the file was changed or replaced, or a header is altered on the way), skew (the server clock is more than 10 minutes off), nonce-store (the collector's folder is not writable), nonce (the request was already used).
  • Panel requests come from fixed IPs: https://sitetus.com/ips.txt

Install (shared hosting included)

  1. Download the zip from the panel: index.php plus an install note.
  2. Upload index.php with FTP or the file manager into the random-named folder under your public/ (or web root) directory, as the package says.
  3. Press "Verify connection" in the panel. That is all.

Optional one line (Laravel): to let the panel watch the scheduler and queue health, add the single line from the package to routes/console.php and deploy; without it those two checks show "no data" and nothing else is affected.

Uninstall: delete the file. The panel side can also revoke the collector with one click.

Composer wrapper (Laravel)

The same core is available as the sitetus/laravel-collector package (PHP ≥ 8.1): its service provider registers the pull route (/sitetus/<install-path>), writes the scheduler and queue heartbeats itself (no line to add), and lets you add developer-defined checks to the envelope with Sitetus::check('orders_last_24h', fn () => CheckOutcome::ok(42)) — numbers and booleans only, never text. The envelope is byte-for-byte the single-file one, except for collector.name.

Optional modules

No module is selected by default. You choose them in the panel when the package is generated; the code of every module you did not choose is removed from your file, and the list of the selected ones is written at its top.

Module What it adds
files Names (never content) of sensitive, recently changed or suspicious files under the web root and the upload directories
archives Number, size and names of archive and dump files left under the web root
permissions World-writable files and directories in the project
bot_traffic Request counts per AI crawler from the access log

files: what the content scan recognises

The first and last 8 KB of the PHP files under the web root are read on your server and matched against a short list of shapes that planted code takes. A match sends the file's name and the id of the rule, never a line of the file.

  • Evaluation of decoded or request-supplied text, a function whose name comes from the request, a command run directly from request input, the evaluating modifier of an old regular-expression function, and an encoded block of 800 characters or more.
  • remote_loader: code that runs what it has just fetched — an evaluation whose argument reads a file or an address, or an include of a web or FTP address, a data: stream or the request body.
  • shell_toolkit: a file that calls four or more different command-execution functions and also reads request input. Code that only looks for a function the host left enabled stops at two or three and does not read the request in the same file.

A match is a reason to look at the file, not a verdict; "nothing matched" says nothing about a file longer than 16 KB beyond its two ends.

Verification

Every envelope carries the SHA-256 of the installed file (collector.file_hash); the panel compares it with the fingerprint it recorded when it generated your package, and the source version is written at the top of the file. composer build prints the SHA-256 of the build it produces.

Requirements

  • PHP ≥ 7.4, zero Composer dependencies.
  • The sodium extension, to verify the Ed25519 signature of the panel's requests (bundled with PHP since 7.2, but some hosts switch it off). Without it an Ed25519 package answers 403 unsupported-algo; the alternative is an RSA-SHA256 package, which needs the openssl extension instead.
  • A writable collector folder: the file keeps its nonce store (one small JSON file) next to itself. If the folder is not writable, requests are refused with 403 nonce-store. Nothing else is ever written.

Works under strict disable_functions and open_basedir; what it cannot measure is reported as "no data".

Development

composer install
composer test          # PHPUnit
composer build         # produces dist/index.php, lints it and prints its SHA-256

Security reports: write to security@sitetus.com; please do not open a public issue. See SECURITY.md.

License

MIT — LICENSE.