docs/reference.md lists every section and key of modemmenu.conf with its
help, the sample's value and the other values the sample shows, read
from the comments of modemmenu.conf.sample by go run ./tools/confref.
TestSampleHasEveryKey fails when the code reads a key the sample doesn't
show: max_input and an item's terminal were missing and are now in it.
The docs index and Configuration link the reference.
mkdocs.yml builds docs/ and the README with brand's shared theme
(Zensical); .github/workflows/pages.yml calls brand's site workflow,
which also fails when docs/reference.md is out of date.
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
Co-authored-by: Claude <noreply@anthropic.com>
Building, running from app_dmodem, configuration, authentication, PPP,
security notes and the tests move from the 827-line README into docs/,
unchanged but for their heading levels and relative links. The README
keeps a summary, the sample session, features, a quick start, the
suite's repositories and the licence. D-Modem-RE becomes D-Modem.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
freepbx/ holds a ready-made setup for FreePBX 16 and 17 with D-Modem's
FreePBX module: modemmenu.conf (auth = file, -serve on a socket in the
asterisk group, PPP, last callers, password changes, an optional BBS
item), a users file, a systemd unit and a test extension. The files go
in /etc/modemmenu, out of fwconsole chown's way. The README walks
through the D-Modem profile and inbound route; make install-freepbx
installs the files without overwriting.
Also move the [terminal] section of modemmenu.conf.sample out of the
header comment it had landed in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6gXs8esrspL3kjPc
The repositories moved from Neo-Desktop to the D-Modem GitHub
organisation: D-Modem-RE is now D-Modem/D-Modem, pico-serial is
D-Modem/hardware, modemmenu (PBX-Modem) is D-Modem/menu, bbs-sec is
D-Modem/bbs and go3270-sec is D-Modem/go3270. Update links, module
paths, submodule URLs and source-location strings to match. Copyright
notices still name Neo-Desktop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUwD2JJ5d6fgHmpVTw
Each Go function and method, tests and test helpers included, and the
pppd plugin's and its test host's C functions, now has a comment saying
what it does, in the repository's style.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
Before the banner modemmenu asks the terminal what it is, in bbs-sec's
order: telnet's terminal type when [terminal] tn3270 is set (a 3270 is
handed to the tn3270 server), the cursor position for ANSI and its size,
ESC Z for a VT52, and DEC's, xterm's and SyncTERM's identification for
an ANSI terminal. A terminal that is not ANSI may be a Commodore: the
login prompt watches for keys only a Commodore sends, and an all-capitals
name gets "PRESS DEL", as bbs-sec does; the menu then speaks PETSCII.
The result is {terminal}, {term}, {term_name}, {rows} and {cols}
(MODEM_* and TERM for exec items, the size set on the line), passed on
in the session header so a downstream menu does not ask again, and used
by [dropfile] emulation = auto (the new default). Bytes that arrive
during the questions go back to the login; a PPP frame ends them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
[general] connect_message ("\r\nConnected at {speed}.\r\n") follows the
banner, before the login prompt, as BBSs greeted their callers; it is
left out when the rate is not known (no DMODEM_RATE, no -rate), and ""
turns it off.
{speed} (MODEM_SPEED) is the rate for reading: "33600 bit/s", or a V.90
call's two directions apart, "50666 bit/s down, 31200 bit/s up"; empty
when not known. The sample's welcome no longer repeats the rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
A dialer that starts PPP at once (Windows' Dial-Up Networking and most
others) sends a PPP frame where the login prompt wants a name. With
[autoppp] enabled, modemmenu sees it (0x7E and the address and control,
plain, escaped or compressed; a name that only starts with ~ stays a
name) and runs [autoppp] command, pppd, on the line.
pppd/modemmenu.c is a pppd plugin: pppd's PAP hook asks the call's own
auth socket (MODEMMENU_AUTH_SOCKET, or its modemmenu-socket option),
where modemmenu checks the login as at the prompt (the backends,
user_pattern, attempts, fail_delay), then [autoppp] item's access rules,
then the time limits; the time left becomes pppd's maxconnect, and
modemmenu hangs pppd up soon after should the link outlive it. The call
counts as a login: the log, the day's use, the last callers. PAP only:
CHAP needs passwords kept where they can be read back.
make builds the plugin when ppp-dev's headers are there and installs it
in pppd's plugin directory. pppd cannot run here (no PPP in the
kernel), so the tests load the real plugin into pppd/test/host.c, which
exports what pppd exports to plugins; the real pppd 2.4.9 loads it and
takes its option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
dropfile = dorinfo1.def writes RBBS's DORINFO1.DEF (QuickBBS,
RemoteAccess): 13 lines in upper case, the names split at their first
space, the FOSSIL flag last; dorinfo#.def names it by the node,
DORINFO1.DEF to DORINFOF.DEF (max_nodes 15 at most).
The defaults follow Synchronet's (and its wiki's formats): DOOR32.SYS's
comm type 0 and handle -1 for a door on stdin and stdout, as modemmenu
runs them (was 2 and 0); the rate is the DTE rate, 38400, in every file
(doors built on DMlib refuse a modem's 26400), or rate = connect for
the modems'. [dropfile] fossil and four_digit_years (MBSE's MM/DD/YYYY
option); an item's door_sys_lines = 31 writes the old DOOR.SYS with the
rest blank, dropfile_lowercase = yes lower-case names for Linux doors.
{dropfile} and MODEM_DROPFILE are the first file's path (Synchronet's
%f). DOOR.SYS's daily limits are no longer 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
An exec item with dropfile = door32.sys door.sys writes DOOR32.SYS (11
lines) and DOOR.SYS (the 52-line GAP format) before its program starts
and removes them after: the user, the rate, the caller ID, the security
level ([dropfile] security, or the item's), the time left (minutes, and
seconds in DOOR.SYS), the emulation and the node. Each door run takes
the first free node of max_nodes (a lock in state_dir/nodes, held while
it runs), each user keeps a number given once (state_dir/usernumbers).
The files go in dropfile_dir ({node} in it) or a new directory; commands
get {node}, {dropfile_dir}, MODEM_NODE and MODEM_DROPFILE_DIR. The
password is not written. [dropfile] has the BBS's name, the sysop and
the comm type, handle and port.
MODEM_SECONDS_LEFT joins MODEM_TIME_LEFT ({seconds_left}) in the
environment, the session file and the header. A modemmenu -serve keeps
the header's time left as a limit of its own, so that going from one
menu to another gives no new allowance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
Each of time_warning's times (the longest first, each once; a plain
number is seconds; 0 or none for none) writes time_warning_message on
the line while a selection runs; a selection started with less time
left gets the warnings still ahead. The message has {seconds_left}
besides {time_left}. One time, 2m, stays the default; the sample uses
5m 1m.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
The Go module is github.com/Neo-Desktop/modemmenu; the license files
and the README name the project modemmenu, and commercial licenses are
asked for at github.com/Neo-Desktop/modemmenu/issues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
LICENSE is the GNU Affero General Public License, version 3 (gnu.org's
text); each source file names it (SPDX-License-Identifier:
AGPL-3.0-only) and Neo-Desktop as the copyright holder.
COMMERCIAL-LICENSE.md: for uses the AGPL does not allow, Neo-Desktop
grants commercial licenses on agreed terms; asked for by a GitHub issue.
CONTRIBUTING.md: contributions come with an agreement (Signed-off-by)
that licenses them to Neo-Desktop under the AGPL and other terms,
commercial ones included, so that they can be part of both.
The README has a License section, and says how a modified modemmenu
offers callers its source (the AGPL's section 13).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
- LDAP groups for the items' groups =: with [ldap] group_base, a group
is an entry there that group_filter finds (groupOfNames,
groupOfUniqueNames and posixGroup by default), searched as
search_bind_dn or as the caller; each answer kept for the call.
- [ldap] password_change = ad: mode = passwd changes an Active
Directory password (unicodePwd's old value deleted, the new one
added, quoted UTF-16LE), AD having no Password Modify.
- time_warning (2m) before the time limit, time_warning_message is
written on the line in the middle of a running selection, unless the
item says time_warning = no (the sample's PPP does).
- mode = callers: the last callers (time, user, rate; no caller ID),
each login recorded in state_dir/callers (the latest 200) when there
is such an item.
- The sample's end has items to copy: ZMODEM uploads (rz -b -R -E),
a Kermit server (kermit -Y -x), lynx -anonymous, mutt, tin, irssi,
Gopher and the last callers; it loads with all of them on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
From claude/beautiful-pasteur-oz81no (af30cbd), brought onto this
branch without the build output it had committed (pbx-modem, 15 MB, now
in .gitignore).
[authd] listen: a unix socket where a program on this machine (the BBS)
asks modemmenu's backends (file, ldap, sql, system) for a user's
password, so that telnet, SSH and web logins there take the same one.
One JSON line each way: {"user","password"} -> {"ok","auth"} or
{"ok": false, "error": "denied"}. The backends are asked as at the
login prompt, user_pattern kept, a refusal fail_delay late.
Who may ask: socket_mode (none for others: refused), socket_group, and
allow_users (the peer's uid, SO_PEERCRED); TCP is refused. -serve
answers it with its sessions; -authd alone
(modemmenu-authd.service.sample).
With this branch's features: settings carry both [authd] and the access
sections; a signup's locked account is refused on the socket too (now
tested), and a password changed from the menu holds there at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
A built-in item: the current password (checked against the backends
again, which finds the one that holds the account), then the new one
twice (min_password, not the current one, three tries). The password
changes where the account is:
- file: the user's line rewritten in place under the lock signups take,
a note after the hash kept; bcrypt, or text with hash = plain
- sql: update_query with update_args (user, password, old_password) and
update_hash (bcrypt, or none for a query that hashes it)
- ldap: Password Modify (RFC 3062) bound as the user, the server's own
policy and hashing applying
- system: PAM's password stack; its messages (a quality module's
reasons) go to the caller
A refused password leaves the old one; the selections after a change
get the new one. The PAM sample has the password stack, and says that
pam_unix applies no quality checks for root (pam_pwquality with
enforce_for_root does).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
Items take users, groups ([groups], or the system's for auth = system),
min_baud, callerids and guest; a caller neither sees nor can choose an
item they may not use.
time_limit limits a call and daily_limit a user's calls in a day (kept
in state_dir/usage under a lock); a selection is hung up at the limit,
and {time_left} / MODEM_TIME_LEFT tell what is left.
[guest] logs in by name without a password, to the guest = yes items
for its own time_limit. [signup] adds new accounts to the users file
with a bcrypt hash, locked (user:!hash) until the sysop unlocks them
unless pending = no; the file backend refuses locked accounts.
[callerid] allow, deny and anonymous decide which calls the line takes;
[number PATTERN] sections deny a number, log it in as a user, or start
an item at once.
Comments may follow a value after a space; \; and \# escape them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
modemmenu -serve listens on [server] listen, a unix socket (or
tcp:host:port), for app_dmodem's mode = unix profiles: each connection
gets a session of its own, modemmenu on a new pty as mode = exec would
give it, so pppd, shells and ^C work the same. A socket has no
environment: the call's details come first as a header, NAME=value
lines and an empty line (app_dmodem's header = yes). socket_mode and
socket_group decide who may connect, max_sessions caps them, SIGTERM
hangs them all up and removes the socket.
Menu items reach other menu applications on unix sockets: mode = unix
(raw), or a path on tcp, telnet and rlogin items, and header = yes sends
the session ahead. A modemmenu -serve with trust_user takes the user of
such a header as logged in, so a caller moves from one menu to another
without a second login.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
Sections of their own for system accounts by PAM (the steps, the
[system] options), the message of the day and the menu (keys, names,
aliases, ?, hangup words, hotkeys); the short configuration shows
[system] and [menu], and its comments are on lines of their own (the
parser has no comments after a value, so the old example did not load).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
auth = system is now PAM alone (pam_service): the /etc/shadow reader and
its yescrypt and crypt dependencies are gone. The uid, root and group
rules stay, by the name service.
motd and motd_file (read at each login) show after the welcome, before
the menu.
The menu reads a line: an item's key (now one or more characters), its
name or an alias selects it, in any case (p, ppp, dialup); ? shows the
menu again, an unknown choice says so. [menu] hangup takes several
words (G goodbye bye logoff); hotkeys = yes keeps one-key selection for
one-character keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
auth = system checks the caller against the machine's own accounts.
method = shadow reads /etc/passwd and /etc/shadow and verifies their
crypt hashes in Go (yescrypt, SHA-512, SHA-256, MD5, bcrypt), refusing
locked accounts and expired accounts or passwords. method = pam runs a
PAM service's auth and account stacks (sssd, Kerberos, anything PAM
does); it needs a build with -tags pam, which make picks when libpam's
headers are installed, so a plain go build stays free of C. Accounts
below min_uid and root (unless allow_root) are not let in, and groups
limits logins to members.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f
A Go program that D-Modem-RE's app_dmodem runs as a mode = exec profile
on the caller's line: it asks for a user name and password, checks them
with a text file, LDAP (bind as the user, directly or after a search) or
an SQL database (MySQL/MariaDB, PostgreSQL, SQLite), then offers a menu
of a BBS, PPP and a shell. The selection gets the user name, password,
the backend that accepted them, the dialed number, caller ID, connect
rate and the connection's date and time: as MODEM_* in its environment,
as shell-quoted {placeholders} in its command, in an optional 0600
session file, in the rlogin handshake (the way BBSs log a caller in), or
sent after connecting to a raw TCP or telnet server.
Moved here from D-Modem-RE's modemmenu/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvtV8Dg9kqRaakbTEfyH3f