File size: 2,830 Bytes
25b930c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Docker Local Testing

This page is a practical checklist for testing the current Docker setup locally.

It covers two paths:

- the default managed-config flow, where the container owns `/data/.config/pinchtab/config.json`
- the explicit-config flow, where you mount your own `config.json` and set `PINCHTAB_CONFIG`

## Managed Config Flow

Build and start the local Compose service:

```bash
docker compose up --build -d
docker compose logs -f pinchtab
```

Inspect the effective config path and persisted config:

```bash
docker exec pinchtab pinchtab config path
docker exec pinchtab sh -lc 'cat /data/.config/pinchtab/config.json'
```

Expected results:

- the config path is `/data/.config/pinchtab/config.json`
- `server.bind` in the persisted config remains `127.0.0.1`
- a token is present if one was generated on first boot or passed in

Verify the config bind address:

```bash
docker exec pinchtab pinchtab config get server.bind
```

Expected result: `0.0.0.0` (set by entrypoint on first boot)

Verify persistence across restart:

```bash
docker compose down
docker compose up -d
docker exec pinchtab sh -lc 'cat /data/.config/pinchtab/config.json'
```

## Explicit `PINCHTAB_CONFIG` Flow

Create a local config file, for example `./tmp/config.json`:

```json
{
  "server": {
    "bind": "0.0.0.0",
    "port": "9867",
    "token": "local-test-token"
  },
  "browser": {
    "extraFlags": "--no-sandbox --disable-gpu"
  }
}
```

Run the container with that config mounted read-only:

```bash
docker run --rm -d \
  --name pinchtab-test \
  -p 127.0.0.1:9867:9867 \
  -e PINCHTAB_CONFIG=/config/config.json \
  -v "$PWD/tmp/config.json:/config/config.json:ro" \
  -v pinchtab-data:/data \
  --shm-size=2g \
  pinchtab/pinchtab
```

Verify the explicit config path and auth:

```bash
docker exec pinchtab-test pinchtab config path
docker exec pinchtab-test sh -lc 'cat /config/config.json'
curl -H 'Authorization: Bearer local-test-token' http://127.0.0.1:9867/health
```

Expected results:

- `pinchtab config path` reports `/config/config.json`
- the mounted file is used as-is
- the container entrypoint does not rewrite the custom config

## What To Check When Something Fails

Container logs:

```bash
docker logs pinchtab
docker logs pinchtab-test
```

Config path:

```bash
docker exec pinchtab pinchtab config path
docker exec pinchtab-test pinchtab config path
```

Persisted config content:

```bash
docker exec pinchtab sh -lc 'cat /data/.config/pinchtab/config.json'
```

## Current Caveat

The development Docker path may still need explicit Chrome flags on some hosts.

If Chromium fails to launch in the local development image, add:

```json
{
  "browser": {
    "extraFlags": "--no-sandbox --disable-gpu"
  }
}
```

The release image path backfills those flags into the managed config automatically.