Skip to content

Commit

Permalink
chore: config add
Browse files Browse the repository at this point in the history
  • Loading branch information
mohameedsherif committed Aug 1, 2024
1 parent 8a7e0db commit fa2175c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import os from 'node:os'
import { log } from '@stacksjs/logging'
import { CAC } from 'cac'
import { version } from '../package.json'
import { type TlsConfig, addCertToSystemTrustStoreAndSaveCerts, createRootCA, generateCert } from '../src'
import { addCertToSystemTrustStoreAndSaveCerts, createRootCA, generateCert } from '../src'
import {config} from '../src/config'

const cli = new CAC('tlsx')

Expand All @@ -25,13 +26,14 @@ cli
.option('--verbose', 'Enable verbose logging', { default: false })
.usage('tlsx secure <domain> [options]')
.example('tlsx secure example.com --output /etc/ssl')
.action(async (domain: string, options?: Options, config?: TlsConfig) => {
domain = domain ?? options?.domain
.action(async (domain: string, options?: Options) => {

domain = domain ?? config?.ssl?.altNameURIs[0]

log.info(`Generating a self-signed SSL certificate for: ${domain}`)
log.debug('Options:', options)

console.log('Options:', config)
console.log(domain)

const CAcert = await createRootCA()

Expand Down

0 comments on commit fa2175c

Please sign in to comment.