Commit Graph
11 Commits
Author SHA1 Message Date
Claude 0cbfdce70f make install: install the systemd units
make install now makes dmodem-login.service, dmodem-login-authd.service
and dmodem-login-ldapd.service from their samples, with the paths of
BINDIR and CONF_DIR, and puts them in SYSTEMD_UNIT_DIR
(/etc/systemd/system). It keeps a unit that is already there and
enables none. install-freepbx and install-dialup use SYSTEMD_UNIT_DIR
too. docs/running.md gives the steps after make install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV8YPyMUdSM1QgsczH
2026-11-24 11:30:28 +00:00
Claude 33f34e3462 Drop the modemmenu install links; the legal text names dmodem-login
make install and install-freepbx no longer put modemmenu and
modemmenu.so links: an old installation changes its app_dmodem profiles
and pppd options to dmodem-login (docs/rename.md says so).
COMMERCIAL-LICENSE.md and CONTRIBUTING.md name dmodem-login and
D-Modem/login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTD8BSptdpaUWGcs65
2026-11-23 09:13:59 +00:00
Claude 3b86b397ad Rename modemmenu to dmodem-login, the repository to D-Modem/login
The program is dmodem-login (like dmodemd and dmodem-ari), the Go module
github.com/D-Modem/login, the site d-modem.github.io/login.  Its files,
units, sockets, PAM service, pppd plugin, environment (DMODEM_LOGIN_*)
and nftables tables follow.

An old installation keeps working:
- make install puts a modemmenu link to dmodem-login, and a modemmenu.so
  link to the plugin, which also takes its old modemmenu-socket option
- the default configuration, users file, state_dir and PAM service fall
  back to modemmenu's when only those are there (config.Legacy)

docs/rename.md (Simplified Technical English) lists the new names and
what an old installation must change (the -serve socket, the units, the
/etc/modemmenu files, the old nftables tables).  CI's bbs job moves a
bbs that still imports github.com/D-Modem/menu to the new path.  The
pppd plugin builds clean with -Wall -Wextra on GCC and Clang.

COMMERCIAL-LICENSE.md and CONTRIBUTING.md (legal text) are not changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRTD8BSptdpaUWGcs65
2026-11-23 05:04:16 +00:00
Claude 06d7aa7734 PPP address pool, isolated dial-up network and DNS overrides
- [ppp_pool]: each PPP caller gets its own address of a range
  ({ppp_local}, {ppp_remote}, {ppp_dns}, {ppp_dns2} and MODEM_PPP_*),
  as flock'd lock files in state_dir/ppp-pool shared by every modemmenu
  and -serve session, so several lines can run PPP at once.  The samples
  move to 10.77.0.0/24 with the pool.
- dialup/: modemmenu-dialup puts the callers' links in a VRF of their
  own, egress by a VLAN, the host's uplink (NAT) or none, with an
  nftables firewall: only the listed service ports of the host, no
  private range (host LANs, other callers) unless ALLOW_CIDRS opens it.
  pppd's ip-up.d/ip-down.d hooks attach each link.
- modemmenu-dns: dnsmasq in the VRF on 10.77.0.1, with overrides from
  /etc/modemmenu/dns.d/*.conf (AIM/ICQ, AOL, MSN, Yahoo names ready).
- make install-dialup, docs/dialup-network.md; confref reads section
  names with underscores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVTwDhoXdaYHRwQ4BT
2026-11-08 13:48:06 +00:00
Claude 80d0fda167 Split the code into packages: cmd/modemmenu, internal/*, authd
All of modemmenu was one package main in the repository's root.  It is
now one module with the program and the pieces it is made of apart:

  cmd/modemmenu/     the program (the login, the menu, access, limits,
                     the selections, -serve, AutoPPP, drop files, the
                     auth socket's server)
  internal/config/   modemmenu.conf's sections and keys, {name} templates
  internal/term/     the caller's line, terminal detection, PETSCII
  internal/auth/     the backends and password changes
  internal/telnet/   the telnet client of mode = telnet items
  authd/             the auth socket's protocol and a client, for a BBS
                     to import (bbs's internal/menuauth is a copy of it)
  samples/           the .conf, .users, .pam and .service samples

make builds ./cmd/modemmenu and installs the samples from samples/; the
docs, confref and the site's reference follow.  The tests are where
their code is, none lost.  TestSampleHasEveryKey now reads the keys of
internal/ too (and the exported Get, Bool...: it would have found none).
.gitignore's "modemmenu" ignored cmd/modemmenu/ as well: it is
/modemmenu now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRbjf74j8oq9R3PXhA
2026-11-06 03:12:02 +00:00
Claude 639d0ad2f9 Build without VCS stamping, so sudo make works in a user's clone
git refuses a checkout owned by another user (exit 128, dubious
ownership), and go build's VCS stamping then fails the build.  Nothing
reads the stamp, so turn it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRV6gXs8esrspL3kjPc
2026-11-05 01:53:57 +00:00
Claude cfdd7ac7f1 Add a FreePBX sample: logins from a users file
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
2026-11-05 01:24:11 +00:00
Claude 04a847970c AutoPPP: PPP dialers log in with PAP, checked by modemmenu
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
2026-10-17 01:48:57 +00:00
Claude f912b979ac System accounts by PAM only; message of the day; menu choices as words
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
2026-10-10 03:20:57 +00:00
Claude 9a407f269e Authentication by the system's accounts: /etc/shadow or PAM
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
2026-10-10 00:47:19 +00:00
Claude f194490fa3 modemmenu: a login and menu for dial-up callers
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
2026-10-10 00:34:46 +00:00