d360c9a5ba
- Systemauslastungs-Sektion wird immer gerendert (nicht nur bei Erfolg) - Fehlermeldung wenn /api/admin/system/stats nicht erreichbar ist - Feature-Status auf In Review gesetzt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.1 KiB
Bash
50 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# setup.sh — First-time build setup for mailarchive
|
|
# Run once on a machine with internet access.
|
|
# After this, the project builds and tests without internet.
|
|
set -e
|
|
|
|
echo "==> Checking Go version"
|
|
go version
|
|
GO_MINOR=$(go version | grep -oP 'go1\.\K[0-9]+')
|
|
if [ "$GO_MINOR" -lt 22 ]; then
|
|
echo "ERROR: Go 1.22+ required"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "==> Downloading dependencies (go mod tidy)"
|
|
go mod tidy
|
|
|
|
echo ""
|
|
echo "==> Verifying modules"
|
|
go mod verify
|
|
|
|
echo ""
|
|
echo "==> Building (Bleve backend — default)"
|
|
make build
|
|
|
|
echo ""
|
|
echo "==> Binary sizes"
|
|
ls -lh bin/
|
|
|
|
echo ""
|
|
echo "==> Running tests"
|
|
make test
|
|
|
|
echo ""
|
|
echo "========================================"
|
|
echo " Build successful!"
|
|
echo ""
|
|
echo " To start the daemon:"
|
|
echo " sudo make install"
|
|
echo " sudo systemctl start mailarchive"
|
|
echo ""
|
|
echo " Or run directly:"
|
|
echo " ./bin/archivmail --config config/config.yml"
|
|
echo ""
|
|
echo " To build with Xapian (optional, needs libxapian-dev):"
|
|
echo " apt install libxapian-dev"
|
|
echo " make build-xapian"
|
|
echo "========================================"
|