Compare commits
17 Commits
b676c8f5ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
feb12eb0c5 | ||
|
|
5a69a9532a | ||
|
|
b5d0fc983e | ||
|
|
866ff1688c | ||
|
|
bfdfd87ec3 | ||
|
|
bf9f9de5d4 | ||
|
|
39bf88dd3b | ||
|
|
43cb959dc2 | ||
|
|
ee57cb486d | ||
|
|
3351044f68 | ||
|
|
af08efb6ad | ||
|
|
349dba63d6 | ||
|
|
a4dd6abc12 | ||
|
|
0e69a47827 | ||
|
|
94e2ccc6e4 | ||
|
|
7ee884fe38 | ||
|
|
3f0fd53a33 |
@@ -25,6 +25,18 @@ configure_file(
|
|||||||
"${CMAKE_CURRENT_BINARY_DIR}/smart"
|
"${CMAKE_CURRENT_BINARY_DIR}/smart"
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/static/start.html.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/static/start.html"
|
||||||
|
IMMEDIATE @ONLY)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/mars-nwe-webui.service.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/mars-nwe-webui.service"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Compiler Switches
|
# Compiler Switches
|
||||||
##############
|
##############
|
||||||
@@ -62,14 +74,27 @@ target_link_libraries(check_login
|
|||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart.conf DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR})
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart.conf DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR})
|
||||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/smart DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/smart DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
|
install(FILES smart.pamd DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d RENAME smart)
|
||||||
|
|
||||||
install(PROGRAMS apply.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(PROGRAMS apply.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
install(PROGRAMS readconfig.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(PROGRAMS readconfig.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
install(PROGRAMS settings.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(PROGRAMS settings.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
install(PROGRAMS static.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(PROGRAMS static.pl DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
|
|
||||||
install(DIRECTORY static/ DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/static/start.html DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/menu.html DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/smart_icon.jpg DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/smart.jpg DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/favicon.ico DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/favicon-32x32.png DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/favicon-16x16.png DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
install(FILES static/apple-touch-icon.png DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||||
|
|
||||||
|
if(WITH_SYSTEMD)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mars-nwe-webui.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS check_login DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
install(TARGETS check_login DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||||
|
|
||||||
install(TARGETS nwwebui DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
install(TARGETS nwwebui DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
||||||
|
|
||||||
|
|||||||
277
README.md
@@ -1,3 +1,276 @@
|
|||||||
# mars-smart
|
# SMArT
|
||||||
|
|
||||||
SMArT is a web configuration tool for MARS_NWE, a Novell NetWare 3.x emulator for Linux and FreeBSD.
|
SMArT is the web-based configuration interface for **MARS_NWE**, a Novell NetWare 3.x emulator for Linux and FreeBSD.
|
||||||
|
|
||||||
|
In the current setup, this repository is no longer treated as a standalone component only. It is integrated into the main `mars_nwe` project as a **Git submodule** and is therefore included in the normal **mars_nwe release** process.
|
||||||
|
|
||||||
|
## Project status and integration
|
||||||
|
|
||||||
|
This repository is intended to be embedded into the main `mars_nwe` Git repository:
|
||||||
|
|
||||||
|
- Main project: `mars_nwe`
|
||||||
|
- Submodule role: provides the SMArT web UI and helper tools
|
||||||
|
- Release model: shipped as part of the integrated **MARS_NWE** release, not as a separate end-user release artifact
|
||||||
|
|
||||||
|
The build and install rules show that the web UI binaries, Perl helpers, configuration, static assets, and PAM file are installed as part of the overall build and installation flow.
|
||||||
|
|
||||||
|
## Architecture overview
|
||||||
|
|
||||||
|
SMArT consists of two main parts:
|
||||||
|
|
||||||
|
1. **Perl-based application logic** for configuration pages and helper scripts
|
||||||
|
2. **`nwwebui` service** as the web frontend that exposes the application over HTTP and HTTPS
|
||||||
|
|
||||||
|
The current implementation adds a dedicated `nwwebui` service that can serve the application directly over:
|
||||||
|
|
||||||
|
- **HTTP on port 9080**
|
||||||
|
- **HTTPS on port 9443**
|
||||||
|
|
||||||
|
The service supports TLS via OpenSSL and can run both listeners in parallel. HTTPS is the preferred mode because authentication happens more securely over an encrypted connection, while plain HTTP may still be useful for testing or trusted internal environments.
|
||||||
|
|
||||||
|
## Security model
|
||||||
|
|
||||||
|
SMArT uses PAM-based authentication through the `check_login` helper. The supplied PAM policy is a standard `pam_unix` stack for authentication, account, password, and session handling. During installation with **MARS_NWE**, this file is installed automatically as:
|
||||||
|
|
||||||
|
- `/etc/pam.d/smart`
|
||||||
|
|
||||||
|
That means no manual PAM file deployment is normally required when SMArT is installed through the integrated `mars_nwe` package or release.
|
||||||
|
|
||||||
|
## Installed components
|
||||||
|
|
||||||
|
The install rules include the following relevant components.
|
||||||
|
|
||||||
|
### Binaries
|
||||||
|
|
||||||
|
- `nwwebui` – dedicated web service frontend
|
||||||
|
- `check_login` – PAM authentication helper
|
||||||
|
|
||||||
|
### Perl helpers
|
||||||
|
|
||||||
|
- `smart`
|
||||||
|
- `apply.pl`
|
||||||
|
- `readconfig.pl`
|
||||||
|
- `settings.pl`
|
||||||
|
- `static.pl`
|
||||||
|
|
||||||
|
### Configuration and assets
|
||||||
|
|
||||||
|
- `smart.conf`
|
||||||
|
- static HTML and image assets for the web UI
|
||||||
|
- optional `mars-nwe-webui.service` systemd unit
|
||||||
|
- PAM file installed as `/etc/pam.d/smart`
|
||||||
|
|
||||||
|
These components are all installed by the build system as part of the same integrated installation target.
|
||||||
|
|
||||||
|
## Typical runtime paths
|
||||||
|
|
||||||
|
The original templates use CMake placeholders. For documentation, the following standard example paths can be used in a typical Linux installation:
|
||||||
|
|
||||||
|
- Main MARS_NWE config directory: `/etc/mars_nwe`
|
||||||
|
- SMArT config file: `/etc/mars_nwe/smart.conf`
|
||||||
|
- Main MARS_NWE server config: `/etc/mars_nwe/nwserv.conf`
|
||||||
|
- Helper binaries and scripts: `/usr/libexec/mars_nwe`
|
||||||
|
- Static SMArT assets: `/usr/libexec/mars_nwe/static`
|
||||||
|
- Log directory: `/var/log/mars_nwe`
|
||||||
|
- PID directory: `/run/mars_nwe`
|
||||||
|
- TLS certificate: `/etc/mars_nwe/server.crt`
|
||||||
|
- TLS private key: `/etc/mars_nwe/server.key`
|
||||||
|
- PAM file: `/etc/pam.d/smart`
|
||||||
|
|
||||||
|
These values are sensible standard defaults for documentation. Packaging may still adjust them depending on the target distribution.
|
||||||
|
|
||||||
|
## The `smart.conf` file
|
||||||
|
|
||||||
|
The `smart.conf` file controls both the SMArT frontend behavior and the `nwwebui` listener settings.
|
||||||
|
|
||||||
|
A documented example with standard installation paths is shown below:
|
||||||
|
|
||||||
|
```perl
|
||||||
|
# SMArT / nwwebui configuration file
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# UI colors
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
$COLOR_BACK = "#F0F0FF";
|
||||||
|
$COLOR_HEAD_BACK = "#C0C0FF";
|
||||||
|
$COLOR_HEAD_FORE = "#000000";
|
||||||
|
$COLOR_SUBH_BACK = "#D0D0FF";
|
||||||
|
$COLOR_SUBH_FORE = "#000000";
|
||||||
|
$COLOR_TEXT_BACK = "#E0E0FF";
|
||||||
|
$COLOR_TEXT_FORE = "#000000";
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Main MARS_NWE configuration
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
$mars_config = '/etc/mars_nwe/nwserv.conf';
|
||||||
|
$nonroot_user = 'nobody';
|
||||||
|
$smart_compact_nwservconf = 0;
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# SMArT internal file layout
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
$smart_conf_path = '/etc/mars_nwe/smart.conf';
|
||||||
|
$smart_nwclient_path = '/etc/mars_nwe/.nwclient';
|
||||||
|
$smart_static_dir = '/usr/libexec/mars_nwe/static';
|
||||||
|
$smart_log_path = '/var/log/mars_nwe/smart.log';
|
||||||
|
$smart_check_login = '/usr/libexec/mars_nwe/check_login';
|
||||||
|
|
||||||
|
# Optional override, usually not needed
|
||||||
|
# $smart_perl_path = '/usr/libexec/mars_nwe/smart';
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# nwwebui listener settings
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
$nw_bind_ip = '0.0.0.0';
|
||||||
|
$nw_log_level = 1;
|
||||||
|
$nw_daemonize = 0;
|
||||||
|
$nw_pid_file = '/run/mars_nwe/nwwebui.pid';
|
||||||
|
$nw_log_file = '/var/log/mars_nwe/nwwebui.log';
|
||||||
|
|
||||||
|
$nw_ssl_enable = 0;
|
||||||
|
$nw_http_port = 9080;
|
||||||
|
$nw_https_port = 9443;
|
||||||
|
|
||||||
|
$nw_cert_file = '/etc/mars_nwe/server.crt';
|
||||||
|
$nw_key_file = '/etc/mars_nwe/server.key';
|
||||||
|
```
|
||||||
|
|
||||||
|
## `smart.conf` settings explained
|
||||||
|
|
||||||
|
### UI colors
|
||||||
|
|
||||||
|
These variables define the default SMArT page colors:
|
||||||
|
|
||||||
|
- `$COLOR_BACK` – page background
|
||||||
|
- `$COLOR_HEAD_BACK` / `$COLOR_HEAD_FORE` – main section header colors
|
||||||
|
- `$COLOR_SUBH_BACK` / `$COLOR_SUBH_FORE` – subsection header colors
|
||||||
|
- `$COLOR_TEXT_BACK` / `$COLOR_TEXT_FORE` – regular content row colors
|
||||||
|
|
||||||
|
### Main MARS_NWE configuration
|
||||||
|
|
||||||
|
- `$mars_config` – path to the main `nwserv.conf` file that SMArT reads and updates
|
||||||
|
- `$nonroot_user` – unprivileged user account used when SMArT drops privileges
|
||||||
|
- `$smart_compact_nwservconf` – controls how `nwserv.conf` is written back:
|
||||||
|
- `0` keeps comments, spacing, and the original structure as much as possible
|
||||||
|
- `1` writes a more compact version without the original long comment layout
|
||||||
|
|
||||||
|
### SMArT internal file layout
|
||||||
|
|
||||||
|
- `$smart_conf_path` – absolute path to `smart.conf`
|
||||||
|
- `$smart_nwclient_path` – file used to store bindery login information for SMArT helper tools
|
||||||
|
- `$smart_static_dir` – directory containing HTML, icons, and other static assets
|
||||||
|
- `$smart_log_path` – log file used by the Perl-based SMArT frontend
|
||||||
|
- `$smart_check_login` – PAM-based authentication helper path
|
||||||
|
- `$smart_perl_path` – optional override for the main SMArT Perl executable; usually not needed
|
||||||
|
|
||||||
|
### `nwwebui` listener settings
|
||||||
|
|
||||||
|
- `$nw_bind_ip` – bind address for HTTP and HTTPS listeners, for example `0.0.0.0` for all IPv4 interfaces or `127.0.0.1` for localhost-only access
|
||||||
|
- `$nw_log_level` – service log verbosity:
|
||||||
|
- `0` = errors only
|
||||||
|
- `1` = informational messages
|
||||||
|
- `2` = debug output
|
||||||
|
- `$nw_daemonize` – whether `nwwebui` detaches into the background
|
||||||
|
- `$nw_pid_file` – location of the PID file
|
||||||
|
- `$nw_log_file` – log file written by `nwwebui`
|
||||||
|
- `$nw_ssl_enable` – enables or disables HTTPS support
|
||||||
|
- `$nw_http_port` – HTTP listener port; set to `0` to disable plain HTTP
|
||||||
|
- `$nw_https_port` – HTTPS listener port; set to `0` to disable HTTPS
|
||||||
|
- `$nw_cert_file` – PEM certificate path for TLS
|
||||||
|
- `$nw_key_file` – PEM private key path for TLS
|
||||||
|
|
||||||
|
The current code and template show that:
|
||||||
|
|
||||||
|
- `nwwebui` listens on `9080` for HTTP by default
|
||||||
|
- `9443` is used for HTTPS
|
||||||
|
- the log file can be configured with `$nw_log_file`
|
||||||
|
- the log path can also be overridden at runtime with `-l`
|
||||||
|
|
||||||
|
Because passwords may be transmitted during login, HTTPS is the recommended way to access the interface.
|
||||||
|
|
||||||
|
## Starting the service
|
||||||
|
|
||||||
|
Depending on the installation method, `nwwebui` can be started either via **systemd** or directly from the **command line**. The build system installs a `mars-nwe-webui.service` unit when systemd support is enabled.
|
||||||
|
|
||||||
|
### Starting with systemd
|
||||||
|
|
||||||
|
A typical installed system uses the `mars-nwe-webui.service` unit. The unit starts `nwwebui`, prepares the needed runtime directories, and loads the standard `smart.conf` file.
|
||||||
|
|
||||||
|
Typical commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
systemctl enable --now mars-nwe-webui.service
|
||||||
|
systemctl start mars-nwe-webui.service
|
||||||
|
systemctl stop mars-nwe-webui.service
|
||||||
|
systemctl restart mars-nwe-webui.service
|
||||||
|
systemctl status mars-nwe-webui.service
|
||||||
|
```
|
||||||
|
|
||||||
|
The service unit starts `nwwebui` with the equivalent of:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/usr/sbin/nwwebui -c /etc/mars_nwe/smart.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
### Starting from the command line
|
||||||
|
|
||||||
|
`nwwebui` can also be launched manually. The built-in usage text documents the supported options:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Usage: nwwebui [-h] [-d] [-s] [-c <smart.conf>] [-p <pidfile>] [-l <logfile>]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help Show this help text and exit
|
||||||
|
-d, --daemon Run in daemon mode
|
||||||
|
-s, --stop Stop the running nwwebui instance
|
||||||
|
-c, --config <file> Use an alternate smart.conf path
|
||||||
|
-p, --pidfile <file> Override PID file path
|
||||||
|
-l, --logfile <file> Override log file path
|
||||||
|
```
|
||||||
|
|
||||||
|
Typical examples:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# start in foreground with the standard configuration
|
||||||
|
/usr/sbin/nwwebui -c /etc/mars_nwe/smart.conf
|
||||||
|
|
||||||
|
# start in daemon mode
|
||||||
|
/usr/sbin/nwwebui -d -c /etc/mars_nwe/smart.conf
|
||||||
|
|
||||||
|
# stop a running instance
|
||||||
|
/usr/sbin/nwwebui -s -c /etc/mars_nwe/smart.conf
|
||||||
|
|
||||||
|
# use a custom PID file
|
||||||
|
/usr/sbin/nwwebui -d -c /etc/mars_nwe/smart.conf -p /run/mars_nwe/nwwebui.pid
|
||||||
|
|
||||||
|
# use a custom log file
|
||||||
|
/usr/sbin/nwwebui -c /etc/mars_nwe/smart.conf -l /var/log/mars_nwe/custom-nwwebui.log
|
||||||
|
|
||||||
|
# override both PID and log file
|
||||||
|
/usr/sbin/nwwebui -d -c /etc/mars_nwe/smart.conf -p /run/mars_nwe/nwwebui.pid -l /var/log/mars_nwe/nwwebui.log
|
||||||
|
```
|
||||||
|
|
||||||
|
The `-l` option overrides `$nw_log_file` from `smart.conf` at runtime.
|
||||||
|
|
||||||
|
Typical access URLs:
|
||||||
|
|
||||||
|
- `http://<host>:9080/`
|
||||||
|
- `https://<host>:9443/`
|
||||||
|
|
||||||
|
For production use, HTTPS should be preferred.
|
||||||
|
|
||||||
|
## Build and installation notes
|
||||||
|
|
||||||
|
This repository is built as part of the main `mars_nwe` build. The build system:
|
||||||
|
|
||||||
|
- generates `smart.conf` from the template
|
||||||
|
- generates the `smart` launcher script
|
||||||
|
- builds `nwwebui`
|
||||||
|
- builds `check_login`
|
||||||
|
- installs the PAM file and static UI assets
|
||||||
|
|
||||||
|
Because this repository is integrated as a Git submodule in `mars_nwe`, end users normally consume it through the main `mars_nwe` source tree and release packages rather than using it as a standalone project.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
SMArT is now an integrated part of the `mars_nwe` release and includes a dedicated `nwwebui` service that can expose the interface over both HTTP and HTTPS. The standard listener ports are **9080** for HTTP and **9443** for HTTPS. Authentication is handled through PAM, and the required `/etc/pam.d/smart` file is installed automatically together with the integrated MARS_NWE installation.
|
||||||
|
|||||||
25
mars-nwe-webui.service.cmake
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=MARS NWE Web UI
|
||||||
|
After=network.target mars-nwe-serv.service
|
||||||
|
Wants=network.target
|
||||||
|
Documentation=man:systemd.service(5)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
WorkingDirectory=/
|
||||||
|
|
||||||
|
ExecStartPre=/bin/mkdir -p @MARS_NWE_LOG_DIR@
|
||||||
|
ExecStartPre=/bin/mkdir -p @MARS_NWE_PID_DIR@
|
||||||
|
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/nwwebui -c @MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=2
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
PrivateTmp=true
|
||||||
|
ProtectSystem=full
|
||||||
|
ProtectHome=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
143
nwwebui.c
@@ -34,6 +34,7 @@ typedef struct {
|
|||||||
char cert_file[512];
|
char cert_file[512];
|
||||||
char key_file[512];
|
char key_file[512];
|
||||||
char pid_file[512];
|
char pid_file[512];
|
||||||
|
char log_file[512];
|
||||||
|
|
||||||
char smart_conf[512];
|
char smart_conf[512];
|
||||||
char smart_perl_path[512];
|
char smart_perl_path[512];
|
||||||
@@ -41,6 +42,7 @@ typedef struct {
|
|||||||
|
|
||||||
static FILE *g_log_fp = NULL;
|
static FILE *g_log_fp = NULL;
|
||||||
static int g_log_level = LOG_LEVEL_DEFAULT;
|
static int g_log_level = LOG_LEVEL_DEFAULT;
|
||||||
|
static char g_log_path[512] = LOG_PATH_DEFAULT;
|
||||||
|
|
||||||
static volatile sig_atomic_t g_terminate = 0;
|
static volatile sig_atomic_t g_terminate = 0;
|
||||||
static volatile sig_atomic_t g_got_signal = 0;
|
static volatile sig_atomic_t g_got_signal = 0;
|
||||||
@@ -52,7 +54,8 @@ static char g_pid_file_path[512] = { 0 };
|
|||||||
/* Console lifecycle output */
|
/* Console lifecycle output */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void console_msg(const char *fmt, ...) {
|
static void console_msg(const char *fmt, ...)
|
||||||
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
@@ -67,28 +70,42 @@ static void console_msg(const char *fmt, ...) {
|
|||||||
/* Logging */
|
/* Logging */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void log_open(void) {
|
static void log_open(void)
|
||||||
|
{
|
||||||
if (!g_log_fp) {
|
if (!g_log_fp) {
|
||||||
g_log_fp = fopen(LOG_PATH_DEFAULT, "a");
|
g_log_fp = fopen(g_log_path, "a");
|
||||||
if (!g_log_fp) {
|
if (!g_log_fp) {
|
||||||
g_log_fp = stderr;
|
g_log_fp = stderr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void log_msg(int level, const char *fmt, ...) {
|
static void log_reopen(const char *path)
|
||||||
|
{
|
||||||
|
if (g_log_fp && g_log_fp != stderr) {
|
||||||
|
fclose(g_log_fp);
|
||||||
|
}
|
||||||
|
g_log_fp = NULL;
|
||||||
|
|
||||||
|
snprintf(g_log_path, sizeof(g_log_path), "%s", path);
|
||||||
|
log_open();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void log_msg(int level, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
time_t now;
|
||||||
|
struct tm tm_now;
|
||||||
|
char tbuf[64];
|
||||||
|
const char *lvl = "INFO";
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
if (level > g_log_level) {
|
if (level > g_log_level) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_open();
|
log_open();
|
||||||
|
|
||||||
time_t now = time(NULL);
|
now = time(NULL);
|
||||||
struct tm tm_now;
|
|
||||||
char tbuf[64];
|
|
||||||
const char *lvl = "INFO";
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
localtime_r(&now, &tm_now);
|
localtime_r(&now, &tm_now);
|
||||||
strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", &tm_now);
|
strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", &tm_now);
|
||||||
|
|
||||||
@@ -108,12 +125,14 @@ static void log_msg(int level, const char *fmt, ...) {
|
|||||||
fflush(g_log_fp);
|
fflush(g_log_fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void die(const char *msg) {
|
static void die(const char *msg)
|
||||||
|
{
|
||||||
log_msg(LOG_LEVEL_ERROR, "%s: %s", msg, strerror(errno));
|
log_msg(LOG_LEVEL_ERROR, "%s: %s", msg, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ssl_die(const char *msg) {
|
static void ssl_die(const char *msg)
|
||||||
|
{
|
||||||
log_msg(LOG_LEVEL_ERROR, "%s", msg);
|
log_msg(LOG_LEVEL_ERROR, "%s", msg);
|
||||||
ERR_print_errors_fp(g_log_fp ? g_log_fp : stderr);
|
ERR_print_errors_fp(g_log_fp ? g_log_fp : stderr);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
@@ -123,7 +142,8 @@ static void ssl_die(const char *msg) {
|
|||||||
/* Helpers */
|
/* Helpers */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void trim(char *s) {
|
static void trim(char *s)
|
||||||
|
{
|
||||||
char *p = s;
|
char *p = s;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@@ -142,7 +162,8 @@ static void trim(char *s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void strip_quotes(char *s) {
|
static void strip_quotes(char *s)
|
||||||
|
{
|
||||||
size_t len = strlen(s);
|
size_t len = strlen(s);
|
||||||
|
|
||||||
if (len >= 2) {
|
if (len >= 2) {
|
||||||
@@ -154,7 +175,8 @@ static void strip_quotes(char *s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_perl_assignment(const char *line, char *key, size_t ksz, char *val, size_t vsz) {
|
static int parse_perl_assignment(const char *line, char *key, size_t ksz, char *val, size_t vsz)
|
||||||
|
{
|
||||||
const char *p = line;
|
const char *p = line;
|
||||||
size_t ki = 0;
|
size_t ki = 0;
|
||||||
size_t vi = 0;
|
size_t vi = 0;
|
||||||
@@ -202,11 +224,13 @@ static int parse_perl_assignment(const char *line, char *key, size_t ksz, char *
|
|||||||
return key[0] != '\0';
|
return key[0] != '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_exists_and_executable(const char *path) {
|
static int file_exists_and_executable(const char *path)
|
||||||
|
{
|
||||||
return access(path, X_OK) == 0;
|
return access(path, X_OK) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_nonblocking(int fd) {
|
static int set_nonblocking(int fd)
|
||||||
|
{
|
||||||
int flags = fcntl(fd, F_GETFL, 0);
|
int flags = fcntl(fd, F_GETFL, 0);
|
||||||
if (flags < 0) {
|
if (flags < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -217,18 +241,20 @@ static int set_nonblocking(int fd) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_usage(const char *progname) {
|
static void print_usage(const char *progname)
|
||||||
|
{
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"%s %s\n"
|
"%s %s\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Usage: %s [-h] [-d] [-s] [-c <smart.conf>] [-p <pidfile>]\n"
|
"Usage: %s [-h] [-d] [-s] [-c <smart.conf>] [-p <pidfile>] [-l <logfile>]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -h, --help Show this help text and exit\n"
|
" -h, --help Show this help text and exit\n"
|
||||||
" -d, --daemon Run in daemon mode\n"
|
" -d, --daemon Run in daemon mode\n"
|
||||||
" -s, --stop Stop the running nwwebui instance\n"
|
" -s, --stop Stop the running nwwebui instance\n"
|
||||||
" -c, --config <file> Use an alternate smart.conf path\n"
|
" -c, --config <file> Use an alternate smart.conf path\n"
|
||||||
" -p, --pidfile <file> Override PID file path\n",
|
" -p, --pidfile <file> Override PID file path\n"
|
||||||
|
" -l, --logfile <file> Override log file path\n",
|
||||||
NWWEBUI_NAME, NWWEBUI_VERSION, progname);
|
NWWEBUI_NAME, NWWEBUI_VERSION, progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,14 +262,16 @@ static void print_usage(const char *progname) {
|
|||||||
/* PID file handling */
|
/* PID file handling */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void remove_pid_file(void) {
|
static void remove_pid_file(void)
|
||||||
|
{
|
||||||
if (g_pid_file_written) {
|
if (g_pid_file_written) {
|
||||||
unlink(g_pid_file_path);
|
unlink(g_pid_file_path);
|
||||||
g_pid_file_written = 0;
|
g_pid_file_written = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_pid_file(const char *path) {
|
static void write_pid_file(const char *path)
|
||||||
|
{
|
||||||
FILE *fp = fopen(path, "w");
|
FILE *fp = fopen(path, "w");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
die("fopen pid file");
|
die("fopen pid file");
|
||||||
@@ -256,7 +284,8 @@ static void write_pid_file(const char *path) {
|
|||||||
g_pid_file_written = 1;
|
g_pid_file_written = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static pid_t read_pid_file(const char *path) {
|
static pid_t read_pid_file(const char *path)
|
||||||
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
long pid = -1;
|
long pid = -1;
|
||||||
|
|
||||||
@@ -279,7 +308,8 @@ static pid_t read_pid_file(const char *path) {
|
|||||||
return (pid_t)pid;
|
return (pid_t)pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_exists(pid_t pid) {
|
static int process_exists(pid_t pid)
|
||||||
|
{
|
||||||
if (pid <= 0) {
|
if (pid <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -295,7 +325,8 @@ static int process_exists(pid_t pid) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pid_is_nwwebui(pid_t pid) {
|
static int pid_is_nwwebui(pid_t pid)
|
||||||
|
{
|
||||||
char path[128];
|
char path[128];
|
||||||
char name[256];
|
char name[256];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@@ -319,7 +350,8 @@ static int pid_is_nwwebui(pid_t pid) {
|
|||||||
return strcmp(name, "nwwebui") == 0;
|
return strcmp(name, "nwwebui") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stop_running_instance(const char *pid_file) {
|
static int stop_running_instance(const char *pid_file)
|
||||||
|
{
|
||||||
pid_t pid = read_pid_file(pid_file);
|
pid_t pid = read_pid_file(pid_file);
|
||||||
|
|
||||||
if (pid <= 0) {
|
if (pid <= 0) {
|
||||||
@@ -353,7 +385,8 @@ static int stop_running_instance(const char *pid_file) {
|
|||||||
/* Daemonization */
|
/* Daemonization */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void daemonize_process(void) {
|
static void daemonize_process(void)
|
||||||
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
@@ -395,7 +428,8 @@ static void daemonize_process(void) {
|
|||||||
/* smart.conf loading */
|
/* smart.conf loading */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void init_defaults(nw_config_t *cfg, const char *smart_conf_path) {
|
static void init_defaults(nw_config_t *cfg, const char *smart_conf_path)
|
||||||
|
{
|
||||||
memset(cfg, 0, sizeof(*cfg));
|
memset(cfg, 0, sizeof(*cfg));
|
||||||
|
|
||||||
snprintf(cfg->bind_ip, sizeof(cfg->bind_ip), "%s", DEFAULT_BIND_IP);
|
snprintf(cfg->bind_ip, sizeof(cfg->bind_ip), "%s", DEFAULT_BIND_IP);
|
||||||
@@ -408,12 +442,16 @@ static void init_defaults(nw_config_t *cfg, const char *smart_conf_path) {
|
|||||||
snprintf(cfg->cert_file, sizeof(cfg->cert_file), "%s", DEFAULT_CERT_FILE);
|
snprintf(cfg->cert_file, sizeof(cfg->cert_file), "%s", DEFAULT_CERT_FILE);
|
||||||
snprintf(cfg->key_file, sizeof(cfg->key_file), "%s", DEFAULT_KEY_FILE);
|
snprintf(cfg->key_file, sizeof(cfg->key_file), "%s", DEFAULT_KEY_FILE);
|
||||||
snprintf(cfg->pid_file, sizeof(cfg->pid_file), "%s", DEFAULT_PID_FILE);
|
snprintf(cfg->pid_file, sizeof(cfg->pid_file), "%s", DEFAULT_PID_FILE);
|
||||||
|
snprintf(cfg->log_file, sizeof(cfg->log_file), "%s", LOG_PATH_DEFAULT);
|
||||||
|
|
||||||
snprintf(cfg->smart_perl_path, sizeof(cfg->smart_perl_path), "%s", DEFAULT_SMART_PERL);
|
snprintf(cfg->smart_perl_path, sizeof(cfg->smart_perl_path), "%s", DEFAULT_SMART_PERL);
|
||||||
snprintf(cfg->smart_conf, sizeof(cfg->smart_conf), "%s", smart_conf_path);
|
snprintf(cfg->smart_conf, sizeof(cfg->smart_conf), "%s", smart_conf_path);
|
||||||
|
|
||||||
|
snprintf(g_log_path, sizeof(g_log_path), "%s", LOG_PATH_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_smart_conf(nw_config_t *cfg) {
|
static void load_smart_conf(nw_config_t *cfg)
|
||||||
|
{
|
||||||
FILE *fp = fopen(cfg->smart_conf, "r");
|
FILE *fp = fopen(cfg->smart_conf, "r");
|
||||||
char line[2048];
|
char line[2048];
|
||||||
|
|
||||||
@@ -434,6 +472,8 @@ static void load_smart_conf(nw_config_t *cfg) {
|
|||||||
snprintf(cfg->bind_ip, sizeof(cfg->bind_ip), "%s", val);
|
snprintf(cfg->bind_ip, sizeof(cfg->bind_ip), "%s", val);
|
||||||
} else if (strcmp(key, "nw_log_level") == 0) {
|
} else if (strcmp(key, "nw_log_level") == 0) {
|
||||||
g_log_level = atoi(val);
|
g_log_level = atoi(val);
|
||||||
|
} else if (strcmp(key, "nw_log_file") == 0) {
|
||||||
|
snprintf(cfg->log_file, sizeof(cfg->log_file), "%s", val);
|
||||||
} else if (strcmp(key, "nw_ssl_enable") == 0) {
|
} else if (strcmp(key, "nw_ssl_enable") == 0) {
|
||||||
cfg->ssl_enable = atoi(val);
|
cfg->ssl_enable = atoi(val);
|
||||||
} else if (strcmp(key, "nw_http_port") == 0) {
|
} else if (strcmp(key, "nw_http_port") == 0) {
|
||||||
@@ -468,13 +508,16 @@ static void load_smart_conf(nw_config_t *cfg) {
|
|||||||
if (g_log_level > LOG_LEVEL_DEBUG) {
|
if (g_log_level > LOG_LEVEL_DEBUG) {
|
||||||
g_log_level = LOG_LEVEL_DEBUG;
|
g_log_level = LOG_LEVEL_DEBUG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(g_log_path, sizeof(g_log_path), "%s", cfg->log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
/* Listener / socket helpers */
|
/* Listener / socket helpers */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static int create_listener(const char *bind_ip, int port) {
|
static int create_listener(const char *bind_ip, int port)
|
||||||
|
{
|
||||||
int fd = socket(AF_INET, SOCK_STREAM, 0);
|
int fd = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
@@ -515,7 +558,8 @@ static int create_listener(const char *bind_ip, int port) {
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t write_all_fd(int fd, const unsigned char *buf, size_t len) {
|
static ssize_t write_all_fd(int fd, const unsigned char *buf, size_t len)
|
||||||
|
{
|
||||||
size_t off = 0;
|
size_t off = 0;
|
||||||
|
|
||||||
while (off < len) {
|
while (off < len) {
|
||||||
@@ -538,7 +582,8 @@ static ssize_t write_all_fd(int fd, const unsigned char *buf, size_t len) {
|
|||||||
return (ssize_t)off;
|
return (ssize_t)off;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t send_all_ssl(SSL *ssl, const unsigned char *buf, size_t len) {
|
static ssize_t send_all_ssl(SSL *ssl, const unsigned char *buf, size_t len)
|
||||||
|
{
|
||||||
size_t off = 0;
|
size_t off = 0;
|
||||||
|
|
||||||
while (off < len) {
|
while (off < len) {
|
||||||
@@ -560,7 +605,8 @@ static ssize_t send_all_ssl(SSL *ssl, const unsigned char *buf, size_t len) {
|
|||||||
/* Perl launcher */
|
/* Perl launcher */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static pid_t spawn_smart_perl(const nw_config_t *cfg, int *child_stdin_fd, int *child_stdout_fd) {
|
static pid_t spawn_smart_perl(const nw_config_t *cfg, int *child_stdin_fd, int *child_stdout_fd)
|
||||||
|
{
|
||||||
int inpipe[2] = { -1, -1 };
|
int inpipe[2] = { -1, -1 };
|
||||||
int outpipe[2] = { -1, -1 };
|
int outpipe[2] = { -1, -1 };
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
@@ -622,7 +668,8 @@ static pid_t spawn_smart_perl(const nw_config_t *cfg, int *child_stdin_fd, int *
|
|||||||
/* Shared child cleanup */
|
/* Shared child cleanup */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void cleanup_child_process(int *child_stdin_fd, int *child_stdout_fd, pid_t *child_pid) {
|
static void cleanup_child_process(int *child_stdin_fd, int *child_stdout_fd, pid_t *child_pid)
|
||||||
|
{
|
||||||
if (*child_stdin_fd >= 0) {
|
if (*child_stdin_fd >= 0) {
|
||||||
close(*child_stdin_fd);
|
close(*child_stdin_fd);
|
||||||
*child_stdin_fd = -1;
|
*child_stdin_fd = -1;
|
||||||
@@ -652,7 +699,8 @@ static void cleanup_child_process(int *child_stdin_fd, int *child_stdout_fd, pid
|
|||||||
/* Plain HTTP handler */
|
/* Plain HTTP handler */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void handle_connection_plain(int client_fd, const nw_config_t *cfg) {
|
static void handle_connection_plain(int client_fd, const nw_config_t *cfg)
|
||||||
|
{
|
||||||
int child_stdin_fd = -1;
|
int child_stdin_fd = -1;
|
||||||
int child_stdout_fd = -1;
|
int child_stdout_fd = -1;
|
||||||
pid_t child_pid = -1;
|
pid_t child_pid = -1;
|
||||||
@@ -739,7 +787,8 @@ cleanup:
|
|||||||
/* TLS handler */
|
/* TLS handler */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void handle_connection_tls(SSL_CTX *ctx, int client_fd, const nw_config_t *cfg) {
|
static void handle_connection_tls(SSL_CTX *ctx, int client_fd, const nw_config_t *cfg)
|
||||||
|
{
|
||||||
SSL *ssl = NULL;
|
SSL *ssl = NULL;
|
||||||
int child_stdin_fd = -1;
|
int child_stdin_fd = -1;
|
||||||
int child_stdout_fd = -1;
|
int child_stdout_fd = -1;
|
||||||
@@ -853,7 +902,8 @@ cleanup:
|
|||||||
/* Signal handlers */
|
/* Signal handlers */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
static void reap_children(int sig) {
|
static void reap_children(int sig)
|
||||||
|
{
|
||||||
(void)sig;
|
(void)sig;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -864,7 +914,8 @@ static void reap_children(int sig) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void term_handler(int sig) {
|
static void term_handler(int sig)
|
||||||
|
{
|
||||||
g_got_signal = sig;
|
g_got_signal = sig;
|
||||||
g_terminate = 1;
|
g_terminate = 1;
|
||||||
}
|
}
|
||||||
@@ -873,9 +924,11 @@ static void term_handler(int sig) {
|
|||||||
/* Main */
|
/* Main */
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
const char *smart_conf_path = DEFAULT_SMART_CONF;
|
const char *smart_conf_path = DEFAULT_SMART_CONF;
|
||||||
const char *pidfile_override = NULL;
|
const char *pidfile_override = NULL;
|
||||||
|
const char *logfile_override = NULL;
|
||||||
int http_fd = -1;
|
int http_fd = -1;
|
||||||
int https_fd = -1;
|
int https_fd = -1;
|
||||||
SSL_CTX *ctx = NULL;
|
SSL_CTX *ctx = NULL;
|
||||||
@@ -895,6 +948,8 @@ int main(int argc, char **argv) {
|
|||||||
smart_conf_path = argv[++i];
|
smart_conf_path = argv[++i];
|
||||||
} else if ((strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--pidfile") == 0) && i + 1 < argc) {
|
} else if ((strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--pidfile") == 0) && i + 1 < argc) {
|
||||||
pidfile_override = argv[++i];
|
pidfile_override = argv[++i];
|
||||||
|
} else if ((strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "--logfile") == 0) && i + 1 < argc) {
|
||||||
|
logfile_override = argv[++i];
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown argument: %s\n", argv[i]);
|
fprintf(stderr, "Unknown argument: %s\n", argv[i]);
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
@@ -949,6 +1004,12 @@ int main(int argc, char **argv) {
|
|||||||
snprintf(cfg.pid_file, sizeof(cfg.pid_file), "%s", pidfile_override);
|
snprintf(cfg.pid_file, sizeof(cfg.pid_file), "%s", pidfile_override);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (logfile_override) {
|
||||||
|
snprintf(cfg.log_file, sizeof(cfg.log_file), "%s", logfile_override);
|
||||||
|
}
|
||||||
|
|
||||||
|
log_reopen(cfg.log_file);
|
||||||
|
|
||||||
if (stop_mode) {
|
if (stop_mode) {
|
||||||
return stop_running_instance(cfg.pid_file);
|
return stop_running_instance(cfg.pid_file);
|
||||||
}
|
}
|
||||||
@@ -963,7 +1024,7 @@ int main(int argc, char **argv) {
|
|||||||
log_msg(LOG_LEVEL_INFO, "%s version %s starting", NWWEBUI_NAME, NWWEBUI_VERSION);
|
log_msg(LOG_LEVEL_INFO, "%s version %s starting", NWWEBUI_NAME, NWWEBUI_VERSION);
|
||||||
log_msg(LOG_LEVEL_INFO, "Using SMArT Perl path: %s", cfg.smart_perl_path);
|
log_msg(LOG_LEVEL_INFO, "Using SMArT Perl path: %s", cfg.smart_perl_path);
|
||||||
log_msg(LOG_LEVEL_INFO,
|
log_msg(LOG_LEVEL_INFO,
|
||||||
"%s version %s config loaded: bind=%s log_level=%d ssl_enable=%d http_port=%d https_port=%d daemonize=%d cert=%s key=%s pid_file=%s smart.conf=%s",
|
"%s version %s config loaded: bind=%s log_level=%d ssl_enable=%d http_port=%d https_port=%d daemonize=%d cert=%s key=%s pid_file=%s log_file=%s smart.conf=%s",
|
||||||
NWWEBUI_NAME,
|
NWWEBUI_NAME,
|
||||||
NWWEBUI_VERSION,
|
NWWEBUI_VERSION,
|
||||||
cfg.bind_ip,
|
cfg.bind_ip,
|
||||||
@@ -975,11 +1036,13 @@ int main(int argc, char **argv) {
|
|||||||
cfg.cert_file,
|
cfg.cert_file,
|
||||||
cfg.key_file,
|
cfg.key_file,
|
||||||
cfg.pid_file,
|
cfg.pid_file,
|
||||||
|
cfg.log_file,
|
||||||
cfg.smart_conf);
|
cfg.smart_conf);
|
||||||
|
|
||||||
if (cfg.daemonize) {
|
if (cfg.daemonize) {
|
||||||
console_msg("%s %s switching to daemon mode", NWWEBUI_NAME, NWWEBUI_VERSION);
|
console_msg("%s %s switching to daemon mode", NWWEBUI_NAME, NWWEBUI_VERSION);
|
||||||
daemonize_process();
|
daemonize_process();
|
||||||
|
log_reopen(cfg.log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
write_pid_file(cfg.pid_file);
|
write_pid_file(cfg.pid_file);
|
||||||
|
|||||||
BIN
opt/Lable.png
Normal file
|
After Width: | Height: | Size: 573 KiB |
BIN
opt/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
opt/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 393 KiB |
BIN
opt/logo-small.png
Normal file
|
After Width: | Height: | Size: 456 KiB |
BIN
opt/logo.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
785
settings.pl
526
smart.cmake
Executable file → Normal file
@@ -1,13 +1,12 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
#
|
|
||||||
# SMArT
|
# SMArT
|
||||||
#
|
#
|
||||||
# Main web frontend
|
# Main program file
|
||||||
#
|
#
|
||||||
# Copyright 2001 Wilmer van der Gaast (lintux@lintux.cx)
|
# Copyright 2001 Wilmer van der Gaast
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -26,295 +25,288 @@
|
|||||||
|
|
||||||
$redirected = 0;
|
$redirected = 0;
|
||||||
|
|
||||||
$smart_version = '@MARS_NWE_VERSION@';
|
$server_id = 'Server: SMArT/Perl/@MARS_NWE_VERSION@';
|
||||||
$server_id = 'Server: SMArT/Perl/' . $smart_version;
|
|
||||||
|
|
||||||
if( ! do('@MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf') )
|
do( '@MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf' )
|
||||||
{
|
or die "Could not load @MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf: $@ $!";
|
||||||
die "Could not load @MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf: $@ $!";
|
|
||||||
}
|
close( STDERR );
|
||||||
|
open( STDERR, '>>' . $smart_log_path )
|
||||||
|
or die "Could not open $smart_log_path: $!";
|
||||||
|
|
||||||
$ENV{HOME} = '@MARS_NWE_INSTALL_FULL_CONFDIR@';
|
$ENV{HOME} = '@MARS_NWE_INSTALL_FULL_CONFDIR@';
|
||||||
$smart_libexec_dir = '@MARS_NWE_INSTALL_FULL_LIBEXECDIR@';
|
$smart_libexec_dir = '@MARS_NWE_INSTALL_FULL_LIBEXECDIR@';
|
||||||
$smart_libexec_dir =~ s#/*$##;
|
$smart_libexec_dir =~ s#/*$##;
|
||||||
|
|
||||||
close( STDERR );
|
|
||||||
open( STDERR, '>>' . $smart_log_path ) or die "Could not open $smart_log_path: $!";
|
|
||||||
select( STDERR ); $| = 1;
|
|
||||||
select( STDOUT ); $| = 1;
|
|
||||||
|
|
||||||
sub log_timestamp()
|
|
||||||
{
|
|
||||||
my @t = localtime( time() );
|
|
||||||
return sprintf(
|
|
||||||
'%04d-%02d-%02d %02d:%02d:%02d',
|
|
||||||
$t[5] + 1900, $t[4] + 1, $t[3],
|
|
||||||
$t[2], $t[1], $t[0]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub log_msg( $$ )
|
|
||||||
{
|
|
||||||
my( $level, $msg ) = @_;
|
|
||||||
print STDERR '[' . log_timestamp() . '] [' . $level . '] [SMArT ' . $smart_version . '] ' . $msg . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub log_info( $ )
|
|
||||||
{
|
|
||||||
log_msg( 'INFO', $_[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub log_error( $ )
|
|
||||||
{
|
|
||||||
log_msg( 'ERROR', $_[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
log_info( 'starting' );
|
|
||||||
log_info( 'loaded configuration from ' . '@MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf' );
|
|
||||||
|
|
||||||
$l = <STDIN>;
|
$l = <STDIN>;
|
||||||
if( ! defined( $l ) )
|
|
||||||
{
|
|
||||||
log_error( 'no request line received on stdin' );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
$l =~ s/[\n\r]//g;
|
$l =~ s/[\n\r]//g;
|
||||||
log_info( 'request: ' . $l );
|
|
||||||
|
|
||||||
@c = split( ' ', $l );
|
@c = split( ' ', $l );
|
||||||
|
if( scalar( @c ) > 2 )
|
||||||
|
{
|
||||||
|
while( keys( %h ) < 15 ) # Who would ever want to send more headers???
|
||||||
|
{
|
||||||
|
$l = <STDIN>;
|
||||||
|
$l =~ s/[\n\r]//g;
|
||||||
|
if( $l eq '' )
|
||||||
|
{ last; }
|
||||||
|
$n = $l;
|
||||||
|
$n =~ s/:[^:]*$//g;
|
||||||
|
$v = $l;
|
||||||
|
$v =~ s/^[^:]*://g;
|
||||||
|
$h{$n} = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$c[0] = uc( $c[0] );
|
||||||
|
|
||||||
|
if( $h{Authorization} eq '' )
|
||||||
|
{ error( 401 ); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@s = split( ' ', $h{Authorization} );
|
||||||
|
if( $s[0] ne 'Basic' or length( $h{Authorization} ) > 80 ) # We can't be too careful, can we...
|
||||||
|
{ error( 401 ); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$s[1] =~ tr#A-Za-z0-9+/##cd;
|
||||||
|
$s[1] =~ tr#A-Za-z0-9+/# -_#;
|
||||||
|
$s[1] = pack( 'c', 32 + 0.75 * length( $s[1] ) ) . $s[1];
|
||||||
|
$s[1] = unpack( 'u', $s[1] );
|
||||||
|
$s[1] =~ s/[\r\n]//g;
|
||||||
|
@l = split( ':', $s[1] );
|
||||||
|
if( $l[0] ne 'root' )
|
||||||
|
{ error( 401 ); }
|
||||||
|
else
|
||||||
|
{ if( $x = system( $smart_check_login, @l ) )
|
||||||
|
{ error( 401 ); } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $c[0] ne 'GET' )
|
||||||
|
{
|
||||||
|
error( 501 );
|
||||||
|
}
|
||||||
|
|
||||||
|
@p = split( '\?', $c[1] );
|
||||||
$cc = $c[1];
|
$cc = $c[1];
|
||||||
@c = split( '/', $c[1] );
|
$cc =~ s/[^\?]*\?//;
|
||||||
shift( @c );
|
$c = substr( shift( @p ), 1 );
|
||||||
|
@p = split( '&', $p[0] );
|
||||||
sub error( $ )
|
foreach $p ( @p )
|
||||||
{
|
{
|
||||||
my( $e ) = @_;
|
$n = $p;
|
||||||
|
$n =~ s/=.*//;
|
||||||
log_error( 'HTTP error ' . $e . ' for request ' . $cc );
|
$v = $p;
|
||||||
|
$v =~ s/.*=//;
|
||||||
print <<EOF;
|
$v =~ s/\+/ /g;
|
||||||
HTTP/1.0 $e Error
|
$v =~ s/%([0-9A-F][0-9A-F])/pack('c',hex($1))/gie;
|
||||||
Content-Type: text/html
|
$p{$n} = $v;
|
||||||
$server_id
|
|
||||||
|
|
||||||
<HTML>
|
|
||||||
<BODY BGCOLOR=$COLOR_BACK>
|
|
||||||
<H1>Error $e</H1>
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
||||||
EOF
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
@c = split( '/', $c );
|
||||||
sub redirect( $ )
|
|
||||||
{
|
|
||||||
my( $u ) = @_;
|
|
||||||
|
|
||||||
print <<EOF;
|
|
||||||
HTTP/1.0 302 Found
|
|
||||||
Location: $u
|
|
||||||
$server_id
|
|
||||||
|
|
||||||
EOF
|
|
||||||
$redirected = 1;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub drop_root()
|
|
||||||
{
|
|
||||||
if( $> == 0 )
|
|
||||||
{
|
|
||||||
my $uid = getpwnam( $nonroot_user );
|
|
||||||
if( ! defined( $uid ) )
|
|
||||||
{
|
|
||||||
log_error( 'could not resolve non-root user ' . $nonroot_user );
|
|
||||||
error( 500 );
|
|
||||||
}
|
|
||||||
$> = $uid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_server()
|
|
||||||
{
|
|
||||||
open( SFILE, '<' . $smart_nwclient_path ) or do {
|
|
||||||
log_error( 'could not open ' . $smart_nwclient_path . ': ' . $! );
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
chomp( $line = <SFILE> );
|
|
||||||
close( SFILE );
|
|
||||||
|
|
||||||
$line =~ s/\/.*//;
|
|
||||||
return( $line );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_bindery_password()
|
|
||||||
{
|
|
||||||
open( SFILE, '<' . $smart_nwclient_path ) or do {
|
|
||||||
log_error( 'could not open ' . $smart_nwclient_path . ': ' . $! );
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
chomp( $line = <SFILE> );
|
|
||||||
close( SFILE );
|
|
||||||
|
|
||||||
$line =~ s/.* //;
|
|
||||||
return( $line );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub unix_userlist()
|
|
||||||
{
|
|
||||||
my( @l, @r, $u );
|
|
||||||
open( FILE, '</etc/passwd' ) or return();
|
|
||||||
while( <FILE> )
|
|
||||||
{
|
|
||||||
chomp;
|
|
||||||
@l = split( /:/ );
|
|
||||||
$u = {};
|
|
||||||
$u->{name} = $l[0];
|
|
||||||
$u->{uid} = $l[2];
|
|
||||||
push( @r, $u );
|
|
||||||
}
|
|
||||||
close( FILE );
|
|
||||||
return( @r );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub unix_grouplist()
|
|
||||||
{
|
|
||||||
my( @l, @r, $u );
|
|
||||||
open( FILE, '</etc/group' ) or return();
|
|
||||||
while( <FILE> )
|
|
||||||
{
|
|
||||||
chomp;
|
|
||||||
@l = split( /:/ );
|
|
||||||
$u = {};
|
|
||||||
$u->{name} = $l[0];
|
|
||||||
$u->{gid} = $l[2];
|
|
||||||
push( @r, $u );
|
|
||||||
}
|
|
||||||
close( FILE );
|
|
||||||
return( @r );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub write_property_string( $$$$$ )
|
|
||||||
{
|
|
||||||
my( $obj, $type, $prop, $seg, $len, $str ) = @_;
|
|
||||||
|
|
||||||
open( FILE, '|' . 'nwbpset -S ' . get_server() ) or return;
|
|
||||||
print FILE <<EOF;
|
|
||||||
000$type
|
|
||||||
$obj
|
|
||||||
$prop
|
|
||||||
$seg
|
|
||||||
$len
|
|
||||||
$str
|
|
||||||
EOF
|
|
||||||
close( FILE );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub read_property_string( $$$ )
|
|
||||||
{
|
|
||||||
my( $obj, $type, $prop ) = @_;
|
|
||||||
my( @l, $s );
|
|
||||||
|
|
||||||
open( FILE, 'nwbpvalues -S ' . get_server() . ' -o ' . $obj . ' -t ' . $type . ' -p ' . $prop . ' |' ) or return '';
|
|
||||||
@l = <FILE>;
|
|
||||||
close( FILE );
|
|
||||||
|
|
||||||
$s = join( '', @l );
|
|
||||||
$s =~ s/[\r\n]+$//g;
|
|
||||||
return( $s );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub authenticate()
|
|
||||||
{
|
|
||||||
my( @h, $auth, @l, $x );
|
|
||||||
|
|
||||||
while( $l = <STDIN> )
|
|
||||||
{
|
|
||||||
$l =~ s/[\n\r]//g;
|
|
||||||
last if $l eq '';
|
|
||||||
push( @h, $l );
|
|
||||||
}
|
|
||||||
|
|
||||||
($auth) = grep( /^Authorization: /i, @h );
|
|
||||||
if( $auth eq '' )
|
|
||||||
{
|
|
||||||
print <<EOF;
|
|
||||||
HTTP/1.0 401 Unauthorized
|
|
||||||
WWW-Authenticate: Basic realm="SMArT"
|
|
||||||
$server_id
|
|
||||||
|
|
||||||
EOF
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$auth =~ s/^Authorization:\s*Basic\s*//i;
|
|
||||||
$auth = unpack( 'u', $auth ) if $auth =~ /^[\x20-\x7e]+$/ && $auth !~ /:/;
|
|
||||||
$auth =~ s/[\r\n]//g;
|
|
||||||
|
|
||||||
@l = split( ':', $auth, 2 );
|
|
||||||
if( $l[0] ne 'root' )
|
|
||||||
{
|
|
||||||
log_error( 'authentication failed for non-root user ' . $l[0] );
|
|
||||||
error( 401 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$x = system( $smart_check_login, @l );
|
|
||||||
if( $x )
|
|
||||||
{
|
|
||||||
log_error( 'authentication failed for user root' );
|
|
||||||
error( 401 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
authenticate();
|
|
||||||
|
|
||||||
if( $c[0] eq 'apply' )
|
if( $c[0] eq 'apply' )
|
||||||
{
|
{
|
||||||
do( $smart_libexec_dir . '/readconfig.pl' ) or do {
|
do( $smart_libexec_dir . '/readconfig.pl' );
|
||||||
log_error( 'could not load readconfig.pl: ' . $@ . ' ' . $! );
|
do( $smart_libexec_dir . '/apply.pl' );
|
||||||
error( 500 );
|
handle_request();
|
||||||
};
|
exit;
|
||||||
do( $smart_libexec_dir . '/apply.pl' ) or do {
|
|
||||||
log_error( 'could not load apply.pl: ' . $@ . ' ' . $! );
|
|
||||||
error( 500 );
|
|
||||||
};
|
|
||||||
handle_request();
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
elsif( $c[0] eq 'settings' )
|
elsif( $c[0] eq 'settings' )
|
||||||
{
|
{
|
||||||
do( $smart_libexec_dir . '/readconfig.pl' ) or do {
|
do( $smart_libexec_dir . '/readconfig.pl' );
|
||||||
log_error( 'could not load readconfig.pl: ' . $@ . ' ' . $! );
|
|
||||||
error( 500 );
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
drop_root();
|
drop_root();
|
||||||
|
|
||||||
if( $cc eq '/' or $cc eq '' )
|
if( $c[0] eq '' )
|
||||||
{
|
{
|
||||||
redirect( '/static/start.html' );
|
print <<EOF;
|
||||||
|
HTTP/1.0 200 OK
|
||||||
|
Content-Type: text/html
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<TITLE>SMArT</TITLE>
|
||||||
|
</HEAD>
|
||||||
|
<FRAMESET COLS="50%,50%">
|
||||||
|
<FRAME NAME="MENU" SRC="/static/menu.html">
|
||||||
|
<FRAME NAME="OPTS" SRC="/static/start.html">
|
||||||
|
</FRAMESET>
|
||||||
|
</HTML>
|
||||||
|
EOF
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
elsif( $c[0] eq 'static' )
|
elsif( $c[0] eq 'static' )
|
||||||
{
|
{
|
||||||
do( $smart_libexec_dir . '/static.pl' ) or do {
|
do( $smart_libexec_dir . '/static.pl' );
|
||||||
log_error( 'could not load static.pl: ' . $@ . ' ' . $! );
|
|
||||||
error( 500 );
|
|
||||||
};
|
|
||||||
handle_request();
|
|
||||||
}
|
}
|
||||||
elsif( $c[0] eq 'settings' )
|
elsif( $c[0] eq 'settings' )
|
||||||
{
|
{
|
||||||
do( $smart_libexec_dir . '/settings.pl' ) or do {
|
do( $smart_libexec_dir . '/settings.pl' );
|
||||||
log_error( 'could not load settings.pl: ' . $@ . ' ' . $! );
|
|
||||||
error( 500 );
|
|
||||||
};
|
|
||||||
handle_request();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error( 'unknown path ' . $cc );
|
error( 500 );
|
||||||
error( 404 );
|
}
|
||||||
|
|
||||||
|
handle_request();
|
||||||
|
exit;
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
##### END OF MAIN PROCEDURES FOLLOW #####
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
sub error( $ )
|
||||||
|
{
|
||||||
|
if( $_[0] eq '401' )
|
||||||
|
{
|
||||||
|
print <<EOF;
|
||||||
|
HTTP/1.0 401 Access denied
|
||||||
|
Content-Type: text/plain
|
||||||
|
WWW-Authenticate: Basic realm="SMArT"
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
You're not allowed to access this URL.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
elsif( $_[0] eq '404' )
|
||||||
|
{
|
||||||
|
print <<EOF;
|
||||||
|
HTTP/1.0 404 File not found
|
||||||
|
Content-Type: text/plain
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
The file you requested does not exist.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
elsif( $_[0] eq '501' )
|
||||||
|
{
|
||||||
|
print <<EOF;
|
||||||
|
HTTP/1.0 501 Unknown command
|
||||||
|
Content-Type: text/plain
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
Unknown command: $c[0]
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print <<EOF;
|
||||||
|
HTTP/1.0 500 Internal server error
|
||||||
|
Content-Type: text/plain
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
Something went wrong...
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub unix_userlist()
|
||||||
|
{
|
||||||
|
my( @c, @d, %e );
|
||||||
|
|
||||||
|
while( @d = getpwent )
|
||||||
|
{
|
||||||
|
unshift( @c, { name => $d[0], uid => $d[2] } );
|
||||||
|
}
|
||||||
|
return( sort( { $a->{"name"} cmp $b->{"name"} } @c ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub unix_grouplist()
|
||||||
|
{
|
||||||
|
my( @c, @d, %e );
|
||||||
|
|
||||||
|
while( @d = getgrent )
|
||||||
|
{
|
||||||
|
unshift( @c, { name => $d[0], gid => $d[2] } );
|
||||||
|
}
|
||||||
|
return( sort( { $a->{"name"} cmp $b->{"name"} } @c ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub redirect( $ )
|
||||||
|
{
|
||||||
|
if( $redirected != 0 )
|
||||||
|
{ return( 0 ); }
|
||||||
|
$redirected = 1;
|
||||||
|
print <<EOF;
|
||||||
|
HTTP/1.0 302 Page relocated
|
||||||
|
Content-Type: text/plain
|
||||||
|
Location: $_[0]
|
||||||
|
$server_id
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_server
|
||||||
|
{
|
||||||
|
open( SFILE, '<' . $smart_nwclient_path );
|
||||||
|
chomp( $line = <SFILE> );
|
||||||
|
close( SFILE );
|
||||||
|
|
||||||
|
$line =~ s/\/.*//;
|
||||||
|
return( $line );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub get_bindery_password
|
||||||
|
{
|
||||||
|
open( SFILE, '<' . $smart_nwclient_path );
|
||||||
|
chomp( $line = <SFILE> );
|
||||||
|
close( SFILE );
|
||||||
|
|
||||||
|
$line =~ s/.* //;
|
||||||
|
return( $line );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub read_property_string
|
||||||
|
{
|
||||||
|
my @x = split( "\n", `nwbpvalues -c -o $_[0] -t $_[1] -p $_[2] -S $server` );
|
||||||
|
my( $i, $s );
|
||||||
|
|
||||||
|
$i = 5;
|
||||||
|
while( hex( $x[$i] ) > 0 )
|
||||||
|
{
|
||||||
|
$s .= pack( 'c', hex( $x[$i] ) );
|
||||||
|
$i ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return( $s );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub read_property_list
|
||||||
|
{
|
||||||
|
my @x = split( "\n", `nwbpvalues -c -o $_[0] -t $_[1] -p $_[2] -S $server` );
|
||||||
|
my( $i, @l );
|
||||||
|
|
||||||
|
$i = 6;
|
||||||
|
while( $x[$i] ne '' )
|
||||||
|
{
|
||||||
|
unshift( @l, $x[$i] );
|
||||||
|
$i += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return( @l );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub write_property_string
|
||||||
|
{
|
||||||
|
open( FILE, '|' . 'nwbpset -S ' . $server );
|
||||||
|
print FILE <<EOF;
|
||||||
|
000$_[1]
|
||||||
|
$_[0]
|
||||||
|
$_[2]
|
||||||
|
$_[3]
|
||||||
|
$_[4]
|
||||||
|
EOF
|
||||||
|
for $i ( 0 .. length( $_[5] ) - 1 )
|
||||||
|
{
|
||||||
|
print( FILE unpack( 'H2', substr( $_[5], $i, 1 ) ) . "\n" );
|
||||||
|
}
|
||||||
|
close( FILE );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub drop_root
|
||||||
|
{
|
||||||
|
$< = $> = getpwnam( $nonroot_user );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,9 @@ $nw_daemonize = 0;
|
|||||||
# PID file written by nwwebui.
|
# PID file written by nwwebui.
|
||||||
$nw_pid_file = '@MARS_NWE_PID_DIR@/nwwebui.pid';
|
$nw_pid_file = '@MARS_NWE_PID_DIR@/nwwebui.pid';
|
||||||
|
|
||||||
|
# Log file written by nwwebui.
|
||||||
|
$nw_log_file = '@MARS_NWE_LOG_DIR@/nwwebui.log';
|
||||||
|
|
||||||
# Enable or disable TLS/SSL support.
|
# Enable or disable TLS/SSL support.
|
||||||
# 1 = enable HTTPS listener
|
# 1 = enable HTTPS listener
|
||||||
# 0 = disable HTTPS listener
|
# 0 = disable HTTPS listener
|
||||||
|
|||||||
4
smart.pamd
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
auth required pam_unix.so
|
||||||
|
account required pam_unix.so
|
||||||
|
password required pam_unix.so
|
||||||
|
session required pam_unix.so
|
||||||
53
static.pl
@@ -5,22 +5,8 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2001 Wilmer van der Gaast (lintux@lintux.cx)
|
# Copyright 2001 Wilmer van der Gaast (lintux@lintux.cx)
|
||||||
#
|
#
|
||||||
|
# Updated with favicon and modern asset MIME type support.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
sub handle_request()
|
sub handle_request()
|
||||||
{
|
{
|
||||||
@@ -32,6 +18,7 @@ sub handle_request()
|
|||||||
}
|
}
|
||||||
$e = $f;
|
$e = $f;
|
||||||
$e =~ s/^.*\.//;
|
$e =~ s/^.*\.//;
|
||||||
|
$e = lc( $e );
|
||||||
if( $e eq 'html' )
|
if( $e eq 'html' )
|
||||||
{
|
{
|
||||||
$t = 'text/html';
|
$t = 'text/html';
|
||||||
@@ -40,22 +27,48 @@ sub handle_request()
|
|||||||
{
|
{
|
||||||
$t = 'image/gif';
|
$t = 'image/gif';
|
||||||
}
|
}
|
||||||
elsif( $e eq 'jpg' )
|
elsif( $e eq 'jpg' || $e eq 'jpeg' )
|
||||||
{
|
{
|
||||||
$t = 'image/jpeg';
|
$t = 'image/jpeg';
|
||||||
}
|
}
|
||||||
|
elsif( $e eq 'png' )
|
||||||
|
{
|
||||||
|
$t = 'image/png';
|
||||||
|
}
|
||||||
|
elsif( $e eq 'ico' )
|
||||||
|
{
|
||||||
|
$t = 'image/x-icon';
|
||||||
|
}
|
||||||
|
elsif( $e eq 'svg' )
|
||||||
|
{
|
||||||
|
$t = 'image/svg+xml';
|
||||||
|
}
|
||||||
|
elsif( $e eq 'webp' )
|
||||||
|
{
|
||||||
|
$t = 'image/webp';
|
||||||
|
}
|
||||||
|
elsif( $e eq 'css' )
|
||||||
|
{
|
||||||
|
$t = 'text/css';
|
||||||
|
}
|
||||||
|
elsif( $e eq 'js' )
|
||||||
|
{
|
||||||
|
$t = 'application/javascript';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$t = 'application/octet-stream';
|
$t = 'application/octet-stream';
|
||||||
}
|
}
|
||||||
print <<EOF;
|
print <<EOF2;
|
||||||
HTTP/1.0 200 OK
|
HTTP/1.0 200 OK
|
||||||
Content-Type: $t
|
Content-Type: $t
|
||||||
$server_id
|
$server_id
|
||||||
|
|
||||||
EOF
|
EOF2
|
||||||
while( <FILE> )
|
binmode( FILE );
|
||||||
|
while( read( FILE, $buf, 8192 ) )
|
||||||
{
|
{
|
||||||
print;
|
print $buf;
|
||||||
}
|
}
|
||||||
|
close( FILE );
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
static/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
static/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 973 B |
BIN
static/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
static/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
725
static/menu.html
@@ -1,56 +1,71 @@
|
|||||||
<HTML>
|
<!DOCTYPE html>
|
||||||
<BODY BGCOLOR=#F0F0FF>
|
<html>
|
||||||
|
<head>
|
||||||
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
|
<meta charset="utf-8">
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<TD>
|
<title>SMArT Main menu</title>
|
||||||
<IMG SRC="/static/smart_icon.jpg"><BR>
|
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
|
||||||
</TD>
|
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
|
||||||
<TD ALIGN=RIGHT>
|
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
|
||||||
<B><FONT SIZE=+2>Main menu</FONT></B><BR>
|
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
|
||||||
</TD>
|
<style>
|
||||||
</TR>
|
:root{--bg:#f4f1ea;--panel:#faf8f4;--line:#dfd2bf;--soft:#efe6d7;--text:#3d342c;--muted:#6f6257;--accent:#ad1d1c;--accent2:#c96b3d;--gold:#b9813d;}
|
||||||
|
*{box-sizing:border-box} html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font:15px/1.55 Arial,Helvetica,sans-serif}
|
||||||
<TR>
|
body{padding:18px}
|
||||||
<TD HEIGHT=25>
|
a{color:inherit} code,tt{font-family:"DejaVu Sans Mono",monospace}
|
||||||
</TD>
|
.shell{max-width:1100px;margin:0 auto}
|
||||||
</TR>
|
.hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px 24px;border:1px solid var(--line);border-radius:18px;background:linear-gradient(135deg,#a80f18,#c44731 60%,#d79a54);color:#fff;box-shadow:0 12px 30px rgba(64,36,12,.08)}
|
||||||
<TR BGCOLOR=#C0C0FF>
|
.hero img{height:42px;width:auto;display:block;background:#fff;border-radius:10px;padding:5px;box-shadow:0 8px 20px rgba(0,0,0,.12)}
|
||||||
<TD COLSPAN=2>
|
.hero h1{margin:0;font-size:28px;line-height:1.1}
|
||||||
<A HREF="/settings/general" TARGET="OPTS"><B><FONT SIZE=+2>General settings</FONT></B></A>
|
.hero p{margin:6px 0 0;font-size:15px;opacity:.95}
|
||||||
</TD>
|
.grid{margin-top:18px;display:grid;gap:16px}
|
||||||
</TR>
|
.card{display:block;text-decoration:none;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 6px 18px rgba(64,36,12,.04)}
|
||||||
<TR BGCOLOR=#D0D0FF>
|
.card-header{padding:16px 18px;background:linear-gradient(90deg,#efe7da,#e8dfcf);border-bottom:1px solid var(--line)}
|
||||||
<TD COLSPAN=2>
|
.card-title{margin:0;font-size:18px;color:var(--accent)}
|
||||||
<B>Servername</B>
|
.card-sub{margin:6px 0 0;color:var(--gold);font-size:12px;text-transform:uppercase;letter-spacing:.12em}
|
||||||
</TD>
|
.card-body{padding:0}
|
||||||
</TR>
|
.info{padding:16px 18px;border-top:1px solid #eee5d7}
|
||||||
<TR BGCOLOR=#E0E0FF>
|
.info:first-child{border-top:0}
|
||||||
<TD COLSPAN=2>
|
.info h3{margin:0 0 8px;font-size:15px;color:#8b4a1d}
|
||||||
|
.info p,.info ul,.info ol{margin:0 0 10px;color:var(--muted)}
|
||||||
The servername is the name under which this server will show up when using
|
.info p:last-child,.info ul:last-child,.info ol:last-child{margin-bottom:0}
|
||||||
tools like <TT>SLIST</TT> (server-list).<BR>
|
.info ul,.info ol{padding-left:22px}
|
||||||
|
.note{color:#5f5349}
|
||||||
|
@media (max-width:700px){body{padding:12px}.hero{padding:18px;align-items:flex-start;flex-direction:column}.hero img{height:36px}.card-header{padding:14px 16px}.info{padding:14px 16px}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="shell">
|
||||||
|
<div class="hero">
|
||||||
|
<div>
|
||||||
|
<h1>Main menu</h1>
|
||||||
|
<p>SMArT configuration navigation with the original explanations preserved.</p>
|
||||||
|
</div>
|
||||||
|
<img src="/static/smart_icon.jpg" alt="SMArT logo">
|
||||||
|
</div>
|
||||||
|
<div class="grid">
|
||||||
|
<a class="card" href="/settings/general" target="OPTS">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2 class="card-title">General settings</h2>
|
||||||
|
<div class="card-sub">Open settings</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="info">
|
||||||
|
<h3>Servername</h3>
|
||||||
|
<div class="note">The servername is the name under which this server will show up when using
|
||||||
|
tools like <tt>SLIST</tt> (server-list).<br/>
|
||||||
If you don't supply an entry for this section, the hostname of your
|
If you don't supply an entry for this section, the hostname of your
|
||||||
Linux-machine will be converted to all-uppercase and used as the servername.
|
Linux-machine will be converted to all-uppercase and used as the servername.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
<div class="info">
|
||||||
</TR>
|
<h3>Internal network number</h3>
|
||||||
|
<div class="note">If have dealt with the TCP/IP-configuration of your Linux-Box, the term
|
||||||
<TR BGCOLOR=#D0D0FF>
|
<i>ip-address</i> may be familiar to you. It's a numer that uniquely
|
||||||
<TD COLSPAN=2>
|
identifies your machine in the internet.<br/>
|
||||||
<B>Internal network number</B>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
If have dealt with the TCP/IP-configuration of your Linux-Box, the term
|
|
||||||
<I>ip-address</I> may be familiar to you. It's a numer that uniquely
|
|
||||||
identifies your machine in the internet.<BR>
|
|
||||||
As you might already expect, even the IPX-people use a unique number to
|
As you might already expect, even the IPX-people use a unique number to
|
||||||
identify each other. Addresses in the IPX-world always consist of a
|
identify each other. Addresses in the IPX-world always consist of a
|
||||||
4-byte network-number plus a 6-byte node-number (remember the
|
4-byte network-number plus a 6-byte node-number (remember the
|
||||||
ip-addresses also use 4-bytes).<BR>
|
ip-addresses also use 4-bytes).<br/>
|
||||||
The numbering-rule for ipx-clients is easy: their address is the
|
The numbering-rule for ipx-clients is easy: their address is the
|
||||||
external-network of the server they are connected to plus the
|
external-network of the server they are connected to plus the
|
||||||
hardware-address of their own ethernet-card (6 byte). As a result of this
|
hardware-address of their own ethernet-card (6 byte). As a result of this
|
||||||
@@ -58,425 +73,301 @@ rule, the clients can determine their address automatically (by listening
|
|||||||
to the server and looking at their own ethernet-hardware) and no
|
to the server and looking at their own ethernet-hardware) and no
|
||||||
configuration-files on the clients-side have to be maintained. (It would
|
configuration-files on the clients-side have to be maintained. (It would
|
||||||
really be a nasty thing if you think of very many DOS-clients [remember:
|
really be a nasty thing if you think of very many DOS-clients [remember:
|
||||||
DOS is an OS where ordinary users can screw up the configuration files].)<BR>
|
DOS is an OS where ordinary users can screw up the configuration files].)<br/>
|
||||||
For internal routing purposes, a NetWare-server has an <I>internal network</I><BR>
|
For internal routing purposes, a NetWare-server has an <i>internal network</i><br/>
|
||||||
As there is no organisation which regulates the use of network-numbers
|
As there is no organisation which regulates the use of network-numbers
|
||||||
in the IPX-world, you have to run <TT>SLIST</TT> (under DOS or Linux) to
|
in the IPX-world, you have to run <tt>SLIST</tt> (under DOS or Linux) to
|
||||||
determine a number that isn't already used by another server on your
|
determine a number that isn't already used by another server on your
|
||||||
net. You better double-check and ask the other network administrators
|
net. You better double-check and ask the other network administrators
|
||||||
before using a random value because not all servers might be on-line when
|
before using a random value because not all servers might be on-line when
|
||||||
you listen to the net.<BR>
|
you listen to the net.<br/>
|
||||||
A reasonable choice for the internal net-number of your MARS_NWE-server
|
A reasonable choice for the internal net-number of your MARS_NWE-server
|
||||||
could be the ip-address of your Linux-Box. It is reasonable because
|
could be the ip-address of your Linux-Box. It is reasonable because
|
||||||
ip-addresse are unique and if every nw-administrator uses only this uniqe
|
ip-addresse are unique and if every nw-administrator uses only this uniqe
|
||||||
value, potential conflicts will be minimized. Of course this choice is
|
value, potential conflicts will be minimized. Of course this choice is
|
||||||
no guarantee and it only works if your Linux-Box IP is well configured.<BR>
|
no guarantee and it only works if your Linux-Box IP is well configured.<br/>
|
||||||
Please note that you have to specify the address of your internal
|
Please note that you have to specify the address of your internal
|
||||||
IPX-network in hexadecimal format (the leading <TT>0x</TT> indicates it).<BR>
|
IPX-network in hexadecimal format (the leading <tt>0x</tt> indicates it).<br/>
|
||||||
<B>Most people who use FreeBSD want to set the network number of their IPX
|
<b>Most people who use FreeBSD want to set the network number of their IPX
|
||||||
network here</B>
|
network here</b></div>
|
||||||
|
</div>
|
||||||
</TD>
|
<div class="info">
|
||||||
</TR>
|
<h3>Tests at startup</h3>
|
||||||
|
<div class="note">If you want some sanity checks at startup, set this flag, so
|
||||||
<TR BGCOLOR=#D0D0FF>
|
MARS_NWE will try to create/change missing directories:<br/>
|
||||||
<TD COLSPAN=2>
|
<tt>SYS:LOGIN, SYS:MAIL, SYS:MAIL/XXX, SYS:PUBLIC, SYS:SYSTEM ...</tt>
|
||||||
<B>Tests at startup</B>
|
(with the right permissions, of course)<br/>
|
||||||
</TD>
|
This should also be enabled when you use a new MARS_NWE version.<br/>
|
||||||
</TR>
|
Disabling this test only spares little time when starting MARS_NWE.<br/></div>
|
||||||
<TR BGCOLOR=#E0E0FF>
|
</div>
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
|
<h3>Server version</h3>
|
||||||
If you want some sanity checks at startup, set this flag, so
|
<div class="note">Some clients work better if the server tells that it is a 3.11 Server,
|
||||||
MARS_NWE will try to create/change missing directories:<BR>
|
|
||||||
<TT>SYS:LOGIN, SYS:MAIL, SYS:MAIL/XXX, SYS:PUBLIC, SYS:SYSTEM ...</TT>
|
|
||||||
(with the right permissions, of course)<BR>
|
|
||||||
This should also be enabled when you use a new MARS_NWE version.<BR>
|
|
||||||
Disabling this test only spares little time when starting MARS_NWE.<BR>
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
<B>Server version</B>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
Some clients work better if the server tells that it is a 3.11 Server,
|
|
||||||
although many calls (namespace services) of a real 3.11 Server are
|
although many calls (namespace services) of a real 3.11 Server are
|
||||||
missing yet.<BR>
|
missing yet.<br/>
|
||||||
If you want to use longfilenamesupport and/or namespace routines
|
If you want to use longfilenamesupport and/or namespace routines
|
||||||
you should set this section to '1' or '2'<BR>
|
you should set this section to '1' or '2'<br/>
|
||||||
And you should read doc/FAQS.<BR>
|
And you should read doc/FAQS.<br/></div>
|
||||||
|
</div>
|
||||||
</TD>
|
<div class="info">
|
||||||
</TR>
|
<h3>Burst mode</h3>
|
||||||
|
<div class="note">If you want to test Burst mode you can enable it here, and in config.h
|
||||||
<TR BGCOLOR=#D0D0FF>
|
you must set <tt>ENABLE_BURSTMODE</tt> to 1. Also, you have to set the
|
||||||
<TD COLSPAN=2>
|
server version number to 3.12 .<br/>
|
||||||
<B>Burst mode</B>
|
<b>MAX_BURST_READ/WRITE_BUF:</b><br/>
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
If you want to test Burst mode you can enable it here, and in config.h
|
|
||||||
you must set <TT>ENABLE_BURSTMODE</TT> to 1. Also, you have to set the
|
|
||||||
server version number to 3.12 .<BR>
|
|
||||||
<B>MAX_BURST_READ/WRITE_BUF:</B><BR>
|
|
||||||
Don't ask me what they mean, but they're hexadecimal, so don't forget to
|
Don't ask me what they mean, but they're hexadecimal, so don't forget to
|
||||||
prepend <TT>0x</TT>.
|
prepend <tt>0x</tt>.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/dirs" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Directories</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/dirs" TARGET="OPTS"><B><FONT SIZE=+2>Directories</FONT></B></A>
|
<div class="note">Some directories for MARS_NWE files.
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
Some directories for MARS_NWE files.
|
|
||||||
The path cache directory is needed for Client-32 and the namespace calls,
|
The path cache directory is needed for Client-32 and the namespace calls,
|
||||||
the spool directory is used for internal print queue handling.
|
the spool directory is used for internal print queue handling.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/configh" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Precompiled settings</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/configh" TARGET="OPTS"><B><FONT SIZE=+2>Precompiled settings</FONT></B></A>
|
<div class="note">When you just leave these fields empty, the values in your <tt>config.h</tt>
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
When you just leave these fields empty, the values in your <TT>config.h</TT>
|
|
||||||
file will be used. If you want to change those settings without recompiling
|
file will be used. If you want to change those settings without recompiling
|
||||||
<TT>MARS_NWE</TT>, you can change them here.
|
<tt>MARS_NWE</tt>, you can change them here.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/security" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Security</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/security" TARGET="OPTS"><B><FONT SIZE=+2>Security</FONT></B></A>
|
<h3>Modes</h3>
|
||||||
</TD>
|
<div class="note">Here you can change the standard modes for new files and directories.
|
||||||
</TR>
|
You can enter <tt>0</tt> here to use the default value, and you can enter
|
||||||
<TR BGCOLOR=#D0D0FF>
|
<tt>-1</tt> for the directory <tt>creat()</tt> mode to use the
|
||||||
<TD COLSPAN=2>
|
<tt>st_mode</tt> of the parent directory.</div>
|
||||||
<B>Modes</B>
|
</div>
|
||||||
</TD>
|
<div class="info">
|
||||||
</TR>
|
<h3>Password handling of DOS-clients</h3>
|
||||||
<TR BGCOLOR=#E0E0FF>
|
<div class="note">When changing your MARS_NWE-password from a DOS-client, this client
|
||||||
<TD COLSPAN=2>
|
(think of "<tt>LOGIN.EXE</tt>", "<tt>SYSCON.EXE</tt>" or "<tt>SETPASS.EXE</tt>")
|
||||||
|
|
||||||
Here you can change the standard modes for new files and directories.
|
|
||||||
You can enter <TT>0</TT> here to use the default value, and you can enter
|
|
||||||
<TT>-1</TT> for the directory <TT>creat()</TT> mode to use the
|
|
||||||
<TT>st_mode</TT> of the parent directory.
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
<B>Password handling of DOS-clients</B>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
When changing your MARS_NWE-password from a DOS-client, this client
|
|
||||||
(think of "<TT>LOGIN.EXE</TT>", "<TT>SYSCON.EXE</TT>" or "<TT>SETPASS.EXE</TT>")
|
|
||||||
can encrypt your password before sending it to the MARS_NWE-server
|
can encrypt your password before sending it to the MARS_NWE-server
|
||||||
(this improves security a little bit).<BR>
|
(this improves security a little bit).<br/>
|
||||||
In this section you can enforce encryption of user-passwords or allow
|
In this section you can enforce encryption of user-passwords or allow
|
||||||
not-encrypted sending of passwords over the net.<BR>
|
not-encrypted sending of passwords over the net.<br/>
|
||||||
On the Linux-side, passwords will only be stored in encrypted format.
|
On the Linux-side, passwords will only be stored in encrypted format.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/susers" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">User configuration</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/susers" TARGET="OPTS"><B><FONT SIZE=+2>User configuration</FONT></B></A>
|
<h3>Guest user</h3>
|
||||||
</TD>
|
<div class="note">Here you can set the UID a user will get before logging in.</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#D0D0FF>
|
<div class="info">
|
||||||
<TD COLSPAN=2>
|
<h3>Supervisor user</h3>
|
||||||
<B>Guest user</B>
|
<div class="note">The <tt>SUPERVISOR</tt> of a NetWare-server is much like <tt>root</tt> on the
|
||||||
</TD>
|
Linux-side.<br/>
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
Here you can set the UID a user will get before logging in.
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
<B>Supervisor user</B>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
The <TT>SUPERVISOR</TT> of a NetWare-server is much like <TT>root</TT> on the
|
|
||||||
Linux-side.<BR>
|
|
||||||
Specify a Linux-user that should be mapped to the supervisor of this
|
Specify a Linux-user that should be mapped to the supervisor of this
|
||||||
MARS_NWE-server.<BR>
|
MARS_NWE-server.<br/>
|
||||||
To improve security, don't use <TT>root</TT> for this purpose but create a
|
To improve security, don't use <tt>root</tt> for this purpose but create a
|
||||||
seperate administrative account (under Linux) called <TT>nw-adm</TT> or similar.<BR>
|
seperate administrative account (under Linux) called <tt>nw-adm</tt> or similar.<br/>
|
||||||
The nw-user defined in this section will have the MARS_NWE internal UID
|
The nw-user defined in this section will have the MARS_NWE internal UID
|
||||||
1 (remember even under Linux <TT>root</TT> must have the special UID 0), so
|
1 (remember even under Linux <tt>root</tt> must have the special UID 0), so
|
||||||
it is not possible to define a supervisor in section 13 (the users
|
it is not possible to define a supervisor in section 13 (the users
|
||||||
defined there will get random UIDs).<BR>
|
defined there will get random UIDs).<br/>
|
||||||
You <I>can</I> define a user with name <TT>SUPERVISOR</TT> in section 13, but he
|
You <i>can</i> define a user with name <tt>SUPERVISOR</tt> in section 13, but he
|
||||||
won't really be the "local god" on the MARS_NWE-server.<BR>
|
won't really be the "local god" on the MARS_NWE-server.<br/>
|
||||||
And of course you <I>can</I> define a supervisor with name <TT>GOD</TT> or <TT>ROOT</TT>
|
And of course you <i>can</i> define a supervisor with name <tt>GOD</tt> or <tt>ROOT</tt>
|
||||||
in <I>this</I> section, which would only break the traditional naming-scheme
|
in <i>this</i> section, which would only break the traditional naming-scheme
|
||||||
of the NetWare-world.
|
of the NetWare-world.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
<div class="info">
|
||||||
</TR>
|
<h3>User mapping</h3>
|
||||||
<TR BGCOLOR=#D0D0FF>
|
<div class="note">If you have a large number of accounts on your Linux-machine, you may
|
||||||
<TD COLSPAN=2>
|
want to map all Linux-logins automatically to MARS_NWE-logins.<br/>
|
||||||
<B>User mapping</B>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
If you have a large number of accounts on your Linux-machine, you may
|
|
||||||
want to map all Linux-logins automatically to MARS_NWE-logins.<BR>
|
|
||||||
At this stage this section is only a quick hack to make life a bit
|
At this stage this section is only a quick hack to make life a bit
|
||||||
easier for the administrator.<BR>
|
easier for the administrator.<br/>
|
||||||
<B>WARNING:</B> As there is no algorithm to convert the encrypted
|
<b>WARNING:</b> As there is no algorithm to convert the encrypted
|
||||||
Linux-passwords into the encrypted format used by the DOS-clients (and
|
Linux-passwords into the encrypted format used by the DOS-clients (and
|
||||||
therefore MARS_NWE), you have to supply a common password for all
|
therefore MARS_NWE), you have to supply a common password for all
|
||||||
automatically mapped users. This is a big security concern and you
|
automatically mapped users. This is a big security concern and you
|
||||||
should never make this common password public (and, of course you
|
should never make this common password public (and, of course you
|
||||||
should choose a sufficient "secure" (read: difficult) password).<BR>
|
should choose a sufficient "secure" (read: difficult) password).<br/>
|
||||||
Type the common password to grant access to the users login and the
|
Type the common password to grant access to the users login and the
|
||||||
command "setpass" instead of telling the password to the user.<BR>
|
command "setpass" instead of telling the password to the user.<br/>
|
||||||
Only those Linux-logins will handled automatically that don't have a
|
Only those Linux-logins will handled automatically that don't have a
|
||||||
x or asterisk as their encrypted password.
|
x or asterisk as their encrypted password.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/volumes" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Volumes</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/volumes" TARGET="OPTS"><B><FONT SIZE=+2>Volumes</FONT></B></A>
|
<div class="note">The OS/2 additional namespace can be used by Windows 9x too. The
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
The OS/2 additional namespace can be used by Windows 9x too. The
|
|
||||||
'no fixed i-nodes' option is necessary when exporting DOS or CD-ROM
|
'no fixed i-nodes' option is necessary when exporting DOS or CD-ROM
|
||||||
file systems. The 'single filesystem' option can be used when the
|
file systems. The 'single filesystem' option can be used when the
|
||||||
entire volume consists of only one mounted filesystem/device.
|
entire volume consists of only one mounted filesystem/device.
|
||||||
For more information about pipe filesystems you can take a look at
|
For more information about pipe filesystems you can take a look at
|
||||||
MARS_NWE's documentation directory.
|
MARS_NWE's documentation directory.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/devices" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Devices</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/devices" TARGET="OPTS"><B><FONT SIZE=+2>Devices</FONT></B></A>
|
<div class="note">This section contains information for the ipx-router built into mars_nwe
|
||||||
</TD>
|
and/or the external program <tt>nwrouted</tt>.<br/>
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
This section contains information for the ipx-router built into mars_nwe
|
|
||||||
and/or the external program <TT>nwrouted</TT>.<BR>
|
|
||||||
Both processes exchange the IPX-packets between your machine and the rest
|
Both processes exchange the IPX-packets between your machine and the rest
|
||||||
of the world (in other words: their functionallity is essential). Of
|
of the world (in other words: their functionallity is essential). Of
|
||||||
course, to use one of both is already sufficient.<BR>
|
course, to use one of both is already sufficient.<br/>
|
||||||
<B>Note for people with other IPX/NCP servers on the net:</B><BR>
|
<b>Note for people with other IPX/NCP servers on the net:</b><br/>
|
||||||
<UL><LI>choose the same frame-type as the other servers use
|
<ul><li>choose the same frame-type as the other servers use
|
||||||
<LI>make sure your network-number is not already in use by another server
|
<li>make sure your network-number is not already in use by another server
|
||||||
(see the output of <TT>SLIST</TT> under Linux or DOS)</UL>
|
(see the output of <tt>SLIST</tt> under Linux or DOS)</li></li></ul>
|
||||||
Under Linux, it is possible to let the kernel creat all ipx-devices
|
Under Linux, it is possible to let the kernel creat all ipx-devices
|
||||||
automatically for you. This is only possible (and only makes sense then)
|
automatically for you. This is only possible (and only makes sense then)
|
||||||
if there are other IPX/NCP servers on the same net which are setup
|
if there are other IPX/NCP servers on the same net which are setup
|
||||||
correctly.<BR>
|
correctly.<br/>
|
||||||
<OL>
|
<ol>
|
||||||
<LI><B>Network number</B><BR>
|
<li><b>Network number</b><br/>
|
||||||
This number is determined by the router of the physical network you're
|
This number is determined by the router of the physical network you're
|
||||||
attached to. Use "0x0" to use the entry for all network number match.
|
attached to. Use "0x0" to use the entry for all network number match.
|
||||||
<LI><B>Device</B><BR>
|
<li><b>Device</b><br/>
|
||||||
The network-interface associated with the NET_NUMBER. (<TT>eth0</TT>,
|
The network-interface associated with the NET_NUMBER. (<tt>eth0</tt>,
|
||||||
<TT>arc0</TT>, <TT>ppp0</TT>, etc.) Use an asterisk to use this entry for
|
<tt>arc0</tt>, <tt>ppp0</tt>, etc.) Use an asterisk to use this entry for
|
||||||
all devices match.
|
all devices match.
|
||||||
<LI><B>Frame type</B><BR>
|
<li><b>Frame type</b><br/>
|
||||||
The frame-type of the data-packets on your local network.<BR>
|
The frame-type of the data-packets on your local network.<br/>
|
||||||
Possible values are:
|
Possible values are:
|
||||||
<UL><LI><TT>ethernet_ii</TT> (Best for mixed(ipx, ip) environments)
|
<ul><li><tt>ethernet_ii</tt> (Best for mixed(ipx, ip) environments)
|
||||||
<LI><TT>802.2</TT> (Novell uses this as default since 3.12)
|
<li><tt>802.2</tt> (Novell uses this as default since 3.12)
|
||||||
<LI><TT>802.3</TT> (Older frame typ, some boot-PROMs use it)
|
<li><tt>802.3</tt> (Older frame typ, some boot-PROMs use it)
|
||||||
<LI><TT>snap</TT> (Normally not used)
|
<li><tt>snap</tt> (Normally not used)
|
||||||
<LI><TT>token</TT> (For token ring cards)
|
<li><tt>token</tt> (For token ring cards)
|
||||||
<LI><TT>auto</TT> (Automatic detection of the frame-type used in your IPX-environment)
|
<li><tt>auto</tt> (Automatic detection of the frame-type used in your IPX-environment)
|
||||||
</UL>
|
</li></li></li></li></li></li></ul>
|
||||||
<LI><B>Ticks</B><BR>
|
<li><b>Ticks</b><br/>
|
||||||
The time data-packets need to get delivered over a
|
The time data-packets need to get delivered over a
|
||||||
certain interface. If your connection goes through several
|
certain interface. If your connection goes through several
|
||||||
routers, the shortest path can be determined by summing up
|
routers, the shortest path can be determined by summing up
|
||||||
all ticks for every route and compare the results.<BR>
|
all ticks for every route and compare the results.<br/>
|
||||||
(1 tick = 1/18th second), default=1<BR>
|
(1 tick = 1/18th second), default=1<br/>
|
||||||
<B>NOTE:</B> If ticks > 6 then the internal router handles
|
<b>NOTE:</b> If ticks > 6 then the internal router handles
|
||||||
RIP/SAP specially. (RIP/SAP filtering)
|
RIP/SAP specially. (RIP/SAP filtering)
|
||||||
</OL>
|
</li></li></li></li></ol>
|
||||||
<B>NOTE:</B>
|
<b>NOTE:</b>
|
||||||
Automatic detection in this section means that ipx-interfaces which
|
Automatic detection in this section means that ipx-interfaces which
|
||||||
are created by other instances than the server/router,
|
are created by other instances than the server/router,
|
||||||
e.g. pppd, ipppd or ipx_interface, will be detected and inserted/removed
|
e.g. pppd, ipppd or ipx_interface, will be detected and inserted/removed
|
||||||
in internal device/routing table at runtime.<BR>
|
in internal device/routing table at runtime.<br/>
|
||||||
<B>You don't have to set this in FreeBSD!</B>
|
<b>You don't have to set this in FreeBSD!</b></div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/logging" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Logging</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/logging" TARGET="OPTS"><B><FONT SIZE=+2>Logging</FONT></B></A>
|
<div class="note">MARS_NWE can keep a log file with error messages, click here to set what
|
||||||
</TD>
|
kind of messages must be logged and where.<br/>
|
||||||
</TR>
|
You can set a logfile name to <tt>syslog</tt> if you want MARS_NWE to
|
||||||
<TR BGCOLOR=#E0E0FF>
|
use <tt>syslogd</tt> for logging.<br/>
|
||||||
<TD COLSPAN=2>
|
According to <tt>nwserv.conf</tt>, the NWCLIENT tag must always be set
|
||||||
|
to <i>No debugging</i>.</div>
|
||||||
MARS_NWE can keep a log file with error messages, click here to set what
|
</div>
|
||||||
kind of messages must be logged and where.<BR>
|
</div>
|
||||||
You can set a logfile name to <TT>syslog</TT> if you want MARS_NWE to
|
</a>
|
||||||
use <TT>syslogd</TT> for logging.<BR>
|
<a class="card" href="/settings/smart" target="OPTS">
|
||||||
According to <TT>nwserv.conf</TT>, the NWCLIENT tag must always be set
|
<div class="card-header">
|
||||||
to <I>No debugging</I>.
|
<h2 class="card-title">SMArT settings</h2>
|
||||||
|
<div class="card-sub">Open settings</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
<div class="card-body">
|
||||||
|
<div class="info">
|
||||||
<TR>
|
<div class="note">Some things have to be configured here before you can use SMArT.</div>
|
||||||
<TD HEIGHT=25>
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
<TR BGCOLOR=#C0C0FF>
|
<a class="card" href="/settings/users" target="OPTS">
|
||||||
<TD COLSPAN=2>
|
<div class="card-header">
|
||||||
<A HREF="/settings/smart" TARGET="OPTS"><B><FONT SIZE=+2>SMArT settings</FONT></B></A>
|
<h2 class="card-title">Users</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#E0E0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
|
<div class="note">You can edit the userlist from the bindery files here. This option will not
|
||||||
Some things have to be configured here before you can use SMArT.
|
change anything to the <tt>nwserv.conf</tt> configuration file.</div>
|
||||||
|
</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
</a>
|
||||||
|
<a class="card" href="/settings/groups" target="OPTS">
|
||||||
<TR>
|
<div class="card-header">
|
||||||
<TD HEIGHT=25>
|
<h2 class="card-title">Groups</h2>
|
||||||
</TD>
|
<div class="card-sub">Open settings</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#D0D0FF>
|
<div class="card-body">
|
||||||
<TD COLSPAN=2>
|
<div class="info">
|
||||||
<A HREF="/settings/users" TARGET="OPTS"><B><FONT SIZE=+2>Users</FONT></B></A>
|
<div class="note">You can edit the group list from the bindery files here. This option will not
|
||||||
</TD>
|
change anything to the <tt>nwserv.conf</tt> configuration file.</div>
|
||||||
</TR>
|
</div>
|
||||||
<TR BGCOLOR=#E0E0FF>
|
</div>
|
||||||
<TD COLSPAN=2>
|
</a>
|
||||||
|
<a class="card" href="/settings/queues" target="OPTS">
|
||||||
You can edit the userlist from the bindery files here. This option will not
|
<div class="card-header">
|
||||||
change anything to the <TT>nwserv.conf</TT> configuration file.
|
<h2 class="card-title">Print queues</h2>
|
||||||
|
<div class="card-sub">Open settings</div>
|
||||||
</TD>
|
</div>
|
||||||
</TR>
|
<div class="card-body">
|
||||||
|
<div class="info">
|
||||||
<TR>
|
<div class="note">Here you can edit the list of print queues. The things you have to fill in are:
|
||||||
<TD HEIGHT=25>
|
<ol>
|
||||||
</TD>
|
<li><b>Print queue name</b><br/>
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
<A HREF="/settings/groups" TARGET="OPTS"><B><FONT SIZE=+2>Groups</FONT></B></A>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
You can edit the group list from the bindery files here. This option will not
|
|
||||||
change anything to the <TT>nwserv.conf</TT> configuration file.
|
|
||||||
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
|
|
||||||
<TR>
|
|
||||||
<TD HEIGHT=25>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
<A HREF="/settings/queues" TARGET="OPTS"><B><FONT SIZE=+2>Print queues</FONT></B></A>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
|
|
||||||
Here you can edit the list of print queues. The things you have to fill in are:
|
|
||||||
<OL>
|
|
||||||
<LI><B>Print queue name</B><BR>
|
|
||||||
The name with which the print queue will show up in the printer lists, and
|
The name with which the print queue will show up in the printer lists, and
|
||||||
the name you need when you want to print something from the client.
|
the name you need when you want to print something from the client.
|
||||||
<LI><B>Unix printing command</B><BR>
|
<li><b>Unix printing command</b><br/>
|
||||||
The command used to send a file to the printer, the text/etc. will come from
|
The command used to send a file to the printer, the text/etc. will come from
|
||||||
the standard input.<BR>
|
the standard input.<br/>
|
||||||
There's a nasty bug in MARS_NWE that removes this property, well, I think
|
There's a nasty bug in MARS_NWE that removes this property, well, I think
|
||||||
it's a bug. It also happens when the startup tests are not set to maximum.
|
it's a bug. It also happens when the startup tests are not set to maximum.
|
||||||
<LI><B>Spool directory</B><BR>
|
<li><b>Spool directory</b><br/>
|
||||||
The directory used to keep the print spool for this print queue. Use the
|
The directory used to keep the print spool for this print queue. Use the
|
||||||
<TT>VOLUME:/directory</TT> form, you can leave this one empty to use a
|
<tt>VOLUME:/directory</tt> form, you can leave this one empty to use a
|
||||||
default directory.
|
default directory.
|
||||||
</UL>
|
|
||||||
|
|
||||||
</TD>
|
</li></li></li></ol></div>
|
||||||
</TR>
|
</div>
|
||||||
</TABLE>
|
</div>
|
||||||
|
</a>
|
||||||
</BODY>
|
</div>
|
||||||
</HTML>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
BIN
static/smart.jpg
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,44 +0,0 @@
|
|||||||
<HTML>
|
|
||||||
<BODY BGCOLOR=#F0F0FF>
|
|
||||||
|
|
||||||
<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%>
|
|
||||||
<TR BGCOLOR=#C0C0FF>
|
|
||||||
<TD>
|
|
||||||
<B><FONT SIZE=+2>SMArT v0.99 (Perl)</FONT></B>
|
|
||||||
</TD>
|
|
||||||
<TD ALIGN=RIGHT>
|
|
||||||
<IMG SRC="/static/smart_icon.jpg"><BR>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#D0D0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
Welcome to SMArT, the easy way to configure mars_nwe, <B>Mar</B>tin <B>S</B>tover's <B>N</B>et<B>W</B>are <B>e</B>mulator.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2>
|
|
||||||
To apply the changes you have made to the configuration, you have to restart <TT>MARS_NWE</TT>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TH ALIGN=CENTER>
|
|
||||||
<A HREF="/cgi-bin/control?start">Start <TT>MARS_NWE</TT>
|
|
||||||
</TH>
|
|
||||||
<TH ALIGN=CENTER>
|
|
||||||
<A HREF="/cgi-bin/control?stop">Stop <TT>MARS_NWE</TT>
|
|
||||||
</TH>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TD COLSPAN=2 ALIGN=CENTER>
|
|
||||||
<BR>The newest version of SMArT can be downloaded from <A HREF="http://www.lintux.cx/" TARGET="_parent">my website</A>.
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
<TR BGCOLOR=#E0E0FF>
|
|
||||||
<TH COLSPAN=2>
|
|
||||||
<BR>© Copyright 2001 <A HREF="mailto:lintux@lintux.cx">Wilmer van der Gaast</A>
|
|
||||||
</TH>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
||||||
115
static/start.html.cmake
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<TITLE>SMArT</TITLE>
|
||||||
|
<META CHARSET="utf-8">
|
||||||
|
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1">
|
||||||
|
<LINK REL="icon" HREF="/static/favicon.ico" TYPE="image/x-icon">
|
||||||
|
<LINK REL="icon" TYPE="image/png" SIZES="32x32" HREF="/static/favicon-32x32.png">
|
||||||
|
<LINK REL="icon" TYPE="image/png" SIZES="16x16" HREF="/static/favicon-16x16.png">
|
||||||
|
<LINK REL="apple-touch-icon" HREF="/static/apple-touch-icon.png">
|
||||||
|
<STYLE TYPE="text/css">
|
||||||
|
BODY {
|
||||||
|
margin: 0;
|
||||||
|
padding: 22px;
|
||||||
|
background: #f6f1ea;
|
||||||
|
color: #342a25;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
A { color: #9f1f1f; text-decoration: none; }
|
||||||
|
A:hover { text-decoration: underline; }
|
||||||
|
.wrapper {
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: #fffdfa;
|
||||||
|
border: 1px solid #e5d6c6;
|
||||||
|
border-radius: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 10px 30px rgba(60, 30, 10, 0.10);
|
||||||
|
}
|
||||||
|
.hero {
|
||||||
|
padding: 22px 24px;
|
||||||
|
background: linear-gradient(135deg, #7d1018, #b82929 60%, #d7b169);
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.hero TABLE { width: 100%; border-collapse: collapse; }
|
||||||
|
.hero-title {
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.hero-sub {
|
||||||
|
margin-top: 6px;
|
||||||
|
color: #f8e6c8;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.hero IMG { max-height: 56px; }
|
||||||
|
.body {
|
||||||
|
padding: 22px;
|
||||||
|
}
|
||||||
|
.notice {
|
||||||
|
padding: 14px 16px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
border: 1px solid #ecdcc8;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #fbf6ef;
|
||||||
|
}
|
||||||
|
.actions TABLE { width: 100%; border-collapse: separate; border-spacing: 12px; }
|
||||||
|
.action {
|
||||||
|
display: block;
|
||||||
|
padding: 16px 18px;
|
||||||
|
border-radius: 12px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
text-decoration: none;
|
||||||
|
background: #9f1f1f;
|
||||||
|
}
|
||||||
|
.action.secondary {
|
||||||
|
background: #6f5b4f;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
padding-top: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #6c5b52;
|
||||||
|
}
|
||||||
|
</STYLE>
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<DIV CLASS="wrapper">
|
||||||
|
<DIV CLASS="hero">
|
||||||
|
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
|
||||||
|
<TR>
|
||||||
|
<TD>
|
||||||
|
<DIV CLASS="hero-title">SMArT v@MARS_NWE_VERSION@</DIV>
|
||||||
|
<DIV CLASS="hero-sub">Perl interface for configuring MARS_NWE</DIV>
|
||||||
|
</TD>
|
||||||
|
<TD ALIGN="RIGHT">
|
||||||
|
<IMG SRC="/static/smart_icon.jpg" ALT="SMArT">
|
||||||
|
</TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
</DIV>
|
||||||
|
<DIV CLASS="body">
|
||||||
|
<DIV CLASS="notice">
|
||||||
|
Welcome to SMArT, the easy way to configure <B>MARS_NWE</B>.
|
||||||
|
</DIV>
|
||||||
|
<DIV CLASS="notice">
|
||||||
|
To apply changes to the configuration, restart <TT>MARS_NWE</TT> after saving your settings.
|
||||||
|
</DIV>
|
||||||
|
<DIV CLASS="actions">
|
||||||
|
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
|
||||||
|
<TR>
|
||||||
|
<TD WIDTH="50%"><A CLASS="action" HREF="/cgi-bin/control?start">Start <TT>MARS_NWE</TT></A></TD>
|
||||||
|
<TD WIDTH="50%"><A CLASS="action secondary" HREF="/cgi-bin/control?stop">Stop <TT>MARS_NWE</TT></A></TD>
|
||||||
|
</TR>
|
||||||
|
</TABLE>
|
||||||
|
</DIV>
|
||||||
|
<DIV CLASS="footer">
|
||||||
|
The newest version of SMArT can be downloaded from <A HREF="http://www.lintux.cx/" TARGET="_parent">the project website</A>.<BR><BR>
|
||||||
|
© Copyright 2026 <A HREF="mailto:mario.fetka@disconnected-by-peer.at">Mario Fetka</A>
|
||||||
|
</DIV>
|
||||||
|
</DIV>
|
||||||
|
</DIV>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||