Skip to content

Commit 6dfbe52

Browse files
chore: fix lint errors
1 parent 664ea19 commit 6dfbe52

24 files changed

Lines changed: 252 additions & 173 deletions

.config/pickier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const config: PickierConfig = {
1616
],
1717

1818
lint: {
19-
extensions: ['ts', 'js'],
19+
extensions: ['ts', 'js', 'md'],
2020
reporter: 'stylish',
2121
cache: false,
2222
maxWarnings: -1,

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changelog
2+
23
[Compare changes](https://github.com/stacksjs/tlsx/compare/v0.12.0...v0.13.0)
34

4-
### 🧹 Chores
5+
## 🧹 Chores
56

67
- release v0.13.0 ([fa88a16](https://github.com/stacksjs/tlsx/commit/fa88a16)) _(by glennmichael123 <gtorregosa@gmail.com>)_
78
- wip ([eaebc81](https://github.com/stacksjs/tlsx/commit/eaebc81)) _(by glennmichael123 <gtorregosa@gmail.com>)_

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ const cert = await generateCertificate({
6060

6161
// Generate a certificate for multiple domains
6262
const multiDomainCert = await generateCertificate({
63-
domains: ['example.com', 'api.example.com', '*.example.com'],
63+
domains: ['example.com', 'api.example.com', '_.example.com'],
6464
rootCA: existingCA,
6565
validityDays: 365,
6666
})
6767

6868
// Generate a certificate with both primary domain and additional domains
6969
const combinedCert = await generateCertificate({
7070
domain: 'example.com',
71-
domains: ['api.example.com', '*.example.com'],
71+
domains: ['api.example.com', '_.example.com'],
7272
rootCA: existingCA,
7373
validityDays: 365,
7474
})
@@ -96,10 +96,10 @@ await cleanupTrustStore({}, 'My Custom Pattern')
9696
tlsx secure example.com
9797

9898
# Generate certificate for multiple domains
99-
tlsx secure -d "example.com,api.example.com,*.example.com"
99+
tlsx secure -d "example.com,api.example.com,_.example.com"
100100

101101
# Generate certificate with primary domain and additional domains
102-
tlsx secure example.com -d "api.example.com,*.example.com"
102+
tlsx secure example.com -d "api.example.com,_.example.com"
103103

104104
# Generate certificate with custom validity and organization
105105
tlsx secure example.com --validity-days 365 --organization-name "My Company"

docs/advanced/certificate-authority.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`tlsx` allows you to create and manage your own Certificate Authority (CA) for signing local development certificates.
44

5-
## What is a Certificate Authority?
5+
## What is a Certificate Authority
66

77
A Certificate Authority (CA) is an entity that issues digital certificates. Each certificate verifies the ownership of a public key by the named subject of the certificate. In the context of `tlsx`, a local CA is created to sign certificates for your development domains, enabling them to be trusted by your system.
88

docs/advanced/ci-cd-integration.md

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,31 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29+
2930
- uses: actions/checkout@v4
3031

3132
- uses: oven-sh/setup-bun@v1
33+
3234
with:
3335
bun-version: latest
3436

3537
- name: Install dependencies
38+
3639
run: bun install
3740

3841
- name: Generate certificates
42+
3943
run: |
4044
bunx @stacksjs/tlsx secure app.localhost
4145
4246
- name: Start server with HTTPS
47+
4348
run: |
4449
bun run start &
4550
sleep 5
4651
4752
- name: Run tests
53+
4854
run: bun test
4955
```
5056
@@ -60,11 +66,13 @@ jobs:
6066
runs-on: ubuntu-latest
6167

6268
steps:
69+
6370
- uses: actions/checkout@v4
6471

6572
- uses: oven-sh/setup-bun@v1
6673

6774
- name: Cache certificates
75+
6876
uses: actions/cache@v3
6977
with:
7078
path: ~/.stacks/ssl
@@ -73,12 +81,14 @@ jobs:
7381
${{ runner.os }}-certs-
7482
7583
- name: Generate certificates (if not cached)
84+
7685
run: |
7786
if [ ! -f ~/.stacks/ssl/app.localhost.crt ]; then
7887
bunx @stacksjs/tlsx secure app.localhost
7988
fi
8089
8190
- name: Run tests
91+
8292
run: bun test
8393
```
8494
@@ -94,11 +104,13 @@ jobs:
94104
runs-on: ubuntu-latest
95105

96106
steps:
107+
97108
- uses: actions/checkout@v4
98109

99110
- uses: oven-sh/setup-bun@v1
100111

101112
- name: Generate certificates
113+
102114
run: |
103115
cat > tlsx.config.ts << 'EOF'
104116
export default {
@@ -112,6 +124,7 @@ jobs:
112124
bunx @stacksjs/tlsx generate
113125
114126
- name: Run E2E tests
127+
115128
run: bun run test:e2e
116129
```
117130
@@ -122,6 +135,7 @@ jobs:
122135
```yaml
123136
# .gitlab-ci.yml
124137
stages:
138+
125139
- test
126140

127141
variables:
@@ -134,12 +148,15 @@ test:
134148
cache:
135149
key: ${CI_COMMIT_REF_SLUG}-certs
136150
paths:
151+
137152
- .ssl/
138153

139154
script:
155+
140156
- bun install
141157
- bunx @stacksjs/tlsx secure app.localhost --cert-path $TLSX_CERT_PATH
142158
- bun test
159+
143160
```
144161

145162
### With Services
@@ -150,15 +167,20 @@ test:
150167
image: oven/bun:latest
151168

152169
services:
170+
153171
- name: postgres:15
172+
154173
alias: db
155174

156175
before_script:
176+
157177
- bun install
158178
- bunx @stacksjs/tlsx secure app.localhost
159179

160180
script:
181+
161182
- bun run test:integration
183+
162184
```
163185

164186
## CircleCI
@@ -170,37 +192,49 @@ version: 2.1
170192
jobs:
171193
test:
172194
docker:
195+
173196
- image: oven/bun:latest
174197

175198
steps:
199+
176200
- checkout
177201

178202
- restore_cache:
203+
179204
keys:
205+
180206
- certs-{{ checksum "tlsx.config.ts" }}
181207
- certs-
182208

183209
- run:
210+
184211
name: Install dependencies
185212
command: bun install
186213

187214
- run:
215+
188216
name: Generate certificates
189217
command: bunx @stacksjs/tlsx secure app.localhost
190218

191219
- save_cache:
220+
192221
paths:
222+
193223
- ~/.stacks/ssl
224+
194225
key: certs-{{ checksum "tlsx.config.ts" }}
195226

196227
- run:
228+
197229
name: Run tests
198230
command: bun test
199231

200232
workflows:
201233
test:
202234
jobs:
235+
203236
- test
237+
204238
```
205239

206240
## Docker Integration
@@ -240,15 +274,20 @@ services:
240274
app:
241275
build: .
242276
volumes:
277+
243278
- certs:/app/.ssl
279+
244280
environment:
281+
245282
- SSL_CERT=/app/.ssl/app.localhost.crt
246283
- SSL_KEY=/app/.ssl/app.localhost.key
247284

248285
cert-generator:
249286
image: oven/bun:latest
250287
volumes:
288+
251289
- certs:/ssl
290+
252291
command: bunx @stacksjs/tlsx secure app.localhost --cert-path /ssl
253292
restart: "no"
254293

@@ -291,19 +330,27 @@ spec:
291330
template:
292331
spec:
293332
containers:
333+
294334
- name: tlsx
335+
295336
image: oven/bun:latest
296337
command:
338+
297339
- sh
298340
- -c
299341
- |
342+
300343
bun add -g @stacksjs/tlsx
301344
bunx @stacksjs/tlsx secure app.localhost --cert-path /certs
302345
volumeMounts:
346+
303347
- name: certs
348+
304349
mountPath: /certs
305350
volumes:
351+
306352
- name: certs
353+
307354
emptyDir: {}
308355
restartPolicy: Never
309356
```
@@ -330,7 +377,7 @@ data:
330377
331378
```bash
332379
# .husky/pre-commit
333-
#!/bin/sh
380+
# !/bin/sh
334381

335382
# Check if certificates need renewal
336383
bunx @stacksjs/tlsx check --quiet
@@ -412,23 +459,27 @@ name: Certificate Renewal
412459

413460
on:
414461
schedule:
415-
- cron: '0 0 1 * *' # Monthly
462+
463+
- cron: '0 0 1 _ _' # Monthly
416464

417465
jobs:
418466
renew:
419467
runs-on: ubuntu-latest
420468

421469
steps:
470+
422471
- uses: actions/checkout@v4
423472

424473
- uses: oven-sh/setup-bun@v1
425474

426475
- name: Check and renew certificates
476+
427477
run: |
428478
bunx @stacksjs/tlsx check
429479
bunx @stacksjs/tlsx renew --threshold 30
430480
431481
- name: Commit renewed certificates
482+
432483
run: |
433484
git config user.name "github-actions[bot]"
434485
git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -443,7 +494,9 @@ jobs:
443494
444495
```yaml
445496
# Use secrets for sensitive data
497+
446498
- name: Generate certificates
499+
447500
env:
448501
CA_PASSWORD: ${{ secrets.CA_PASSWORD }}
449502
run: |
@@ -455,12 +508,14 @@ jobs:
455508
456509
```yaml
457510
# Don't upload private keys as artifacts
511+
458512
- uses: actions/upload-artifact@v3
513+
459514
with:
460515
name: certificates
461516
path: |
462-
.ssl/*.crt
463-
!.ssl/*.key # Exclude private keys
517+
.ssl/_.crt
518+
!.ssl/_.key # Exclude private keys
464519
```
465520
466521
## Troubleshooting
@@ -474,7 +529,9 @@ jobs:
474529
### Debug Mode
475530
476531
```yaml
532+
477533
- name: Generate certificates (debug)
534+
478535
run: |
479536
bunx @stacksjs/tlsx secure app.localhost --verbose
480537
env:

docs/advanced/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export default {
282282
```
283283

284284
Recommended key sizes:
285+
285286
- **2048**: Standard, good balance
286287
- **3072**: Enhanced security
287288
- **4096**: Maximum security (slower)

docs/advanced/custom-cas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ COPY ./ca/team-ca.crt /usr/local/share/ca-certificates/
225225
# Update trust store
226226
RUN update-ca-certificates
227227

228-
# Your app...
228+
# Your app
229229
```
230230

231231
### Kubernetes Secret

0 commit comments

Comments
 (0)