forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #1738 from gtoxlili/main
fix : specify the default hostname if docker builds with a proxy
This commit is contained in:
commit
bb3f6ee086
@ -41,6 +41,9 @@ COPY --from=builder /app/.next/server ./.next/server
|
|||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD if [ -n "$PROXY_URL" ]; then \
|
CMD if [ -n "$PROXY_URL" ]; then \
|
||||||
|
if [ -z "$HOSTNAME" ]; then \
|
||||||
|
export HOSTNAME="127.0.0.1" \
|
||||||
|
fi; \
|
||||||
protocol=$(echo $PROXY_URL | cut -d: -f1); \
|
protocol=$(echo $PROXY_URL | cut -d: -f1); \
|
||||||
host=$(echo $PROXY_URL | cut -d/ -f3 | cut -d: -f1); \
|
host=$(echo $PROXY_URL | cut -d/ -f3 | cut -d: -f1); \
|
||||||
port=$(echo $PROXY_URL | cut -d: -f3); \
|
port=$(echo $PROXY_URL | cut -d: -f3); \
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
export function prettyObject(msg: any) {
|
export function prettyObject(msg: any) {
|
||||||
|
const obj = msg;
|
||||||
if (typeof msg !== "string") {
|
if (typeof msg !== "string") {
|
||||||
msg = JSON.stringify(msg, null, " ");
|
msg = JSON.stringify(msg, null, " ");
|
||||||
}
|
}
|
||||||
const prettyMsg = ["```json", msg, "```"].join("\n");
|
if (msg === "{}") {
|
||||||
return prettyMsg;
|
return obj.toString();
|
||||||
|
}
|
||||||
|
return ["```json", msg, "```"].join("\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user