Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Fix entrypoint issues. Clean up Dockerfile build-deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
goofball222 committed Jun 22, 2021
1 parent fb9d6cb commit 61ac0ad
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 280 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
* **2021-06-21**
* Switch to GitHub actions for builds
* Fix issue with logging time
* Stop checking for su-exec, fixes issue with Ubuntu Docker host, possibly others.
* Remove unneeded packages from build-deps
---
* **2021-04-19**
* Bump version to v2.2.6
Expand Down
59 changes: 0 additions & 59 deletions experimental/Dockerfile

This file was deleted.

66 changes: 0 additions & 66 deletions experimental/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion experimental/VERSION

This file was deleted.

10 changes: 0 additions & 10 deletions experimental/hooks/build

This file was deleted.

83 changes: 0 additions & 83 deletions experimental/root/usr/local/bin/docker-entrypoint.sh

This file was deleted.

45 changes: 0 additions & 45 deletions experimental/root/usr/local/bin/entrypoint-functions.sh

This file was deleted.

2 changes: 1 addition & 1 deletion stable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN \
&& addgroup -g $PGID doh \
&& adduser -D -G doh -u $PUID doh \
&& apk add -q --no-cache --virtual .build-deps \
gcc git go make musl-dev \
git go make \
&& apk add -q --no-cache \
bash ca-certificates shadow su-exec tzdata \
&& bash -c 'mkdir -p {conf,data,src}' \
Expand Down
18 changes: 7 additions & 11 deletions stable/root/usr/local/bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Init script for DNS over HTTPS proxy Docker container
# License: Apache-2.0
# Github: https://github.com/goofball222/dns-over-https.git
SCRIPT_VERSION="1.0.0"
# Last updated date: 2018-11-12
SCRIPT_VERSION="1.2.0"
# Last updated date: 2021-06-21

set -Eeuo pipefail

Expand Down Expand Up @@ -54,15 +54,11 @@ if [ "$(id -u)" = '0' ]; then
if [[ "${@}" =~ 'doh-' ]]; then
f_confchk
f_giduid
if [ -x "/sbin/su-exec" ]; then
f_log "INFO - Use su-exec to drop privileges and start process as GID=${PGID}, UID=${PUID}"
f_log "EXEC - su-exec doh:doh ${@} -conf ${CONFFILE}"
exec su-exec doh:doh ${@} -conf ${CONFFILE} &
f_idle_handler
else
f_log "ERROR - su-exec NOT FOUND. Run state is invalid. Exiting."
exit 1;
fi

f_log "INFO - Use su-exec to drop privileges and start process as GID=${PGID}, UID=${PUID}"
f_log "EXEC - su-exec doh:doh ${@} -conf ${CONFFILE}"
exec su-exec doh:doh ${@} -conf ${CONFFILE} &
f_idle_handler
else
f_log "EXEC - ${@} as UID 0 (root)"
exec "${@}"
Expand Down
7 changes: 3 additions & 4 deletions stable/root/usr/local/bin/entrypoint-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# entrypoint-functions.sh script for UniFi Docker container
# License: Apache-2.0
# Github: https://github.com/goofball222/dns-over-https
ENTRYPOINT_FUNCTIONS_VERSION="1.0.0"
# Last updated date: 2018-11-12
ENTRYPOINT_FUNCTIONS_VERSION="1.1.0"
# Last updated date: 2021-06-21

f_confchk() {
cp ${DATADIR}/doh-client.conf.default ${CONFDIR}/doh-client.conf.default
Expand Down Expand Up @@ -41,6 +41,5 @@ f_giduid() {
}

f_log() {
echo "$(date +"[%Y-%m-%d %T,%3N]") <docker-entrypoint> $*"
echo "$(date -u +%FT$(nmeter -d0 '%3t' | head -n1)) <docker-entrypoint> $*"
}

0 comments on commit 61ac0ad

Please sign in to comment.