63 lines
1.7 KiB
Markdown
63 lines
1.7 KiB
Markdown
# LOGAR Linux Edge Forwarder
|
|
|
|
Lightweight edge log forwarder for Linux servers running systemd.
|
|
|
|
## Features
|
|
- **Zero Local State**: No local SQLite database or state tracking on the edge server.
|
|
- **Edge Noise Stripping**: Strips conversational/informational noise (`INFO`, `DEBUG`) directly at the source via `journalctl -p warning`.
|
|
- **End-to-End OpenPGP Encryption**: Encrypts logs using the server's public key; decrypted exclusively on the cloud hub.
|
|
- **Authenticated TCP Socket**: Direct, low-overhead TCP streaming with token authentication.
|
|
- **No GPG Binary Required**: Pure-Python implementation (`pgpy` + `cryptography`).
|
|
|
|
## Installation
|
|
```bash
|
|
python3 -m pip install -r requirements.txt
|
|
```
|
|
|
|
## Configuration
|
|
Place `client_config.json` generated by the server (`Server.py --create-client-config`) in the same directory as `Linux_Client.py`.
|
|
|
|
## Running the Forwarder
|
|
```bash
|
|
python3 Linux_Client.py --hours 6
|
|
```
|
|
|
|
## Cron / Systemd Timer Deployment
|
|
### Option A: Cron Job (Every 3 hours)
|
|
```bash
|
|
0 */3 * * * cd /opt/logar && /usr/bin/python3 Linux_Client.py --hours 6 >> /var/log/logar_client.log 2>&1
|
|
```
|
|
|
|
### Option B: Systemd Service & Timer
|
|
1. Create `/etc/systemd/system/logar-forwarder.service`:
|
|
```ini
|
|
[Unit]
|
|
Description=LOGAR Edge Forwarder
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
WorkingDirectory=/opt/logar
|
|
ExecStart=/usr/bin/python3 /opt/logar/Linux_Client.py --hours 6
|
|
```
|
|
|
|
2. Create `/etc/systemd/system/logar-forwarder.timer`:
|
|
```ini
|
|
[Unit]
|
|
Description=Run LOGAR Edge Forwarder every 3 hours
|
|
|
|
[Timer]
|
|
OnBootSec=5min
|
|
OnUnitActiveSec=3h
|
|
Persistent=true
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|
|
```
|
|
|
|
3. Enable and start:
|
|
```bash
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now logar-forwarder.timer
|
|
```
|