From aacaca3d4e13d114951a9b36cf3dcc8d87daf650 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 1 Jun 2021 20:17:06 +0100 Subject: [PATCH] update functionality complete --- hosting/docker-compose.dev.yaml | 14 ++++++++++++ hosting/docker-compose.yaml | 2 +- hosting/envoy.dev.yaml.hbs | 3 +-- hosting/envoy.yaml | 2 +- .../src/pages/builder/portal/_layout.svelte | 2 +- .../portal/settings/organisation.svelte | 1 - .../builder/portal/settings/update.svelte | 22 +++++++++---------- packages/server/src/app.js | 16 +++++++------- .../worker/src/api/controllers/admin/debug.js | 4 ---- .../src/api/controllers/admin/updates.js | 1 - packages/worker/src/api/routes/admin/debug.js | 9 -------- packages/worker/src/api/routes/index.js | 2 -- 12 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 packages/worker/src/api/controllers/admin/debug.js delete mode 100644 packages/worker/src/api/controllers/admin/updates.js delete mode 100644 packages/worker/src/api/routes/admin/debug.js diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index 3b99ef796c..1eddbf9271 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -64,6 +64,20 @@ 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/docker-compose.yaml b/hosting/docker-compose.yaml index c672f911a2..b03b433cef 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -126,7 +126,7 @@ services: labels: - "com.centurylinklabs.watchtower.enable=false" ports: - - 6666:8080 + - 6161:8080 volumes: diff --git a/hosting/envoy.dev.yaml.hbs b/hosting/envoy.dev.yaml.hbs index 054ceb9d3f..6a1d758895 100644 --- a/hosting/envoy.dev.yaml.hbs +++ b/hosting/envoy.dev.yaml.hbs @@ -132,5 +132,4 @@ static_resources: address: socket_address: address: {{ address }} - port_value: 4002 - + port_value: 4002 \ No newline at end of file diff --git a/hosting/envoy.yaml b/hosting/envoy.yaml index 6e143ac843..601506c622 100644 --- a/hosting/envoy.yaml +++ b/hosting/envoy.yaml @@ -140,5 +140,5 @@ static_resources: address: socket_address: address: watchtower-service - port_value: 6666 + port_value: 6161 diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index e6f7da4371..4bc0b46167 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -44,7 +44,7 @@ href: "/builder/portal/settings/theming", }, { - title: "Update", + title: "Updates", href: "/builder/portal/settings/update", }, ]) diff --git a/packages/builder/src/pages/builder/portal/settings/organisation.svelte b/packages/builder/src/pages/builder/portal/settings/organisation.svelte index 9cb448fb17..f8f4c8a7dd 100644 --- a/packages/builder/src/pages/builder/portal/settings/organisation.svelte +++ b/packages/builder/src/pages/builder/portal/settings/organisation.svelte @@ -70,7 +70,6 @@ loading = false } - {#if $auth.isAdmin} diff --git a/packages/builder/src/pages/builder/portal/settings/update.svelte b/packages/builder/src/pages/builder/portal/settings/update.svelte index a0eaa987cd..5835f9d0dc 100644 --- a/packages/builder/src/pages/builder/portal/settings/update.svelte +++ b/packages/builder/src/pages/builder/portal/settings/update.svelte @@ -27,17 +27,16 @@ async function updateBudibase() { try { notifications.info("Updating budibase..") - // const response = await fetch("http://localhost:6666/v1/update", { - // headers: { - // Authorization: "Bearer budibase" - // } - // }) + const response = await fetch("/v1/update", { + headers: { + Authorization: "Bearer budibase", + }, + }) notifications.success("Your budibase installation is up to date.") } catch (err) { notifications.error(`Error installing budibase update ${err}`) } } - {#if $auth.isAdmin} @@ -45,15 +44,16 @@ Update - Keep your budibase installation up to date to take advantage of the latest features, security updates and much more. + Keep your budibase installation up to date to take advantage of the + latest features, security updates and much more. -
-
- -
+
+
+
+
{/if} diff --git a/packages/server/src/app.js b/packages/server/src/app.js index 5772eefad3..d7fc248bba 100644 --- a/packages/server/src/app.js +++ b/packages/server/src/app.js @@ -28,14 +28,14 @@ app.use( }) ) -let logger = pino({ - prettyPrint: { - levelFirst: true, - }, - level: env.LOG_LEVEL || "error", -}) - -app.use(logger) +app.use( + pino({ + prettyPrint: { + levelFirst: true, + }, + level: env.LOG_LEVEL || "error", + }) +) if (!env.isTest()) { const bullApp = bullboard.init() diff --git a/packages/worker/src/api/controllers/admin/debug.js b/packages/worker/src/api/controllers/admin/debug.js deleted file mode 100644 index a96bf00c83..0000000000 --- a/packages/worker/src/api/controllers/admin/debug.js +++ /dev/null @@ -1,4 +0,0 @@ -exports.fetchDebugLogs = async ctx => { - // read them from file - // serve them -} diff --git a/packages/worker/src/api/controllers/admin/updates.js b/packages/worker/src/api/controllers/admin/updates.js deleted file mode 100644 index a41beaf50c..0000000000 --- a/packages/worker/src/api/controllers/admin/updates.js +++ /dev/null @@ -1 +0,0 @@ -exports.updateSystem = async ctx => {} diff --git a/packages/worker/src/api/routes/admin/debug.js b/packages/worker/src/api/routes/admin/debug.js deleted file mode 100644 index ee8e490d0e..0000000000 --- a/packages/worker/src/api/routes/admin/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -const Router = require("@koa/router") -const controller = require("../../controllers/admin/debug") -const adminOnly = require("../../../middleware/adminOnly") - -const router = Router() - -router.get("/api/admin/debug/logs", adminOnly, controller.fetchDebugLogs) - -module.exports = router diff --git a/packages/worker/src/api/routes/index.js b/packages/worker/src/api/routes/index.js index ae83a714db..8b232f7b7c 100644 --- a/packages/worker/src/api/routes/index.js +++ b/packages/worker/src/api/routes/index.js @@ -5,7 +5,6 @@ const templateRoutes = require("./admin/templates") const emailRoutes = require("./admin/email") const authRoutes = require("./admin/auth") const roleRoutes = require("./admin/roles") -const updatesRoutes = require("./admin/updates") const appRoutes = require("./app") exports.routes = [ @@ -17,5 +16,4 @@ exports.routes = [ templateRoutes, emailRoutes, roleRoutes, - updatesRoutes, ]