Skip to content

Commit 4efd967

Browse files
committed
Add ALLOW_PAUSE/ALLOW_UNPAUSE, bump upstream to ls75, update tooling
- Add ALLOW_PAUSE and ALLOW_UNPAUSE options (synced from upstream ls75) - Bump upstream reference to linuxserver/docker-socket-proxy:3.2.15-r0-ls75 - Update pre-commit hooks: pre-commit-hooks v6.0.0, yamllint v1.38.0, shellcheck-py v0.11.0.1, hadolint v2.14.0 - Update GitHub Actions: actions/checkout v6, actions/setup-python v6 - Version 1.2.0
1 parent fa0282e commit 4efd967

8 files changed

Lines changed: 37 additions & 14 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-python@v5
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-python@v6
1515
with:
1616
python-version: "3.12"
1717
- run: pip install pre-commit
@@ -21,8 +21,8 @@ jobs:
2121
needs: lint
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-python@v5
24+
- uses: actions/checkout@v6
25+
- uses: actions/setup-python@v6
2626
with:
2727
python-version: "3.12"
2828
- run: pip install pyyaml
@@ -32,7 +32,7 @@ jobs:
3232
needs: test
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v6
3636
- run: |
3737
docker build \
3838
--build-arg BUILD_FROM=ghcr.io/home-assistant/amd64-base:3.23 \

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -9,21 +9,21 @@ repos:
99
- id: check-added-large-files
1010

1111
- repo: https://github.com/adrienverge/yamllint
12-
rev: v1.35.1
12+
rev: v1.38.0
1313
hooks:
1414
- id: yamllint
1515
args: [-c, .yamllint.yaml]
1616

1717
- repo: https://github.com/shellcheck-py/shellcheck-py
18-
rev: v0.10.0.1
18+
rev: v0.11.0.1
1919
hooks:
2020
- id: shellcheck
2121
args: [--severity=warning]
2222
files: ^socket-proxy/rootfs/etc/services\.d/socket-proxy/run$
2323
types: [file]
2424

2525
- repo: https://github.com/hadolint/hadolint
26-
rev: v2.12.0
26+
rev: v2.14.0
2727
hooks:
2828
- id: hadolint-docker
2929
files: Dockerfile$

socket-proxy/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.2.0
4+
5+
- Add `ALLOW_PAUSE` and `ALLOW_UNPAUSE` options — allow pausing and unpausing containers (synced from upstream linuxserver/docker-socket-proxy 3.2.15-r0-ls75)
6+
- Bump upstream reference to linuxserver/docker-socket-proxy 3.2.15-r0-ls75
7+
- Update pre-commit hooks: pre-commit-hooks v6.0.0, yamllint v1.38.0, shellcheck-py v0.11.0.1, hadolint v2.14.0
8+
- Update GitHub Actions: actions/checkout v6, actions/setup-python v6
9+
310
## 1.1.2
411

512
- Bump HAProxy from 3.2.13-r0 to 3.2.15-r0 (Alpine 3.23 package update)

socket-proxy/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Upstream reference: linuxserver/docker-socket-proxy:3.2.13-r0-ls70
1+
# Upstream reference: linuxserver/docker-socket-proxy:3.2.15-r0-ls75
22
build_from:
33
aarch64: ghcr.io/home-assistant/aarch64-base:3.23
44
amd64: ghcr.io/home-assistant/amd64-base:3.23

socket-proxy/config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >-
33
Filtered, read-only Docker socket proxy using HAProxy.
44
Requires Protection mode to be disabled (Info tab) for Docker socket access.
55
slug: socket-proxy
6-
version: 1.1.2
6+
version: 1.2.0
77
url: https://github.com/fergus/haos-docker-socket-proxy
88
arch:
99
- amd64
@@ -24,6 +24,8 @@ options:
2424
ALLOW_START: false
2525
ALLOW_STOP: false
2626
ALLOW_RESTARTS: false
27+
ALLOW_PAUSE: false
28+
ALLOW_UNPAUSE: false
2729
ALLOWED_CIDRS: []
2830
AUTH: false
2931
BUILD: false
@@ -56,6 +58,8 @@ schema:
5658
ALLOW_START: bool
5759
ALLOW_STOP: bool
5860
ALLOW_RESTARTS: bool
61+
ALLOW_PAUSE: bool
62+
ALLOW_UNPAUSE: bool
5963
ALLOWED_CIDRS:
6064
- str
6165
AUTH: bool

socket-proxy/rootfs/etc/services.d/socket-proxy/run

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ bashio::log.info " +------------------------------------+"
3737
bashio::log.info ""
3838

3939
# Version and config info
40-
ADDON_VERSION="1.1.2"
41-
UPSTREAM_PIN="linuxserver/docker-socket-proxy:3.2.15-r0-ls71"
40+
ADDON_VERSION="1.2.0"
41+
UPSTREAM_PIN="linuxserver/docker-socket-proxy:3.2.15-r0-ls75"
4242
bashio::log.info "Version: ${ADDON_VERSION}"
4343
bashio::log.info "Upstream: ${UPSTREAM_PIN}"
4444

@@ -61,6 +61,8 @@ is_valid_cidr() {
6161
ALLOW_START=$(bool2int 'ALLOW_START')
6262
ALLOW_STOP=$(bool2int 'ALLOW_STOP')
6363
ALLOW_RESTARTS=$(bool2int 'ALLOW_RESTARTS')
64+
ALLOW_PAUSE=$(bool2int 'ALLOW_PAUSE')
65+
ALLOW_UNPAUSE=$(bool2int 'ALLOW_UNPAUSE')
6466
AUTH=$(bool2int 'AUTH')
6567
BUILD=$(bool2int 'BUILD')
6668
COMMIT=$(bool2int 'COMMIT')
@@ -88,7 +90,7 @@ TASKS=$(bool2int 'TASKS')
8890
VERSION=$(bool2int 'VERSION')
8991
VOLUMES=$(bool2int 'VOLUMES')
9092

91-
export ALLOW_START ALLOW_STOP ALLOW_RESTARTS AUTH BUILD COMMIT CONFIGS
93+
export ALLOW_START ALLOW_STOP ALLOW_RESTARTS ALLOW_PAUSE ALLOW_UNPAUSE AUTH BUILD COMMIT CONFIGS
9294
export CONTAINERS DISABLE_IPV6 DISTRIBUTION EVENTS EXEC GRPC IMAGES INFO
9395
export LOG_LEVEL NETWORKS NODES PING PLUGINS POST SECRETS SERVICES
9496
export SESSION SWARM SYSTEM TASKS VERSION VOLUMES
@@ -156,6 +158,8 @@ if [ "${POST}" = "1" ]; then WRITE_OPS+=("POST"); fi
156158
if [ "${ALLOW_START}" = "1" ]; then WRITE_OPS+=("ALLOW_START"); fi
157159
if [ "${ALLOW_STOP}" = "1" ]; then WRITE_OPS+=("ALLOW_STOP"); fi
158160
if [ "${ALLOW_RESTARTS}" = "1" ]; then WRITE_OPS+=("ALLOW_RESTARTS"); fi
161+
if [ "${ALLOW_PAUSE}" = "1" ]; then WRITE_OPS+=("ALLOW_PAUSE"); fi
162+
if [ "${ALLOW_UNPAUSE}" = "1" ]; then WRITE_OPS+=("ALLOW_UNPAUSE"); fi
159163

160164
bashio::log.info "Port: ${PORT}"
161165
bashio::log.info "IPv6: $([ "${DISABLE_IPV6}" = "1" ] && echo 'disabled' || echo 'enabled')"

socket-proxy/rootfs/templates/haproxy.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ frontend proxy
3636
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 }
3737
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
3838
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }
39+
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/pause } { env(ALLOW_PAUSE) -m bool }
40+
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/unpause } { env(ALLOW_UNPAUSE) -m bool }
3941
http-request deny unless METH_GET || { env(POST) -m bool }
4042
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/auth } { env(AUTH) -m bool }
4143
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/build } { env(BUILD) -m bool }

socket-proxy/translations/en.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ configuration:
1111
ALLOW_RESTARTS:
1212
name: Allow Restarts
1313
description: Allow restarting, stopping, and killing containers.
14+
ALLOW_PAUSE:
15+
name: Allow Pause
16+
description: Allow pausing containers (POST .../pause).
17+
ALLOW_UNPAUSE:
18+
name: Allow Unpause
19+
description: Allow unpausing containers (POST .../unpause).
1420
ALLOWED_CIDRS:
1521
name: Allowed Source IPs
1622
description: List of IP addresses or CIDR ranges permitted to connect. Leave empty to allow all sources.

0 commit comments

Comments
 (0)