Merge branch 'master' of github.com:benallfree/pockethost

This commit is contained in:
Ben Allfree 2024-01-28 14:32:59 +00:00
commit 5354e55d0a
7 changed files with 100 additions and 17 deletions

View File

@ -26,6 +26,42 @@
"tailable",
"Unsub",
"unzipper",
"upserting"
"upserting",
"authstore",
"autocancel",
"automigrate",
"Certbot",
"czvf",
"Darkmode",
"Dockerized",
"dockerode",
"esbuild",
"frontends",
"fullchain",
"IPCIDR",
"Jsonifiable",
"memorystream",
"Middlware",
"mothership",
"multitenancy",
"multitenant",
"nofile",
"nohup",
"PASV",
"pbincache",
"pexec",
"pocketbase",
"pockethost",
"POCKETSTREAM",
"privkey",
"Rpcs",
"TRYFETCH",
"Ulimits",
"unsub",
"Unsubbing",
"Unsubscriber",
"Unwatching",
"unzipper",
"Virtio"
]
}

View File

@ -262,6 +262,7 @@ export const createPocketbaseClient = (config: PocketbaseClientConfig) => {
'Content-Type': 'application/json',
Authorization: client.authStore.token,
},
openWhenHidden: true,
body: JSON.stringify({
instanceId: instance.id,
n: nInitial,

View File

@ -6,10 +6,10 @@
import FAQSection from '$src/routes/account/FAQSection.svelte'
import PricingCard from '$src/routes/account/PricingCard.svelte'
import {
isUserFounder,
isUserLegacy,
userStore,
userSubscriptionType,
isUserFounder,
} from '$util/stores'
import { onMount } from 'svelte'
import { writable } from 'svelte/store'
@ -21,7 +21,7 @@
const membershipCount = await client()
.client.collection('settings')
.getFirstListItem(`name = 'founders-edition-count'`)
founderMembershipsRemaining.set(membershipCount.value)
founderMembershipsRemaining.set(Math.max(0, membershipCount.value))
} catch (e) {
console.error(e)
}
@ -85,7 +85,7 @@
<PricingCard
name={`${PLAN_NAMES[SubscriptionType.Lifetime]}`}
qtyRemaining={founderMembershipsRemaining}
qtyMax={200}
qtyMax={100}
description="Super elite! The Founder's Edition is our way of saying thanks for supporting PocketHost in these early days. Choose between lifetime and annual options."
priceMonthly={[299, 'once, use forever']}
priceAnnually={[99, 'year (save 55%)']}

View File

@ -2,7 +2,7 @@
import { StreamNames, Unsubscribe, type InstanceLogFields } from '$shared'
import { client } from '$src/pocketbase-client'
import { mkCleanup } from '$util/componentCleanup'
import { onMount } from 'svelte'
import { onMount, tick } from 'svelte'
import { derived, writable } from 'svelte/store'
import { instance } from '../store'
@ -33,6 +33,29 @@
modal?.showModal()
}
// Auto Scrolls The Logs Window as New Logs Are Appended
// -----------------------------------------------------
let logElement: Element
let logElementPopup: Element
let autoScroll: boolean = true
const scrollToBottom = (node: Element) => {
if (node) {
node.scroll({ top: node.scrollHeight, behavior: 'smooth' })
}
}
$: if ($logs && autoScroll) {
tick().then(() => {
if (logElement) scrollToBottom(logElement)
if (logElementPopup) scrollToBottom(logElementPopup)
})
}
// -----------------------------------------------------
const logs = writable<InstanceLogFields[]>([])
const onDestroy = mkCleanup()
@ -62,9 +85,22 @@
<dialog id="loggingFullscreenModal" class="modal backdrop-blur">
<div class="modal-box max-w-[90vw] h-[90vh]">
<button
class="btn btn-sm absolute top-[6px] right-[6px]"
on:click={() => (autoScroll = !autoScroll)}
>AutoScroll
<i
class="fa-regular"
class:fa-close={!autoScroll}
class:fa-arrow-down={autoScroll}
/>
</button>
<h3 class="font-bold text-lg">Instance Logging</h3>
<div class="py-4 h-[80vh] overflow-y-scroll flex flex-col">
<div
class="py-4 h-[80vh] overflow-y-scroll flex flex-col"
bind:this={logElementPopup}
>
{#each $logs as log}
<div
class="px-4 text-[11px] font-mono flex align-center"
@ -87,12 +123,20 @@
</dialog>
<div class="mockup-code">
<button
class="btn btn-sm absolute top-[6px] right-[6px]"
on:click={handleFullScreenModal}
>Fullscreen <i class="fa-regular fa-arrows-maximize"></i></button
>
<div class="h-[450px] flex flex-col overflow-y-scroll">
<div class="flex flex-row absolute top-[6px] right-[6px] gap-1">
<button class="btn btn-sm" on:click={() => (autoScroll = !autoScroll)}
>AutoScroll
<i
class="fa-regular"
class:fa-close={!autoScroll}
class:fa-arrow-down={autoScroll}
/>
</button>
<button class="btn btn-sm" on:click={handleFullScreenModal}
>Fullscreen <i class="fa-regular fa-arrows-maximize" /></button
>
</div>
<div class="h-[450px] flex flex-col overflow-y-scroll" bind:this={logElement}>
{#each $logs as log}
<div class="px-4 text-[11px] font-mono flex align-center" data-prefix=">">
<div>

View File

@ -2,7 +2,7 @@
## Introduction
PocketHost is the open source the cloud hosting platform for PocketBase. https://pockethost.io is the flagship service running PocketHost, where you can host your PocketBase projects wit zero setup. Create a project like you would in Firebase and Supabase and let PocketHost do the rest.
PocketHost is the open source cloud hosting platform for PocketBase. https://pockethost.io is the flagship service running PocketHost, where you can host your PocketBase projects with zero setup. Create a project like you would in Firebase and Supabase and let PocketHost do the rest.
Features:

View File

@ -20,8 +20,6 @@ const { dbg, info, error } = LoggerService({
level: DEBUG() ? LogLevelName.Debug : LogLevelName.Info,
}).create(`edge-syslogd`)
console.log(`debug is ${DEBUG()}`)
server.on('error', (err) => {
console.log(`Server error:\n${err.stack}`)
server.close()

View File

@ -109,9 +109,13 @@ export const createPocketbaseService = async (
const docker = new Docker()
iLogger.info(`Starting instance`)
const _stdoutData = (data: Buffer) => {}
const _stdoutData = (data: Buffer) => {
dbg(data.toString())
}
stdout.on('data', _stdoutData)
const _stdErrData = (data: Buffer) => {}
const _stdErrData = (data: Buffer) => {
dbg(data.toString())
}
stderr.on('data', _stdErrData)
const Binds = [
`${mkInstanceDataPath(instanceId)}:${mkContainerHomePath()}`,