Commit Graph
11 Commits
Author SHA1 Message Date
Liam Crilly 7fac908742 Added routes array to the default configuration.
The default configuration previously contained just a listeners and
applications object. Since routes is now a principle configuration object,
and a recommended way of configurating Unit, it is now included in the
default configuration.

This change benefits new users because it explicitly introduces the three
principle configuration objects which leads more intuitively to the
documentation. Experienced users may choose to ignore or delete routes.

routes is defined as an array instead of an object because this change
is designed to assist new users, where the simpler form of routes is
easier to understand.
2023-10-02 09:43:57 +01:00
Liam Crilly b42f6b1dc8 Tools: unitc edit mode for interactive configuration. 2023-06-07 14:45:35 +01:00
Liam Crilly 9ff59e6c4b Tools: improved ps(1) portability for unitc.
Improved cross-platform support by trying multiple ps(1) invocations to
obtain the unitd command line parameters. Additional error checking
detects when this process fails.

The first attempt uses `ps -wwo args=COMMAND -p` which has very broad
support and has the additional benefit of simplifying the output for
more reliable parsing of the process info. If that fails then we fall
back to simply `ps`.

The parsing of the process info has also changed. Instead of converting
'[]' into spaces we now convert them into explicit delimiters (using '^').
This is more reliable as it marks the beginning and the end of the info
we care about. Any trailing process information is now ignored (FreeBSD).

Additional error handling improves the robustness when starting unitd with
a different filename or from a relative path. In this case the control
socket and log file detection will fail when running `unitd --help`.
Additional error checking and messages are displayed when the control socket
cannot be determined. A single warning is shown when the log file cannot be
determined.
2023-06-01 17:53:12 +01:00
Liam Crilly d481801907 Docker: show welcome page on port 80 when entrypoint.d is empty.
The entrypoint script now performs a default configuration when no useful
files are found in /docker-entrypoint.d/

The default configuration serves a welcome page in response to all
requests, using Markdown unless text/html is sent in the Accept header.

This provides a useful 'hello world' experience when running a Unit
container for the first time.
2023-05-09 22:53:18 +01:00
Liam Crilly 20a5fd44ac Docker: add support for JavaScript modules. 2023-05-09 19:19:36 +01:00
Liam Crilly c54331fa3d Tools: use control socket and log file from running instance.
If unitd was started with an explicit path then unitc will use that
binary instead of the default PATH to obtain the default control socket
and log file locations.
2023-04-04 11:29:53 +01:00
Liam Crilly bbeccabe0a Tools: improved detection of unitd control socket.
Now unitc obtains the path to the unitd binary from information
contained in the unitd: main process. If unitd was started with an
explicit path then that path will be used to obtain the default
control socket, instead of using the unitd binary in $PATH.
2023-02-27 14:25:58 +00:00
Liam Crilly a2b3992462 Tools: unitc avoid interactive rm(1) invocations. 2022-12-19 15:03:55 +00:00
Liam Crilly e2dd3610f3 Tools: fixed quoting for apostrophe in setup-unit. 2022-12-16 12:46:35 +00:00
Liam Crilly 101b262f1f Tools: Added unitc. 2022-12-14 16:20:08 +00:00
Liam Crilly dfededabdc Added tools/README.md. 2022-12-03 18:11:14 +00:00