Commit graph

125 commits

Author SHA1 Message Date
Martin Hebnes Pedersen
946a91fcc4 Move embedded web assets to web package
The embedded filesystem was in package main, making it inaccessible to
alternative main packages that need to serve the HTTP interface. Moving
the embed directive and web handlers to a dedicated web package allows
any package to import and use the web UI functionality.

This also improves separation of concerns by isolating static file
serving, template handling, and dev server proxying in a single package,
and simplifies the API by removing the staticContent parameter from
NewHandler.

Ref #512 and #15
2025-12-30 09:59:16 +01:00
Martin Hebnes Pedersen
9bc6ac22b1 Refactor reload handling 2025-06-22 20:22:37 +02:00
Martin Hebnes Pedersen
13f1a101d7 Add live-reload functionality to web config 2025-06-22 18:59:12 +02:00
Martin Hebnes Pedersen
addbefa74a Add SIGHUP-based live reload functionality
Ref issue #6
2025-06-22 13:10:12 +02:00
Martin Hebnes Pedersen
6fe9a4f403 Signal handling cleanup 2025-06-22 07:37:43 +02:00
Martin Hebnes Pedersen
713d20a491 Call app.Close from main 2025-06-20 12:58:25 +02:00
Martin Hebnes Pedersen
e69745e051 Move signal handling to main 2025-06-17 09:14:34 +02:00
Martin Hebnes Pedersen
6ae942e13b Refactor to prepare for hot reloading of config
* Remove singletons
* Split into app, cli and api packages

Ref #6
2025-06-14 07:50:42 +02:00
joverfelt
a31158c76c Add mps command for managing message pickup stations
ref #51
2025-06-13 12:48:18 +02:00
Martin Hebnes Pedersen
ea0ea7b418 Add CLI option to check for updates
`pat version --check`
2025-06-04 11:17:20 +02:00
Martin Hebnes Pedersen
d856c1997c Add Reply All message action
Resolves #278
2025-05-23 11:32:19 +02:00
Martin Hebnes Pedersen
f70b3301b1 Add Configuration page to web gui
Resolves #5
2025-05-20 08:59:40 +02:00
Martin Hebnes Pedersen
34f38822b5 Add CLI command templates
With subcommands `update` and `seqset`.

Deprecates command `updateforms`.
2024-12-27 14:43:14 +01:00
Martin Hebnes Pedersen
3a2c12b6b3 Add support for template sequence numbers 2024-12-27 13:55:28 +01:00
Martin Hebnes Pedersen
81c0f59ba1 Reference message by path or mid (extract/compose) 2024-12-19 23:53:46 +01:00
Martin Hebnes Pedersen
a3be5a1fdb Add compose --in-reply-to 2024-12-19 23:53:46 +01:00
Martin Hebnes Pedersen
8145400203 Deprecate composeform command (use compose instead) 2024-12-13 14:09:49 +01:00
Martin Hebnes Pedersen
98e36ad455 Refactor file editing using CLI editor 2024-12-13 12:51:05 +01:00
Robert James Hernandez
5604eac885 Fix creation of configdir in prehook
Move prehook dir settings to main to ensure that running the tests
does not result in the configdir being created.
2024-09-01 07:31:35 +02:00
Martin Hebnes Pedersen
f0c78674e5 Fix missing appname for tag <ProgramVersion> 2024-04-13 07:33:20 +02:00
Martin Hebnes Pedersen
5b56bc2d95 Print notice if password recovery email is not set
This was requested by the Winlink Development Team.

Resolves #442
2024-03-29 12:24:56 +01:00
Martin Hebnes Pedersen
7e1488d049 Add CLI command to get/set password recovery email
Ref #442
2024-03-29 12:24:56 +01:00
Martin Hebnes Pedersen
2e61f66a5a Support defining hamlib_rigs through env variables
The envconfig package introduced in 77cc83b does not handle map of
structs, so we have to handle hamlib_rigs manually.

This also defaults the "network" attribute to "tcp", which is what most
users want (for rigctld).
2023-11-07 22:45:06 +01:00
Martin Hebnes Pedersen
588c450198 Rewrite aliases using serial-tnc:// 2023-05-21 23:35:13 +02:00
Martin Hebnes Pedersen
b6c22722a2 Remove handling of some deprecated config fields 2023-04-30 08:12:36 +02:00
Martin Hebnes Pedersen
d716296b52 Add support for AGWPE (e.g. Direwolf) over TCP
This eliminates the need for Linux's AX25 stack when using Direwolf or
AGWPE TNCs. It makes AGWPE the default AX.25 engine if the build does
not include Linux AX.25 support.

Direwolf >= v1.6 is recommended (< v1.2 is unsupported).

Closes #367
2023-02-21 11:14:17 +01:00
Chris Keller
6756d994eb Integrate with github.com/n8jja/Pat-Vara
Co-authored-by: gh42lb <92827417+gh42lb@users.noreply.github.com>
2022-08-20 21:25:03 +02:00
Alan Crosswell
46a890059a Add several (some undocumented) insertion tags that are required for the Winlink Check In form. 2022-04-09 21:24:34 +02:00
Martin Hebnes Pedersen
0040473c18 Add --p2p-only option to compose
Resolves #334
2022-03-21 22:01:53 +01:00
Chris Keller
c6f3bfb2e6 Remove WINMOR support
Resolves #331.
2022-03-21 19:51:03 +01:00
Martin Hebnes Pedersen
441fda35c4 Graceful shutdown through context cancellation
By doing graceful shutdown, we're able to properly close all of the open
resources such as modem connections and ongoing sessions.

This will allow transport drivers controlling stateful TNCs (e.g.
ptc-go) to recover the initial TNC state before termination.

Resolves #314
2022-02-20 14:48:29 +01:00
Daniele Forsi
a840ced09b Fix typing errors in d/changelog and comments
Fix spelling erors found with:
codespell --skip web,*.rtf --ignore-words-list ans --write-changes
2022-01-04 21:53:19 +01:00
Benjamin Seidenberg
fdabbcc4ef Add --from/-r option for non-interactive compose.
Address https://github.com/la5nta/pat/issues/310https://github.com/la5nta/pat/issues/310
2021-12-19 18:20:03 +01:00
Martin Hebnes Pedersen
54e1d49e0d Move compose help details to usage section
The description field should contain a short description of the command,
not full usage help text.
2021-12-12 16:41:14 +01:00
Benjamin Seidenberg
b39809011f Add support for scriptable message composition
Addresses https://github.com/la5nta/pat/issues/297

This commit adds support for non-interactive message sending from the
command line, in order to support scriptable interactions.

To do this, we fork the compose path into 3:
- Interactive (existing)
- Non-Interactive (based on command-line arguments and stdin)
- Reply (synonym for interactive)
2021-12-03 21:14:28 +01:00
Martin Hebnes Pedersen
1f4cf8fe38 Add CLI command for printing useful env variables
This should be particularly useful when scriping against Pat. It also
serves as a sort of documentation of various environment variables that
effects Pat.
2021-12-02 18:26:54 +01:00
Martin Hebnes Pedersen
d7cc80b0d7 Remove paths from the 'pat version' output
They are all included in the debug log.
2021-10-25 19:49:55 +02:00
Chris Keller
6949d55907 Reintroduce config file forms_path for backward compat 2021-10-24 22:42:46 +02:00
Chris Keller
5a6764bce1 Revamp customized file paths
* Deprecate `forms_path` in the config file and replace with `--forms` flag
* Clean up `optionsSet()` to show correct defaults
* Clean up places that detected when `forms_path` was not configured (before it had a default)

Resolves https://github.com/la5nta/pat/issues/287
2021-10-24 22:42:46 +02:00
Chris Keller
e68850056e Fix some Go linter errors
* Replace(..., -1) with ReplaceAll
* Variable names hiding packages
* Error messages start with lowercase and no end punctuation
* Don't `defer` in a loop
* Etc.
2021-08-20 21:35:21 +02:00
Chris Keller
e94f05f37c Move config, data and state files to XDG locations
Addressing https://github.com/la5nta/pat/issues/216. Includes migration of existing files, plus refactoring of directory access and build info.
2021-08-15 19:35:15 +02:00
Martin Hebnes Pedersen
37b0e490c5 Add debug logging capabilities
Enabled by setting the environment variable PAT_DEBUG=1.
2021-07-28 19:21:34 +02:00
Chris Keller
cef588d96b Address bugs found in review
*  If forms_path isn't configured or doesn't exist, don't bother trying to update
*  Set no-cache HTTP header
2021-06-21 22:23:23 +02:00
Chris Keller
4acb48fde3 Add forms update via CLI 2021-06-21 22:23:23 +02:00
Chris Keller
1d415a2ffa Add forms update via web GUI 2021-06-21 22:23:23 +02:00
rainerg2000
9f504321e1 added CLI option composeform for generating a message based on Winlink forms, like ICS213 2021-06-16 20:08:41 +02:00
rainerg2000
c161d26171 added forms package, is not hooked up to any useful work yet 2021-06-16 20:08:41 +02:00
Martin Hebnes Pedersen
64ec2e7594 Remove usage of the (now deprecated) ioutil pkg 2021-05-20 19:40:32 +02:00
blockmurder
17cc57133f move GPSd config to its own struct. Only show warning when UI is served on all interfaces. Show who (IP) is accessing the GPSd data. 2019-09-30 19:41:20 +02:00
blockmurder
184137ed45 if set in config use server time 2019-09-30 19:39:13 +02:00