[debug]
debug.keep_temporary
Keeps the temporary directories of a program after it ends. Without this setting, they are deleted.
A program gets its own directory for working files with Core\IO::createTemporaryDirectory. Novis deletes that directory when the program ends. This happens when the program ends normally, stops early or stops with an error. With this setting on, Novis deletes nothing and writes each kept directory to the log. You can then look at the files that a failing run left. Turn the setting off again afterwards, because nothing else deletes those directories.
Good to know: only the person who runs Novis can set it, in nvs.toml. A program cannot keep its own files this way. If it could, an attacker could make a program fill the disk.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
The examples below run with this configuration file.
# Temporary directories are deleted when a run ends.[debug]keep_temporary = falseWhat happens to your scratch files
<?nvs// A program can get its own directory for working files. It is deleted when the program ends.// `[debug] keep_temporary` stops the deletion, so you can look at the files a run left://// [debug]// keep_temporary = true//// This file sets `false`. Every server in production should use `false`.
echo 'kept after a run: ', Core\Config::get('debug.keep_temporary') ?? '(no value)', "\n";
// `io.temp_root` is where these directories are made. Here it is the `tmp` folder of the// data folder. The full path differs on each machine, so this prints only `tmp`.echo 'made under: ', Core\Path::fileName(Core\Config::get('io.temp_root') ?? ''), "\n";
// A program cannot change `keep_temporary`, so this prints `no`. Otherwise a program// could keep every file it makes until the disk is full.string $name = 'debug.keep_temporary';echo 'a program may: ', Core\Config::set($name, 'true') ? 'yes' : 'no', "\n";
// You can turn the setting on in `nvs.toml` while the server runs. A restart is not needed.// While it is on, nothing deletes the files. Turn it off again when you are done.kept after a run: falsemade under: tmpa program may: noChangelog
| Version | Change |
|---|---|
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.inline
Decides whether a debugging dump also appears in the page, or only in the log.
Core\Debug::dump always writes its value to the log. With this setting on, a dump made while an HTML page is built is also added to the end of that page. A JSON response is never changed.
The default depends on the mode in [mode] default. In development the dumps are added to the page, and in production they are not. A program cannot turn this setting on. In production, a dump that you forgot in the code is only a line in the log. A program can turn it off for its own request with Core\Config::set('debug.inline', 'false').
[debug] store records each request for the debug viewer, a page in your browser. When it is also on, the block in the page starts with the number of queries the request ran. It also has a link that opens this request in the debug viewer.
Good to know: on the command line, a dump always goes to standard error. This setting has no effect there.
nvs.toml sets the value that each request starts with. A request may set its own value to false with Core\Config::set, and to nothing else.
A change in the file takes effect a few seconds after you save it. The server does not restart.
Where a debugging dump shows up
<?nvs// `Core\Debug::dump` always writes to the log. `[debug] inline` says whether an HTML page// also shows the dump at its end. This file sets nothing, so the run mode is used.// In development mode the page shows the dump. In production mode it does not.// This program runs in production mode, so this prints `false`.
echo 'in force: ', Core\Config::get('debug.inline') ?? '(no value)', "\n";
// A program may never turn this setting on, so this prints `no`. A dump you forget// in your code writes only to the log. It never appears in the response.echo 'turn it on: ', Core\Config::set('debug.inline', 'true') ? 'yes' : 'no', "\n";
// A program may turn it off for its own request, so this prints `yes`.// The page for this request then does not show the dump, in any mode.echo 'turn it off: ', Core\Config::set('debug.inline', 'false') ? 'yes' : 'no', "\n";
// In a command-line program, `Core\Debug::dump` writes to the error stream.// The normal output does not contain the dump, so you can still pipe it to another program.Core\Debug::dump(['order' => 1042, 'total' => '19.90']);echo "done\n";in force: falseturn it on: noturn it off: yesdoneChangelog
| Version | Change |
|---|---|
0.0.6 | [debug] inline adds the output of Core\Debug::dump to an HTML page. With [debug] store on, this output also shows how many queries the request ran. It has a link that opens the request in the debug viewer. |
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.mode
Lists the debug probes that a program may turn on. A probe records what a program does while it runs.
There are four probes:
coveragecounts how many times each line ran.branchcounts which way eachifwent.tracewrites a line for each call, withCore\Debug::startTrace.profiletimes each call, withCore\Debug::startProfile.
The default is no probe, the same as mode = []. A program cannot change this setting. A call to start a probe that the list does not name throws a RuntimeError.
nvs run and nvs test accept any of the four probes. A server accepts only coverage. It also needs [mode] default = "development". With any other probe, the server does not start, and the error says why. So a production server must set mode = [], or leave mode out.
With [debug] store on, nvs debug opens a web page that shows the coverage of each request. The page colors each line by how many times it ran.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
Which probes are on
<?nvs// `[debug] mode` lists the debug probes that this program may turn on.// A probe records what the program does, such as each call it makes.// This file does not set `mode`, so no probe is on. This prints `(no value)`.// To allow a trace, write://// [debug]// mode = ["trace"]echo 'mode: ', Core\Config::get('debug.mode') ?? '(no value)', "\n";
// This line tries to turn the trace probe on. A program cannot change this setting.// So `Core\Config::set` returns `false`, and this prints `no`.string $name = 'debug.mode';echo 'change it: ', Core\Config::set($name, '["trace"]') ? 'yes' : 'no', "\n";mode: (no value)change it: noA probe that is not listed
<?nvs// A program can start only the probes that `[debug] mode` lists.// This file lists none, so `Core\Debug::startTrace` throws a `RuntimeError`.try { Core\Debug::startTrace('trace.jsonl'); echo "the trace started\n";} catch (RuntimeError $error) { echo "the trace did not start\n";}
// The `catch` block caught the error, so the program goes on with no trace.echo "done\n";the trace did not startdonedebug.store
Saves a record of each request. You look at the records later with nvs debug.
With store = true, Novis writes a record of each request to files in debug/spool in the data folder. A record has the result, the log lines, each Core\Debug::dump value and the time of each query. Jobs from [[schedule]] and the queue are recorded too, and so is each run of nvs run and nvs test.
In development mode, a record also has the request and the response. The Authorization and Cookie headers are replaced with [redacted]. So is the value of each form or JSON field named password, passwd, secret, token, api_key or apikey. A body of another type is saved as it was sent. The viewer marks it as not checked for passwords.
In production mode, a record has no headers and no body. A dump record has the type and size of each value, but not the value.
The default is false. A program can turn recording off for its own request. It cannot turn it on.
nvs.toml sets the value that each request starts with. A request may set its own value to false with Core\Config::set, and to nothing else.
A change in the file takes effect a few seconds after you save it. The server does not restart.
Save a record of each request
<?nvs// `[debug] store` saves a record of each request to files in the data folder.// `nvs debug` reads these files into a database. This file does not set `store`,// so the default is used, and this prints `false`. To turn it on, write://// [debug]// store = trueecho 'store: ', Core\Config::get('debug.store') ?? '(no value)', "\n";
// A program cannot turn recording on, so this prints `no`.// Only the person who runs the server can turn it on, in `nvs.toml`.echo 'turn it on: ', Core\Config::set('debug.store', 'true') ? 'yes' : 'no', "\n";
// A program can turn recording off for its own request, so this prints `yes`.// Then this request writes no record.echo 'turn it off: ', Core\Config::set('debug.store', 'false') ? 'yes' : 'no', "\n";Core\Config::restore('debug.store');
// With `store` on, this dump is saved in the record too. It also goes to the error output.Core\Debug::dump(['order' => 1042, 'total' => '19.90']);echo "done\n";store: falseturn it on: noturn it off: yesdoneChangelog
| Version | Change |
|---|---|
0.0.6 | A production server records no dumped value, only its file and line and the type and size of each value. In development, a recorded JSON or form field named password, secret, token or api_key is replaced with [redacted]. The Settings page of the debug viewer lists the newest 50 sign-ins. |
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.spool_max
The most disk space that the debug records of one process may use. The default is 256M.
With [debug] store = true, Novis writes a record of each request to files in debug/spool in the data folder. nvs debug reads these files and deletes them. When nvs debug does not run, the files stay on the disk. This limit stops them from filling the disk.
A server divides the space equally between its worker threads, and each thread writes its own files. When a thread needs more space than its part, it deletes its own oldest file. It then writes a line with the number of records it deleted. nvs debug saves that number in its database.
A program cannot change this setting. You can change it in nvs.toml while the server runs.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
The disk space for debug records
<?nvs// `[debug] spool_max` is the most disk space that the debug records of one process may use.// When the records need more, the oldest file of records is deleted.// This file does not set it, so the default is used, and this prints `256M`.echo 'spool_max: ', Core\Config::get('debug.spool_max') ?? '(no value)', "\n";
// A program cannot change this setting, so both lines print `no`.// A program that could raise it could fill the disk.string $name = 'debug.spool_max';echo 'raise it: ', Core\Config::set($name, '100G') ? 'yes' : 'no', "\n";echo 'lower it: ', Core\Config::set($name, '1M') ? 'yes' : 'no', "\n";spool_max: 256Mraise it: nolower it: noChangelog
| Version | Change |
|---|---|
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.index_age
How long nvs debug keeps the record of a request. The default is 7d, which is seven days.
nvs debug reads the records that [debug] store saves into one database, debug/index.sqlite. This file is in the data folder, .nvsdata next to the nvs program.
Each record belongs to one request or one run. A run is a scheduled job, a queue job, or a command such as nvs run. After nvs debug reads new records, it deletes each request that started more than index_age ago. All the records of that request are deleted with it.
Each record of a run is deleted when it is older than index_age. A run can last longer than index_age. Then the run loses its first records and keeps its newest ones. The run itself is deleted when it ended more than index_age ago. The page of the run in the debug viewer says which records were deleted.
When nvs serve starts nvs debug, nvs debug uses the same configuration files as the server. A program cannot change this setting.
A record can contain data that a user sent, such as the body of a form. Set index_age no longer than you need the records.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
How long request records are kept
<?nvs// `[debug] index_age` is how long `nvs debug` keeps the record of a request.// When a record is older, `nvs debug` deletes it from its database.// This file does not set it, so the default is used, and this prints `7d` (seven days).echo 'index_age: ', Core\Config::get('debug.index_age') ?? '(no value)', "\n";
// A program cannot change this setting, so this prints `no`.// The records contain request data, so only the person who runs the server decides how long they stay.string $name = 'debug.index_age';echo 'change it: ', Core\Config::set($name, '1d') ? 'yes' : 'no', "\n";index_age: 7dchange it: noChangelog
| Version | Change |
|---|---|
0.0.6 | [debug] index_age and [debug] index_max delete the records of a finished run one at a time, oldest first. Before, all the records of a finished run were deleted at the same time. The page of a run in the debug viewer says the time before which its records were deleted. |
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.index_max
The largest size of the database that nvs debug writes. The default is 1G, which is one gigabyte.
nvs debug reads the records that [debug] store saves into one database, debug/index.sqlite in the data folder. When the records in this database use more than index_max, nvs debug deletes the oldest records first. It deletes a request together with all of its records.
A run is a scheduled job, a queue job, or a command such as nvs run. The records of a run are deleted one at a time, oldest first. This also happens before the run ends. A long run keeps its newest records. The run itself is deleted after its records. The page of the run in the debug viewer says which records were deleted.
The file does not get smaller when records are deleted. New records use the space that the deleted records used. The file stays about index_max in size.
[debug] index_age sets how long a record is kept. A record is deleted when it is past either limit. A program cannot change this setting.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
The largest size of the debug database
<?nvs// `[debug] index_max` is the largest size of the database that `nvs debug` writes.// When the database is larger, `nvs debug` deletes the oldest records first.// This file does not set it, so the default `1G` is used, and this prints `1G`.echo 'index_max: ', Core\Config::get('debug.index_max') ?? '(no value)', "\n";
// A program may not change `debug.index_max`.// When the name is written in the call, the program does not compile.
// When the name is in a variable, the compiler cannot check it.// The call runs, returns `false`, and this prints `no`.string $name = 'debug.index_max';echo 'raise it: ', Core\Config::set($name, '100G') ? 'yes' : 'no', "\n";index_max: 1Graise it: noChangelog
| Version | Change |
|---|---|
0.0.6 | [debug] index_age and [debug] index_max delete the records of a finished run one at a time, oldest first. Before, all the records of a finished run were deleted at the same time. The page of a run in the debug viewer says the time before which its records were deleted. |
0.0.6 | [debug] index_max now limits every record in the debug database, oldest first, including the records of a command that is still running. Before, the records of a running command were not deleted for size. The records of every finished request were deleted instead. |
0.0.6 | The page of each setting says whether a request may change it with Core\Config::set. A page for a block lists the settings in it that a request may change. |
debug.listen
The address that nvs debug serves the debug viewer on. It is an IP address and a port. The default is 127.0.0.1:8137.
nvs debug prints a link with this address and a token. Open that link in a browser to see the viewer. nvs debug --listen <address> uses another address for one run. If the port is in use, nvs debug stops with an error.
On a loopback address, such as 127.0.0.1, the viewer uses plain HTTP. Only a browser on the same computer can open it. On any other address, the viewer uses HTTPS and needs a token. nvs debug creates a certificate, a key and a token in debug/ in the data folder. Then it prints a link that contains the token. Open that link once, and the browser keeps the token in a cookie.
[debug] tls_cert_file, tls_key_file and token_file name your own files instead. nvs debug reads this setting when it starts. A program cannot change it.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
The address of the debug viewer
<?nvs// `[debug] listen` is the address where `nvs debug` serves the debug viewer.// This file does not set it, so the default is used, and this prints `127.0.0.1:8137`.echo 'listen: ', Core\Config::get('debug.listen') ?? '(no value)', "\n";
// `Core\Config::set('debug.listen', ...)` does not compile,// because a program may not change `debug.listen`.
// This program keeps the name in a variable. The compiler does not check a variable, so `set` runs and returns `false`.// This prints `no`.string $name = 'debug.listen';echo 'change it: ', Core\Config::set($name, '0.0.0.0:8137') ? 'yes' : 'no', "\n";listen: 127.0.0.1:8137change it: nodebug.tls_cert_file
The certificate file that nvs debug uses for HTTPS. There is no default.
nvs debug uses HTTPS when [debug] listen is an address that is not loopback. Without this setting, nvs debug creates a certificate in debug/ in the data folder and uses it. That certificate is self-signed, so the browser shows a warning the first time. Set this to a certificate that the browser already trusts.
[debug] tls_key_file names the private key of the same certificate. nvs debug uses your files only when both of them exist. If a file does not exist, nvs debug prints a warning and uses the certificate it created.
nvs debug reads this setting when it starts. A program cannot change it.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
Your own certificate for the debug viewer
<?nvs// `[debug] tls_cert_file` is a certificate file for the debug viewer, such as `/etc/novis/debug.crt`.// This file does not set it, so `nvs debug` creates its own certificate, and this prints `(not set)`.echo 'tls_cert_file: ', Core\Config::get('debug.tls_cert_file') ?? '(not set)', "\n";
// `Core\Config::set('debug.tls_cert_file', ...)` does not compile,// because a program may not change `debug.tls_cert_file`.
// This program keeps the name in a variable. The compiler does not check a variable, so `set` runs and returns `false`.// This prints `no`.string $name = 'debug.tls_cert_file';echo 'change it: ', Core\Config::set($name, '/etc/novis/debug.crt') ? 'yes' : 'no', "\n";tls_cert_file: (not set)change it: nodebug.tls_key_file
The private key file that nvs debug uses for HTTPS. There is no default.
The key belongs to the certificate that [debug] tls_cert_file names. nvs debug uses HTTPS when [debug] listen is an address that is not loopback. Without your own files, nvs debug creates a certificate and a key in debug/ in the data folder and uses them.
nvs debug uses your files only when both of them exist. If a file does not exist, nvs debug prints a warning and uses the key it created. Keep the key file readable only by the account that runs nvs debug.
nvs debug reads this setting when it starts. A program cannot change it.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
Your own key for the debug viewer
<?nvs// `[debug] tls_key_file` is the private key file for the debug viewer, such as `/etc/novis/debug.key`.// This file does not set it, so `nvs debug` creates its own key, and this prints `(not set)`.echo 'tls_key_file: ', Core\Config::get('debug.tls_key_file') ?? '(not set)', "\n";
// `Core\Config::set('debug.tls_key_file', ...)` does not compile,// because a program may not change `debug.tls_key_file`.
// This program keeps the name in a variable. The compiler does not check a variable, so `set` runs and returns `false`.// This prints `no`.string $name = 'debug.tls_key_file';echo 'change it: ', Core\Config::set($name, '/etc/novis/debug.key') ? 'yes' : 'no', "\n";tls_key_file: (not set)change it: nodebug.token_file
The file with the token that opens the debug viewer. There is no default.
nvs debug always needs a token, on every address. Without this setting, nvs debug creates a random token in debug/ in the data folder. It prints a link that contains the token. Open that link once, and the browser keeps the token in a cookie.
Set this when you want to choose the token yourself. The file contains the token on one line. The token has at least 16 characters. Each character is a letter, a digit, -, _, . or ~. If the token is not valid, nvs debug stops with an error. If the file does not exist, nvs debug prints a warning and uses the token it created.
nvs debug reads this setting when it starts. A program cannot change it.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
Your own token for the debug viewer
<?nvs// `[debug] token_file` is a file with the token that opens the debug viewer, such as `/etc/novis/debug.token`.// This file does not set it, so `nvs debug` creates its own token, and this prints `(not set)`.echo 'token_file: ', Core\Config::get('debug.token_file') ?? '(not set)', "\n";
// `Core\Config::set('debug.token_file', ...)` does not compile,// because a program may not change `debug.token_file`.
// This program keeps the name in a variable. The compiler does not check a variable, so `set` runs and returns `false`.// This prints `no`.string $name = 'debug.token_file';echo 'change it: ', Core\Config::set($name, '/etc/novis/debug.token') ? 'yes' : 'no', "\n";token_file: (not set)change it: nodebug.remote
Lets a developer read this server's debug records from their own machine.
Each developer runs nvs debug key once. It prints a public key such as ed25519:.... You add that key to keys with the developer's name. A developer with a listed key connects to the address in listen with TLS 1.3. A connection with a key that is not listed ends before the server reads a request. The log names each connection by its key's name.
A developer can turn on recording for a short time. allow says what that recording may contain: requests, headers, bodies, dumps and queries. The default is requests and queries. max_window is the longest time recording may stay on. The default is 15m.
Good to know: when you remove a key from the file, the server reads the file again. That developer's open connections then end at once. A program cannot change any of these settings.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect a few seconds after you save it. The server does not restart.
The examples below run with this configuration file.
# The developer `alice` may connect on port 7443. She may record requests and queries for up to 10 minutes.[debug.remote]listen = "127.0.0.1:7443"allow = ["requests", "queries"]max_window = "10m"
[[debug.remote.keys]]name = "alice"key = "ed25519:BxQhLjtIVWJvfImWo7C9ytfk8f4LGCUyP0xZZnOAjZo="Let one developer read this server
<?nvs// `[debug.remote]` lets a developer read this server's debug records from their own machine.// The `nvs.toml` beside this file lists one developer key. A program can read `listen` and `max_window`.echo 'listen: ', Core\Config::get('debug.remote.listen') ?? '(no value)', "\n";echo 'max_window: ', Core\Config::get('debug.remote.max_window') ?? '(no value)', "\n";
// `allow` and `keys` are lists. `Core\Config::get` returns `null` for a list, so this prints `(no value)`.echo 'allow: ', Core\Config::get('debug.remote.allow') ?? '(no value)', "\n";
// A program cannot change these settings, so each line prints `no`. The names are in variables,// because a call with one of these names written as a string does not compile.array<string> $changes = [ 'debug.remote.max_window' => '24h', 'debug.remote.allow' => 'bodies', 'debug.remote.keys' => 'ed25519:BzBZgqvU/SZPeKHK8xxFbpfA6RI7ZI223wgxWoOs1f4=',];foreach ($changes as string $key => string $value) { echo 'change ', $key, ': ', Core\Config::set($key, $value) ? 'yes' : 'no', "\n";}listen: 127.0.0.1:7443max_window: 10mallow: (no value)change debug.remote.max_window: nochange debug.remote.allow: nochange debug.remote.keys: noChangelog
| Version | Change |
|---|---|
0.0.6 | The debug viewer on your computer can show the records of a server, such as a production server. [debug.remote] lists the public key of each developer who may connect, and nvs debug key prints your key. A connection without a listed key ends before the server reads a request. |
debug.remote.listen
The address where developers connect to read this server's debug records: an IP address and a port.
There is no default port. When [debug.remote] lists a key, you must write listen, such as "0.0.0.0:7443". The port cannot be 0. The server opens the address once, when it starts, so a change needs a restart.
The application's own port cannot be used, so listen = "app" is not allowed. A host may allow only port 443. In that case, a proxy on port 443 can send the debug connections to listen. When a connection starts, the developer's viewer sends the name nvs-debug/1. The proxy can read this name without decrypting the connection. It then sends the connection to this address.
Good to know: a connection without a listed key ends before the server reads a request. A program can read this address, but it cannot change it.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
The examples below run with this configuration file.
# Developers with a listed key connect to this server on port 7443.[debug.remote]listen = "127.0.0.1:7443"
[[debug.remote.keys]]name = "alice"key = "ed25519:BxQhLjtIVWJvfImWo7C9ytfk8f4LGCUyP0xZZnOAjZo="Read the debug address
<?nvs// `[debug.remote] listen` is the address where developers connect to read this server's debug records.// The `nvs.toml` beside this file sets it, so this prints `127.0.0.1:7443`.echo 'listen: ', Core\Config::get('debug.remote.listen') ?? '(no value)', "\n";
// A program cannot move the address, so this prints `no`. The name is in a variable,// because a call with this name written as a string does not compile.string $key = 'debug.remote.listen';echo 'move it: ', Core\Config::set($key, '0.0.0.0:7443') ? 'yes' : 'no', "\n";listen: 127.0.0.1:7443move it: noChangelog
| Version | Change |
|---|---|
0.0.6 | [debug.remote] listen is the address where developers connect to a server's debug records. The viewer sends the protocol name nvs-debug/1 when a connection starts. A proxy on port 443 can read this name and send the connection to listen. |
debug.server
Lists the servers that the debug viewer on a developer's machine can connect to.
Each entry has a name and an address. The address is the host and the port of that server's [debug.remote] listen. Servers with the same group are behind one load balancer, which shares requests among them. The viewer shows their requests together, and turns on recording on all of them at once.
fingerprint identifies the server's debug certificate. Run nvs debug fingerprint on the server, and copy the line it prints into the entry. The server also writes its fingerprint to its log when it starts. The viewer then connects only to a server with that certificate. Without a fingerprint, the server needs a certificate for its host name.
Good to know: only nvs debug on a developer's machine reads this list. A server ignores it, so one nvs.toml works for both. A change needs a restart of nvs debug. The list has no secrets, so you can commit it with the project.
Only nvs.toml sets this key. A request may not change it.
A change in the file takes effect only when the server starts again.
The examples below run with this configuration file.
# Two servers behind one load balancer. The debug viewer on a developer's machine shows their records together.[[debug.server]]name = "shop-1"address = "192.0.2.10:7443"group = "shop"fingerprint = "sha256:BzBZgqvU/SZPeKHK8xxFbpfA6RI7ZI223wgxWoOs1f4="
[[debug.server]]name = "shop-2"address = "192.0.2.11:7443"group = "shop"fingerprint = "sha256:ByRBXnuYtdLvDClGY4Cdutf0ES5LaIWiv9z5FjNQbYo="List two servers of one group
<?nvs// `[[debug.server]]` lists the servers that `nvs debug` on a developer's machine can connect to.// Only `nvs debug` reads this list. A program gets `null` for each entry, so this prints `(no value)`.echo 'shop-1 address: ', Core\Config::get('debug.server.0.address') ?? '(no value)', "\n";
// A program cannot point an entry at another server, so each line prints `no`. The names are in// variables, because a call with one of these names written as a string does not compile.array<string> $changes = [ 'debug.server.0.address' => '198.51.100.7:7443', 'debug.server.0.fingerprint' => 'sha256:BxQhLjtIVWJvfImWo7C9ytfk8f4LGCUyP0xZZnOAjZo=',];foreach ($changes as string $key => string $value) { echo 'change ', $key, ': ', Core\Config::set($key, $value) ? 'yes' : 'no', "\n";}shop-1 address: (no value)change debug.server.0.address: nochange debug.server.0.fingerprint: noChangelog
| Version | Change |
|---|---|
0.0.6 | [[debug.server]] lists the servers that the debug viewer on a developer's computer connects to. Run nvs debug fingerprint on a server, and add the line it prints to that server's entry. This line identifies the server's certificate, and the viewer connects only to a server that has this certificate. |
