Configure, manage, validate, and inspect an Nginx web server
Source: target-root/usr/local/libexec/solidgroundux/manage-web-server.sh
Configure, manage, validate, and inspect an Nginx web server
Public functions
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_web_ask_selection | Present a numbered selection prompt and return the chosen item to its caller. | - $2: Name of the output shell variable. | — |
_web_server_load_state | Read web-management settings from the state file when available. | — | — |
_web_server_save_state | Save web-management settings to the configured state file. | — | — |
_dryrun_complete | Report the dry-run result without executing the requested host change. | — | — |
_web_server_package_installed | Test whether Nginx is installed. | — | — |
_web_server_storage_root | Resolve the configured SolidGroundUX storage root. | — | — |
_web_server_root | Resolve the configured web content root. | — | — |
_web_server_save_root | Persist the configured web content root. | - $1: Root filesystem directory. | — |
_web_server_installed_docs_root | Use SGND_WEB_DOC_INSTALLED_ROOT from the environment or web-server.cfg; | — | Prints an absolute path beneath the active framework root when staged. |
_web_server_enabled_sites | List enabled Nginx sites. | — | — |
_web_server_available_sites | List available Nginx sites. | — | — |
_web_server_read_site_config | Allow inspection of root-owned configuration files without changing | - $1 Existing Nginx site identifier. | Writes the configuration contents to stdout. |
_web_server_validate_site_name | Validate an Nginx site name. | - $1: Value to inspect or write. | — |
_web_server_current_dns | Resolve the first configured non-loopback DNS server. | — | — |
_web_server_local_ipv4 | Resolve this server's primary IPv4 address. | — | — |
_web_server_offer_dns_record | Optionally register an internal AD DNS A record. | - $1: Web hostname for which a DNS record may be created. | — |
_web_server_remove_dns_record | During site removal, delete only a confirmed A record pointing at this host. | - $1: Web hostname whose DNS entry may be removed. | — |
_web_server_site_document_root | Resolve the document root for an Nginx site. | - $1: Configured Nginx site name. | — |
_web_server_remove_document_content | Remove all content below a document root. | - $1: Absolute web document root whose content is to be removed. | — |
_web_server_ensure_directory | Create and prepare a web content directory when needed. | - $1: Filesystem path to inspect. | — |
_web_server_ensure_https_fallback | A removed hostname must never serve another site's content. Ubuntu's | — | — |
_web_server_reload | Validate and reload Nginx. | — | — |
_web_server_step_install_packages | Install Nginx and publishing prerequisites. | — | — |
_web_server_step_start | Enable and start Nginx. | — | — |
_web_server_prepare | Run the complete Web Server preparation sequence in one management process. | — | — |
_web_server_configure_root | Select or create the web content root. | — | — |
_web_server_manage_service | Manage nginx.service state and startup behavior. | — | — |
_web_server_configure_firewall | Allow HTTP and HTTPS through UFW. | — | — |
_web_server_create_site | Create and enable an Nginx site. | — | — |
_web_server_ensure_site | Noninteractive, idempotent site provisioning for an approved remote deployment. | — | — |
_web_server_ensure_directory_for_publish | Noninteractive preparation/repair of a dedicated publishing directory. | — | — |
_web_server_configure_dns | Reuse existing interactive AD DNS setup via a direct action. | — | — |
_web_server_enable_site | Enable an available Nginx site. | - $1: Optional: configured Nginx site name. | — |
_web_server_disable_site | Disable an enabled Nginx site. | - $1: Optional: configured Nginx site name. | — |
_web_server_change_document_root | Change the document root for an Nginx site. | - $1: Optional: configured Nginx site name. | — |
_web_server_remove_site | Remove an Nginx site configuration. | - $1: Optional: configured Nginx site name. | — |
_web_server_remove_site_content | Remove the contents of a site's document root. | - $1: Optional: configured Nginx site name. | — |
_web_server_list_sites | List Nginx sites and document roots. | — | — |
_web_server_configure_https | Enable HTTPS using an existing certificate or a locally generated self-signed | - $1: Optional: configured Nginx site name. | — |
_web_server_export_https_certificate | Make the public certificate of an HTTPS-enabled Nginx site available to the | - $1 Optional Nginx site identifier. | — |
_web_server_configure_basic_auth | Add or remove password protection without changing the public site or TLS setup. | - $1: Optional: configured Nginx site name. | — |
_web_server_update_markdown_upload | Keep Python implementation in lib/solidgroundux/py, not a duplicate | — | — |
_web_server_configure_markdown_upload | Bind the upload service to localhost, outside the document root, with | - $1: Optional: configured Nginx site name. | — |
_web_server_site_summary | Keep the selected site's hostname, root, status, and protection visible. | - $1: Configured Nginx site name. | — |
_web_server_manage_sites | List sites, choose the active site, and keep its details above the actions. | — | — |
_web_server_default_docs_address | Return a sensible documentation web address. | — | — |
_web_server_configure_documentation_site | Create or select the Nginx site used to publish SolidGroundUX documentation. | — | — |
_web_server_documentation_paths | Never sync a missing, nested, identical, or symlinked documentation root. | - $1: Output variable for documentation source path. | — |
_web_server_documentation_changes | Compare the full tree with rsync's read-only itemized dry-run, including | - $1: Source path. | — |
_web_server_update_documentation | This action only updates an EXISTING configured documentation site. | — | — |
_web_server_documentation_status | Only installed-documentation sources can be compared automatically; | — | — |
_web_server_status | Show web-server status and configuration. | — | — |
_web_server_validate | Validate the web-server role. | — | — |
_run_action | Dispatch the requested management action to its implementation. | - $1: Management action to execute. | — |
Description
Configure, manage, validate, and inspect an Nginx web server.
Usage
Run the executable from its shell command (or installed wrapper):
manage-web-server --action status
manage-web-server --dryrun --action configure-root
Script-specific options:
--action NAME,-a: Management action (supported actions:prepare,install,start,configure-root,manage-sites,ensure-site,ensure-directory,configure-dns,configure-documentation,documentation-status,update-documentation,service,firewall,validate,status).--site-name VALUE: Nginx site identifier for ensure-site.--web-address VALUE: Hostname for ensure-site.--document-root VALUE: Absolute document root for ensure-site.--deployment-user VALUE: Unprivileged SSH publishing account.
