mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Compare commits
4 Commits
l10n_dev
...
feature/be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb9d7f6f3d | ||
|
|
cd34796b9d | ||
|
|
0d788e3d06 | ||
|
|
8887281246 |
@@ -54,7 +54,7 @@ RUN apk add --no-cache su-exec iputils-ping shadow
|
|||||||
USER root
|
USER root
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=::
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,15 @@ export PGID=${PGID:-0}
|
|||||||
|
|
||||||
export HOMEPAGE_BUILDTIME=$(date +%s)
|
export HOMEPAGE_BUILDTIME=$(date +%s)
|
||||||
|
|
||||||
|
# Try IPv6 first (dual stack when available), but fall back to IPv4 if the bind fails
|
||||||
|
export HOSTNAME=${HOSTNAME:-::}
|
||||||
|
if [ "$HOSTNAME" = "::" ]; then
|
||||||
|
if ! node -e "const server = require('http').createServer(() => {}); const host = '::'; const port = process.env.PORT || 3000; server.once('error', (err) => { console.error('IPv6 bind failed:', err.message); process.exit(1); }); server.listen(port, host, () => server.close(() => process.exit(0)));"; then
|
||||||
|
echo "Falling back to IPv4 bind at 0.0.0.0"
|
||||||
|
export HOSTNAME=0.0.0.0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Check ownership before chown
|
# Check ownership before chown
|
||||||
if [ -e /app/config ]; then
|
if [ -e /app/config ]; then
|
||||||
CURRENT_UID=$(stat -c %u /app/config)
|
CURRENT_UID=$(stat -c %u /app/config)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ services:
|
|||||||
- 3000:3000
|
- 3000:3000
|
||||||
volumes:
|
volumes:
|
||||||
- /path/to/config:/app/config # Make sure your local config directory exists
|
- /path/to/config:/app/config # Make sure your local config directory exists
|
||||||
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
|
- /var/run/docker.sock:/var/run/docker.sock:ro # (optional) For docker integrations
|
||||||
environment:
|
environment:
|
||||||
HOMEPAGE_ALLOWED_HOSTS: gethomepage.dev # required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
|
HOMEPAGE_ALLOWED_HOSTS: gethomepage.dev # required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
|
||||||
```
|
```
|
||||||
@@ -36,7 +36,7 @@ services:
|
|||||||
- 3000:3000
|
- 3000:3000
|
||||||
volumes:
|
volumes:
|
||||||
- /path/to/config:/app/config # Make sure your local config directory exists
|
- /path/to/config:/app/config # Make sure your local config directory exists
|
||||||
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations, see alternative methods
|
- /var/run/docker.sock:/var/run/docker.sock:ro # (optional) For docker integrations, see alternative methods
|
||||||
environment:
|
environment:
|
||||||
HOMEPAGE_ALLOWED_HOSTS: gethomepage.dev # required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
|
HOMEPAGE_ALLOWED_HOSTS: gethomepage.dev # required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
|
||||||
PUID: $PUID
|
PUID: $PUID
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ All service widgets work essentially the same, that is, homepage makes a proxied
|
|||||||
|
|
||||||
If, after correctly adding and mapping your custom icons via the [Icons](../configs/services.md#icons) instructions, you are still unable to see your icons please try recreating your container.
|
If, after correctly adding and mapping your custom icons via the [Icons](../configs/services.md#icons) instructions, you are still unable to see your icons please try recreating your container.
|
||||||
|
|
||||||
## Disabling IPv6
|
## Disabling IPv6 for http requests {#disabling-ipv6}
|
||||||
|
|
||||||
If you are having issues with certain widgets that are unable to reach public APIs (e.g. weather), in certain setups you may need to disable IPv6. You can set the environment variable `HOMEPAGE_PROXY_DISABLE_IPV6` to `true` to disable IPv6 for the homepage proxy.
|
If you are having issues with certain widgets that are unable to reach public APIs (e.g. weather), in certain setups you may need to disable IPv6. You can set the environment variable `HOMEPAGE_PROXY_DISABLE_IPV6` to `true` to disable IPv6 for the homepage proxy.
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export function middleware(req) {
|
|||||||
// Check the Host header, if HOMEPAGE_ALLOWED_HOSTS is set
|
// Check the Host header, if HOMEPAGE_ALLOWED_HOSTS is set
|
||||||
const host = req.headers.get("host");
|
const host = req.headers.get("host");
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
let allowedHosts = [`localhost:${port}`, `127.0.0.1:${port}`];
|
let allowedHosts = [`localhost:${port}`, `127.0.0.1:${port}`, `[::1]:${port}`];
|
||||||
const allowAll = process.env.HOMEPAGE_ALLOWED_HOSTS === "*";
|
const allowAll = process.env.HOMEPAGE_ALLOWED_HOSTS === "*";
|
||||||
if (process.env.HOMEPAGE_ALLOWED_HOSTS) {
|
if (process.env.HOMEPAGE_ALLOWED_HOSTS) {
|
||||||
allowedHosts = allowedHosts.concat(process.env.HOMEPAGE_ALLOWED_HOSTS.split(","));
|
allowedHosts = allowedHosts.concat(process.env.HOMEPAGE_ALLOWED_HOSTS.split(","));
|
||||||
|
|||||||
Reference in New Issue
Block a user