Skip to content

Commit 38e2d93

Browse files
committed
feat(scripts): add cert management scripts
1 parent b8be9d8 commit 38e2d93

File tree

11 files changed

+182
-74
lines changed

11 files changed

+182
-74
lines changed

Diff for: editors/vscode/settings.json

+7-68
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"[markdown]": {
2424
"editor.defaultFormatter": "esbenp.prettier-vscode"
2525
},
26+
"[shellscript]": {
27+
"editor.defaultFormatter": "foxundermoon.shell-format"
28+
},
2629
"[typescript]": {
2730
"editor.defaultFormatter": "esbenp.prettier-vscode"
2831
},
@@ -171,73 +174,9 @@
171174
},
172175
"editor.wordWrap": "off",
173176
"errorLens.excludeBySource": ["cSpell"],
174-
"eslint.run": "onSave",
175177
"explorer.compactFolders": false,
176178
"explorer.confirmDelete": false,
177179
"explorer.confirmDragAndDrop": false,
178-
"explorer.fileNesting.enabled": true,
179-
"explorer.fileNesting.expand": false,
180-
"explorer.fileNesting.patterns": {
181-
"*.asax": "$(capture).*.cs, $(capture).*.vb",
182-
"*.ascx": "$(capture).*.cs, $(capture).*.vb",
183-
"*.ashx": "$(capture).*.cs, $(capture).*.vb",
184-
"*.aspx": "$(capture).*.cs, $(capture).*.vb",
185-
"*.bloc.dart": "$(capture).event.dart, $(capture).state.dart",
186-
"*.c": "$(capture).h",
187-
"*.cc": "$(capture).hpp, $(capture).h, $(capture).hxx",
188-
"*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.css, $(capture).component.scss, $(capture).component.sass, $(capture).component.less",
189-
"*.cpp": "$(capture).hpp, $(capture).h, $(capture).hxx",
190-
"*.cshtml": "$(capture).cshtml.cs",
191-
"*.csproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
192-
"*.css": "$(capture).css.map, $(capture).*.css",
193-
"*.cxx": "$(capture).hpp, $(capture).h, $(capture).hxx",
194-
"*.dart": "$(capture).freezed.dart, $(capture).g.dart",
195-
"*.ex": "$(capture).html.eex, $(capture).html.heex, $(capture).html.leex",
196-
"*.java": "$(capture).class",
197-
"*.js": "$(capture).js.map, $(capture).*.js, $(capture)_*.js",
198-
"*.jsx": "$(capture).js, $(capture).*.jsx, $(capture)_*.js, $(capture)_*.jsx",
199-
"*.master": "$(capture).*.cs, $(capture).*.vb",
200-
"*.module.ts": "$(capture).resolver.ts, $(capture).controller.ts, $(capture).service.ts",
201-
"*.pubxml": "$(capture).pubxml.user",
202-
"*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb",
203-
"*.tex": "$(capture).acn, $(capture).acr, $(capture).alg, $(capture).aux, $(capture).bbl, $(capture).blg, $(capture).fdb_latexmk, $(capture).fls, $(capture).glg, $(capture).glo, $(capture).gls, $(capture).idx, $(capture).ind, $(capture).ist, $(capture).lof, $(capture).log, $(capture).lot, $(capture).out, $(capture).pdf, $(capture).synctex.gz, $(capture).toc, $(capture).xdv",
204-
"*.ts": "$(capture).js, $(capture).d.ts.map, $(capture).*.ts, $(capture)_*.js, $(capture)_*.ts",
205-
"*.tsx": "$(capture).ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx",
206-
"*.vbproj": "*.config, *proj.user, appsettings.*, bundleconfig.json",
207-
"*.vue": "$(capture).*.ts, $(capture).*.js, $(capture).story.vue",
208-
"*.xaml": "$(capture).xaml.cs",
209-
".clang-tidy": ".clang-format, .clangd, compile_commands.json",
210-
".env": "*.env, .env.*, .envrc, env.d.ts",
211-
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
212-
".project": ".classpath",
213-
"BUILD.bazel": "*.bzl, *.bazel, *.bazelrc, bazel.rc, .bazelignore, .bazelproject, WORKSPACE",
214-
"CMakeLists.txt": "*.cmake, *.cmake.in, .cmake-format.yaml, CMakePresets.json",
215-
"artisan": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, server.php, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, webpack.mix.js, windi.config.*",
216-
"astro.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
217-
"cargo.toml": ".clippy.toml, .rustfmt.toml, cargo.lock, clippy.toml, cross.toml, rust-toolchain.toml, rustfmt.toml",
218-
"composer.json": ".php*.cache, composer.lock, phpunit.xml*, psalm*.xml",
219-
"default.nix": "shell.nix",
220-
"deno.json*": "*.env, .env.*, .envrc, api-extractor.json, env.d.ts, import-map.json, import_map.json, jsconfig.*, tsconfig.*, tsdoc.*",
221-
"docker-compose.*": ".dockerignore, dockerfile, dockerfile*",
222-
"flake.nix": "flake.lock",
223-
"gatsby-config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, gatsby-browser.*, gatsby-node.*, gatsby-ssr.*, gatsby-transformer.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
224-
"gemfile": ".ruby-version, gemfile.lock",
225-
"go.mod": ".air*, go.sum",
226-
"mix.exs": ".credo.exs, .dialyzer_ignore.exs, .formatter.exs, .iex.exs, .tool-versions, mix.lock",
227-
"next.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, next-env.d.ts, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
228-
"nuxt.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
229-
"package.json": ".browserslist*, .circleci*, .codecov, .commitlint*, .cz-config.js, .czrc, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lighthouserc.*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, api-extractor.json, apollo.config.*, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.*, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, histoire.config.*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lighthouserc.*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, package.nls*.json, phpcs.xml, playwright.config.*, pm2.*, pnpm*, prettier*, pullapprove*, puppeteer.config.*, pyrightconfig.json, release-tasks.sh, renovate*, rollup.config.*, stylelint*, tsconfig.*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, vitest.config.*, webpack*, workspace.json, xo.config.*, yarn*, .ncurc.js, .htmlhint*, nyc.config.js, .swcrc",
230-
"pubspec.yaml": ".metadata, .packages, all_lint_rules.yaml, analysis_options.yaml, build.yaml, pubspec.lock",
231-
"pyproject.toml": ".pdm.toml, pdm.lock, pyproject.toml",
232-
"quasar.conf.js": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, quasar.extensions.json, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
233-
"readme*": "authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors*, todo*",
234-
"remix.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, remix.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
235-
"rush.json": ".browserslist*, .circleci*, .codecov, .commitlint*, .cz-config.js, .czrc, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lighthouserc.*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, api-extractor.json, apollo.config.*, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.*, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, histoire.config.*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lighthouserc.*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, package.nls*.json, phpcs.xml, playwright.config.*, pm2.*, pnpm*, prettier*, pullapprove*, puppeteer.config.*, pyrightconfig.json, release-tasks.sh, renovate*, rollup.config.*, stylelint*, tsconfig.*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, vitest.config.*, webpack*, workspace.json, xo.config.*, yarn*",
236-
"shims.d.ts": "*.d.ts",
237-
"svelte.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, mdsvex.config.js, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
238-
"vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
239-
"vue.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*"
240-
},
241180
"files.associations": {
242181
".env*": "dotenv"
243182
},
@@ -246,6 +185,8 @@
246185
"files.insertFinalNewline": true,
247186
"git-graph.tabIconColourTheme": "grey",
248187
"git.autofetch": true,
188+
"git.blame.editorDecoration.enabled": true,
189+
"git.blame.statusBarItem.enabled": true,
249190
"git.openRepositoryInParentFolders": "never",
250191
"github.copilot.enable": {
251192
"*": true,
@@ -301,6 +242,7 @@
301242
"Q_NEW_SESSION": "1"
302243
},
303244
"terminal.integrated.fontFamily": "Delugia",
245+
"terminal.integrated.fontLigatures": true,
304246
"terminal.integrated.fontSize": 16,
305247
"terminal.integrated.stickyScroll.enabled": true,
306248
"todo-tree.general.tags": [
@@ -339,8 +281,5 @@
339281
"workbench.startupEditor": "none",
340282
"workbench.statusBar.visible": true,
341283
"workbench.tree.enableStickyScroll": true,
342-
"workbench.tree.indent": 20,
343-
"[shellscript]": {
344-
"editor.defaultFormatter": "foxundermoon.shell-format"
345-
}
284+
"workbench.tree.indent": 20
346285
}

Diff for: os/common/ghostty/config

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
background-blur-radius = 20
2+
background-opacity = 0.95
3+
confirm-close-surface = false
4+
cursor-style = bar
5+
font-family = Delugia
6+
font-size = 16
7+
font-thicken = true
8+
macos-titlebar-style = hidden
9+
quit-after-last-window-closed = true
10+
shell-integration = detect
11+
theme = GruvboxDark
12+
window-decoration = true
13+
window-height = 22
14+
window-padding-balance = true
15+
window-padding-x = 20
16+
window-padding-y = 20
17+
window-theme = ghostty
18+
window-width = 80

Diff for: os/mac/brew/Brewfile

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ brew "tre-command"
8080
brew "ctop"
8181
brew "gping"
8282
brew "thefuck"
83+
brew "cleanclip"
84+
brew "step"
8385
cask "raycast"
8486
cask "docker"
8587
cask "notion"
@@ -100,3 +102,6 @@ cask "fig"
100102
cask "visual-studio-code"
101103
cask "wezterm"
102104
cask "brave-browser"
105+
cask "keepingyouawake"
106+
cask "hiddenbar"
107+
cask "ghostty"

Diff for: os/mac/iterm/com.googlecode.iterm2.plist

+5-3
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,7 @@
20352035
<key>HideMenuBarInFullscreen</key>
20362036
<false/>
20372037
<key>HideScrollbar</key>
2038-
<false/>
2038+
<true/>
20392039
<key>HideTab</key>
20402040
<true/>
20412041
<key>HideTabCloseButton</key>
@@ -2840,7 +2840,7 @@
28402840
<key>Blur</key>
28412841
<true/>
28422842
<key>Blur Radius</key>
2843-
<real>20.445611702127664</real>
2843+
<real>64</real>
28442844
<key>Bold Color</key>
28452845
<dict>
28462846
<key>Alpha Component</key>
@@ -3037,6 +3037,8 @@
30373037
<true/>
30383038
<key>Draw Powerline Glyphs</key>
30393039
<false/>
3040+
<key>Faint Text Alpha</key>
3041+
<real>0.50319940476190472</real>
30403042
<key>Flashing Bell</key>
30413043
<true/>
30423044
<key>Foreground Color</key>
@@ -3408,7 +3410,7 @@
34083410
<key>Title Components</key>
34093411
<integer>4</integer>
34103412
<key>Transparency</key>
3411-
<real>0.053382646276595745</real>
3413+
<real>0.10310267857142859</real>
34123414
<key>Triggers</key>
34133415
<array/>
34143416
<key>Unicode Version</key>

Diff for: scripts/cert/get

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source "$DOTFILES_PATH/scripts/core/_main.sh"
6+
7+
##? Retrieve the certificate bundle for a given server
8+
##?
9+
##? Usage:
10+
##? get <remote_service_url>
11+
docs::parse "$@"
12+
13+
# openssl s_client -showcerts -connect $1:$2 </dev/null 2>&1 | sed -n -e '/-.BEGIN/,/-.END/ p' | tee >(pbcopy)
14+
15+
step certificate inspect --insecure --bundle --short --format=text $1
16+
echo
17+
echo
18+
step certificate inspect --insecure --bundle --format=pem $1

Diff for: scripts/cert/selfsigned

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source "$DOTFILES_PATH/scripts/core/_main.sh"
6+
7+
COLOR_RED="\033[31m"
8+
COLOR_GREEN="\033[32m"
9+
COLOR_YELLOW="\033[33m"
10+
COLOR_BLUE="\033[34m"
11+
COLOR_CYAN="\033[36m"
12+
COLOR_RESET="\033[0m"
13+
14+
_print_summary() {
15+
echo -e "${COLOR_YELLOW}=== Summary of Input ===${COLOR_RESET}"
16+
echo -e "${COLOR_CYAN}Certificate Name:${COLOR_RESET} $certificate_name"
17+
echo -e "${COLOR_CYAN}Common Name (CN):${COLOR_RESET} $common_name"
18+
echo -e "${COLOR_CYAN}Subject Alternative Names (SANs):${COLOR_RESET} ${subject_alternative_names[*]}"
19+
echo -e "${COLOR_CYAN}Organizational Unit:${COLOR_RESET} $organizational_unit"
20+
echo -e "${COLOR_CYAN}Organization:${COLOR_RESET} $organization"
21+
echo -e "${COLOR_CYAN}Locality:${COLOR_RESET} $locality"
22+
echo -e "${COLOR_CYAN}Province:${COLOR_RESET} $province"
23+
echo -e "${COLOR_CYAN}Country:${COLOR_RESET} $country"
24+
echo -e "${COLOR_CYAN}Certificate Duration (Not After):${COLOR_RESET} $certificate_duration hours"
25+
}
26+
27+
_print_success() {
28+
echo -e "${COLOR_GREEN}Certificate successfully created: ${COLOR_BLUE}${certificate_name}.crt ${COLOR_GREEN}and ${COLOR_BLUE}${certificate_name}.key${COLOR_RESET}"
29+
}
30+
31+
read -p "$(echo -e "${COLOR_CYAN}Enter the Certificate Name (without extension): ${COLOR_RESET}")" certificate_name
32+
read -p "$(echo -e "${COLOR_CYAN}Enter the Common Name (CN): ${COLOR_RESET}")" common_name
33+
34+
echo -e "${COLOR_CYAN}Enter the Subject Alternative Names (SANs), separated by commas (e.g., www.example.com, api.example.com):${COLOR_RESET}"
35+
read subject_alternative_names_input
36+
37+
read -p "$(echo -e "${COLOR_CYAN}Enter the Organizational Unit [Default: Clancy]: ${COLOR_RESET}")" organizational_unit
38+
organizational_unit=${organizational_unit:-Clancy}
39+
40+
read -p "$(echo -e "${COLOR_CYAN}Enter the Organization [Default: Dema]: ${COLOR_RESET}")" organization
41+
organization=${organization:-Dema}
42+
43+
read -p "$(echo -e "${COLOR_CYAN}Enter the Locality [Default: Ordes]: ${COLOR_RESET}")" locality
44+
locality=${locality:-Ordes}
45+
46+
read -p "$(echo -e "${COLOR_CYAN}Enter the Province [Default: A Coruña]: ${COLOR_RESET}")" province
47+
province=${province:-A Coruña}
48+
49+
read -p "$(echo -e "${COLOR_CYAN}Enter the Country [Default: Spain]: ${COLOR_RESET}")" country
50+
country=${country:-Spain}
51+
52+
read -p "$(echo -e "${COLOR_CYAN}Enter the Certificate Duration in hours [Default: 87600]: ${COLOR_RESET}")" certificate_duration
53+
certificate_duration=${certificate_duration:-87600}
54+
55+
IFS=',' read -ra subject_alternative_names_raw <<<"$subject_alternative_names_input"
56+
subject_alternative_names=()
57+
san_arguments=()
58+
for san in "${subject_alternative_names_raw[@]}"; do
59+
trimmed_san="$(echo "$san" | xargs)"
60+
subject_alternative_names+=("$trimmed_san")
61+
san_arguments+=(--san "$trimmed_san")
62+
done
63+
64+
certificate_template=$(
65+
cat <<EOF
66+
{
67+
"subject": {
68+
"commonName": "$common_name",
69+
"organizationalUnit": "$organizational_unit",
70+
"organization": "$organization",
71+
"locality": "$locality",
72+
"province": "$province",
73+
"country": "$country"
74+
},
75+
"sans": {{ toJson .SANs }},
76+
{{- if typeIs "*rsa.PublicKey" .Insecure.CR.PublicKey }}
77+
"keyUsage": ["keyEncipherment", "digitalSignature"],
78+
{{- else }}
79+
"keyUsage": ["digitalSignature"],
80+
{{- end }}
81+
"extKeyUsage": ["serverAuth", "clientAuth"],
82+
"basicConstraints": {
83+
"isCA": false
84+
}
85+
}
86+
EOF
87+
)
88+
89+
echo
90+
_print_summary
91+
echo
92+
93+
read -p "$(echo -e "${COLOR_YELLOW}Confirm and generate the certificate? [y/N]: ${COLOR_RESET}")" confirm_generation
94+
if [[ "${confirm_generation,,}" != "y" ]]; then
95+
echo -e "${COLOR_RED}Aborted.${COLOR_RESET}"
96+
exit 0
97+
fi
98+
99+
echo
100+
101+
step certificate create "$common_name" "${certificate_name}.crt" "${certificate_name}.key" \
102+
--subtle \
103+
--insecure \
104+
--no-password \
105+
--kty RSA \
106+
--size 2048 \
107+
--not-before -1h \
108+
--not-after "${certificate_duration}h" \
109+
--template <(echo "$certificate_template") \
110+
"${san_arguments[@]}"
111+
112+
echo
113+
114+
step certificate inspect --insecure --bundle --short --format=text "${certificate_name}.crt"
115+
116+
echo
117+
118+
_print_success

Diff for: shell/aliases.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ alias lzd="lazydocker"
3131
alias dc="dot docker connect"
3232

3333
# IDEs and editors
34+
alias i.='(idea $PWD &>/dev/null &)'
3435
alias c.='(code $PWD &>/dev/null &)'
36+
alias o.='open .'
3537

3638
# Utils
37-
alias ping="gping"
39+
alias ping="prettyping --nolegend"
3840
alias htop="btm"
3941
alias k="kill -9"
4042
alias df="pydf"

Diff for: shell/bash/completions/_smallstep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
eval "$(step completion bash)"

0 commit comments

Comments
 (0)