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

Remove unused function isAdminIp #248

Merged
merged 1 commit into from
Jan 16, 2024
Merged
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
19 changes: 0 additions & 19 deletions src/src/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,11 @@ const allowAllIps = Boolean(process.env.ALLOW_ALL_IPS);

if (allowAllIps) logs.warn(`WARNING! ALLOWING ALL IPFS`);

// Authorize by IP

const adminIps = [
// Admin users connecting from the VPN
"172.33.10.",
// Admin users connecting from the WIFI
"172.33.12.",
// WIFI DNP ip, which may be applied to users in some situations
"172.33.1.10",
// DAPPMANAGER IP
"172.33.1.7",
// Also localhost calls
"127.0.0.1"
];

const localhostIps = [
// Internal calls from the same container
"127.0.0.1"
];

function isAdminIp(ip: string): boolean {
return allowAllIps || adminIps.some(_ip => ip.includes(_ip));
}

function isLocalhostIp(ip: string): boolean {
return allowAllIps || localhostIps.some(_ip => ip.includes(_ip));
}
Expand Down
Loading