Browse Source

update functionality complete

master
Martin McKeaveney 5 years ago
parent
commit
aacaca3d4e
  1. 14
      hosting/docker-compose.dev.yaml
  2. 2
      hosting/docker-compose.yaml
  3. 3
      hosting/envoy.dev.yaml.hbs
  4. 2
      hosting/envoy.yaml
  5. 2
      packages/builder/src/pages/builder/portal/_layout.svelte
  6. 1
      packages/builder/src/pages/builder/portal/settings/organisation.svelte
  7. 22
      packages/builder/src/pages/builder/portal/settings/update.svelte
  8. 16
      packages/server/src/app.js
  9. 4
      packages/worker/src/api/controllers/admin/debug.js
  10. 1
      packages/worker/src/api/controllers/admin/updates.js
  11. 9
      packages/worker/src/api/routes/admin/debug.js
  12. 2
      packages/worker/src/api/routes/index.js

14
hosting/docker-compose.dev.yaml

@ -64,6 +64,20 @@ services:
- "${REDIS_PORT}:6379" - "${REDIS_PORT}:6379"
volumes: volumes:
- redis_data:/data - 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: volumes:
couchdb3_data: couchdb3_data:

2
hosting/docker-compose.yaml

@ -126,7 +126,7 @@ services:
labels: labels:
- "com.centurylinklabs.watchtower.enable=false" - "com.centurylinklabs.watchtower.enable=false"
ports: ports:
- 6666:8080 - 6161:8080
volumes: volumes:

3
hosting/envoy.dev.yaml.hbs

@ -132,5 +132,4 @@ static_resources:
address: address:
socket_address: socket_address:
address: {{ address }} address: {{ address }}
port_value: 4002 port_value: 4002

2
hosting/envoy.yaml

@ -140,5 +140,5 @@ static_resources:
address: address:
socket_address: socket_address:
address: watchtower-service address: watchtower-service
port_value: 6666 port_value: 6161

2
packages/builder/src/pages/builder/portal/_layout.svelte

@ -44,7 +44,7 @@
href: "/builder/portal/settings/theming", href: "/builder/portal/settings/theming",
}, },
{ {
title: "Update", title: "Updates",
href: "/builder/portal/settings/update", href: "/builder/portal/settings/update",
}, },
]) ])

1
packages/builder/src/pages/builder/portal/settings/organisation.svelte

@ -70,7 +70,6 @@
loading = false loading = false
} }
</script> </script>
{#if $auth.isAdmin} {#if $auth.isAdmin}

22
packages/builder/src/pages/builder/portal/settings/update.svelte

@ -27,17 +27,16 @@
async function updateBudibase() { async function updateBudibase() {
try { try {
notifications.info("Updating budibase..") notifications.info("Updating budibase..")
// const response = await fetch("http://localhost:6666/v1/update", { const response = await fetch("/v1/update", {
// headers: { headers: {
// Authorization: "Bearer budibase" Authorization: "Bearer budibase",
// } },
// }) })
notifications.success("Your budibase installation is up to date.") notifications.success("Your budibase installation is up to date.")
} catch (err) { } catch (err) {
notifications.error(`Error installing budibase update ${err}`) notifications.error(`Error installing budibase update ${err}`)
} }
} }
</script> </script>
{#if $auth.isAdmin} {#if $auth.isAdmin}
@ -45,15 +44,16 @@
<Layout gap="XS" noPadding> <Layout gap="XS" noPadding>
<Heading size="M">Update</Heading> <Heading size="M">Update</Heading>
<Body> <Body>
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.
</Body> </Body>
</Layout> </Layout>
<Divider size="S" /> <Divider size="S" />
<div class="fields"> <div class="fields">
<div class="field"> <div class="field">
<Button cta on:click={updateBudibase}>Check For Updates</Button> <Button cta on:click={updateBudibase}>Check For Updates</Button>
</div>
</div> </div>
</div>
</Layout> </Layout>
{/if} {/if}

16
packages/server/src/app.js

@ -28,14 +28,14 @@ app.use(
}) })
) )
let logger = pino({ app.use(
prettyPrint: { pino({
levelFirst: true, prettyPrint: {
}, levelFirst: true,
level: env.LOG_LEVEL || "error", },
}) level: env.LOG_LEVEL || "error",
})
app.use(logger) )
if (!env.isTest()) { if (!env.isTest()) {
const bullApp = bullboard.init() const bullApp = bullboard.init()

4
packages/worker/src/api/controllers/admin/debug.js

@ -1,4 +0,0 @@
exports.fetchDebugLogs = async ctx => {
// read them from file
// serve them
}

1
packages/worker/src/api/controllers/admin/updates.js

@ -1 +0,0 @@
exports.updateSystem = async ctx => {}

9
packages/worker/src/api/routes/admin/debug.js

@ -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

2
packages/worker/src/api/routes/index.js

@ -5,7 +5,6 @@ const templateRoutes = require("./admin/templates")
const emailRoutes = require("./admin/email") const emailRoutes = require("./admin/email")
const authRoutes = require("./admin/auth") const authRoutes = require("./admin/auth")
const roleRoutes = require("./admin/roles") const roleRoutes = require("./admin/roles")
const updatesRoutes = require("./admin/updates")
const appRoutes = require("./app") const appRoutes = require("./app")
exports.routes = [ exports.routes = [
@ -17,5 +16,4 @@ exports.routes = [
templateRoutes, templateRoutes,
emailRoutes, emailRoutes,
roleRoutes, roleRoutes,
updatesRoutes,
] ]

Loading…
Cancel
Save