mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
Feature/start tunnel (#3037)
* fix live-build resolv.conf * improved debuggability * wip: start-tunnel * fixes for trixie and tor * non-free-firmware on trixie * wip * web server WIP * wip: tls refactor * FE patchdb, mocks, and most endpoints * fix editing records and patch mocks * refactor complete * finish api * build and formatter update * minor change toi viewing addresses and fix build * fixes * more providers * endpoint for getting config * fix tests * api fixes * wip: separate port forward controller into parts * simplify iptables rules * bump sdk * misc fixes * predict next subnet and ip, use wan ips, and form validation * refactor: break big components apart and address todos (#3043) * refactor: break big components apart and address todos * starttunnel readme, fix pf mocks, fix adding tor domain in startos --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> * better tui * tui tweaks * fix: address comments * better regex for subnet * fixes * better validation * handle rpc errors * build fixes * fix: address comments (#3044) * fix: address comments * fix unread notification mocks * fix row click for notification --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> * fix raspi build * fix build * fix build * fix build * fix build * try to fix build * fix tests * fix tests * fix rsync tests * delete useless effectful test --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> Co-authored-by: Alex Inkin <alexander@inkin.ru>
This commit is contained in:
@@ -616,6 +616,7 @@ export class SubContainerRc<
|
||||
return this.subcontainer.guid
|
||||
}
|
||||
private destroyed = false
|
||||
private destroying: Promise<null> | null = null
|
||||
public constructor(
|
||||
private readonly subcontainer: SubContainerOwned<Manifest, Effects>,
|
||||
) {
|
||||
@@ -695,14 +696,16 @@ export class SubContainerRc<
|
||||
|
||||
get destroy() {
|
||||
return async () => {
|
||||
if (!this.destroyed) {
|
||||
if (!this.destroyed && !this.destroying) {
|
||||
const rcs = --this.subcontainer.rcs
|
||||
if (rcs <= 0) {
|
||||
await this.subcontainer.destroy()
|
||||
this.destroying = this.subcontainer.destroy()
|
||||
if (rcs < 0) console.error(new Error("UNREACHABLE: rcs < 0").stack)
|
||||
}
|
||||
this.destroyed = true
|
||||
}
|
||||
await this.destroying
|
||||
this.destroyed = true
|
||||
this.destroying = null
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,23 +573,23 @@ export class FileHelper<A> {
|
||||
/**
|
||||
* Create a File Helper for a .toml file
|
||||
*/
|
||||
static toml<A extends TOML.JsonMap>(
|
||||
static toml<A extends Record<string, unknown>>(
|
||||
path: ToPath,
|
||||
shape: Validator<TOML.JsonMap, A>,
|
||||
shape: Validator<Record<string, unknown>, A>,
|
||||
): FileHelper<A>
|
||||
static toml<A extends Transformed, Transformed = TOML.JsonMap>(
|
||||
static toml<A extends Transformed, Transformed = Record<string, unknown>>(
|
||||
path: ToPath,
|
||||
shape: Validator<Transformed, A>,
|
||||
transformers: Transformers<TOML.JsonMap, Transformed>,
|
||||
transformers: Transformers<Record<string, unknown>, Transformed>,
|
||||
): FileHelper<A>
|
||||
static toml<A extends Transformed, Transformed = TOML.JsonMap>(
|
||||
static toml<A extends Transformed, Transformed = Record<string, unknown>>(
|
||||
path: ToPath,
|
||||
shape: Validator<Transformed, A>,
|
||||
transformers?: Transformers<TOML.JsonMap, Transformed>,
|
||||
transformers?: Transformers<Record<string, unknown>, Transformed>,
|
||||
) {
|
||||
return FileHelper.rawTransformed<A, TOML.JsonMap, Transformed>(
|
||||
return FileHelper.rawTransformed<A, Record<string, unknown>, Transformed>(
|
||||
path,
|
||||
(inData) => TOML.stringify(inData),
|
||||
(inData) => TOML.stringify(inData as TOML.JsonMap),
|
||||
(inString) => TOML.parse(inString),
|
||||
(data) => shape.unsafeCast(data),
|
||||
transformers,
|
||||
|
||||
Reference in New Issue
Block a user