-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix gitignore * Add global envs * Fix test * Set alias for dappmanager API * Remove hardcoded IP * Hardcode config for new IP range * Fix route * Generate config depending on IP range * remove isAdmin middleware * add minimumDappnodeVersion * fix typo * fix typo * Fix non-existing vars file * Improved dns IP resolution --------- Co-authored-by: pablomendezroyo <[email protected]>
- Loading branch information
1 parent
357ca24
commit 4465106
Showing
16 changed files
with
143 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,9 @@ | ||
# dedicated files | ||
build_* | ||
build/src/node_modules/ | ||
build/src/mockFiles/ | ||
build/src/db.json | ||
build/src/vpndb/ | ||
build/src/vpndb.json | ||
uploader | ||
|
||
# Build artifacts | ||
build/src/dist | ||
build/ui_openvpn/build | ||
|
||
# Version data file | ||
.version.json | ||
.git-data.json | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
releases.json | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
ui_openvpn/node_modules | ||
ui_openvpn/build | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
src/node_modules | ||
src/dist | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
build_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,15 @@ | |
"version": "0.2.8", | ||
"description": "Dappnode package responsible for providing the VPN (OpenVPN) connection", | ||
"type": "dncore", | ||
"architectures": [ | ||
"linux/amd64", | ||
"linux/arm64" | ||
], | ||
"architectures": ["linux/amd64", "linux/arm64"], | ||
"author": "DAppNode Association <[email protected]> (https://github.com/dappnode)", | ||
"contributors": [ | ||
"Eduardo Antuña <[email protected]> (https://github.com/eduadiez)", | ||
"DAppLion <[email protected]> (https://github.com/dapplion)", | ||
"vdo <[email protected]> (https://github.com/vdo)", | ||
"Alex Floyd <[email protected]> (https://github.com/mex20)" | ||
], | ||
"keywords": [ | ||
"DAppNodeCore", | ||
"VPN", | ||
"OpenVPN" | ||
], | ||
"keywords": ["DAppNodeCore", "VPN", "OpenVPN"], | ||
"links": { | ||
"homepage": "https://github.com/dappnode/DNP_VPN#readme" | ||
}, | ||
|
@@ -29,5 +22,14 @@ | |
"bugs": { | ||
"url": "https://github.com/dappnode/DNP_VPN/issues" | ||
}, | ||
"license": "GPL-3.0" | ||
} | ||
"license": "GPL-3.0", | ||
"globalEnvs": [ | ||
{ | ||
"envs": ["HOSTNAME", "INTERNAL_IP"], | ||
"services": ["vpn.dnp.dappnode.eth"] | ||
} | ||
], | ||
"requirements": { | ||
"minimumDappnodeVersion": "0.2.85" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Resolver } from 'dns'; | ||
import { logs } from '../logs'; | ||
|
||
export async function getContainerIP(containerName: string): Promise<string | null> { | ||
|
||
const resolver = new Resolver(); | ||
|
||
// Use Docker's DNS server to resolve container name. | ||
resolver.setServers(['127.0.0.11']); | ||
|
||
return new Promise((resolve) => { | ||
resolver.resolve4(containerName, (err, addresses) => { | ||
if (err) { | ||
logs.error(`Error resolving ${containerName} IP address: ${err}`); | ||
resolve(null); | ||
} else { | ||
// Resolve with the first address found (if any). | ||
logs.info(`Resolved ${containerName} IP addresses: ${addresses}`); | ||
resolve(addresses.length > 0 ? addresses[0] : null); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.