Merge pull request #10921 from Budibase/fix/airgap-templates-call
update airgap script and enable support for offline mode
This commit is contained in:
commit
958cabee52
|
@ -2,7 +2,9 @@ const fs = require("fs")
|
||||||
const { execSync } = require("child_process")
|
const { execSync } = require("child_process")
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
|
|
||||||
const IMAGES = {
|
const IS_SINGLE_IMAGE = process.env.SINGLE_IMAGE
|
||||||
|
|
||||||
|
let IMAGES = {
|
||||||
worker: "budibase/worker",
|
worker: "budibase/worker",
|
||||||
apps: "budibase/apps",
|
apps: "budibase/apps",
|
||||||
proxy: "budibase/proxy",
|
proxy: "budibase/proxy",
|
||||||
|
@ -10,7 +12,13 @@ const IMAGES = {
|
||||||
couch: "ibmcom/couchdb3",
|
couch: "ibmcom/couchdb3",
|
||||||
curl: "curlimages/curl",
|
curl: "curlimages/curl",
|
||||||
redis: "redis",
|
redis: "redis",
|
||||||
watchtower: "containrrr/watchtower"
|
watchtower: "containrrr/watchtower",
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_SINGLE_IMAGE) {
|
||||||
|
IMAGES = {
|
||||||
|
budibase: "budibase/budibase"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const FILES = {
|
const FILES = {
|
||||||
|
@ -39,11 +47,10 @@ for (let image in IMAGES) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy config files
|
// copy config files
|
||||||
copyFile(FILES.COMPOSE)
|
if (!IS_SINGLE_IMAGE) {
|
||||||
|
copyFile(FILES.COMPOSE)
|
||||||
|
}
|
||||||
copyFile(FILES.ENV)
|
copyFile(FILES.ENV)
|
||||||
|
|
||||||
// compress
|
// compress
|
||||||
execSync(`tar -czf bb-airgapped.tar.gz hosting/scripts/bb-airgapped`)
|
execSync(`tar -czf bb-airgapped.tar.gz hosting/scripts/bb-airgapped`)
|
||||||
|
|
||||||
// clean up
|
|
||||||
fs.rmdirSync(OUTPUT_DIR, { recursive: true })
|
|
|
@ -66,6 +66,7 @@
|
||||||
"build:docker:selfhost": "lerna run --stream build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh latest && cd -",
|
"build:docker:selfhost": "lerna run --stream build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh latest && cd -",
|
||||||
"build:docker:develop": "node scripts/pinVersions && lerna run --stream build:docker && yarn build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -",
|
"build:docker:develop": "node scripts/pinVersions && lerna run --stream build:docker && yarn build:docker:proxy && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -",
|
||||||
"build:docker:airgap": "node hosting/scripts/airgapped/airgappedDockerBuild",
|
"build:docker:airgap": "node hosting/scripts/airgapped/airgappedDockerBuild",
|
||||||
|
"build:docker:airgap:single": "SINGLE_IMAGE=1 node hosting/scripts/airgapped/airgappedDockerBuild",
|
||||||
"build:digitalocean": "cd hosting/digitalocean && ./build.sh && cd -",
|
"build:digitalocean": "cd hosting/digitalocean && ./build.sh && cd -",
|
||||||
"build:docker:single:multiarch": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/single/Dockerfile -t budibase:latest .",
|
"build:docker:single:multiarch": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/single/Dockerfile -t budibase:latest .",
|
||||||
"build:docker:single:image": "docker build -f hosting/single/Dockerfile -t budibase:latest .",
|
"build:docker:single:image": "docker build -f hosting/single/Dockerfile -t budibase:latest .",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import { apps, templates, licensing, groups } from "stores/portal"
|
import { admin, apps, templates, licensing, groups } from "stores/portal"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { redirect } from "@roxi/routify"
|
import { redirect } from "@roxi/routify"
|
||||||
|
|
||||||
|
@ -9,14 +9,18 @@
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
try {
|
try {
|
||||||
// Always load latest
|
const promises = [licensing.init()]
|
||||||
await Promise.all([
|
|
||||||
licensing.init(),
|
|
||||||
templates.load(),
|
|
||||||
groups.actions.init(),
|
|
||||||
])
|
|
||||||
|
|
||||||
if ($templates?.length === 0) {
|
if (!$admin.offlineMode) {
|
||||||
|
promises.push(templates.load())
|
||||||
|
}
|
||||||
|
|
||||||
|
promises.push(groups.actions.init())
|
||||||
|
|
||||||
|
// Always load latest
|
||||||
|
await Promise.all(promises)
|
||||||
|
|
||||||
|
if (!$admin.offlineMode && $templates?.length === 0) {
|
||||||
notifications.error("There was a problem loading quick start templates")
|
notifications.error("There was a problem loading quick start templates")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@
|
||||||
>
|
>
|
||||||
Create new app
|
Create new app
|
||||||
</Button>
|
</Button>
|
||||||
{#if $apps?.length > 0}
|
{#if $apps?.length > 0 && !$admin.offlineMode}
|
||||||
<Button
|
<Button
|
||||||
size="M"
|
size="M"
|
||||||
secondary
|
secondary
|
||||||
|
|
|
@ -46,6 +46,7 @@ export function createAdminStore() {
|
||||||
store.accountPortalUrl = environment.accountPortalUrl
|
store.accountPortalUrl = environment.accountPortalUrl
|
||||||
store.isDev = environment.isDev
|
store.isDev = environment.isDev
|
||||||
store.baseUrl = environment.baseUrl
|
store.baseUrl = environment.baseUrl
|
||||||
|
store.offlineMode = environment.offlineMode
|
||||||
return store
|
return store
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ const environment = {
|
||||||
SELF_HOSTED: process.env.SELF_HOSTED,
|
SELF_HOSTED: process.env.SELF_HOSTED,
|
||||||
HTTP_MB_LIMIT: process.env.HTTP_MB_LIMIT,
|
HTTP_MB_LIMIT: process.env.HTTP_MB_LIMIT,
|
||||||
FORKED_PROCESS_NAME: process.env.FORKED_PROCESS_NAME || "main",
|
FORKED_PROCESS_NAME: process.env.FORKED_PROCESS_NAME || "main",
|
||||||
|
OFFLINE_MODE: process.env.OFFLINE_MODE,
|
||||||
// old
|
// old
|
||||||
CLIENT_ID: process.env.CLIENT_ID,
|
CLIENT_ID: process.env.CLIENT_ID,
|
||||||
_set(key: string, value: any) {
|
_set(key: string, value: any) {
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { BBContext } from "@budibase/types"
|
import { Ctx } from "@budibase/types"
|
||||||
import env from "../../../environment"
|
import env from "../../../environment"
|
||||||
|
|
||||||
export const fetch = async (ctx: BBContext) => {
|
export const fetch = async (ctx: Ctx) => {
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
multiTenancy: !!env.MULTI_TENANCY,
|
multiTenancy: !!env.MULTI_TENANCY,
|
||||||
|
offlineMode: !!env.OFFLINE_MODE,
|
||||||
cloud: !env.SELF_HOSTED,
|
cloud: !env.SELF_HOSTED,
|
||||||
accountPortalUrl: env.ACCOUNT_PORTAL_URL,
|
accountPortalUrl: env.ACCOUNT_PORTAL_URL,
|
||||||
disableAccountPortal: env.DISABLE_ACCOUNT_PORTAL,
|
disableAccountPortal: env.DISABLE_ACCOUNT_PORTAL,
|
||||||
|
|
|
@ -24,6 +24,7 @@ describe("/api/system/environment", () => {
|
||||||
isDev: false,
|
isDev: false,
|
||||||
multiTenancy: true,
|
multiTenancy: true,
|
||||||
baseUrl: "http://localhost:10000",
|
baseUrl: "http://localhost:10000",
|
||||||
|
offlineMode: false,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -61,6 +61,7 @@ const environment = {
|
||||||
CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 3600,
|
CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 3600,
|
||||||
SESSION_UPDATE_PERIOD: process.env.SESSION_UPDATE_PERIOD,
|
SESSION_UPDATE_PERIOD: process.env.SESSION_UPDATE_PERIOD,
|
||||||
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
|
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
|
||||||
|
OFFLINE_MODE: process.env.OFFLINE_MODE,
|
||||||
/**
|
/**
|
||||||
* Mock the email service in use - links to ethereal hosted emails are logged instead.
|
* Mock the email service in use - links to ethereal hosted emails are logged instead.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue