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 nsupdate module #1645

Closed
wants to merge 13 commits into from
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,10 @@ WORKDIR /usr/src/app
# TODO: consider moving all these binaries to the build-binaries stage
RUN apk add --no-cache bind-dev xz libltdl miniupnpc zip unzip dbus bind avahi-tools

# Copy docker
COPY docker/rndc.conf /etc/bind/
COPY docker/update_local_dyndns.sh /usr/local/bin/update_local_dyndns

# Copy git data
COPY --from=git-data /usr/src/app/.git-data.json $GIT_DATA_PATH

# Copy binaries
COPY --from=build-binaries /usr/bin/nsupdate /usr/bin/nsupdate
COPY --from=build-binaries /usr/bin/docker /usr/bin/docker
COPY --from=build-binaries /usr/local/bin/docker-compose /usr/local/bin/docker-compose

Expand Down
8 changes: 0 additions & 8 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,16 @@ ENV REACT_APP_API_URL /
RUN yarn build
# Results in build/*

# Copy docker
COPY docker/rndc.conf /etc/bind/
COPY docker/update_local_dyndns.sh /usr/local/bin/update_local_dyndns

# Copy git data
COPY --from=git-data /usr/src/app/.git-data.json $GIT_DATA_PATH

# Copy binaries
COPY --from=build-binaries /usr/bin/nsupdate /usr/bin/nsupdate
COPY --from=build-binaries /usr/bin/docker /usr/bin/docker
COPY --from=build-binaries /usr/local/bin/docker-compose /usr/local/bin/docker-compose

# Copy the src last as it's the layer most likely to change
COPY packages/hostScripts/hostScripts /usr/src/app/hostScripts

COPY docker/rndc.conf /etc/bind/
COPY docker/update_local_dyndns.sh /usr/local/bin/update_local_dyndns

WORKDIR /app
COPY docker/start_dev.sh /usr/src/app/start_dev.sh
ENTRYPOINT [ "/usr/src/app/start_dev.sh" ]
1 change: 0 additions & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
- ETH_MAINNET_RPC_URL_REMOTE=
- IPFS_HOST=
- DISABLE_UPNP=
dns: 172.33.1.2
networks:
dncore_network:
ipv4_address: 172.33.1.7
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ services:
- ETH_MAINNET_RPC_URL_REMOTE=
- IPFS_HOST=
- DISABLE_UPNP=
dns: 172.33.1.2
networks:
dncore_network:
ipv4_address: 172.33.1.7
Expand Down
12 changes: 0 additions & 12 deletions docker/rndc.conf

This file was deleted.

2 changes: 0 additions & 2 deletions packages/dappmanager/src/daemons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { startDynDnsDaemon } from "./dyndns/index.js";
import { startEthMultiClientDaemon } from "./ethMultiClient/index.js";
import { startEthicalMetricsDaemon } from "./ethicalMetrics/index.js";
import { startNatRenewalDaemon } from "./natRenewal/index.js";
import { startNsUpdateDaemon } from "./nsupdate/index.js";
import { startStakerDaemon } from "./stakerConfig/index.js";
import { startTelegramBotDaemon } from "./telegramBot/index.js";

Expand All @@ -15,7 +14,6 @@ export function startDaemons(signal: AbortSignal): void {
startEthMultiClientDaemon(signal);
startEthicalMetricsDaemon(signal);
startNatRenewalDaemon(signal);
startNsUpdateDaemon(signal);
startStakerDaemon();
startTelegramBotDaemon();
}
84 changes: 0 additions & 84 deletions packages/dappmanager/src/daemons/nsupdate/index.ts

This file was deleted.

30 changes: 1 addition & 29 deletions packages/dappmanager/src/initializeDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import getPublicIpFromUrls from "./utils/getPublicIpFromUrls.js";
import { params } from "@dappnode/params";
import ping from "./utils/ping.js";
import { pause } from "./utils/asyncFlows.js";
import retry from "async-retry";
import { shell } from "@dappnode/utils";
import { IdentityInterface } from "@dappnode/common";
import { logs } from "@dappnode/logger";
Expand Down Expand Up @@ -171,7 +170,7 @@ export default async function initializeDb(): Promise<void> {
// and the external IP from UPnP command succeeded
const upnpAvailable =
Boolean(publicIp && externalIp && internalIp !== publicIp) &&
(await isUpnpAvailable())
(await isUpnpAvailable())
? true
: false;

Expand Down Expand Up @@ -211,33 +210,6 @@ export default async function initializeDb(): Promise<void> {
// - Updates the domain: db.domain.set(domain);
dyndns.generateKeys(); // Auto-checks if keys are already generated

/**
* Set the domain of this DAppNode to point to the internal IP for better UX
* on Wifi connections, only if the internal IP !== public IP
* MUST be run after key generation `dyndns.generateKeys()`
* NOTE: Runs as a forked process with retry and a try / catch block
* > update_local_dyndns abcd1234abcd1234.dyndns.dappnode.io 192.168.1.12
*/
try {
await retry(async function updateLocalDyndnsCall(): Promise<void> {
const domain = db.domain.get();
const publicIp = db.publicIp.get();
const internalIp = db.internalIp.get();
if (internalIp !== publicIp && internalIp && domain) {
try {
await shell(`update_local_dyndns ${domain} ${internalIp}`);
logs.info(`Updated local dyndns: ${domain} ${internalIp}`);
} catch (e) {
// Log the error in each attempt for transparency / debugging
logs.warn(`Error on updateLocalDyndns attempt: ${e.message}`);
throw e;
}
}
});
} catch (e) {
logs.error("Error on update local dyndns", e);
}

/**
* After initializing all the internal params (hostname, internal_ip, etc)
* Persist them to the global ENVs file so other packages can consume it
Expand Down
1 change: 0 additions & 1 deletion packages/dappmanager/src/modules/ethClient/apiUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { listPackageNoThrow } from "@dappnode/dockerapi";
*/
export function getEthExecClientApiUrl(dnpName: string, port = 8545): string {
/**
* Binded to the domain mapper module 'nsupdate'
* ```
* domain = "bitcoin.dappnode", "other.public.dappnode"
* ```
Expand Down
31 changes: 0 additions & 31 deletions packages/dappmanager/src/modules/nsupdate/execNsupdate.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/dappmanager/src/modules/nsupdate/index.ts

This file was deleted.

Loading
Loading