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

This commit is contained in:
Ben Allfree 2024-06-06 12:41:58 +00:00
commit 99a0bcab9c
101 changed files with 132 additions and 287 deletions

View File

@ -15,15 +15,14 @@
"check:types:dashboard": "cd packages/dashboard && pnpm check:types",
"check:types:superadmin": "cd packages/superadmin && pnpm check:types",
"check:types:pockethost": "cd packages/pockethost && pnpm check:types",
"check:types:common": "cd packages/common && pnpm check:types",
"lint": "prettier -c \"./**/*.{ts,js,cjs,svelte,json}\"",
"lint:fix": "prettier -w \"./**/*.{ts,js,cjs,svelte,json}\"",
"build": "concurrently 'pnpm:build:*'",
"build-frontends": "concurrently 'pnpm:build:frontend:*'",
"build:frontend:dashboard": "cd packages/dashboard && pnpm build",
"build:docker": "cd pockethost-instance && pnpm build",
"build:frontend:lander": "cd packages/lander && pnpm build",
"build:frontend:superadmin": "cd packages/superadmin && pnpm build",
"build:docker": "cd packages/pockethost-instance && pnpm build",
"dev:cli": "cd packages/pockethost && pnpm dev",
"dev:lander": "cd packages/lander && pnpm start",
"dev:dashboard": "cd packages/dashboard && pnpm dev",

View File

@ -1,26 +0,0 @@
{
"name": "@pockethost/common",
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
"module": "src/index.ts",
"type": "module",
"scripts": {
"check:types": "tsc --noEmit "
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@s-libs/micro-dash": "^16.1.0",
"ajv": "^8.12.0",
"bottleneck": "^2.19.5",
"chalk": "^5.3.0",
"json-stringify-safe": "^5.0.1",
"nanoid": "^5.0.2",
"pocketbase": "^0.21.3"
},
"devDependencies": {
"@types/json-stringify-safe": "^5.0.2"
}
}

View File

@ -1,109 +0,0 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}

View File

@ -14,7 +14,7 @@
"type": "module",
"devDependencies": {
"@microsoft/fetch-event-source": "https://github.com/pockethost/fetch-event-source.git#ebe3b7122647b48b93fd11effbbfb915d98956b0",
"@pockethost/common": "workspace:../common",
"pockethost": "workspace:../pockethost",
"@s-libs/micro-dash": "^16.1.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.25.2",

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { InstanceStatus } from '@pockethost/common'
import { InstanceStatus } from 'pockethost'
import { onMount } from 'svelte'
export let status: InstanceStatus = InstanceStatus.Idle

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { isUserFounder, userSubscriptionType } from '$util/stores'
import { PLAN_NAMES, SubscriptionType } from '@pockethost/common'
import { PLAN_NAMES, SubscriptionType } from 'pockethost'
isUserFounder

View File

@ -1,4 +1,4 @@
import { assertTruthy } from '@pockethost/common'
import { assertTruthy } from 'pockethost'
export const html = () => {
const htmlElement = document.querySelector('html')

View File

@ -5,7 +5,7 @@
import MobileTable from '$components/tables/pricing-table/MobileTable.svelte'
import { DISCORD_URL, DOCS_URL } from '$src/env'
import { isUserFounder, userSubscriptionType } from '$util/stores'
import { PLAN_NAMES, SubscriptionType } from '@pockethost/common'
import { PLAN_NAMES, SubscriptionType } from 'pockethost'
type ItemValue = '1' | 'Unlimited' | 'YesBlock' | 'NoBlock'

View File

@ -1,5 +1,5 @@
import { InstanceFields } from '@pockethost/common'
import { boolean } from 'boolean'
import { InstanceFields } from 'pockethost'
/**
* These environment variables default to pointing to the production build so

View File

@ -1,6 +1,7 @@
import { INSTANCE_URL } from '$src/env'
import { createGenericSyncEvent } from '$util/events'
import { fetchEventSource } from '@microsoft/fetch-event-source'
import { keys, map } from '@s-libs/micro-dash'
import {
AuthModel,
BaseAuthStore,
@ -22,8 +23,7 @@ import {
type InstanceFields,
type InstanceId,
type InstanceLogFields,
} from '@pockethost/common'
import { keys, map } from '@s-libs/micro-dash'
} from 'pockethost'
export type AuthToken = string
export type AuthStoreProps = {

View File

@ -10,7 +10,7 @@
userStore,
userSubscriptionType,
} from '$util/stores'
import { PLAN_NAMES, SubscriptionType } from '@pockethost/common'
import { PLAN_NAMES, SubscriptionType } from 'pockethost'
import { onMount } from 'svelte'
import { writable } from 'svelte/store'

View File

@ -3,7 +3,7 @@
import AlertBar from '$components/AlertBar.svelte'
import { INSTANCE_ADMIN_URL } from '$src/env'
import { globalInstancesStore } from '$util/stores'
import { assert } from '@pockethost/common'
import { assert } from 'pockethost'
import { instance } from './store'
let isReady = false

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { assertExists } from '@pockethost/common'
import { assertExists } from 'pockethost'
import Code from './Code.svelte'
import Ftp from './Ftpx.svelte'
import { instance } from './store'

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { assertExists } from '@pockethost/common'
import { assertExists } from 'pockethost'
import { instance } from '../store'
import LoggingInner from './LoggingInner.svelte'

View File

@ -1,11 +1,7 @@
<script lang="ts">
import { client } from '$src/pocketbase-client'
import { mkCleanup } from '$util/componentCleanup'
import {
StreamNames,
Unsubscribe,
type InstanceLogFields,
} from '@pockethost/common'
import { StreamNames, Unsubscribe, type InstanceLogFields } from 'pockethost'
import { onMount, tick } from 'svelte'
import { derived, writable } from 'svelte/store'
import { instance } from '../store'

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { assertExists } from '@pockethost/common'
import { assertExists } from 'pockethost'
import { instance } from '../store'
import SecretsInner from './SecretsInner.svelte'

View File

@ -1,7 +1,7 @@
<script lang="ts">
import AlertBar from '$components/AlertBar.svelte'
import { client } from '$src/pocketbase-client/index.js'
import { SECRET_KEY_REGEX, UpdateInstancePayload } from '@pockethost/common'
import { SECRET_KEY_REGEX, UpdateInstancePayload } from 'pockethost'
import { reduce } from '@s-libs/micro-dash'
import { instance } from '../store.js'
import { items } from './stores.js'

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { assertExists } from '@pockethost/common'
import { assertExists } from 'pockethost'
import { instance } from '../store'
import AdminSync from './AdminSync.svelte'
import CustomDomain from './CustomDomain.svelte'

View File

@ -6,7 +6,7 @@
import { DOCS_URL, INSTANCE_BARE_HOST } from '$src/env'
import { client } from '$src/pocketbase-client'
import { userSubscriptionType } from '$util/stores'
import { SubscriptionType } from '@pockethost/common'
import { SubscriptionType } from 'pockethost'
import { dns } from 'svelte-highlight/languages'
import { instance } from '../store'

View File

@ -1,4 +1,4 @@
import type { InstanceFields } from '@pockethost/common'
import type { InstanceFields } from 'pockethost'
import { writable } from 'svelte/store'
export const instance = writable<InstanceFields>()

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { globalInstancesStore, userSubscriptionType } from '$util/stores'
import { SubscriptionType } from '@pockethost/common'
import { SubscriptionType } from 'pockethost'
import { values } from '@s-libs/micro-dash'
import Creator from './Creator.svelte'
import Paywall from './Paywall.svelte'

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { userSubscriptionType } from '$util/stores'
import { SubscriptionType } from '@pockethost/common'
import { SubscriptionType } from 'pockethost'
</script>
<div class="card max-w-sm bg-base-100 shadow-xl">

View File

@ -3,7 +3,7 @@
import CardHeader from '$components/cards/CardHeader.svelte'
import InstanceRow from '$src/routes/dashboard/InstanceRow.svelte'
import { globalInstancesStore } from '$util/stores'
import { InstanceFields } from '@pockethost/common'
import { InstanceFields } from 'pockethost'
import { values } from '@s-libs/micro-dash'
let arrayOfActiveInstances: InstanceFields[] = []

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { INSTANCE_ADMIN_URL } from '$src/env.js'
import { InstanceFields } from '@pockethost/common'
import { InstanceFields } from 'pockethost'
export let instance: InstanceFields
export let index: number

View File

@ -1,4 +1,4 @@
import { LoggerService, LogLevelName } from '@pockethost/common'
import { LoggerService, LogLevelName } from 'pockethost'
import { PUBLIC_DEBUG } from './env'
// Initiate the logging service

View File

@ -1,4 +1,4 @@
import { createCleanupManager } from '@pockethost/common'
import { createCleanupManager } from 'pockethost'
import { onDestroy } from 'svelte'
// TODO: Document this more

View File

@ -1,4 +1,5 @@
import { client } from '$src/pocketbase-client'
import consoleLogger from '@pockethost/plugin-console-logger'
import {
SubscriptionType,
UserFields,
@ -6,8 +7,7 @@ import {
type InstanceFields,
type InstanceId,
type UnsubscribeFunc,
} from '@pockethost/common'
import consoleLogger from '@pockethost/plugin-console-logger'
} from 'pockethost'
import { writable } from 'svelte/store'
// TODO: Removing this will cause the app to crash
// Theres a reference inside of `createPocketbaseClient.ts` that needs the information that comes from this file

View File

@ -189,7 +189,7 @@ total_users: 5103
- fix: only allocate default port if port is not specified
- fix: package overrides
- fix: patch package fix
- fix: pb_hooks module not building when @pockethost/common was included
- fix: pb_hooks module not building when pockethost was included
- fix: pockethost defaults logging
- fix: pro pricing button
- fix: remove deno path

View File

@ -44,7 +44,7 @@
"prettier": "^3.0.3"
},
"dependencies": {
"@pockethost/common": "link:../common",
"pockethost": "workspace:../pockethost",
"@tailwindcss/typography": "^0.5.10",
"autoprefixer": "^10.4.16",
"boolean": "^3.2.0",

View File

@ -11,6 +11,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"@pockethost/common": "workspace:../common"
"pockethost": "workspace:../pockethost"
}
}

View File

@ -5,7 +5,7 @@ import {
isLevelGte,
isLevelLte,
stringify,
} from '@pockethost/common'
} from 'pockethost'
export const LogLevelConsoleMap = {
[LogLevelName.Trace]: console.trace,

View File

@ -20,7 +20,7 @@
},
"dependencies": {
"@dotenvx/dotenvx": "^0.44.1",
"@pockethost/common": "workspace:../common",
"pockethost": "workspace:../pockethost",
"@pockethost/plugin-console-logger": "workspace:../plugin-console-logger",
"@s-libs/micro-dash": "^16.1.0",
"@types/node-os-utils": "^1.3.4",
@ -62,9 +62,14 @@
"url-pattern": "^1.0.3",
"vhost": "^3.0.2",
"winston": "^3.11.0",
"winston-syslog": "^2.7.0"
"winston-syslog": "^2.7.0",
"chalk": "^5.3.0",
"json-stringify-safe": "^5.0.1",
"nanoid": "^5.0.2",
"pocketbase": "^0.21.3"
},
"devDependencies": {
"@types/json-stringify-safe": "^5.0.2",
"@types/cors": "^2.8.17",
"@types/d3-scale": "^4.0.6",
"@types/d3-scale-chromatic": "^3.0.1",

View File

@ -3,6 +3,7 @@ import {
MOTHERSHIP_ADMIN_USERNAME,
MOTHERSHIP_INTERNAL_URL,
} from '$constants'
import { LoggerService } from '$public'
import {
MothershipAdminClientService,
PocketbaseService,
@ -13,7 +14,6 @@ import {
realtimeLog,
} from '$services'
import { discordAlert, tryFetch } from '$util'
import { LoggerService } from '@pockethost/common'
import { ErrorRequestHandler } from 'express'
export async function daemon() {

View File

@ -1,7 +1,7 @@
import { MOTHERSHIP_INTERNAL_URL } from '$constants'
import { LoggerService } from '$public'
import { ftpService } from '$services'
import { tryFetch } from '$util'
import { LoggerService } from '@pockethost/common'
export async function ftp() {
const logger = LoggerService().create(`EdgeFtpCommand`)

View File

@ -1,6 +1,6 @@
import { SYSLOGD_PORT } from '$constants'
import { LoggerService } from '$public'
import { InstanceLogger } from '$services'
import { LoggerService } from '@pockethost/common'
import * as dgram from 'dgram'
import parse from 'syslog-parse'

View File

@ -9,8 +9,8 @@ import {
SSL_CERT,
SSL_KEY,
} from '$constants'
import { LoggerService } from '$public'
import { discordAlert } from '$util'
import { LoggerService } from '@pockethost/common'
import { forEach } from '@s-libs/micro-dash'
import cors from 'cors'
import express, { ErrorRequestHandler } from 'express'

View File

@ -3,8 +3,8 @@ import {
DISCORD_HEALTH_CHANNEL_URL,
MOTHERSHIP_PORT,
} from '$constants'
import { LoggerService, stringify } from '$public'
import { discordAlert } from '$util'
import { LoggerService, stringify } from '@pockethost/common'
import Bottleneck from 'bottleneck'
import { execSync } from 'child_process'
import fetch from 'node-fetch'

View File

@ -1,4 +1,4 @@
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import { Command } from 'commander'
import { checkHealth } from './checkHealth'

View File

@ -9,8 +9,8 @@ import {
MOTHERSHIP_SEMVER,
mkContainerHomePath,
} from '$constants'
import { LoggerService } from '$public'
import { PortService } from '$services'
import { LoggerService } from '@pockethost/common'
import copyfiles from 'copyfiles'
import { GobotOptions, gobot } from 'gobot'
import { rimraf } from 'rimraf'

View File

@ -1,5 +1,5 @@
import { MOTHERSHIP_DATA_ROOT } from '$constants'
import { stringify } from '@pockethost/common'
import { stringify } from '$public'
import { writeFileSync } from 'fs'
import { gobot } from 'gobot'

View File

@ -1,4 +1,4 @@
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import { Command } from 'commander'
import { sendMail } from './sendmail'

View File

@ -6,8 +6,8 @@ import {
MOTHERSHIP_URL,
TEST_EMAIL,
} from '$constants'
import { LoggerService, PocketBase, UserFields } from '$public'
import { SqliteService } from '$services'
import { LoggerService, PocketBase, UserFields } from '@pockethost/common'
import { map } from '@s-libs/micro-dash'
import Bottleneck from 'bottleneck'
import { InvalidArgumentError, program } from 'commander'

View File

@ -1,4 +1,4 @@
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import { Command } from 'commander'
import { daemon } from '../EdgeCommand/DaemonCommand/ServeCommand/daemon'
import { syslog } from '../EdgeCommand/SyslogCommand/ServeCommand/syslog'

2
packages/pockethost/src/cli/index.ts Normal file → Executable file
View File

@ -1,7 +1,7 @@
#!/usr/bin/env node
import { DEBUG, DefaultSettingsService, PH_PLUGINS, SETTINGS } from '$constants'
import { LogLevelName, LoggerService, loadPlugins } from '@pockethost/common'
import { LogLevelName, LoggerService, loadPlugins } from '$public'
import { program } from 'commander'
import EventSource from 'eventsource'
import { EdgeCommand } from './commands/EdgeCommand'

View File

@ -1,3 +1,10 @@
import {
InstanceFields,
InstanceId,
IoCManager,
UserFields,
mkSingleton,
} from '$public'
import {
HandlerFactory,
SettingsService,
@ -7,13 +14,6 @@ import {
mkPath,
mkString,
} from '$util'
import {
InstanceFields,
InstanceId,
IoCManager,
UserFields,
mkSingleton,
} from '@pockethost/common'
import { forEach } from '@s-libs/micro-dash'
import devcert from 'devcert'
import envPaths from 'env-paths'

View File

@ -0,0 +1 @@
export * from './public-api'

View File

@ -1,6 +1,6 @@
import { DATA_ROOT } from '$constants'
import { InstanceFields, Logger, PocketBase, newId } from '$public'
import { assert } from '$util'
import { InstanceFields, Logger, PocketBase, newId } from '@pockethost/common'
import { compact, map } from '@s-libs/micro-dash'
import {
Mode,

View File

@ -7,13 +7,8 @@ import {
SSL_CERT,
SSL_KEY,
} from '$constants'
import { LoggerService, PocketBase, mergeConfig, mkSingleton } from '$public'
import { exitHook } from '$util'
import {
LoggerService,
PocketBase,
mergeConfig,
mkSingleton,
} from '@pockethost/common'
import { keys, values } from '@s-libs/micro-dash'
import { readFileSync } from 'fs'
import { FtpSrv } from 'ftp-srv'

View File

@ -1,11 +1,11 @@
import { mkInstanceDataPath } from '$constants'
import { asyncExitHook } from '$util'
import {
LoggerService,
createCleanupManager,
mergeConfig,
stringify,
} from '@pockethost/common'
} from '$public'
import { asyncExitHook } from '$util'
import * as fs from 'fs'
import { Tail } from 'tail'
import * as winston from 'winston'

View File

@ -11,15 +11,6 @@ import {
mkDocUrl,
mkEdgeUrl,
} from '$constants'
import {
InstanceLogger,
MothershipAdminClientService,
PocketbaseService,
PortService,
SpawnConfig,
proxyService,
} from '$services'
import { asyncExitHook, mkInternalUrl, now } from '$util'
import {
CLEANUP_PRIORITY_LAST,
ClientResponseError,
@ -32,7 +23,16 @@ import {
createTimerManager,
mkSingleton,
stringify,
} from '@pockethost/common'
} from '$public'
import {
InstanceLogger,
MothershipAdminClientService,
PocketbaseService,
PortService,
SpawnConfig,
proxyService,
} from '$services'
import { asyncExitHook, mkInternalUrl, now } from '$util'
import { flatten, map, values } from '@s-libs/micro-dash'
import Bottleneck from 'bottleneck'
import { globSync } from 'glob'

View File

@ -7,7 +7,7 @@ import {
PocketBase,
UserFields,
UserId,
} from '@pockethost/common'
} from '$public'
import { forEach } from '@s-libs/micro-dash'
export const mkInstanceCache = (client: PocketBase) => {

View File

@ -5,7 +5,7 @@ import {
InstanceId,
InstanceStatus,
WithUser,
} from '@pockethost/common'
} from '$public'
import { MixinContext } from '.'
export type InstanceApi = ReturnType<typeof createInstanceMixin>

View File

@ -8,7 +8,7 @@ import {
RestMethods,
createRestHelper,
stringify,
} from '@pockethost/common'
} from '$public'
import { MixinContext } from '.'
import { createInstanceMixin } from './InstanceMIxin'

View File

@ -9,7 +9,7 @@ import {
PocketBase,
mergeConfig,
mkSingleton,
} from '@pockethost/common'
} from '$public'
import { createAdminPbClient } from './createAdminPbClient'
export type ClientServiceConfig = {

View File

@ -5,14 +5,14 @@ import {
mkContainerHomePath,
mkInstanceDataPath,
} from '$constants'
import { PortService } from '$services'
import { SyslogLogger, asyncExitHook, mkInternalUrl, tryFetch } from '$util'
import {
LoggerService,
SingletonBaseConfig,
createCleanupManager,
mkSingleton,
} from '@pockethost/common'
} from '$public'
import { PortService } from '$services'
import { SyslogLogger, asyncExitHook, mkInternalUrl, tryFetch } from '$util'
import { map } from '@s-libs/micro-dash'
import Docker, { Container, ContainerCreateOptions } from 'dockerode'
import { existsSync } from 'fs'

View File

@ -1,6 +1,6 @@
import { INITIAL_PORT_POOL_SIZE } from '$constants'
import { mergeConfig, mkSingleton } from '$public'
import { PromiseAllocator } from '$util'
import { mergeConfig, mkSingleton } from '@pockethost/common'
import getPort from 'get-port'
export type Config = { maxPorts: number }

View File

@ -1,11 +1,11 @@
import { DAEMON_PORT } from '$constants'
import { asyncExitHook } from '$util'
import {
Logger,
LoggerService,
SingletonBaseConfig,
mkSingleton,
} from '@pockethost/common'
} from '$public'
import { asyncExitHook } from '$util'
import cors from 'cors'
import express, { Request, Response } from 'express'
import 'express-async-errors'

View File

@ -5,7 +5,7 @@ import {
PocketBase,
SingletonBaseConfig,
stringify,
} from '@pockethost/common'
} from '$public'
import { text } from 'node:stream/consumers'
import { JsonifiableObject } from 'type-fest/source/jsonifiable'
import { InstanceLogger } from './InstanceLoggerService'

View File

@ -4,7 +4,7 @@ import {
mkSingleton,
serialAsyncExecutionGuard,
SingletonBaseConfig,
} from '@pockethost/common'
} from '$public'
import knex from 'knex'
export type SqliteServiceApi = ReturnType<typeof knex>

View File

@ -1,4 +1,4 @@
import { mkSingleton } from '@pockethost/common'
import { mkSingleton } from '$public'
import { boolean as castToBoolean } from 'boolean'
import { existsSync, mkdirSync } from 'fs'

View File

@ -1,5 +1,5 @@
import { SYSLOGD_PORT } from '$constants'
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import * as winston from 'winston'
import 'winston-syslog'

View File

@ -1,2 +1,2 @@
import { assert } from '@pockethost/common'
import { assert } from '$public'
export { assert }

View File

@ -1,5 +1,5 @@
import { DISCORD_ALERT_CHANNEL_URL } from '$constants'
import { stringify } from '@pockethost/common'
import { stringify } from '$public'
const cache: { [_: string]: NodeJS.Timeout } = {}

View File

@ -1,4 +1,4 @@
import { Logger } from '@pockethost/common'
import { Logger } from '$public'
import { exec } from 'child_process'
export const pexec = (logger: Logger) => (cmd: string) => {

View File

@ -1,4 +1,4 @@
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'
import fetch from 'node-fetch'
import { dirname } from 'path'

View File

@ -1,4 +1,4 @@
import { LoggerService } from '@pockethost/common'
import { LoggerService } from '$public'
import fetch, { Response } from 'node-fetch'
export const TRYFETCH_RETRY_MS = 50

View File

@ -17,6 +17,7 @@
"noEmit": true,
"baseUrl": ".",
"paths": {
"$public": ["./src/public-api"],
"$util": ["./src/util"],
"$services": ["./src/services"],
"$constants": ["./src/constants"],

View File

@ -14,7 +14,7 @@
"type": "module",
"devDependencies": {
"@microsoft/fetch-event-source": "https://github.com/pockethost/fetch-event-source.git#ebe3b7122647b48b93fd11effbbfb915d98956b0",
"@pockethost/common": "workspace:../common",
"pockethost": "workspace:../pockethost",
"@s-libs/micro-dash": "^16.1.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.25.2",

View File

@ -1,4 +1,4 @@
import { assertTruthy } from '@pockethost/common'
import { assertTruthy } from 'pockethost'
export const html = () => {
const htmlElement = document.querySelector('html')

View File

@ -1,11 +1,11 @@
import { createGenericSyncEvent } from '$util/events'
import { keys, map } from '@s-libs/micro-dash'
import {
BaseAuthStore,
ClientResponseError,
PocketBase,
type AuthModel,
} from '@pockethost/common'
import { keys, map } from '@s-libs/micro-dash'
} from 'pockethost'
export type AuthToken = string
export type AuthStoreProps = {

View File

@ -1,4 +1,4 @@
import { LoggerService, LogLevelName } from '@pockethost/common'
import { LoggerService, LogLevelName } from 'pockethost'
import { PUBLIC_DEBUG } from './env'
// Initiate the logging service

View File

@ -1,4 +1,4 @@
import { createCleanupManager } from '@pockethost/common'
import { createCleanupManager } from 'pockethost'
import { onDestroy } from 'svelte'
// TODO: Document this more

View File

@ -1,10 +1,6 @@
import { client } from '$src/pocketbase-client'
import {
loadPlugins,
type InstanceFields,
type InstanceId,
} from '@pockethost/common'
import consoleLogger from '@pockethost/plugin-console-logger'
import { loadPlugins, type InstanceFields, type InstanceId } from 'pockethost'
import { writable } from 'svelte/store'
// TODO: Removing this will cause the app to crash

Some files were not shown because too many files have changed in this diff Show More