From e927f44c12b9c220c4c1c983592b7e5d05a3cdfb Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 1 Jun 2021 20:22:56 +0100 Subject: [PATCH] removing superfluous controllers --- hosting/docker-compose.dev.yaml | 14 -------------- hosting/envoy.dev.yaml.hbs | 2 +- hosting/envoy.yaml | 9 ++++----- packages/auth/src/middleware/auditLog.js | 8 +------- packages/worker/package.json | 1 - packages/worker/src/api/routes/admin/updates.js | 9 --------- 6 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 packages/worker/src/api/routes/admin/updates.js diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index 1eddbf9271..3b99ef796c 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -64,20 +64,6 @@ services: - "${REDIS_PORT}:6379" volumes: - redis_data:/data - - watchtower-service: - image: containrrr/watchtower - volumes: - - /var/run/docker.sock:/var/run/docker.sock - command: --debug --http-api-update budibase/apps budibase/worker - environment: - - WATCHTOWER_HTTP_API=true - - WATCHTOWER_HTTP_API_TOKEN=budibase - - WATCHTOWER_CLEANUP=true - labels: - - "com.centurylinklabs.watchtower.enable=false" - ports: - - 6161:8080 volumes: couchdb3_data: diff --git a/hosting/envoy.dev.yaml.hbs b/hosting/envoy.dev.yaml.hbs index 6a1d758895..080311ee49 100644 --- a/hosting/envoy.dev.yaml.hbs +++ b/hosting/envoy.dev.yaml.hbs @@ -132,4 +132,4 @@ static_resources: address: socket_address: address: {{ address }} - port_value: 4002 \ No newline at end of file + port_value: 4002 diff --git a/hosting/envoy.yaml b/hosting/envoy.yaml index 601506c622..20e912434a 100644 --- a/hosting/envoy.yaml +++ b/hosting/envoy.yaml @@ -21,6 +21,10 @@ static_resources: cluster: app-service prefix_rewrite: "/" + - match: { path: "/v1/update" } + route: + cluster: watchtower-service + - match: { prefix: "/builder/" } route: cluster: app-service @@ -38,11 +42,6 @@ static_resources: route: cluster: worker-service - - match: { prefix: "/v1/update" } - route: - cluster: watchtower-service - - - match: { path: "/" } route: cluster: app-service diff --git a/packages/auth/src/middleware/auditLog.js b/packages/auth/src/middleware/auditLog.js index 919d7257ba..c9063ae2e0 100644 --- a/packages/auth/src/middleware/auditLog.js +++ b/packages/auth/src/middleware/auditLog.js @@ -1,10 +1,4 @@ module.exports = async (ctx, next) => { - ctx.log.info({ - userId: ctx.user && ctx.user._id, - ip: ctx.ip, - url: ctx.originalUrl, - origin: ctx.origin, - method: ctx.method, - }) + // Placeholder for audit log middleware return next() } diff --git a/packages/worker/package.json b/packages/worker/package.json index fe289844f0..da59c55c59 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -26,7 +26,6 @@ "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", - "dockerode": "^3.3.0", "dotenv": "^8.2.0", "got": "^11.8.1", "joi": "^17.4.0", diff --git a/packages/worker/src/api/routes/admin/updates.js b/packages/worker/src/api/routes/admin/updates.js deleted file mode 100644 index a89ce8b68a..0000000000 --- a/packages/worker/src/api/routes/admin/updates.js +++ /dev/null @@ -1,9 +0,0 @@ -const Router = require("@koa/router") -const controller = require("../../controllers/admin/updates") -const adminOnly = require("../../../middleware/adminOnly") - -const router = Router() - -router.get("/api/admin/update", adminOnly, controller.updateSystem) - -module.exports = router