Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IP_RANGES_FETCH_ENABLED environment variable #4398

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const schema = require('./schema');
const logger = require('./logger').global;

const IP_RANGES_FETCH_ENABLED = process.env.IP_RANGES_FETCH_ENABLED !== 'false';

async function appStart () {
const migrate = require('./migrate');
const setup = require('./setup');
Expand All @@ -13,7 +15,18 @@ async function appStart () {
return migrate.latest()
.then(setup)
.then(schema.getCompiledSchema)
.then(internalIpRanges.fetch)
.then(() => {
if (IP_RANGES_FETCH_ENABLED) {
logger.info('IP Ranges fetch is enabled');
return internalIpRanges.fetch().catch((err) => {
logger.error('IP Ranges fetch failed, continuing anyway:', err.message);
return Promise.resolve();
});
} else {
logger.info('IP Ranges fetch is disabled by environment variable');
return Promise.resolve();
}
})
.then(() => {
internalCertificate.initTimer();
internalIpRanges.initTimer();
Expand Down
8 changes: 8 additions & 0 deletions docs/src/advanced-config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ The easy fix is to add a Docker environment variable to the Nginx Proxy Manager
DISABLE_IPV6: 'true'
```

## Disabling IP Ranges Fetch

By default, NPM fetches IP ranges from CloudFront and Cloudflare during application startup. In environments with limited internet access or to speed up container startup, this fetch can be disabled:

```yml
environment:
IP_RANGES_FETCH_ENABLED: 'false'
```

## Custom Nginx Configurations

Expand Down