From 6bd9a63ad7dc4e4bbfbf56e6d679c85ddeda25c6 Mon Sep 17 00:00:00 2001 From: Shahrad Elahi Date: Tue, 31 Oct 2023 18:33:19 +0330 Subject: [PATCH] update --- Dockerfile | 4 ++-- Dockerfile-Dev | 2 +- docker-entrypoint.sh | 2 +- src/middleware.ts | 3 ++- src/next.config.js | 2 +- src/pages/api/{wireguard => }/healthcheck.ts | 0 6 files changed, 7 insertions(+), 6 deletions(-) rename src/pages/api/{wireguard => }/healthcheck.ts (100%) diff --git a/Dockerfile b/Dockerfile index 7170270..b17f89e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,8 +47,8 @@ RUN npm install --omit dev EXPOSE 3000/tcp -HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://127.0.0.1:3000/api/wireguard/healthcheck || exit 1 +HEALTHCHECK --interval=60s --timeout=10s --start-period=5s --retries=3 \ + CMD curl -f http://127.0.0.1:3000/api/healthcheck || exit 1 COPY docker-entrypoint.sh /usr/bin/entrypoint RUN chmod +x /usr/bin/entrypoint diff --git a/Dockerfile-Dev b/Dockerfile-Dev index b9dc094..3b5f66c 100644 --- a/Dockerfile-Dev +++ b/Dockerfile-Dev @@ -29,7 +29,7 @@ COPY /config/torrc /etc/tor/torrc EXPOSE 3000/tcp HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://127.0.0.1:3000/api/wireguard/healthcheck || exit 1 + CMD curl -f http://127.0.0.1:3000/api/healthcheck || exit 1 COPY docker-entrypoint.sh /usr/bin/entrypoint RUN chmod +x /usr/bin/entrypoint diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 73319f0..8d8547b 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -91,6 +91,6 @@ echo -e "========================================================\n" sleep 1 # After 10 seconds, export the database to the WireGuard config file -screen -dm bash -c "sleep 10; curl -s -o /dev/null http://127.0.0.1:3000/api/wireguard/healthcheck" +screen -dm bash -c "sleep 10; curl -s -o /dev/null http://127.0.0.1:3000/api/healthcheck" exec "$@" diff --git a/src/middleware.ts b/src/middleware.ts index 213c2e7..dd7a040 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -10,8 +10,9 @@ export default withAuth({ }) // See "Matching Paths" below to learn more +// https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths export const config = { matcher: [ - '/((?!api/auth|api/wireguard/healthcheck|api/ping|login|logo.png|fonts|_next/static|_next/image|favicon.ico).*)', + '/((?!api/auth|api/healthcheck|_next/static|_next/image|login|logo.png|fonts|favicon.ico).*)', ], } \ No newline at end of file diff --git a/src/next.config.js b/src/next.config.js index c377b6c..97016e7 100644 --- a/src/next.config.js +++ b/src/next.config.js @@ -9,7 +9,7 @@ function publicENV(ex = {}) { const nextConfig = { reactStrictMode: true, transpilePackages: [], - env: publicENV({ NEXTAUTH_URL: 'http://127.0.0.1:3000' }), + env: publicENV({}), images: { domains: [ 'img.shields.io' ] } diff --git a/src/pages/api/wireguard/healthcheck.ts b/src/pages/api/healthcheck.ts similarity index 100% rename from src/pages/api/wireguard/healthcheck.ts rename to src/pages/api/healthcheck.ts