This commit is contained in:
mike12345567 2021-01-06 17:28:22 +00:00
parent 0f4dcbc3e2
commit b6e5658f4e
6 changed files with 35 additions and 29 deletions

View File

@ -1,5 +1,4 @@
<script>
import { Label, DropdownMenu } from "@budibase/bbui"
import ThemeEditor from "./ThemeEditor.svelte"

View File

@ -27,7 +27,6 @@
}
function updateSelfHosting(event) {
if (hostingInfo.type === "cloud" && event.target.checked) {
hostingInfo.hostingUrl = "localhost:10000"
hostingInfo.useHttps = false
@ -41,10 +40,7 @@
})
</script>
<ModalContent
title="Builder settings"
confirmText="Save"
onConfirm={save}>
<ModalContent title="Builder settings" confirmText="Save" onConfirm={save}>
<h5>Theme</h5>
<ThemeEditor />
<h5>Hosting</h5>
@ -52,7 +48,11 @@
This section contains settings that relate to the deployment and hosting of
apps made in this builder.
</p>
<Toggle thin text="Self hosted" on:change={updateSelfHosting} bind:checked={selfhosted} />
<Toggle
thin
text="Self hosted"
on:change={updateSelfHosting}
bind:checked={selfhosted} />
{#if selfhosted}
<Input bind:value={hostingInfo.hostingUrl} label="Hosting URL" />
<Input bind:value={hostingInfo.selfHostKey} label="Hosting Key" />

View File

@ -1,6 +1,11 @@
<script>
import { writable } from "svelte/store"
import { store, automationStore, backendUiStore, hostingStore } from "builderStore"
import {
store,
automationStore,
backendUiStore,
hostingStore,
} from "builderStore"
import { string, object } from "yup"
import api, { get } from "builderStore/api"
import Form from "@svelteschool/svelte-forms"

View File

@ -11,7 +11,7 @@ const PUBLIC_READ_POLICY = {
{
Effect: "Allow",
Principal: {
AWS: ["*"]
AWS: ["*"],
},
Action: "s3:GetObject",
Resource: [`arn:aws:s3:::${APP_BUCKET}/*`],
@ -65,8 +65,7 @@ async function getMinioSession() {
Bucket: APP_BUCKET,
})
.promise()
}
else {
} else {
throw err
}
}

View File

@ -1,7 +1,10 @@
const env = require("../environment")
module.exports = async (ctx, next) => {
if (!ctx.request.body.selfHostKey || env.SELF_HOST_KEY !== ctx.request.body.selfHostKey) {
if (
!ctx.request.body.selfHostKey ||
env.SELF_HOST_KEY !== ctx.request.body.selfHostKey
) {
ctx.throw(401, "Deployment unauthorised")
} else {
await next()