|
|
@@ -66,6 +66,7 @@
|
|
|
<li><a href="#forwarding-squid-logs-from-a-remote-squid-host-important">Forwarding Squid logs from remote host</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
+ <li><a href="#docker-compose">Docker Compose</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li>
|
|
|
@@ -194,6 +195,50 @@ _A modern tool for parsing and analyzing Squid logs, providing a user-friendly d
|
|
|
apt install git python3 python3-pip python3-venv libmariadb-dev curl
|
|
|
```
|
|
|
|
|
|
+### Docker Compose
|
|
|
+
|
|
|
+Docker Compose is useful when SquidStats and Squid run on the same host. Docker
|
|
|
+and the Compose plugin are required. The compose file reads configuration from
|
|
|
+`.env`, mounts the application logs, persists the SQLite database in
|
|
|
+`./SquidStats`, and exposes the web panel on port `5000`.
|
|
|
+
|
|
|
+1. Extract the release and enter its directory:
|
|
|
+
|
|
|
+ ```bash
|
|
|
+ sudo mkdir -p /opt/containers/squidstats
|
|
|
+ sudo tar -xf squidstats.tar -C /opt/containers/squidstats
|
|
|
+ cd /opt/containers/squidstats
|
|
|
+ ```
|
|
|
+
|
|
|
+2. Create the persistent database directory and environment file:
|
|
|
+
|
|
|
+ ```bash
|
|
|
+ mkdir -p SquidStats logs
|
|
|
+ cp example.env .env
|
|
|
+ ```
|
|
|
+
|
|
|
+ Set at least `FIRST_PASSWORD`, `DATABASE_STRING_CONNECTION=/opt/SquidStats/squidstats.db`,
|
|
|
+ `SQUID_LOG=/var/log/squid/access.log`, `SQUID_CACHE_LOG=/var/log/squid/cache.log`,
|
|
|
+ `SQUID_CONFIG_PATH=/etc/squid/squid.conf`, `ACL_FILES_DIR=/etc/squid/squid.d`,
|
|
|
+ `LISTEN_HOST=0.0.0.0`, and `LISTEN_PORT=5000` in `.env`.
|
|
|
+
|
|
|
+3. Build and start the application:
|
|
|
+
|
|
|
+ ```bash
|
|
|
+ docker compose build --no-cache
|
|
|
+ docker compose up -d
|
|
|
+ docker compose logs -f squidstats
|
|
|
+ ```
|
|
|
+
|
|
|
+ The default mounts expect Squid configuration and logs in `/etc/squid` and
|
|
|
+ `/var/log/squid`. Override `SQUID_CONFIG_DIR`, `SQUID_LOG_DIR`, or
|
|
|
+ `DATABASE_DIR` in the shell when the host uses different locations. The
|
|
|
+ Squid log mount is read-only; the configuration mount is writable only
|
|
|
+ because the administration features may update Squid configuration.
|
|
|
+
|
|
|
+ Open `http://<server>:5000`. Keep `.env` private and replace the example
|
|
|
+ password before exposing the panel.
|
|
|
+
|
|
|
#### 🔧 Cache Manager Configuration (Critical for SquidStats)
|
|
|
|
|
|
**SquidStats requires proper Cache Manager configuration to function correctly.** Please follow the [official Squid Cache Manager documentation](https://wiki.squid-cache.org/Features/CacheManager/Index) for complete setup.
|