mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-18 15:26:17 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| abe8390237 |
@@ -1,71 +0,0 @@
|
|||||||
name: Publish AUR package
|
|
||||||
|
|
||||||
# Pushes the contents of pkg/aur/ to the remoteterm-meshcore AUR repository
|
|
||||||
# whenever a GitHub release is published. Can also be triggered manually for
|
|
||||||
# testing or out-of-band republishes.
|
|
||||||
#
|
|
||||||
# Required secrets:
|
|
||||||
# AUR_SSH_PRIVATE_KEY Private SSH key registered with the AUR maintainer
|
|
||||||
# account that owns the remoteterm-meshcore package.
|
|
||||||
# AUR_COMMIT_EMAIL Email used for the AUR git commit identity.
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Version to publish (no v prefix, e.g. 3.9.1)'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
# Serialize publishes so a fast back-to-back release sequence cannot race
|
|
||||||
# two pushes against the AUR repo. The later one wins by virtue of being
|
|
||||||
# the final state.
|
|
||||||
group: publish-aur
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-aur:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Resolve version from event
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
VERSION="${{ inputs.version }}"
|
|
||||||
else
|
|
||||||
VERSION="${{ github.event.release.tag_name }}"
|
|
||||||
fi
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "Publishing AUR package for version $VERSION"
|
|
||||||
|
|
||||||
- name: Stamp pkgver into PKGBUILD
|
|
||||||
run: |
|
|
||||||
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" pkg/aur/PKGBUILD
|
|
||||||
sed -i "s/^pkgrel=.*/pkgrel=1/" pkg/aur/PKGBUILD
|
|
||||||
|
|
||||||
- name: Publish to AUR
|
|
||||||
uses: KSXGitHub/github-actions-deploy-aur@v4.1.2
|
|
||||||
with:
|
|
||||||
pkgname: remoteterm-meshcore
|
|
||||||
pkgbuild: pkg/aur/PKGBUILD
|
|
||||||
assets: |
|
|
||||||
pkg/aur/remoteterm-meshcore.install
|
|
||||||
pkg/aur/remoteterm-meshcore.service
|
|
||||||
pkg/aur/remoteterm.env
|
|
||||||
commit_username: jkingsman
|
|
||||||
commit_email: ${{ secrets.AUR_COMMIT_EMAIL }}
|
|
||||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
||||||
commit_message: "Update to ${{ steps.version.outputs.version }}"
|
|
||||||
# Recompute sha256sums from the live release tarball + the bundled
|
|
||||||
# service/env files. The committed PKGBUILD has SKIP placeholders.
|
|
||||||
updpkgsums: true
|
|
||||||
# Validate the PKGBUILD parses and sources download, but skip the
|
|
||||||
# actual build (which would run uv sync + npm install for several
|
|
||||||
# minutes of CI time on every release).
|
|
||||||
test: true
|
|
||||||
test_flags: --clean --cleanbuild --nodeps --nobuild
|
|
||||||
@@ -161,29 +161,6 @@ To stop:
|
|||||||
sudo docker compose down
|
sudo docker compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install Path 3: Arch Linux (AUR)
|
|
||||||
|
|
||||||
A [`remoteterm-meshcore`](https://aur.archlinux.org/packages/remoteterm-meshcore) package is available in the AUR. Install it with an AUR helper or build it manually:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# with an AUR helper
|
|
||||||
yay -S remoteterm-meshcore
|
|
||||||
|
|
||||||
# or manually
|
|
||||||
git clone https://aur.archlinux.org/remoteterm-meshcore.git
|
|
||||||
cd remoteterm-meshcore
|
|
||||||
makepkg -si
|
|
||||||
```
|
|
||||||
|
|
||||||
Configure your radio connection, then start the service:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo vi /etc/remoteterm-meshcore/remoteterm.env
|
|
||||||
sudo systemctl enable --now remoteterm-meshcore
|
|
||||||
```
|
|
||||||
|
|
||||||
Access the app at http://localhost:8000.
|
|
||||||
|
|
||||||
## Standard Environment Variables
|
## Standard Environment Variables
|
||||||
|
|
||||||
Only one transport may be active at a time. If multiple are set, the server will refuse to start.
|
Only one transport may be active at a time. If multiple are set, the server will refuse to start.
|
||||||
@@ -222,15 +199,6 @@ $env:MESHCORE_SERIAL_PORT="COM8" # or your COM port
|
|||||||
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
|
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> **Windows + MQTT fanout:** Python's default Windows event loop (ProactorEventLoop) is not compatible with the MQTT libraries used by RemoteTerm. If you configure any MQTT integration, add `--loop none` to your uvicorn command:
|
|
||||||
>
|
|
||||||
> ```powershell
|
|
||||||
> uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --loop none
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> If you forget, the app will start normally but MQTT connections will fail and you'll see a toast in the UI with this same guidance.
|
|
||||||
|
|
||||||
If you enable Basic Auth, protect the app with HTTPS. HTTP Basic credentials are not safe on plain HTTP. Also note that the app's permissive CORS policy is a deliberate trusted-network tradeoff, so cross-origin browser JavaScript is not a reliable way to use that Basic Auth gate.
|
If you enable Basic Auth, protect the app with HTTPS. HTTP Basic credentials are not safe on plain HTTP. Also note that the app's permissive CORS policy is a deliberate trusted-network tradeoff, so cross-origin browser JavaScript is not a reliable way to use that Basic Auth gate.
|
||||||
|
|
||||||
## Where To Go Next
|
## Where To Go Next
|
||||||
|
|||||||
+5
-13
@@ -254,22 +254,14 @@ class BaseMqttPublisher(ABC):
|
|||||||
self._last_error = _format_error_detail(e)
|
self._last_error = _format_error_detail(e)
|
||||||
|
|
||||||
# Windows ProactorEventLoop does not implement add_reader /
|
# Windows ProactorEventLoop does not implement add_reader /
|
||||||
# add_writer, which paho-mqtt requires. The failure can
|
# add_writer, which paho-mqtt requires. Give a specific,
|
||||||
# surface as a direct NotImplementedError (add_writer in
|
# actionable toast instead of the generic connection error.
|
||||||
# __aenter__) or as a generic timeout (add_reader fails
|
if isinstance(e, NotImplementedError) and sys.platform == "win32":
|
||||||
# inside an event-loop callback, so paho never hears back).
|
|
||||||
# Either way, if we're on Windows with Proactor the root
|
|
||||||
# cause is the same and retrying won't help.
|
|
||||||
_on_proactor = (
|
|
||||||
sys.platform == "win32"
|
|
||||||
and type(asyncio.get_event_loop()).__name__ == "ProactorEventLoop"
|
|
||||||
)
|
|
||||||
if _on_proactor:
|
|
||||||
broadcast_error(
|
broadcast_error(
|
||||||
"MQTT unavailable — Windows event loop incompatible",
|
"MQTT unavailable — Windows event loop incompatible",
|
||||||
"The default Windows event loop (ProactorEventLoop) does "
|
"The default Windows event loop (ProactorEventLoop) does "
|
||||||
"not support MQTT. Add --loop none to your uvicorn "
|
"not support MQTT. Restart with: uv run uvicorn "
|
||||||
"command and restart. See README.md for details.",
|
"app.main:app --loop none",
|
||||||
)
|
)
|
||||||
_broadcast_health()
|
_broadcast_health()
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|||||||
+100
-19
@@ -1,41 +1,122 @@
|
|||||||
import logging
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Windows event-loop advisory for MQTT fanout
|
# Windows event-loop fix for MQTT fanout (aiomqtt / paho-mqtt) compatibility
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# On Windows, uvicorn's default event loop (ProactorEventLoop) does not
|
# On Windows, uvicorn's default "auto" loop explicitly creates ProactorEventLoop,
|
||||||
# implement add_reader()/add_writer(), which paho-mqtt (via aiomqtt) requires.
|
# which does NOT implement add_reader()/add_writer() — calls that paho-mqtt
|
||||||
# We cannot fix this from inside the app — the loop is already created by the
|
# requires internally. Setting the event loop *policy* alone is not enough
|
||||||
# time this module is imported. Log a prominent warning so Windows operators
|
# because uvicorn's "auto" factory bypasses it.
|
||||||
# who want MQTT know to add ``--loop none`` to their uvicorn command.
|
#
|
||||||
|
# The fix: re-exec the current process with "--loop none", which tells uvicorn
|
||||||
|
# to let asyncio.run() create the loop through the standard policy (where we
|
||||||
|
# have just installed WindowsSelectorEventLoopPolicy).
|
||||||
|
#
|
||||||
|
# Guards:
|
||||||
|
# - "--loop" already in argv → we (or the operator) already handled it
|
||||||
|
# - MESHCORE_NO_AUTO_LOOP_ON_WIN32=true → operator opt-out for custom
|
||||||
|
# runners, test harnesses, or other non-uvicorn invocations
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
if sys.platform == "win32":
|
_win32_needs_reexec = (
|
||||||
|
sys.platform == "win32"
|
||||||
|
and os.environ.get("MESHCORE_NO_AUTO_LOOP_ON_WIN32", "").lower() not in ("true", "1")
|
||||||
|
and "--loop" not in sys.argv
|
||||||
|
)
|
||||||
|
# Skip re-exec when --reload is active: on Windows os.execv spawns a new
|
||||||
|
# process and exits, so the reloader's child dies and a fresh uvicorn
|
||||||
|
# (with its own reloader) starts — creating doubled watchers or a loop.
|
||||||
|
# Also skip if sys.executable is missing (embedded / frozen Python).
|
||||||
|
if _win32_needs_reexec and "--reload" in sys.argv:
|
||||||
|
print(
|
||||||
|
"\n" + "!" * 78 + "\n"
|
||||||
|
" WINDOWS + --reload DETECTED\n" + "!" * 78 + "\n"
|
||||||
|
"\n"
|
||||||
|
" We can't auto-fix the event loop when --reload is active because\n"
|
||||||
|
" the re-exec would fight with uvicorn's reloader process.\n"
|
||||||
|
"\n"
|
||||||
|
" If you need MQTT fanout, add --loop none to your command:\n"
|
||||||
|
"\n"
|
||||||
|
" uv run uvicorn app.main:app --reload \033[1m--loop none\033[0m [... other options ...]\n"
|
||||||
|
"\n"
|
||||||
|
" Everything else works fine as-is.\n"
|
||||||
|
"\n" + "!" * 78 + "\n",
|
||||||
|
file=sys.stderr,
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
_win32_needs_reexec = False
|
||||||
|
|
||||||
|
if _win32_needs_reexec and not sys.executable:
|
||||||
|
# Embedded or frozen Python — can't re-exec, just warn.
|
||||||
|
_win32_needs_reexec = False
|
||||||
|
|
||||||
|
if _win32_needs_reexec:
|
||||||
import asyncio as _asyncio
|
import asyncio as _asyncio
|
||||||
|
|
||||||
_loop = _asyncio.get_event_loop()
|
_asyncio.set_event_loop_policy(
|
||||||
_is_proactor = type(_loop).__name__ == "ProactorEventLoop"
|
_asyncio.WindowsSelectorEventLoopPolicy() # type: ignore[attr-defined]
|
||||||
if _is_proactor:
|
)
|
||||||
|
|
||||||
|
print(
|
||||||
|
"\n" + "=" * 78 + "\n"
|
||||||
|
" HALLO FRIEND WINDOWS USER <3 WE GOTTA ADJUST THINGS BEFORE YOU STARTUP\n"
|
||||||
|
+ "="
|
||||||
|
* 78
|
||||||
|
+ "\n"
|
||||||
|
"\n"
|
||||||
|
" uvicorn's default event loop on Windows (ProactorEventLoop) is not\n"
|
||||||
|
" compatible with aiomqtt/paho-mqtt, which require add_reader() /\n"
|
||||||
|
" add_writer(). Re-executing with '--loop none' so uvicorn honours\n"
|
||||||
|
" WindowsSelectorEventLoopPolicy and MQTT fanout can function.\n"
|
||||||
|
""
|
||||||
|
" In English: The code we use for MQTT is fussy. We're restarting\n"
|
||||||
|
" the server with the right settings for MQTT to work.\n"
|
||||||
|
"\n"
|
||||||
|
" This may or may not work :) If the app starts up after this without a warning, you're good to go.\n"
|
||||||
|
"\n" + "=" * 78 + "\n",
|
||||||
|
file=sys.stderr,
|
||||||
|
flush=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
# sys.argv[0] on Windows is typically a .exe console-script launcher
|
||||||
|
# (e.g. .venv\Scripts\uvicorn.exe) which Python can't open as a script.
|
||||||
|
# use "python -m uvicorn" instead, forwarding the original arguments.
|
||||||
|
# yes, this is brittle as all hell.
|
||||||
|
try:
|
||||||
|
os.execv(
|
||||||
|
sys.executable,
|
||||||
|
[sys.executable, "-m", "uvicorn"] + sys.argv[1:] + ["--loop", "none"],
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
# execv failed — fall through and let the app start normally.
|
||||||
|
# MQTT fanout will not work, but everything else will.
|
||||||
print(
|
print(
|
||||||
"\n" + "!" * 78 + "\n"
|
"\n" + "!" * 78 + "\n"
|
||||||
" NOTE FOR WINDOWS USERS\n" + "!" * 78 + "\n"
|
" AUTO-RESTART FAILED :<\n" + "!" * 78 + "\n"
|
||||||
"\n"
|
"\n"
|
||||||
" The running event loop is ProactorEventLoop, which is not\n"
|
" We tried to restart uvicorn with the necessary settings\n"
|
||||||
" compatible with MQTT fanout (aiomqtt / paho-mqtt).\n"
|
" automatically, but there was a problem with the invocation\n"
|
||||||
|
" (not shocking; this is a fragile system).\n"
|
||||||
"\n"
|
"\n"
|
||||||
" If you use MQTT integrations, restart with --loop none:\n"
|
" Please rerun RemoteTerm with a command like:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" uv run uvicorn app.main:app \033[1m--loop none\033[0m"
|
" uv run uvicorn app.main:app \033[1m--loop none\033[0m [... other options ...]\n"
|
||||||
" [... other options ...]\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" Everything else works fine as-is.\n"
|
" Setting '--loop none' on uvicorn startup will put you in a good\n"
|
||||||
|
" state for MQTT and bypass this self-repair.\n"
|
||||||
|
"\n"
|
||||||
|
" The server is starting anyway -- everything except MQTT fanout\n"
|
||||||
|
" will work normally. If you want to suppress this attempt, \n"
|
||||||
|
" set the env var MESHCORE_NO_AUTO_LOOP_ON_WIN32=true\n"
|
||||||
"\n" + "!" * 78 + "\n",
|
"\n" + "!" * 78 + "\n",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
flush=True,
|
flush=True,
|
||||||
)
|
)
|
||||||
del _loop, _is_proactor
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import logging
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,11 @@ import {
|
|||||||
Cell,
|
Cell,
|
||||||
} from 'recharts';
|
} from 'recharts';
|
||||||
|
|
||||||
import { MeshCoreDecoder, Utils } from '@michaelhart/meshcore-decoder';
|
|
||||||
|
|
||||||
import { RawPacketList } from './RawPacketList';
|
import { RawPacketList } from './RawPacketList';
|
||||||
import { RawPacketInspectorDialog } from './RawPacketDetailModal';
|
import { RawPacketInspectorDialog } from './RawPacketDetailModal';
|
||||||
import { Button } from './ui/button';
|
import { Button } from './ui/button';
|
||||||
import type { Channel, Contact, RawPacket } from '../types';
|
import type { Channel, Contact, RawPacket } from '../types';
|
||||||
import {
|
import {
|
||||||
KNOWN_PAYLOAD_TYPES,
|
|
||||||
RAW_PACKET_STATS_WINDOWS,
|
RAW_PACKET_STATS_WINDOWS,
|
||||||
buildRawPacketStatsSnapshot,
|
buildRawPacketStatsSnapshot,
|
||||||
type NeighborStat,
|
type NeighborStat,
|
||||||
@@ -27,26 +24,9 @@ import {
|
|||||||
type RawPacketStatsSessionState,
|
type RawPacketStatsSessionState,
|
||||||
type RawPacketStatsWindow,
|
type RawPacketStatsWindow,
|
||||||
} from '../utils/rawPacketStats';
|
} from '../utils/rawPacketStats';
|
||||||
import { createDecoderOptions } from '../utils/rawPacketInspector';
|
|
||||||
import { getContactDisplayName } from '../utils/pubkey';
|
import { getContactDisplayName } from '../utils/pubkey';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
const KNOWN_PAYLOAD_TYPE_SET = new Set<string>(KNOWN_PAYLOAD_TYPES);
|
|
||||||
|
|
||||||
function getPacketTypeName(
|
|
||||||
packet: RawPacket,
|
|
||||||
decoderOptions?: ReturnType<typeof createDecoderOptions>
|
|
||||||
): string {
|
|
||||||
try {
|
|
||||||
const decoded = MeshCoreDecoder.decode(packet.data, decoderOptions);
|
|
||||||
if (!decoded.isValid) return 'Unknown';
|
|
||||||
const name = Utils.getPayloadTypeName(decoded.payloadType);
|
|
||||||
return KNOWN_PAYLOAD_TYPE_SET.has(name) ? name : 'Unknown';
|
|
||||||
} catch {
|
|
||||||
return 'Unknown';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RawPacketFeedViewProps {
|
interface RawPacketFeedViewProps {
|
||||||
packets: RawPacket[];
|
packets: RawPacket[];
|
||||||
rawPacketStatsSession: RawPacketStatsSessionState;
|
rawPacketStatsSession: RawPacketStatsSessionState;
|
||||||
@@ -448,48 +428,6 @@ export function RawPacketFeedView({
|
|||||||
const [nowSec, setNowSec] = useState(() => Math.floor(Date.now() / 1000));
|
const [nowSec, setNowSec] = useState(() => Math.floor(Date.now() / 1000));
|
||||||
const [selectedPacket, setSelectedPacket] = useState<RawPacket | null>(null);
|
const [selectedPacket, setSelectedPacket] = useState<RawPacket | null>(null);
|
||||||
const [analyzeModalOpen, setAnalyzeModalOpen] = useState(false);
|
const [analyzeModalOpen, setAnalyzeModalOpen] = useState(false);
|
||||||
const [mobileFiltersOpen, setMobileFiltersOpen] = useState(false);
|
|
||||||
const [enabledTypes, setEnabledTypes] = useState<Set<string>>(() => new Set(KNOWN_PAYLOAD_TYPES));
|
|
||||||
|
|
||||||
const decoderOptions = useMemo(() => createDecoderOptions(channels), [channels]);
|
|
||||||
|
|
||||||
const packetsWithTypes = useMemo(
|
|
||||||
() =>
|
|
||||||
packets.map((packet) => ({
|
|
||||||
packet,
|
|
||||||
payloadType: getPacketTypeName(packet, decoderOptions),
|
|
||||||
})),
|
|
||||||
[packets, decoderOptions]
|
|
||||||
);
|
|
||||||
|
|
||||||
const allTypesEnabled = enabledTypes.size === KNOWN_PAYLOAD_TYPES.length;
|
|
||||||
|
|
||||||
const filteredPackets = useMemo(() => {
|
|
||||||
if (allTypesEnabled) return packets;
|
|
||||||
return packetsWithTypes
|
|
||||||
.filter(({ payloadType }) => enabledTypes.has(payloadType))
|
|
||||||
.map(({ packet }) => packet);
|
|
||||||
}, [packetsWithTypes, enabledTypes, packets, allTypesEnabled]);
|
|
||||||
|
|
||||||
const handleToggleAll = () => {
|
|
||||||
setEnabledTypes(allTypesEnabled ? new Set() : new Set(KNOWN_PAYLOAD_TYPES));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleToggleType = (type: string) => {
|
|
||||||
setEnabledTypes((prev) => {
|
|
||||||
const next = new Set(prev);
|
|
||||||
if (next.has(type)) {
|
|
||||||
next.delete(type);
|
|
||||||
} else {
|
|
||||||
next.add(type);
|
|
||||||
}
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOnly = (type: string) => {
|
|
||||||
setEnabledTypes(new Set([type]));
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const interval = window.setInterval(() => {
|
const interval = window.setInterval(() => {
|
||||||
@@ -530,129 +468,38 @@ export function RawPacketFeedView({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="border-b border-border px-4 py-2.5">
|
<div className="flex items-center justify-between gap-3 border-b border-border px-4 py-2.5">
|
||||||
<div className="flex items-center justify-between gap-3">
|
<div>
|
||||||
<div>
|
<h2 className="font-semibold text-base text-foreground">Raw Packet Feed</h2>
|
||||||
<h2 className="font-semibold text-base text-foreground">Raw Packet Feed</h2>
|
<p className="text-xs text-muted-foreground">
|
||||||
<p className="hidden md:block text-xs text-muted-foreground">
|
Collecting stats since {formatTimestamp(rawPacketStatsSession.sessionStartedAt)}
|
||||||
Collecting stats since {formatTimestamp(rawPacketStatsSession.sessionStartedAt)}
|
</p>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setAnalyzeModalOpen(true)}
|
|
||||||
>
|
|
||||||
Analyze Packet
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setStatsOpen((current) => !current)}
|
|
||||||
aria-expanded={statsOpen}
|
|
||||||
>
|
|
||||||
{statsOpen ? (
|
|
||||||
<ChevronRight className="h-4 w-4" />
|
|
||||||
) : (
|
|
||||||
<ChevronLeft className="h-4 w-4" />
|
|
||||||
)}
|
|
||||||
{statsOpen ? 'Hide Stats' : 'Show Stats'}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<p className="md:hidden text-xs text-muted-foreground">
|
<div className="flex items-center gap-2">
|
||||||
Collecting stats since {formatTimestamp(rawPacketStatsSession.sessionStartedAt)}
|
<Button
|
||||||
{!mobileFiltersOpen && (
|
type="button"
|
||||||
<>
|
variant="outline"
|
||||||
{' · '}
|
size="sm"
|
||||||
<button
|
onClick={() => setAnalyzeModalOpen(true)}
|
||||||
type="button"
|
>
|
||||||
className="text-primary hover:text-primary/80 transition-colors"
|
Analyze Packet
|
||||||
onClick={() => setMobileFiltersOpen(true)}
|
</Button>
|
||||||
>
|
<Button
|
||||||
Show Filters
|
type="button"
|
||||||
</button>
|
variant="outline"
|
||||||
</>
|
size="sm"
|
||||||
)}
|
onClick={() => setStatsOpen((current) => !current)}
|
||||||
</p>
|
aria-expanded={statsOpen}
|
||||||
|
>
|
||||||
{mobileFiltersOpen && (
|
{statsOpen ? <ChevronRight className="h-4 w-4" /> : <ChevronLeft className="h-4 w-4" />}
|
||||||
<div className="mt-1.5 md:hidden flex flex-wrap items-center gap-x-3 gap-y-1">
|
{statsOpen ? 'Hide Stats' : 'Show Stats'}
|
||||||
<label className="flex items-center gap-1 text-xs text-muted-foreground cursor-pointer">
|
</Button>
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={allTypesEnabled}
|
|
||||||
onChange={handleToggleAll}
|
|
||||||
className="rounded"
|
|
||||||
/>
|
|
||||||
All
|
|
||||||
</label>
|
|
||||||
{KNOWN_PAYLOAD_TYPES.map((type) => (
|
|
||||||
<span key={type} className="inline-flex items-center gap-1 text-xs">
|
|
||||||
<label className="flex items-center gap-1 text-foreground cursor-pointer">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={enabledTypes.has(type)}
|
|
||||||
onChange={() => handleToggleType(type)}
|
|
||||||
className="rounded"
|
|
||||||
/>
|
|
||||||
{type}
|
|
||||||
</label>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="text-[0.625rem] text-muted-foreground hover:text-primary transition-colors"
|
|
||||||
onClick={() => handleOnly(type)}
|
|
||||||
>
|
|
||||||
(only)
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="mt-1.5 hidden md:flex flex-wrap items-center gap-x-3 gap-y-1">
|
|
||||||
<label className="flex items-center gap-1 text-xs text-muted-foreground cursor-pointer">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={allTypesEnabled}
|
|
||||||
onChange={handleToggleAll}
|
|
||||||
className="rounded"
|
|
||||||
/>
|
|
||||||
All
|
|
||||||
</label>
|
|
||||||
{KNOWN_PAYLOAD_TYPES.map((type) => (
|
|
||||||
<span key={type} className="inline-flex items-center gap-1 text-xs">
|
|
||||||
<label className="flex items-center gap-1 text-foreground cursor-pointer">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={enabledTypes.has(type)}
|
|
||||||
onChange={() => handleToggleType(type)}
|
|
||||||
className="rounded"
|
|
||||||
/>
|
|
||||||
{type}
|
|
||||||
</label>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="text-[0.625rem] text-muted-foreground hover:text-primary transition-colors"
|
|
||||||
onClick={() => handleOnly(type)}
|
|
||||||
>
|
|
||||||
(only)
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex min-h-0 flex-1 flex-col md:flex-row">
|
<div className="flex min-h-0 flex-1 flex-col md:flex-row">
|
||||||
<div className={cn('min-h-0 min-w-0 flex-1', statsOpen && 'md:border-r md:border-border')}>
|
<div className={cn('min-h-0 min-w-0 flex-1', statsOpen && 'md:border-r md:border-border')}>
|
||||||
<RawPacketList
|
<RawPacketList packets={packets} channels={channels} onPacketClick={setSelectedPacket} />
|
||||||
packets={filteredPackets}
|
|
||||||
channels={channels}
|
|
||||||
onPacketClick={setSelectedPacket}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<aside
|
<aside
|
||||||
|
|||||||
@@ -1666,8 +1666,7 @@ function AppriseConfigEditor({
|
|||||||
rows={4}
|
rows={4}
|
||||||
/>
|
/>
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
One URL per line. All URLs receive every matched notification. For Matrix room version 12
|
One URL per line. All URLs receive every matched notification.
|
||||||
(servername-less room IDs), append <code>?hsreq=no</code> to the URL.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const RAW_PACKET_STATS_WINDOW_SECONDS: Record<Exclude<RawPacketStatsWindow, 'ses
|
|||||||
|
|
||||||
export const MAX_RAW_PACKET_STATS_OBSERVATIONS = 20000;
|
export const MAX_RAW_PACKET_STATS_OBSERVATIONS = 20000;
|
||||||
|
|
||||||
export const KNOWN_PAYLOAD_TYPES = [
|
const KNOWN_PAYLOAD_TYPES = [
|
||||||
'Advert',
|
'Advert',
|
||||||
'GroupText',
|
'GroupText',
|
||||||
'TextMessage',
|
'TextMessage',
|
||||||
|
|||||||
@@ -1,117 +0,0 @@
|
|||||||
# Maintainer: Jack Kingsman <jack.kingsman@gmail.com>
|
|
||||||
|
|
||||||
pkgname=remoteterm-meshcore
|
|
||||||
# pkgver is rewritten by .github/workflows/publish-aur.yml on each release.
|
|
||||||
pkgver=3.9.0
|
|
||||||
pkgrel=1
|
|
||||||
pkgdesc='Web interface for MeshCore mesh radio networks'
|
|
||||||
arch=(x86_64 aarch64)
|
|
||||||
url='https://github.com/jkingsman/Remote-Terminal-for-MeshCore'
|
|
||||||
license=('MIT')
|
|
||||||
# No system python dependency — we bundle a standalone interpreter via
|
|
||||||
# python-build-standalone so the package is immune to Arch python ABI bumps.
|
|
||||||
depends=(glibc)
|
|
||||||
makedepends=(uv nodejs npm)
|
|
||||||
optdepends=('bluez: BLE transport support')
|
|
||||||
backup=(etc/remoteterm-meshcore/remoteterm.env)
|
|
||||||
# The bundled python-build-standalone binary ships pre-stripped. makepkg's
|
|
||||||
# default strip pass corrupts its unusual ELF layout (.dynstr not in segment),
|
|
||||||
# so we disable stripping for the whole package.
|
|
||||||
options=(!strip)
|
|
||||||
install=remoteterm-meshcore.install
|
|
||||||
source=(
|
|
||||||
"$pkgname-$pkgver.tar.gz::https://github.com/jkingsman/Remote-Terminal-for-MeshCore/archive/refs/tags/$pkgver.tar.gz"
|
|
||||||
"remoteterm-meshcore.service"
|
|
||||||
"remoteterm.env"
|
|
||||||
)
|
|
||||||
# sha256sums are recomputed by `updpkgsums` in the publish workflow before
|
|
||||||
# the PKGBUILD is pushed to AUR. The committed values are intentionally SKIP
|
|
||||||
# so the file is honest about not tracking real hashes in this repo.
|
|
||||||
sha256sums=('SKIP'
|
|
||||||
'SKIP'
|
|
||||||
'SKIP')
|
|
||||||
|
|
||||||
# python-build-standalone: stripped install_only builds (~30 MB each).
|
|
||||||
# Bump _pyver and _pybuilddate when updating the bundled interpreter.
|
|
||||||
_pyver=3.13.13
|
|
||||||
_pybuilddate=20260408
|
|
||||||
|
|
||||||
source_x86_64=("python-${_pyver}-x86_64.tar.gz::https://github.com/astral-sh/python-build-standalone/releases/download/${_pybuilddate}/cpython-${_pyver}+${_pybuilddate}-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz")
|
|
||||||
sha256sums_x86_64=('SKIP')
|
|
||||||
|
|
||||||
source_aarch64=("python-${_pyver}-aarch64.tar.gz::https://github.com/astral-sh/python-build-standalone/releases/download/${_pybuilddate}/cpython-${_pyver}+${_pybuilddate}-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz")
|
|
||||||
sha256sums_aarch64=('SKIP')
|
|
||||||
|
|
||||||
_srcname="Remote-Terminal-for-MeshCore-$pkgver"
|
|
||||||
|
|
||||||
build() {
|
|
||||||
cd "$_srcname"
|
|
||||||
|
|
||||||
# Build frontend
|
|
||||||
cd frontend
|
|
||||||
npm ci
|
|
||||||
npm run build
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# Create venv using the bundled standalone Python interpreter, then install
|
|
||||||
# Python dependencies into it. This produces a fully self-contained venv
|
|
||||||
# that does not reference the system Python at all.
|
|
||||||
uv venv --python "$srcdir/python/bin/python3" .venv
|
|
||||||
uv sync --no-dev --frozen
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
|
||||||
cd "$_srcname"
|
|
||||||
|
|
||||||
local _optdir=/opt/remoteterm-meshcore
|
|
||||||
local _instdir="$pkgdir$_optdir"
|
|
||||||
|
|
||||||
# App source
|
|
||||||
install -d "$_instdir"
|
|
||||||
cp -r app "$_instdir/"
|
|
||||||
cp pyproject.toml uv.lock "$_instdir/"
|
|
||||||
|
|
||||||
# Frontend build
|
|
||||||
install -d "$_instdir/frontend"
|
|
||||||
cp -r frontend/dist "$_instdir/frontend/"
|
|
||||||
|
|
||||||
# Bundled Python interpreter
|
|
||||||
cp -a "$srcdir/python" "$_instdir/python"
|
|
||||||
|
|
||||||
# Python venv
|
|
||||||
cp -a .venv "$_instdir/"
|
|
||||||
|
|
||||||
# Fix shebangs and venv config: replace build-time paths with final
|
|
||||||
# install paths so the venv works from /opt after installation.
|
|
||||||
# sed only operates on regular file contents, so symlinks need separate
|
|
||||||
# fixup below.
|
|
||||||
find "$_instdir/.venv/bin" -type f -exec \
|
|
||||||
sed -i "s|$srcdir/$_srcname/.venv|$_optdir/.venv|g" {} +
|
|
||||||
find "$_instdir/.venv/bin" -type f -exec \
|
|
||||||
sed -i "s|$srcdir/python|$_optdir/python|g" {} +
|
|
||||||
sed -i \
|
|
||||||
-e "s|$srcdir/$_srcname/.venv|$_optdir/.venv|g" \
|
|
||||||
-e "s|$srcdir/python|$_optdir/python|g" \
|
|
||||||
"$_instdir/.venv/pyvenv.cfg" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Recreate the venv interpreter symlinks — these are symlinks (not files),
|
|
||||||
# so sed cannot fix them. Point them at the bundled Python.
|
|
||||||
ln -sf "$_optdir/python/bin/python3" "$_instdir/.venv/bin/python"
|
|
||||||
ln -sf python "$_instdir/.venv/bin/python3"
|
|
||||||
ln -sf python "$_instdir/.venv/bin/python3.13"
|
|
||||||
|
|
||||||
# Data directory symlink
|
|
||||||
ln -s /var/lib/remoteterm-meshcore "$_instdir/data"
|
|
||||||
|
|
||||||
# Systemd service
|
|
||||||
install -Dm644 "$srcdir/remoteterm-meshcore.service" \
|
|
||||||
"$pkgdir/usr/lib/systemd/system/remoteterm-meshcore.service"
|
|
||||||
|
|
||||||
# Environment file
|
|
||||||
install -Dm640 "$srcdir/remoteterm.env" \
|
|
||||||
"$pkgdir/etc/remoteterm-meshcore/remoteterm.env"
|
|
||||||
|
|
||||||
# License
|
|
||||||
install -Dm644 LICENSE.md \
|
|
||||||
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
pre_install() {
|
|
||||||
getent group remoteterm > /dev/null || groupadd -r remoteterm
|
|
||||||
getent passwd remoteterm > /dev/null || \
|
|
||||||
useradd -r -g remoteterm -d /var/lib/remoteterm-meshcore -s /sbin/nologin \
|
|
||||||
-c "RemoteTerm for MeshCore" remoteterm
|
|
||||||
}
|
|
||||||
|
|
||||||
pre_upgrade() {
|
|
||||||
pre_install
|
|
||||||
}
|
|
||||||
|
|
||||||
post_install() {
|
|
||||||
echo "==> Set your radio connection (serial, TCP, or BLE) in"
|
|
||||||
echo "==> /etc/remoteterm-meshcore/remoteterm.env"
|
|
||||||
echo "==> Start the service with: systemctl enable --now remoteterm-meshcore"
|
|
||||||
echo "==> The web UI will be at http://localhost:8000"
|
|
||||||
}
|
|
||||||
|
|
||||||
post_upgrade() {
|
|
||||||
# Clean orphaned __pycache__ dirs left by the previous Python version
|
|
||||||
find /opt/remoteterm-meshcore -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
||||||
|
|
||||||
if command -v systemctl &>/dev/null && systemctl --version &>/dev/null 2>&1; then
|
|
||||||
systemctl daemon-reload
|
|
||||||
if systemctl is-active --quiet remoteterm-meshcore; then
|
|
||||||
systemctl restart remoteterm-meshcore
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pre_remove() {
|
|
||||||
if command -v systemctl &>/dev/null && systemctl --version &>/dev/null 2>&1; then
|
|
||||||
systemctl disable --now remoteterm-meshcore 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
post_remove() {
|
|
||||||
if command -v systemctl &>/dev/null && systemctl --version &>/dev/null 2>&1; then
|
|
||||||
systemctl daemon-reload
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "==> Database and config remain in /var/lib/remoteterm-meshcore/, remoteterm user retained."
|
|
||||||
echo "==> To fully clean up: sudo rm -rf /var/lib/remoteterm-meshcore"
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=RemoteTerm for MeshCore
|
|
||||||
Documentation=https://github.com/jkingsman/Remote-Terminal-for-MeshCore
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=remoteterm
|
|
||||||
Group=remoteterm
|
|
||||||
WorkingDirectory=/opt/remoteterm-meshcore
|
|
||||||
EnvironmentFile=/etc/remoteterm-meshcore/remoteterm.env
|
|
||||||
ExecStart=/opt/remoteterm-meshcore/.venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5s
|
|
||||||
|
|
||||||
StateDirectory=remoteterm-meshcore
|
|
||||||
|
|
||||||
# Hardening
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=yes
|
|
||||||
PrivateTmp=yes
|
|
||||||
NoNewPrivileges=yes
|
|
||||||
|
|
||||||
# Serial port access (uucp group on Arch)
|
|
||||||
SupplementaryGroups=uucp
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# RemoteTerm for MeshCore configuration
|
|
||||||
# https://github.com/jkingsman/Remote-Terminal-for-MeshCore
|
|
||||||
|
|
||||||
# Transport: uncomment ONE section below
|
|
||||||
|
|
||||||
# Serial auto-detect (default — no config needed)
|
|
||||||
|
|
||||||
# Serial manual port
|
|
||||||
#MESHCORE_SERIAL_PORT=/dev/ttyUSB0
|
|
||||||
|
|
||||||
# TCP
|
|
||||||
#MESHCORE_TCP_HOST=192.168.1.100
|
|
||||||
#MESHCORE_TCP_PORT=4000
|
|
||||||
|
|
||||||
# BLE (also requires the optional `bluez` package)
|
|
||||||
#MESHCORE_BLE_ADDRESS=AA:BB:CC:DD:EE:FF
|
|
||||||
#MESHCORE_BLE_PIN=123456
|
|
||||||
|
|
||||||
# Database
|
|
||||||
MESHCORE_DATABASE_PATH=/var/lib/remoteterm-meshcore/meshcore.db
|
|
||||||
|
|
||||||
# Bots can run arbitrary Python on the server. Leave this set to 'true' unless
|
|
||||||
# you trust everyone on your network.
|
|
||||||
MESHCORE_DISABLE_BOTS=true
|
|
||||||
|
|
||||||
# HTTP Basic Auth (recommended when bots are enabled)
|
|
||||||
#MESHCORE_BASIC_AUTH_USERNAME=
|
|
||||||
#MESHCORE_BASIC_AUTH_PASSWORD=
|
|
||||||
+4
-1
@@ -14,7 +14,7 @@ dependencies = [
|
|||||||
"pynacl>=1.5.0",
|
"pynacl>=1.5.0",
|
||||||
"meshcore==2.3.2",
|
"meshcore==2.3.2",
|
||||||
"aiomqtt>=2.0",
|
"aiomqtt>=2.0",
|
||||||
"apprise>=1.9.8",
|
"apprise>=1.9.7",
|
||||||
"boto3>=1.38.0",
|
"boto3>=1.38.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -53,6 +53,9 @@ ignore = [
|
|||||||
"SIM117", # nested with statements - can be clearer in tests
|
"SIM117", # nested with statements - can be clearer in tests
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
"app/main.py" = ["E402"] # imports after Windows event-loop re-exec block
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
known-first-party = ["app"]
|
known-first-party = ["app"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# test_aur_package.sh — Build the AUR package in one Arch container, then
|
|
||||||
# install and run it in a clean Arch container with port 8000 exposed.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# ./scripts/quality/test_aur_package.sh [--port PORT]
|
|
||||||
#
|
|
||||||
# The script streams application logs until you Ctrl-C.
|
|
||||||
|
|
||||||
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
||||||
PORT=8000
|
|
||||||
if [ "${1:-}" = "--port" ]; then PORT="${2:-8000}"; fi
|
|
||||||
|
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
CYAN='\033[0;36m'
|
|
||||||
BOLD='\033[1m'
|
|
||||||
NC='\033[0m'
|
|
||||||
|
|
||||||
ARTIFACT_DIR="$(mktemp -d)"
|
|
||||||
INSTALL_CONTAINER="remoteterm-aur-test-$$"
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
echo
|
|
||||||
echo -e "${YELLOW}Cleaning up...${NC}"
|
|
||||||
docker rm -f "$INSTALL_CONTAINER" 2>/dev/null || true
|
|
||||||
rm -rf "$ARTIFACT_DIR"
|
|
||||||
echo -e "${GREEN}Done.${NC}"
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
# ── Phase 1: Build ────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
echo -e "${BOLD}=== Phase 1: Build AUR package ===${NC}"
|
|
||||||
|
|
||||||
docker run --rm \
|
|
||||||
-v "$REPO_ROOT/pkg/aur:/pkg:ro" \
|
|
||||||
-v "$ARTIFACT_DIR:/out" \
|
|
||||||
archlinux:latest bash -c '
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
pacman -Syu --noconfirm base-devel git curl >/dev/null 2>&1
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh >/dev/null 2>&1
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
pacman -S --noconfirm nodejs npm >/dev/null 2>&1
|
|
||||||
|
|
||||||
useradd -m builder
|
|
||||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
BUILD_DIR=/home/builder/build
|
|
||||||
mkdir -p "$BUILD_DIR"
|
|
||||||
cp /pkg/PKGBUILD /pkg/remoteterm-meshcore.install \
|
|
||||||
/pkg/remoteterm-meshcore.service /pkg/remoteterm.env "$BUILD_DIR/"
|
|
||||||
chown -R builder:builder "$BUILD_DIR"
|
|
||||||
|
|
||||||
echo "Building package..."
|
|
||||||
su builder -c "export PATH=\"$HOME/.local/bin:\$PATH\" && cd $BUILD_DIR && makepkg -sf --noconfirm" 2>&1
|
|
||||||
|
|
||||||
cp "$BUILD_DIR"/remoteterm-meshcore-*.pkg.tar.zst /out/
|
|
||||||
echo "Package artifact copied to /out/"
|
|
||||||
ls -lh /out/*.pkg.tar.zst
|
|
||||||
'
|
|
||||||
|
|
||||||
PKG_FILE="$(ls "$ARTIFACT_DIR"/*.pkg.tar.zst 2>/dev/null | head -1)"
|
|
||||||
if [ -z "$PKG_FILE" ]; then
|
|
||||||
echo -e "${RED}Build failed — no .pkg.tar.zst produced${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "${GREEN}Built: $(basename "$PKG_FILE") ($(du -h "$PKG_FILE" | cut -f1))${NC}"
|
|
||||||
echo
|
|
||||||
|
|
||||||
# ── Phase 2: Install and run ─────────────────────────────────────────────────
|
|
||||||
|
|
||||||
echo -e "${BOLD}=== Phase 2: Install and run ===${NC}"
|
|
||||||
|
|
||||||
docker run -d \
|
|
||||||
--name "$INSTALL_CONTAINER" \
|
|
||||||
-p "$PORT:8000" \
|
|
||||||
-v "$ARTIFACT_DIR:/pkg:ro" \
|
|
||||||
archlinux:latest bash -c '
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Install the package (triggers pre_install which creates the remoteterm user)
|
|
||||||
pacman -Syu --noconfirm >/dev/null 2>&1
|
|
||||||
pacman -U --noconfirm /pkg/*.pkg.tar.zst
|
|
||||||
|
|
||||||
# Create the state directory (systemd StateDirectory= would do this on a real host)
|
|
||||||
mkdir -p /var/lib/remoteterm-meshcore
|
|
||||||
chown remoteterm:remoteterm /var/lib/remoteterm-meshcore
|
|
||||||
|
|
||||||
echo "============================================"
|
|
||||||
echo " RemoteTerm installed — starting server"
|
|
||||||
echo "============================================"
|
|
||||||
|
|
||||||
# Run as the remoteterm service user, matching the systemd unit
|
|
||||||
exec su -s /bin/bash remoteterm -c "cd /opt/remoteterm-meshcore && exec .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000"
|
|
||||||
' >/dev/null
|
|
||||||
|
|
||||||
echo -e "${CYAN}Container:${NC} $INSTALL_CONTAINER"
|
|
||||||
echo -e "${CYAN}Listening:${NC} http://localhost:$PORT"
|
|
||||||
echo -e "${CYAN}Health: ${NC} http://localhost:$PORT/api/health"
|
|
||||||
echo
|
|
||||||
echo -e "${YELLOW}Streaming logs (Ctrl-C to stop and clean up)...${NC}"
|
|
||||||
echo
|
|
||||||
|
|
||||||
docker logs -f "$INSTALL_CONTAINER"
|
|
||||||
@@ -56,7 +56,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "apprise"
|
name = "apprise"
|
||||||
version = "1.9.9"
|
version = "1.9.7"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "certifi" },
|
{ name = "certifi" },
|
||||||
@@ -67,9 +67,9 @@ dependencies = [
|
|||||||
{ name = "requests-oauthlib" },
|
{ name = "requests-oauthlib" },
|
||||||
{ name = "tzdata", marker = "sys_platform == 'win32'" },
|
{ name = "tzdata", marker = "sys_platform == 'win32'" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/20/f4/be5c7e39b83a2285ab62ae7c19bb10704836f59c0a5b4c471730f54c9f98/apprise-1.9.9.tar.gz", hash = "sha256:fd622c0df16bdc79ed385539735573488cafe2405d25747e87eebd6b09b26012", size = 2032822 }
|
sdist = { url = "https://files.pythonhosted.org/packages/bc/f5/97dc06b3401bb67abcef6e8bef7155f192b75795c2a2aa4d59eb5aa7fa66/apprise-1.9.7.tar.gz", hash = "sha256:2f73cc1e0264fb119fdb9b7cde82e8fde40a0f531ac885d8c6f0cf0f6e13aec2", size = 1937173 }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/e6/2f/54d068d7e011a8b4e0aae3e93b09a30b33bcf780829fe70c6e8876aeb0e0/apprise-1.9.9-py3-none-any.whl", hash = "sha256:55ceb8827a1c783d683881c9f77fa42eb43b3fc91b854419c452d557101c7068", size = 1519940 },
|
{ url = "https://files.pythonhosted.org/packages/fb/6b/cfa80a13437896eb8f4504ddac6dfa4ef7f1d2b2261057aa4a30003b8de6/apprise-1.9.7-py3-none-any.whl", hash = "sha256:c7640a81a1097685de66e0508e3da89f49235d566cb44bbead1dd98419bf5ee3", size = 1459879 },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1022,7 +1022,7 @@ dev = [
|
|||||||
requires-dist = [
|
requires-dist = [
|
||||||
{ name = "aiomqtt", specifier = ">=2.0" },
|
{ name = "aiomqtt", specifier = ">=2.0" },
|
||||||
{ name = "aiosqlite", specifier = ">=0.19.0" },
|
{ name = "aiosqlite", specifier = ">=0.19.0" },
|
||||||
{ name = "apprise", specifier = ">=1.9.8" },
|
{ name = "apprise", specifier = ">=1.9.7" },
|
||||||
{ name = "boto3", specifier = ">=1.38.0" },
|
{ name = "boto3", specifier = ">=1.38.0" },
|
||||||
{ name = "fastapi", specifier = ">=0.115.0" },
|
{ name = "fastapi", specifier = ">=0.115.0" },
|
||||||
{ name = "httpx", specifier = ">=0.28.1" },
|
{ name = "httpx", specifier = ">=0.28.1" },
|
||||||
|
|||||||
Reference in New Issue
Block a user