feat: Docker Compose files in repos (#84)

Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #84.
This commit is contained in:
keb authored and Karl-Einar Bergstrøm committed 2026-10-15 14:20:17 +02:00
1 parent 580c7ef985
commit 0f5248d8f6
20 files changed
+577 -202

No files matched your search

+6 -3
View File
@@ -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
}
+2
View File
@@ -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",
}
+1 -1
View File
@@ -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."),
+2
View File
@@ -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),
}
}
+3
View File
@@ -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