Skip to content

Commit 1b802ff

Browse files
authored
Merge pull request #41 from zzahkaboom24/pause-resume-support
Adding pause & resume support
2 parents 7b08306 + d748b60 commit 1b802ff

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ RUN \
3232
ENV ALLOW_RESTARTS=0 \
3333
ALLOW_STOP=0 \
3434
ALLOW_START=0 \
35+
ALLOW_PAUSE=0 \
36+
ALLOW_UNPAUSE=0 \
3537
AUTH=0 \
3638
BUILD=0 \
3739
COMMIT=0 \

Dockerfile.aarch64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ RUN \
3232
ENV ALLOW_RESTARTS=0 \
3333
ALLOW_STOP=0 \
3434
ALLOW_START=0 \
35+
ALLOW_PAUSE=0 \
36+
ALLOW_UNPAUSE=0 \
3537
AUTH=0 \
3638
BUILD=0 \
3739
COMMIT=0 \

Dockerfile.riscv64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ RUN \
3232
ENV ALLOW_RESTARTS=0 \
3333
ALLOW_STOP=0 \
3434
ALLOW_START=0 \
35+
ALLOW_PAUSE=0 \
36+
ALLOW_UNPAUSE=0 \
3537
AUTH=0 \
3638
BUILD=0 \
3739
COMMIT=0 \

readme-vars.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ full_custom_readme: |
9292
- ALLOW_START=0 #optional
9393
- ALLOW_STOP=0 #optional
9494
- ALLOW_RESTARTS=0 #optional
95+
- ALLOW_PAUSE=0 #optional
96+
- ALLOW_RESUME=0 #optional
9597
- AUTH=0 #optional
9698
- BUILD=0 #optional
9799
- COMMIT=0 #optional
@@ -176,6 +178,8 @@ full_custom_readme: |
176178
| `-e ALLOW_START=0` | `/containers/{id}/start` - **This option will work even if `POST=0`** |
177179
| `-e ALLOW_STOP=0` | `/containers/{id}/stop` - **This option will work even if `POST=0`** |
178180
| `-e ALLOW_RESTARTS=0` | `/containers/{id}/stop`, `/containers/{id}/restart`, and `/containers/{id}/kill` - **This option will work even if `POST=0`** |
181+
| `-e ALLOW_PAUSE=0` | `/containers/{id}/pause` - **This option will work even if `POST=0`** |
182+
| `-e ALLOW_UNPAUSE=0` | `/containers/{id}/unpause` - **This option will work even if `POST=0`** |
179183
| `-e AUTH=0` | `/auth` |
180184
| `-e BUILD=0` | `/build` |
181185
| `-e COMMIT=0` | `/commit` |
@@ -326,6 +330,7 @@ full_custom_readme: |
326330
327331
## Versions
328332
333+
* **24.02.26:** - Add `ALLOW_PAUSE` and `ALLOW_UNPAUSE`.
329334
* **26.12.25:** - Rebase to Alpine 3.23.
330335
* **19.08.25:** - Add tzdata for localised logging timestamps.
331336
* **03.06.25:** - Rebase to Alpine 3.22. Add RISCV support.

root/templates/haproxy.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ frontend proxy
2828
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
2929
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
3030
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }
31+
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/pause } { env(ALLOW_PAUSE) -m bool }
32+
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/unpause } { env(ALLOW_UNPAUSE) -m bool }
3133
http-request deny unless METH_GET || { env(POST) -m bool }
3234
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/auth } { env(AUTH) -m bool }
3335
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/build } { env(BUILD) -m bool }

0 commit comments

Comments
 (0)