pax_global_header 0000666 0000000 0000000 00000000064 14251261704 0014514 g ustar 00root root 0000000 0000000 52 comment=ffda29af4045e543e55b25564d265af37f92fc41
kel-agent-0.4.6/ 0000775 0000000 0000000 00000000000 14251261704 0013372 5 ustar 00root root 0000000 0000000 kel-agent-0.4.6/.github/ 0000775 0000000 0000000 00000000000 14251261704 0014732 5 ustar 00root root 0000000 0000000 kel-agent-0.4.6/.github/auto_assign.yml 0000664 0000000 0000000 00000001272 14251261704 0017773 0 ustar 00root root 0000000 0000000 # Set to true to add reviewers to pull requests
addReviewers: true
# Set to true to add assignees to pull requests
addAssignees: author
# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- xylo04
# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
# A list of assignees, overrides reviewers if set
# assignees:
# - assigneeA
# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2
# A list of keywords to be skipped the process that add reviewers if pull requests include it
# skipKeywords:
# - wip
kel-agent-0.4.6/.github/renovate.json 0000664 0000000 0000000 00000001167 14251261704 0017455 0 ustar 00root root 0000000 0000000 {
"extends": [
":separateMajorReleases",
":combinePatchMinorReleases",
":ignoreUnstable",
":prImmediately",
":semanticPrefixFixDepsChoreOthers",
":automergeDisabled",
":ignoreModulesAndTests",
":autodetectPinVersions",
":prHourlyLimit2",
":prConcurrentLimit20",
"group:monorepos",
"group:recommended",
"helpers:disableTypesNodeMajor"
],
"postUpdateOptions": [
"gomodTidy"
],
"schedule": ["after 3am and before 7am"],
"timezone": "America/Denver",
"packageRules": [
{
"matchUpdateTypes": ["patch", "pin", "digest"],
"automerge": true
}
]
}
kel-agent-0.4.6/.github/workflows/ 0000775 0000000 0000000 00000000000 14251261704 0016767 5 ustar 00root root 0000000 0000000 kel-agent-0.4.6/.github/workflows/assign_pr.yml 0000664 0000000 0000000 00000000243 14251261704 0021476 0 ustar 00root root 0000000 0000000 name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review]
jobs:
add-reviewers:
uses: k0swe/.github/.github/workflows/assign_pr.yml@main
kel-agent-0.4.6/.github/workflows/release.yml 0000664 0000000 0000000 00000010137 14251261704 0021134 0 ustar 00root root 0000000 0000000 name: Release
on:
push:
tags:
- 'v*'
jobs:
release-linux:
name: Build the Linux release artifact
runs-on: [ self-hosted, linux, x64 ]
# Trust that the runner has an sbuild chroot
# sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang
# newgrp sbuild
# sudo sbuild-debian-developer-setup --suite=stable
steps:
- name: Remove old release artifacts
run: rm -f ../kel-agent_*
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
- name: Build Debian package
run: make deb-package
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ../*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-rpi:
name: Build the Raspberry Pi release artifact
runs-on: [ self-hosted, linux, ARM ]
# Trust that the runner has an sbuild chroot:
# sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang
# newgrp sbuild
# sudo sbuild-debian-developer-setup --suite=stable
steps:
- name: Remove old release artifacts
run: rm -f ../kel-agent_*
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
- name: Build Debian package
run: make deb-package
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ../*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-flatpak:
name: Build the Flatpak release artifact
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-20.08
options: --privileged
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Flatpak
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: kel-agent.flatpak
manifest-path: flatpak/radio.k0swe.Kel_Agent.yml
branch: main
cache-key: flatpak-builder-${{ github.sha }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: kel-agent.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-macos:
name: Build the MacOS release artifact
runs-on: macos-latest
steps:
- name: Install WhiteBox Packages
run: |
curl "http://s.sudre.free.fr/Software/files/Packages.dmg" --output ${HOME}/Packages.dmg
sudo hdiutil attach ${HOME}/Packages.dmg
find /Volumes -name "Install Packages.pkg" | xargs -I {} sudo installer -pkg "{}" -target /
- name: Create keychain with signing certificate
uses: apple-actions/import-codesign-certs@v1
with:
keychain: k0swe
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
- name: Build Mac package
run: make mac-package
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: kel-agent_mac.pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-windows:
name: Build the Windows release artifact
runs-on: windows-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
- name: Build Windows package
run: |
$env:PATH += ";$env:WIX\bin"
make win-package
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: win/kel-agent.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
kel-agent-0.4.6/.github/workflows/test.yml 0000664 0000000 0000000 00000001007 14251261704 0020467 0 ustar 00root root 0000000 0000000 name: Test
on:
push:
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
branches:
- '*'
jobs:
test:
name: Run unit tests
strategy:
matrix:
go-version: [ 1.15.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
kel-agent-0.4.6/.gitignore 0000664 0000000 0000000 00000000347 14251261704 0015366 0 ustar 00root root 0000000 0000000 # Compiled assets
kel-agent
kel-agent.exe
kel-agent.pkg
kel-agent_mac.pkg
win/kel-agent.msi
win/kel-agent.wixobj
win/kel-agent.wixpdb
autorevision.cache
repo/
.flatpak-builder/
kel-agent.flatpak
flatpak_app/
.idea/
.pc
.DS_Store
kel-agent-0.4.6/BUILDING.md 0000664 0000000 0000000 00000002322 14251261704 0015110 0 ustar 00root root 0000000 0000000 # Build requirements
Building the basic program should only require a recent version of golang.
```shell
make
```
## Bumping the version
1. `go get -u && go mod tidy`
2. `rm assets/modules.txt && make assets/modules.txt`
3. Cross-reference `assets/modules.txt` with `flatpak/radio.k0swe.Kel_Agent.yml`
4. Cross-reference `go.mod` with `Makefile`
5. Cross-reference `go.mod` with `debian/control` `Build-Depends`
6. Run `make deb-package` on Linux amd64 and Linux arm to make sure `chroot`s are set up
7. Run `make flatpak` on Linux amd64 to make sure that's building
8. Add changelog entries in `debian/changelog` and `assets/radio.k0swe.Kel_Agent.metainfo.xml`
9. Bump versions in `macos/kel-agent.pkgproj` and `win/kel-agent.wxs`
## Packaging for Debian Linux (incl. Raspberry Pi)
```shell
sudo apt install build-essential debhelper dh-golang sbuild autorevision
export ARCH=$(dpkg --print-architecture)
sudo sbuild-createchroot stable /srv/chroot/stable-"$ARCH" http://deb.debian.org/debian
make deb-package
```
## Packaging for Flatpak
```shell
sudo apt install flatpak flatpak-builder appstream-util desktop-file-validate
flatpak install flathub runtime/org.freedesktop.Sdk.Extension.golang/x86_64/20.08
make flatpak
```
kel-agent-0.4.6/LICENSE 0000664 0000000 0000000 00000026116 14251261704 0014405 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Chris Keller
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
kel-agent-0.4.6/Makefile 0000664 0000000 0000000 00000006763 14251261704 0015046 0 ustar 00root root 0000000 0000000 VERSION = $(shell < debian/changelog head -1 | egrep -o "[0-9]+\.[0-9]+\.[0-9]+")
GITCOMMIT = $(shell git rev-parse --short HEAD 2> /dev/null || true)
GENERATED = kel-agent kel-agent_*.pkg win/kel-agent_*.msi win/kel-agent.wixobj autorevision.cache \
../kel-agent_* ../*.deb flatpak/repo/ flatpak/.flatpak-builder/ flatpak/kel_agent.flatpak \
flatpak/flatpak_app/ flatpak/build-out/
.PHONY: all
all: kel-agent
.PHONY: test
test:
go test ./...
go vet ./...
if command -v appstream-util; then appstream-util validate-relax --nonet assets/radio.k0swe.Kel_Agent.metainfo.xml; fi
if command -v desktop-file-validate; then desktop-file-validate assets/radio.k0swe.Kel_Agent.desktop; fi
assets/modules.txt:
go mod vendor
mv vendor/modules.txt assets/
rm -rf vendor
kel-agent: test
export GITCOMMIT=$(GITCOMMIT) && scripts/build.sh
architecture.svg:
# apt install graphviz
dot -T svg -o architecture.svg < architecture.dot
autorevision.cache:
autorevision -s VCS_SHORT_HASH -o ./autorevision.cache
.PHONY: deb-tarball
deb-tarball: autorevision.cache
cd .. && tar -cvJf kel-agent_$(VERSION).orig.tar.xz --exclude-vcs kel-agent
.PHONY: deb-orig-tarball
deb-orig-tarball: autorevision.cache
cd .. && tar -cvJf kel-agent_$(VERSION).orig.tar.xz --exclude-vcs --exclude=debian --exclude=.github --exclude=.idea kel-agent
# TODO: This target can be removed once the package is in Debian stable and Ubuntu stable
../golang-github-k0swe-wsjtx-go-dev_4.0.1-1_all.deb:
wget https://github.com/k0swe/wsjtx-go/releases/download/v4.0.1/golang-github-k0swe-wsjtx-go-dev_4.0.1-1_all.deb \
-O ../golang-github-k0swe-wsjtx-go-dev_4.0.1-1_all.deb
# TODO: This target can be removed once the package is in Debian stable and Ubuntu stable
../golang-github-mazznoer-csscolorparser-dev_0.1.2-1_all.deb:
wget https://github.com/k0swe/wsjtx-go/releases/download/v4.0.1/golang-github-mazznoer-csscolorparser-dev_0.1.2-1_all.deb \
-O ../golang-github-mazznoer-csscolorparser-dev_0.1.2-1_all.deb
# TODO: This target can be removed once the package is in Debian stable and Ubuntu stable
../golang-github-adrg-xdg-dev_0.4.0-1_all.deb:
wget http://ftp.us.debian.org/debian/pool/main/g/golang-github-adrg-xdg/golang-github-adrg-xdg-dev_0.4.0-1_all.deb \
-O ../golang-github-adrg-xdg-dev_0.4.0-1_all.deb
.PHONY: deb-package
deb-package: deb-tarball ../golang-github-k0swe-wsjtx-go-dev_4.0.1-1_all.deb ../golang-github-adrg-xdg-dev_0.4.0-1_all.deb ../golang-github-mazznoer-csscolorparser-dev_0.1.2-1_all.deb
# https://wiki.debian.org/sbuild
sbuild -d stable \
--extra-package=../golang-github-k0swe-wsjtx-go-dev_4.0.1-1_all.deb \
--extra-package=../golang-github-adrg-xdg-dev_0.4.0-1_all.deb \
--extra-package=../golang-github-mazznoer-csscolorparser-dev_0.1.2-1_all.deb
.PHONY: flatpak
flatpak: kel-agent
cd flatpak && \
flatpak-builder --force-clean build-out radio.k0swe.Kel_Agent.yml --repo=repo && \
flatpak build-bundle repo kel_agent.flatpak radio.k0swe.Kel_Agent main
.PHONY: mac-package
mac-package: kel-agent
# http://s.sudre.free.fr/Software/Packages/about.html
packagesbuild --package-version $(VERSION) macos/kel-agent.pkgproj
productsign --keychain `security list-keychains | grep k0swe | tr -d \"` \
--sign "Developer ID Installer: Chris Keller (2UK8VD3UP4)" \
kel-agent.pkg kel-agent-signed.pkg
mv kel-agent-signed.pkg kel-agent_mac.pkg
.PHONY: win-package
win-package: kel-agent
# https://wixtoolset.org/
cd win && candle kel-agent.wxs && light kel-agent.wixobj
.PHONY: clean
clean:
rm -rf $(GENERATED)
kel-agent-0.4.6/README.md 0000664 0000000 0000000 00000002674 14251261704 0014662 0 ustar 00root root 0000000 0000000 [](https://goreportcard.com/report/github.com/k0swe/kel-agent)
[](https://github.com/k0swe/kel-agent/releases/latest)
[](https://github.com/k0swe/kel-agent/releases/latest)
# kel-agent
An agent program for translating between various amateur radio installed programs and WebSockets.
This was built to support https://github.com/k0swe/forester but can be used by any web application
that needs to communicate with amateur radio installed programs.

This currently supports communication with WSJT-X. Planned support includes `rigctld` and Ham Radio
Deluxe for transceiver remote control.
To get started using `kel-agent`, download an appropriate executable from the
[latest release](https://github.com/k0swe/kel-agent/releases/latest). Windows, Mac, Debian/Ubuntu
Linux and Raspberry Pi installers are available.
See the [Running documentation](RUNNING.md) for how to configure, execute and serve `kel-agent`.
## Acknowledgements
The wire logo for `kel-agent` was created by [Freepik](https://www.flaticon.com/authors/freepik)
on [Flaticon](https://www.flaticon.com).
kel-agent-0.4.6/RUNNING.md 0000664 0000000 0000000 00000010032 14251261704 0015030 0 ustar 00root root 0000000 0000000 # Running `kel-agent`
## Running on localhost
In the simplest case, `kel-agent` is running on the same computer as your radio programs and
browser. In this case, you can have `kel-agent` bind to `localhost` which will only allow programs
on the same computer to connect. This is straightforward, safe and the default.
```
$ kel-agent
2020/10/10 18:50:32 kel-agent ready to serve at ws://localhost:8081
```
To use a different port, add the `host` argument.
```
$ kel-agent -host localhost:9988
2020/10/10 20:06:39 kel-agent ready to serve at ws://localhost:9988
```
## Running on another machine
If you want to run your radio programs and `kel-agent` on one computer and your browser on another,
this is possible. There are a couple of approaches. Neither is super easy, which I hope to fix.
NOTE: I do *not* recommend serving this in a way that's exposed to the internet because there is
*no* authentication. If exposed to the internet, anyone could potentially initiate transmissions
with your radio.
### SSH port forwarding
This method is relatively simple and quick to execute, but is more brittle than serving secure
websockets because there is some setup each time you want to use the agent remotely, and
conceptually a little harder. Your remote machine must be running an SSH server for this to work.
On the remote machine with your radio software, run `kel-agent` normally. It can be bound to
`localhost`.
```
$ kel-agent
2020/10/10 18:50:32 kel-agent ready to serve at ws://localhost:8081
```
On the machine with your browser, start a command line and establish an SSH tunnel with port
forwarding:
```
$ ssh -N -L localhost:8081:localhost:8081 radio-pi
```
The first `localhost:8081` means "on this (browser) machine, bind to port 8081 and only expose to
`localhost` so other computers can't use it." The second `localhost:8081` means "once you log into
the remote computer, start forwarding traffic to port 8081 on its (remote) `localhost`." Finally,
`radio-pi` in my example is the remote hostname which is running `kel-agent` and the SSH server.
The command will look like it's not doing anything; just let it run, and the tunnel will stay open.
Now your web application can be configured to connect to `localhost`. Traffic bound for
`localhost:8081` will get securely forwarded to the remote machine. Both the browser and `kel-agent`
think they're talking to local processes, and you won't get mixed content warnings.
### Secure Websocket with TLS
This method needs a little more set up ahead of time, but is easier to use once it's set up.
First, you'll need `kel-agent` to bind to `0.0.0.0` to allow connections from other computers.
Second, due to the mixed content policy which is standard in web browsers, you'll need to specify a
TLS certificate and private key. Eventually I hope to make this easy, but for now you'll need to
follow https://stackoverflow.com/a/60516812/587091. In short,
1. generate a CA key and root certificate, then
2. a server key and certificate signing request with the server's hostname,
3. sign the request to generate the server certificate, then finally
4. install the root certificate in your browser's trusted authorities.
Yeah, I really need to make this easier.
```
$ kel-agent -host 0.0.0.0:8081 -key server.key -cert server.crt
2020/10/10 19:05:39 kel-agent ready to serve at wss://0.0.0.0:8081
```
Once running this way, your web application can be configured to connect directly to the remote
computer.
## Allowed origins
As part of the same-origin policy which is standard in web browsers, `kel-agent` will only accept
browser connections from certain origins (basically, websites). By default, only the website
`https://forester.radio` plus some local developer addresses are allowed to connect to `kel-agent`,
but this can be customized if others develop web applications that use `kel-agent`. I'm happy to
accept pull requests to expand the default list!
```
$ kel-agent -origins "https://forester.radio,https://someother.nifty.app"
2020/10/10 19:18:52 Allowed origins are [https://forester.radio https://someother.nifty.app]
```
kel-agent-0.4.6/VERSION.go 0000664 0000000 0000000 00000000207 14251261704 0015045 0 ustar 00root root 0000000 0000000 package main
// These are filled by `go build --ldflags`
var (
Version = "unknown"
GitCommit = "unknown"
BuildTime = "unknown"
)
kel-agent-0.4.6/architecture.dot 0000664 0000000 0000000 00000001577 14251261704 0016576 0 ustar 00root root 0000000 0000000 digraph {
Internet [ shape=septagon]
subgraph clusterComputer{
label="Computer";
labeljust=l;
style=rounded;
fontsize=10;
subgraph clusterBrowser {
label="Web Browser ";
labeljust=l;
fontsize=10;
color=lightgrey;
Application [label="Web Application"; shape=box]
};
agent [label="kel-agent"; shape=box; style=filled; fillcolor=lightblue]
WSJTX [label="WSJT-X"]
rigctld [label="hamlib\nrigctld"]
HRD;
etc [label="..."];
}
edge [style=bold; dir=none; fontsize=10;]
Internet -> Application
Application -> agent [label=" websocket"]
agent -> WSJTX [label="UDP"]
agent -> rigctld [label="TCP"; style=dotted]
agent -> HRD [label="UDP"; style=dotted]
agent -> etc [style=dotted]
}
kel-agent-0.4.6/architecture.svg 0000664 0000000 0000000 00000012567 14251261704 0016610 0 ustar 00root root 0000000 0000000
kel-agent-0.4.6/assets/ 0000775 0000000 0000000 00000000000 14251261704 0014674 5 ustar 00root root 0000000 0000000 kel-agent-0.4.6/assets/kel-agent.1 0000664 0000000 0000000 00000004041 14251261704 0016624 0 ustar 00root root 0000000 0000000 .TH KEL-AGENT 1
.SH NAME
kel-agent \- translates between amateur radio programs and WebSockets
.SH SYNOPSIS
.B kel-agent
[\fB\-host\fR \fIhost:port\fR]
[\fB\-cert\fR \fIcertfile\fR
\fB\-key\fR \fIkeyfile\fR]
[\fB\-origins\fR \fI"http://origin1"\fR[\fI,"http://origin2"\fR...]]
[\fB\-v\fR]
.SH DESCRIPTION
.B kel-agent
translates between various amateur radio installed programs and WebSockets. This
allows amateur radio web applications to access rig control and digital mode
APIs which are only available over TCP, UDP or by watching local files.
\fIWSJT-X\fR is currently supported, with planned support for \fIrigctld\fR and
\fIHam Radio Deluxe\fR.
.PP
.B kel-agent
was built to support https://github.com/k0swe/forester but can be used by any
web application that needs to communicate with amateur radio installed programs.
.SH OPTIONS
.TP
.BR \-host =\fIhost:port\fR
Set the websocket server hosting address. Default is \fIlocalhost:8081\fR.
.TP
.BR \-cert =\fIcertfile\fR \ \fB\-key\fR =\fIkeyfile\fR
Set the websocket server TLS certificate and private key. These are only
necessary when serving beyond localhost.
.TP
.BR -origins =\fI"http://origin1","http://origin2"\fR
Set which CORS origins (basically, which websites) should be allowed to access
the WebSocket server. Default is \fI"https://forester.radio"\fR plus some
localhost development origins.
.TP
.BR -v
Enable verbose debug logging.
.SH EXAMPLE
When running your web application and browser on the same computer as your
ham radio programs, no \fBkel-agent\fR options are needed. This is
straightforward, safe and the default.
.PP
$ \fBkel-agent\fR
.PP
If a different hosting port than 8081 is required, use the \fB-host\fR option.
.PP
$ \fBkel-agent -host\fR=\fIlocalhost:5001\fR
.PP
It's also possible to run your ham radio programs and \fBkel-agent\fR on one
computer, and your web browser and web app on another. This is more complex to
secure. I refer you to the GitHub repository for up-to-date documentation.
.SH SEE ALSO
\(bu https://github.com/k0swe/kel-agent
\(bu https://github.com/k0swe/forester
kel-agent-0.4.6/assets/license-32918167.pdf 0000664 0000000 0000000 00000123054 14251261704 0017740 0 ustar 00root root 0000000 0000000 %PDF-1.4
1 0 obj
<<
/Title ( L i c e n s e)
/Creator ( w k h t m l t o p d f 0 . 1 2 . 5)
/Producer ( Q t 4 . 8 . 7)
/CreationDate (D:20210522211737Z)
>>
endobj
3 0 obj
<<
/Type /ExtGState
/SA true
/SM 0.02
/ca 1.0
/CA 1.0
/AIS false
/SMask /None>>
endobj
4 0 obj
[/Pattern /DeviceRGB]
endobj
6 0 obj
<<
/Type /XObject
/Subtype /Image
/Width 1588
/Height 234
/BitsPerComponent 8
/ColorSpace /DeviceRGB
/Length 7 0 R
/Filter /DCTDecode
>>
stream
JFIF &""&0-0>>T &""&0-0>>T 4"
kd 4!#4 A xWI1sUh9) ÀB wX /:IǗIAJO/0lB˦tj7 9t!N͠