Some checks failed
Release / release (push) Failing after 53s
- Cache current log file incrementally by line count/inode to avoid re-processing the whole file every refresh. - Collect 4xx/5xx errors during aggregation and add [4] ERRORS tab. - Update README URLs and brew tap to point to git.janvete.com. - Replace GitHub Actions workflow with Forgejo Actions release workflow.
84 lines
1.9 KiB
Markdown
84 lines
1.9 KiB
Markdown
# Caddyview
|
|
|
|
Remote Caddy log viewer over SSH.
|
|
|
|
## Installation
|
|
|
|
### macOS (Homebrew)
|
|
|
|
```bash
|
|
brew tap janvete/tools
|
|
brew install caddyview
|
|
```
|
|
|
|
### Linux
|
|
|
|
Download the latest release from the [releases page](https://git.janvete.com/seth/Caddyview/releases) and extract it:
|
|
|
|
```bash
|
|
VERSION=v0.6.0
|
|
curl -L "https://git.janvete.com/seth/Caddyview/releases/download/${VERSION}/caddyview-${VERSION}-linux-amd64.tar.gz" | tar xz
|
|
sudo mv caddyview /usr/local/bin/
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
caddyview ssh root@192.168.x.x
|
|
caddyview ssh -p 2222 admin@server.com
|
|
```
|
|
|
|
Press `[1]` for live traffic, `[2]` for last 24 hours, `[3]` for last 7 days, and `[4]` to view recent 4xx/5xx errors with URL and origin.
|
|
|
|
## Required Caddyfile Changes
|
|
|
|
### 1. Add a log block to your Caddyfile
|
|
|
|
Add the logging configuration to a [snippet](https://caddyserver.com/docs/caddyfile/concepts#snippets) or to each individual site block:
|
|
|
|
```caddyfile
|
|
(hsts) {
|
|
log {
|
|
output file /var/log/caddy/access.log {
|
|
roll_size 100mb
|
|
roll_keep 10
|
|
}
|
|
format json
|
|
}
|
|
header {
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
|
X-Content-Type-Options "nosniff"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
Permissions-Policy "geolocation=(), microphone=(), camera=()"
|
|
-Server
|
|
}
|
|
}
|
|
|
|
some.dns.com {
|
|
import hsts
|
|
reverse_proxy 192.168.71.6:1378
|
|
}
|
|
```
|
|
|
|
### 2. Create the log file with correct permissions (BEFORE reloading!)
|
|
|
|
```bash
|
|
mkdir -p /var/log/caddy
|
|
touch /var/log/caddy/access.log
|
|
chown caddy:caddy /var/log/caddy/access.log
|
|
```
|
|
|
|
### 3. Reload Caddy
|
|
|
|
```bash
|
|
systemctl reload caddy
|
|
```
|
|
|
|
## Development
|
|
|
|
The source repository is hosted at `https://git.janvete.com/seth/Caddyview`.
|
|
To clone via SSH use the dedicated SSH endpoint:
|
|
|
|
```bash
|
|
git clone ssh://git@git-ssh.janvete.com:554/seth/Caddyview.git
|
|
```
|