1. Caddy version (caddy version
):
v2.4.3 h1:Y1FaV2N4WO3rBqxSYA8UZsZTQdN+PwcoOcAiZTM8C0I=
2. How I run Caddy:
install caddy bin
a. System environment:
alpine:edge
dockerfile deploy container
b. Command:
/usr/local/bin/caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
c. Service/unit/compose file:
FROM alpine:edge
RUN apk update && \
apk add --no-cache --virtual .build-deps ca-certificates nss-tools curl && \
mkdir /tmp/v2ray && \
mkdir /tmp/caddy && \
curl -L -H "Cache-Control: no-cache" -o /tmp/v2ray/v2ray.zip https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip && \
unzip /tmp/v2ray/v2ray.zip -d /tmp/v2ray && \
install -m 755 /tmp/v2ray/v2ray /usr/local/bin/v2ray && \
install -m 755 /tmp/v2ray/v2ctl /usr/local/bin/v2ctl && \
v2ray -version && \
curl -L -H "Cache-Control: no-cache" -o /tmp/caddy/caddy https://github.com/caddyserver/caddy/releases/download/v2.4.3/caddy_2.4.3_linux_arm64.tar.gz && \
tar -zxvf /tmp/caddy/caddy.tar.gz -C /tmp/caddy && \
install -m 755 /tmp/caddy/caddy /usr/local/bin/caddy && \
caddy version && \
rm -rf /tmp/caddy && \
rm -rf /tmp/v2ray && \
rm -rf /var/cache/apk/* && \
apk del .build-deps
COPY etc/ /conf
ADD config.sh /config.sh
RUN chmod +x /config.sh
CMD /config.sh
d. My complete Caddyfile or JSON config:
I have deleted parts of the files for confidentiality reasons
:$PORT
root * ******
file_server browse
tls internal
header {
Permissions-Policy interest-cohort=()
Strict-Transport-Security max-age=31536000;
X-Robots-Tag none
X-Content-Type-Options nosniff
X-Frame-Options DENY
Referrer-Policy no-referrer-when-downgrade
}
basicauth ****** {
****** ******
}
@websocket****** {
header Connection *Upgrade*
header Upgrade websocket
path ******
}
reverse_proxy @websocket****** ******
3. The problem Iām having:
error obtaining home directory, please define environment variable HOME.
4. Error messages and/or full log output:
{ālevelā:āwarnā,ātsā:1629167856.1931417,āmsgā:āunable to determine directory for user configuration; falling back to current directoryā,āerrorā:āneither $XDG_CONFIG_HOME nor $HOME are definedā}
Error obtaining home directory, please define environment variable HOME.
5. What I already tried:
using caddy version v2.3 ~ v2.1
Still prompted Error obtaining home directory, please define environment variable HOME.