Skip to content

Commit

Permalink
chore: several improvements
Browse files Browse the repository at this point in the history
chore: wip

chore: wip

chore: wip

chore: wip
  • Loading branch information
chrisbbreuer committed Dec 6, 2024
1 parent 022f58e commit 1e6266c
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 209 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"preview:docs": "vitepress preview docs"
},
"dependencies": {
"@stacksjs/tlsx": "^0.7.6"
"@stacksjs/tlsx": "^0.8.3"
},
"devDependencies": {
"@stacksjs/cli": "^0.68.2",
Expand Down
31 changes: 17 additions & 14 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import type { ReverseProxyConfig, ReverseProxyOptions } from './types'
import os from 'node:os'
import path from 'node:path'
import type { ReverseProxyConfig } from './types'
import { homedir } from 'node:os'
import { join } from 'node:path'
import { loadConfig } from 'bun-config'

export const defaultConfig: ReverseProxyConfig = {
from: 'localhost:5173',
to: 'stacks.localhost',
https: {
basePath: '',
caCertPath: join(homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
certPath: join(homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
keyPath: join(homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
},
etcHostsCleanup: true,
verbose: true,
}

// eslint-disable-next-line antfu/no-top-level-await
export const config: ReverseProxyConfig = await loadConfig({
name: 'reverse-proxy',
defaultConfig: {
from: 'localhost:5173',
to: 'stacks.localhost',
https: {
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
},
etcHostsCleanup: true,
verbose: true,
},
defaultConfig,
})
Loading

0 comments on commit 1e6266c

Please sign in to comment.