mirror of
https://github.com/pockethost/pockethost.git
synced 2025-05-28 09:46:46 +00:00
chore: refactor includes
This commit is contained in:
parent
d1c25e0d47
commit
f4be4318c4
@ -7,19 +7,19 @@ import {
|
||||
TRACE,
|
||||
} from '$constants'
|
||||
import {
|
||||
centralDbService,
|
||||
clientService,
|
||||
ftpService,
|
||||
instanceService,
|
||||
ipWhitelistService,
|
||||
pocketbaseService,
|
||||
proxyService,
|
||||
realtimeLog,
|
||||
rpcService,
|
||||
sqliteService,
|
||||
updaterService,
|
||||
} from '$services'
|
||||
import { LoggerService } from '@pockethost/common'
|
||||
import { centralDbService } from './services/CentralDbService'
|
||||
import { ipWhitelistService } from './services/IpWhitelistService'
|
||||
import { updaterService } from './services/UpdaterService/UpdaterService'
|
||||
// gen:import
|
||||
|
||||
const [major, minor, patch] = process.versions.node.split('.').map(Number)
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { DAEMON_PB_DATA_DIR } from '$constants'
|
||||
import { PocketbaseClientApi } from '$services'
|
||||
import { assert } from '$util'
|
||||
import { InstanceFields, Logger } from '@pockethost/common'
|
||||
import { compact, map } from '@s-libs/micro-dash'
|
||||
@ -13,13 +14,12 @@ import {
|
||||
import { FileStat, FileSystem, FtpConnection } from 'ftp-srv'
|
||||
import { customAlphabet } from 'nanoid'
|
||||
import { isAbsolute, join, normalize, resolve, sep } from 'path'
|
||||
import { PocketbaseClientApi } from '../clientService/PbClient'
|
||||
import {
|
||||
FolderNames,
|
||||
INSTANCE_ROOT_FOLDER_NAMES,
|
||||
MAINTENANCE_ONLY_FOLDER_NAMES,
|
||||
isInstanceRootFolder,
|
||||
} from './FtpService'
|
||||
} from '.'
|
||||
import * as fsAsync from './fs-async'
|
||||
|
||||
const nanoid = customAlphabet(`abcdefghijklmnop`)
|
||||
|
@ -4,7 +4,13 @@ import {
|
||||
mkDocUrl,
|
||||
PUBLIC_MOTHERSHIP_NAME,
|
||||
} from '$constants'
|
||||
import { clientService, proxyService } from '$services'
|
||||
import {
|
||||
clientService,
|
||||
InstanceLogger,
|
||||
pocketbaseService,
|
||||
port,
|
||||
proxyService,
|
||||
} from '$services'
|
||||
import { mkInternalUrl, now } from '$util'
|
||||
import {
|
||||
assertTruthy,
|
||||
@ -22,9 +28,6 @@ import { map, values } from '@s-libs/micro-dash'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import { ClientResponseError } from 'pocketbase'
|
||||
import { AsyncReturnType } from 'type-fest'
|
||||
import { InstanceLogger } from '../InstanceLoggerService'
|
||||
import { pocketbaseService } from '../PocketBaseService/PocketBaseService'
|
||||
import { port } from '../PortManager'
|
||||
|
||||
enum InstanceApiStatus {
|
||||
Starting = 'starting',
|
@ -1,4 +1,5 @@
|
||||
import { DAEMON_IPCIDR_LIST } from '$constants'
|
||||
import { proxyService } from '$services'
|
||||
import { assert } from '$util'
|
||||
import {
|
||||
LoggerService,
|
||||
@ -6,7 +7,6 @@ import {
|
||||
SingletonBaseConfig,
|
||||
} from '@pockethost/common'
|
||||
import IPCIDR from 'ip-cidr'
|
||||
import { proxyService } from '../ProxyService'
|
||||
export type IpWhitelistServiceConfig = SingletonBaseConfig & {
|
||||
ipRanges: string[]
|
||||
}
|
||||
|
@ -4,17 +4,15 @@ import {
|
||||
mkInstanceDataPath,
|
||||
PUBLIC_DEBUG,
|
||||
} from '$constants'
|
||||
import { port as getPort } from '$services'
|
||||
import { assert, mkInternalUrl, tryFetch } from '$util'
|
||||
import { port as getPort, InstanceLogger, updaterService } from '$services'
|
||||
import { assert, AsyncContext, mkInternalUrl, tryFetch } from '$util'
|
||||
import {
|
||||
createCleanupManager,
|
||||
createTimerManager,
|
||||
InvocationPid,
|
||||
} from '@pockethost/common'
|
||||
import {
|
||||
mkSingleton,
|
||||
SingletonBaseConfig,
|
||||
} from '@pockethost/common/src/mkSingleton'
|
||||
} from '@pockethost/common'
|
||||
import { map } from '@s-libs/micro-dash'
|
||||
import Docker, { Container, ContainerCreateOptions } from 'dockerode'
|
||||
import { existsSync } from 'fs'
|
||||
@ -22,9 +20,6 @@ import MemoryStream from 'memorystream'
|
||||
import { dirname } from 'path'
|
||||
import { gte } from 'semver'
|
||||
import { AsyncReturnType } from 'type-fest'
|
||||
import { AsyncContext } from '../../util/AsyncContext'
|
||||
import { InstanceLogger } from '../InstanceLoggerService'
|
||||
import { updaterService } from '../UpdaterService/UpdaterService'
|
||||
|
||||
export type PocketbaseCommand = 'serve' | 'migrate'
|
||||
export type Env = { [_: string]: string }
|
@ -1,3 +1,9 @@
|
||||
import {
|
||||
clientService,
|
||||
instanceService,
|
||||
rpcService,
|
||||
updaterService,
|
||||
} from '$services'
|
||||
import {
|
||||
CreateInstancePayload,
|
||||
CreateInstancePayloadSchema,
|
||||
@ -20,10 +26,6 @@ import {
|
||||
type SetInstanceMaintenanceResult,
|
||||
} from '@pockethost/common'
|
||||
import { valid, validRange } from 'semver'
|
||||
import { instanceService } from '../InstanceService/InstanceService'
|
||||
import { updaterService } from '../UpdaterService/UpdaterService'
|
||||
import { clientService } from '../clientService/clientService'
|
||||
import { rpcService } from './RpcService'
|
||||
|
||||
export const registerRpcCommands = async (logger: Logger) => {
|
||||
const { client } = await clientService()
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { MixinContext } from '$services'
|
||||
import { AsyncContext } from '$util'
|
||||
import {
|
||||
INSTANCE_COLLECTION,
|
||||
InstanceFields,
|
||||
@ -9,8 +11,6 @@ import {
|
||||
} from '@pockethost/common'
|
||||
import { reduce } from '@s-libs/micro-dash'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import { AsyncContext } from '../../util/AsyncContext'
|
||||
import { MixinContext } from './PbClient'
|
||||
|
||||
export type InstanceApi = ReturnType<typeof createInstanceMixin>
|
||||
|
||||
|
2
packages/daemon/src/services/clientService/index.ts
Normal file
2
packages/daemon/src/services/clientService/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './PbClient'
|
||||
export * from './clientService'
|
@ -1,10 +1,13 @@
|
||||
export * from './FtpService/FtpService'
|
||||
export * from './InstanceService/InstanceService'
|
||||
export * from './PocketBaseService/PocketBaseService'
|
||||
export * from './CentralDbService'
|
||||
export * from './FtpService'
|
||||
export * from './InstanceLoggerService'
|
||||
export * from './InstanceService'
|
||||
export * from './IpWhitelistService'
|
||||
export * from './PocketBaseService'
|
||||
export * from './PortManager'
|
||||
export * from './ProxyService'
|
||||
export * from './RealtimeLog'
|
||||
export * from './RpcService/RpcService'
|
||||
export * from './SqliteService/SqliteService'
|
||||
export * from './clientService/PbClient'
|
||||
export * from './clientService/clientService'
|
||||
export * from './RpcService'
|
||||
export * from './SqliteService'
|
||||
export * from './UpdaterService'
|
||||
export * from './clientService'
|
||||
|
@ -1,3 +1,4 @@
|
||||
export * from './AsyncContext'
|
||||
export * from './PromiseAllocator'
|
||||
export * from './assert'
|
||||
export * from './downloadAndExtract'
|
||||
|
Loading…
x
Reference in New Issue
Block a user