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.
This commit is contained in:
20 files changed
+577
-202
No files matched your search
@@ -102,13 +102,16 @@ func (m Model) containerRender(withSource bool) func(styles.Styles, provider.Con
|
||||
n := st.Node(storeKey(c))
|
||||
line := c.Name
|
||||
if c.Source.Kind == provider.KindRepo {
|
||||
// A secret file: a lock for an encrypted one, a leaf
|
||||
// for Spring config, a file in the warning colour for plain
|
||||
// text, and its type after it ("sops · age", "env · plain text").
|
||||
// A secret file: a lock for an encrypted one, a leaf for
|
||||
// Spring config, a whale for compose, a file in the warning
|
||||
// colour for plain text, and its type after it ("sops ·
|
||||
// age", "env · plain text").
|
||||
icon, style := iconSet.Encrypted, sty.KindRepo
|
||||
switch {
|
||||
case strings.HasPrefix(c.Detail, "spring"):
|
||||
icon, style = iconSet.Spring, sty.Spring
|
||||
case strings.HasPrefix(c.Detail, "compose"):
|
||||
icon, style = iconSet.Compose, sty.Compose
|
||||
case !strings.HasPrefix(c.Detail, "sops"):
|
||||
icon, style = iconSet.PlainFile, sty.Warning
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ type Set struct {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ var NerdFont = Set{
|
||||
Encrypted: "\U000F033E", // md-lock
|
||||
PlainFile: "\U000F0214", // md-file
|
||||
Spring: "\U000F032A", // md-leaf
|
||||
Compose: "\U000F0868", // md-docker
|
||||
Note: "\U000F09ED",
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ func (m *Map) Actions() []Action {
|
||||
a(Lists, "prevTab", &m.PrevTab, "prev tab", "lists", "Previous tab of the focused pane: Sources and Favourites in Sources; Secrets, Keys, Certs in Secrets."),
|
||||
a(Lists, "nextTab", &m.NextTab, "next tab", "lists", "Next tab of the focused pane."),
|
||||
a(Lists, "sourcesView", &m.SourcesView, "grouped/flat sources", "lists", "Switch the Sources pane between grouped by provider and a flat list."),
|
||||
a(Lists, "toggleHidden", &m.ToggleHidden, "show/hide hidden", "lists", "Show or hide what's hidden: Spring config keys that don't look like secrets, and files and repos with only those. Shown, they're dimmed; Go to finds them too."),
|
||||
a(Lists, "toggleHidden", &m.ToggleHidden, "show/hide hidden", "lists", "Show or hide what's hidden: Spring and compose keys that don't look like secrets, example files (.env.example), and files and repos with only those. Shown, they're dimmed; Go to finds them too."),
|
||||
a(Lists, "star", &m.Favourite, "star", "lists", "Star or unstar the selected subscription, vault or secret, for the account showing it. Starred items get a ★ and sort first."),
|
||||
a(Lists, "goTo", &m.Search, "search", "lists", "Go to anything: search every vault and secret loaded and jump to one. Again in Go to: only the source or group you're in, and back to all. On the left, the scope: All, an account (or Databricks, or Repos), or one source (○ ◐ ● for how much of it is loaded)."),
|
||||
a(Lists, "favourites", &m.Favourites, "favourites", "lists", "Go to, on Favourites: everything you've starred, to search and jump to."),
|
||||
|
||||
@@ -35,6 +35,7 @@ type Styles struct {
|
||||
KindDatabricks lipgloss.Style
|
||||
KindRepo lipgloss.Style
|
||||
Spring lipgloss.Style // Spring Boot config files
|
||||
Compose lipgloss.Style // Docker Compose files
|
||||
|
||||
// themed marks the selection colours as set by the theme, so
|
||||
// OnBackground leaves them.
|
||||
@@ -72,6 +73,7 @@ func Default() Styles {
|
||||
KindDatabricks: lipgloss.NewStyle().Foreground(lipgloss.Red),
|
||||
KindRepo: lipgloss.NewStyle().Foreground(lipgloss.Magenta),
|
||||
Spring: lipgloss.NewStyle().Foreground(lipgloss.Green),
|
||||
Compose: lipgloss.NewStyle().Foreground(lipgloss.Blue),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ var Roles = map[string]string{
|
||||
"databricksColor": "Databricks workspaces and scopes",
|
||||
"repoColor": "repos and their secret files (SOPS)",
|
||||
"springColor": "Spring Boot config files",
|
||||
"composeColor": "Docker Compose files",
|
||||
}
|
||||
|
||||
// FromTheme returns the default styles with the theme's roles applied, and
|
||||
@@ -102,6 +103,8 @@ func FromTheme(theme map[string][]string) (Styles, color.Color, error) {
|
||||
st.KindRepo = v.fg(lipgloss.NewStyle())
|
||||
case "springColor":
|
||||
st.Spring = v.fg(lipgloss.NewStyle())
|
||||
case "composeColor":
|
||||
st.Compose = v.fg(lipgloss.NewStyle())
|
||||
}
|
||||
}
|
||||
return st, fg, nil
|
||||
|
||||
Reference in new issue
Block a user