Files
lazysecrets/internal/ui/icons/icons.go
T
keb de38b8b281
CI / Checks (pull_request) Successful in 40s
PR title / Conventional title (pull_request) Successful in 1s
feat: Docker Compose files in repos
compose.yaml, docker-compose.yml and their variants tracked by git are
listed under Repos, their services' environment variables as secrets,
named service.VAR.

- environment as a map or a list, and <<: *anchors shared between
  services; the secret patterns pick the keys, the rest hidden, with
  compose.secretPatterns for compose files' own.
- ${VAR}, $VAR, ${VAR:?…} and variables without a value are marked as
  references; docker-compose.example.yml and the like are hidden.
- Jasypt values decrypt with the service's JASYPT_ENCRYPTOR_PASSWORD.
- A blue Docker icon, themeable with composeColor.
2026-10-15 14:19:30 +02:00

52 lines
1.4 KiB
Go

// Package icons maps backends to Nerd Font glyphs. They are on by default
// and can be turned off, since they render as boxes without a Nerd Font
// (v3+) installed.
package icons
import "git.kebcloud.no/keb/lazysecrets/internal/provider"
type Set struct {
Azure string
Databricks string
Repo string
Encrypted string // an encrypted file (SOPS)
PlainFile string // a plain text secrets file (.env)
Spring string // a Spring Boot config file
Compose string // a Docker Compose file
Note string // has a note (lazysecrets list)
}
// None renders no icons.
var None = Set{}
// NerdFont uses Nerd Fonts v3 Material Design glyphs. There is no Databricks
// logo glyph, so it uses stacked layers, which resembles it.
var NerdFont = Set{
Azure: "\U000F0805", // md-microsoft_azure
Databricks: "\U000F0F58", // md-layers_triple
Repo: "\U000F02A2", // md-git
Encrypted: "\U000F033E", // md-lock
PlainFile: "\U000F0214", // md-file
Spring: "\U000F032A", // md-leaf
Compose: "\U000F0868", // md-docker
Note: "\U000F09ED",
}
// Prefix returns the icon for kind followed by a space, or "" if the set has
// no icon for it.
func (s Set) Prefix(kind provider.Kind) string {
var icon string
switch kind {
case provider.KindAzure:
icon = s.Azure
case provider.KindDatabricks:
icon = s.Databricks
case provider.KindRepo:
icon = s.Repo
}
if icon == "" {
return ""
}
return icon + " "
}