change db path
docker / docker (push) Successful in 2m9s

This commit is contained in:
tchivert committed 2026-07-17 22:19:46 +02:00
1 parent 971b661add
commit c9003e6ba5
4 files changed
+6 -6

No files matched your search

+2 -1
View File
@@ -6,8 +6,9 @@ COPY . .
RUN GOOS=linux go build -trimpath -ldflags="-s -w" -o ssh-tarpit .
FROM alpine
RUN adduser -D -H -s /sbin/nologin tarpit
RUN addgroup -g 1000 tarpit && adduser -D -H -s /sbin/nologin -u 1000 -G tarpit tarpit
WORKDIR /app
RUN mkdir -p data && chown tarpit data
COPY --from=build /app/ssh-tarpit ./
EXPOSE 2222
USER tarpit
+2 -3
View File
@@ -12,7 +12,7 @@ All configuration is done via environment variables:
| `SSH_TARPIT_TARPIT` | `false` | Enable tarpit mode (`true`, `1`, `yes`, `on`) |
| `SSH_TARPIT_TARPIT_DELAY` | `1s` | Delay between tarpit bytes |
| `SSH_TARPIT_TARPIT_MAX_DURATION` | `0s` | Max tarpit duration (0 = unlimited) |
| `SSH_TARPIT_DB_PATH` | `./logs.db` | Path to SQLite database |
| `SSH_TARPIT_DB_PATH` | `./data/logs.db` | Path to SQLite database |
| `SSH_TARPIT_GEOIP_PATH` | | Path to GeoIP databases (GeoIP disabled if empty) |
| `SSH_TARPIT_MYSQL_USER` | | MySQL username (enables MySQL when set) |
| `SSH_TARPIT_MYSQL_PASS` | | MySQL password |
@@ -27,12 +27,11 @@ All configuration is done via environment variables:
### SQLite
Create the database file, then start the container:
Clone the repository start the container:
```bash
git clone https://git.rznet.fr/razian/ssh-tarpit.git
cd ssh-tarpit
touch logs.db
docker compose up -d
```
+1 -1
View File
@@ -6,7 +6,7 @@ services:
- '2222:2222'
restart: always
volumes:
- ./logs.db:/app/logs.db
- ./data:/app/data
# - /var/lib/GeoIP:/app/GeoIP
environment:
- SSH_TARPIT_PORT=2222
+1 -1
View File
@@ -48,7 +48,7 @@ func loadConfig() Config {
Tarpit: getEnvBool("SSH_TARPIT_TARPIT", false),
TarpitDelay: getEnvDuration("SSH_TARPIT_TARPIT_DELAY", 1*time.Second),
TarpitMaxDur: getEnvDuration("SSH_TARPIT_TARPIT_MAX_DURATION", 0),
DBPath: getEnv("SSH_TARPIT_DB_PATH", "./logs.db"),
DBPath: getEnv("SSH_TARPIT_DB_PATH", "./data/logs.db"),
GeoIPPath: getEnv("SSH_TARPIT_GEOIP_PATH", ""),
MySQLUser: getEnv("SSH_TARPIT_MYSQL_USER", ""),
MySQLPass: getEnv("SSH_TARPIT_MYSQL_PASS", ""),