| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 1 | package installer |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 2 | |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 3 | import ( |
| 4 | "embed" |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 5 | "encoding/json" |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 6 | "fmt" |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 7 | htemplate "html/template" |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 8 | "log" |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 9 | "strings" |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 10 | "text/template" |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 11 | |
| 12 | "github.com/Masterminds/sprig/v3" |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 13 | ) |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 14 | |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 15 | //go:embed values-tmpl |
| 16 | var valuesTmpls embed.FS |
| 17 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 18 | type Named interface { |
| 19 | Nam() string |
| 20 | } |
| 21 | |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 22 | type App struct { |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 23 | Name string |
| 24 | Namespaces []string |
| 25 | Templates []*template.Template |
| 26 | Schema string |
| 27 | Readme *template.Template |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 28 | } |
| 29 | |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 30 | func (a App) ConfigSchema() map[string]any { |
| 31 | ret := make(map[string]any) |
| 32 | if err := json.NewDecoder(strings.NewReader(a.Schema)).Decode(&ret); err != nil { |
| 33 | panic(err) // TODO(giolekva): prevalidate |
| 34 | } |
| 35 | return ret |
| 36 | } |
| 37 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 38 | type StoreApp struct { |
| 39 | App |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 40 | Icon htemplate.HTML |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 41 | ShortDescription string |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 42 | } |
| 43 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 44 | func (a App) Nam() string { |
| 45 | return a.Name |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 46 | } |
| 47 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 48 | func (a StoreApp) Nam() string { |
| 49 | return a.Name |
| 50 | } |
| 51 | |
| 52 | type AppRepository[A Named] interface { |
| 53 | GetAll() ([]A, error) |
| 54 | Find(name string) (*A, error) |
| 55 | } |
| 56 | |
| 57 | type InMemoryAppRepository[A Named] struct { |
| 58 | apps []A |
| 59 | } |
| 60 | |
| 61 | func NewInMemoryAppRepository[A Named](apps []A) AppRepository[A] { |
| 62 | return &InMemoryAppRepository[A]{ |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 63 | apps, |
| 64 | } |
| 65 | } |
| 66 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 67 | func (r InMemoryAppRepository[A]) Find(name string) (*A, error) { |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 68 | for _, a := range r.apps { |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 69 | if a.Nam() == name { |
| Giorgi Lekveishvili | bd6be7f | 2023-05-26 15:51:28 +0400 | [diff] [blame] | 70 | return &a, nil |
| 71 | } |
| 72 | } |
| 73 | return nil, fmt.Errorf("Application not found: %s", name) |
| 74 | } |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 75 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 76 | func (r InMemoryAppRepository[A]) GetAll() ([]A, error) { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 77 | return r.apps, nil |
| 78 | } |
| 79 | |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 80 | func CreateAllApps() []App { |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 81 | tmpls, err := template.New("root").Funcs(template.FuncMap(sprig.FuncMap())).ParseFS(valuesTmpls, "values-tmpl/*") |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 82 | if err != nil { |
| 83 | log.Fatal(err) |
| 84 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 85 | ret := []App{ |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 86 | CreateAppIngressPrivate(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 87 | CreateCertificateIssuerPublic(valuesTmpls, tmpls), |
| 88 | CreateCertificateIssuerPrivate(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 89 | CreateAppCoreAuth(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 90 | CreateAppHeadscale(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 91 | CreateAppTailscaleProxy(valuesTmpls, tmpls), |
| 92 | CreateMetallbConfigEnv(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 4fc2943 | 2023-07-20 10:03:28 +0400 | [diff] [blame^] | 93 | CreateMetallbIPAddressPool(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 94 | CreateEnvManager(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 95 | CreateWelcome(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 96 | CreateAppManager(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 97 | CreateIngressPublic(valuesTmpls, tmpls), |
| 98 | CreateCertManager(valuesTmpls, tmpls), |
| 99 | CreateCertManagerWebhookGandi(valuesTmpls, tmpls), |
| 100 | CreateCertManagerWebhookGandiRole(valuesTmpls, tmpls), |
| 101 | CreateCSIDriverSMB(valuesTmpls, tmpls), |
| 102 | CreateResourceRendererController(valuesTmpls, tmpls), |
| 103 | CreateHeadscaleController(valuesTmpls, tmpls), |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 104 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 105 | for _, a := range CreateStoreApps() { |
| 106 | ret = append(ret, a.App) |
| 107 | } |
| 108 | return ret |
| 109 | } |
| 110 | |
| 111 | func CreateStoreApps() []StoreApp { |
| 112 | tmpls, err := template.New("root").Funcs(template.FuncMap(sprig.FuncMap())).ParseFS(valuesTmpls, "values-tmpl/*") |
| 113 | if err != nil { |
| 114 | log.Fatal(err) |
| 115 | } |
| 116 | return []StoreApp{ |
| 117 | CreateAppVaultwarden(valuesTmpls, tmpls), |
| 118 | CreateAppMatrix(valuesTmpls, tmpls), |
| 119 | CreateAppPihole(valuesTmpls, tmpls), |
| 120 | CreateAppMaddy(valuesTmpls, tmpls), |
| 121 | CreateAppQBittorrent(valuesTmpls, tmpls), |
| 122 | CreateAppJellyfin(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 672af5d | 2023-07-12 11:57:51 +0400 | [diff] [blame] | 123 | CreateAppSoftServe(valuesTmpls, tmpls), |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 124 | CreateAppRpuppy(valuesTmpls, tmpls), |
| 125 | } |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 126 | } |
| 127 | |
| Giorgi Lekveishvili | 4d2784d | 2023-06-01 14:27:32 +0400 | [diff] [blame] | 128 | // TODO(gio): service account needs permission to create/update secret |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 129 | func CreateAppIngressPrivate(fs embed.FS, tmpls *template.Template) App { |
| 130 | schema, err := fs.ReadFile("values-tmpl/ingress-private.jsonschema") |
| 131 | if err != nil { |
| 132 | panic(err) |
| 133 | } |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 134 | return App{ |
| 135 | "ingress-private", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 136 | []string{"ingress-private"}, |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 137 | []*template.Template{ |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 138 | tmpls.Lookup("ingress-private.yaml"), |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 139 | }, |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 140 | string(schema), |
| Giorgi Lekveishvili | 4d2784d | 2023-06-01 14:27:32 +0400 | [diff] [blame] | 141 | tmpls.Lookup("ingress-private.md"), |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 142 | } |
| 143 | } |
| 144 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 145 | func CreateCertificateIssuerPrivate(fs embed.FS, tmpls *template.Template) App { |
| 146 | schema, err := fs.ReadFile("values-tmpl/certificate-issuer-private.jsonschema") |
| 147 | if err != nil { |
| 148 | panic(err) |
| 149 | } |
| 150 | return App{ |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 151 | "certificate-issuer-private", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 152 | []string{}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 153 | []*template.Template{ |
| 154 | tmpls.Lookup("certificate-issuer-private.yaml"), |
| 155 | }, |
| 156 | string(schema), |
| 157 | tmpls.Lookup("certificate-issuer-private.md"), |
| 158 | } |
| 159 | } |
| 160 | |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 161 | func CreateCertificateIssuerPublic(fs embed.FS, tmpls *template.Template) App { |
| 162 | schema, err := fs.ReadFile("values-tmpl/certificate-issuer-public.jsonschema") |
| 163 | if err != nil { |
| 164 | panic(err) |
| 165 | } |
| 166 | return App{ |
| 167 | "certificate-issuer-public", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 168 | []string{}, |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 169 | []*template.Template{ |
| 170 | tmpls.Lookup("certificate-issuer-public.yaml"), |
| 171 | }, |
| 172 | string(schema), |
| 173 | tmpls.Lookup("certificate-issuer-public.md"), |
| 174 | } |
| 175 | } |
| 176 | |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 177 | func CreateAppCoreAuth(fs embed.FS, tmpls *template.Template) App { |
| 178 | schema, err := fs.ReadFile("values-tmpl/core-auth.jsonschema") |
| 179 | if err != nil { |
| 180 | panic(err) |
| 181 | } |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 182 | return App{ |
| 183 | "core-auth", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 184 | []string{"core-auth"}, |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 185 | []*template.Template{ |
| 186 | tmpls.Lookup("core-auth-storage.yaml"), |
| 187 | tmpls.Lookup("core-auth.yaml"), |
| 188 | }, |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 189 | string(schema), |
| Giorgi Lekveishvili | 3ca1f3f | 2023-05-30 14:33:02 +0400 | [diff] [blame] | 190 | tmpls.Lookup("core-auth.md"), |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 191 | } |
| 192 | } |
| 193 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 194 | func CreateAppVaultwarden(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 195 | schema, err := fs.ReadFile("values-tmpl/vaultwarden.jsonschema") |
| 196 | if err != nil { |
| 197 | panic(err) |
| 198 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 199 | return StoreApp{ |
| 200 | App: App{ |
| 201 | "vaultwarden", |
| 202 | []string{"app-vaultwarden"}, |
| 203 | []*template.Template{ |
| 204 | tmpls.Lookup("vaultwarden.yaml"), |
| 205 | }, |
| 206 | string(schema), |
| 207 | tmpls.Lookup("vaultwarden.md"), |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 208 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 209 | Icon: `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 48 48"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M35.38 25.63V9.37H24v28.87a34.93 34.93 0 0 0 5.41-3.48q6-4.66 6-9.14Zm4.87-19.5v19.5A11.58 11.58 0 0 1 39.4 30a16.22 16.22 0 0 1-2.11 3.81a23.52 23.52 0 0 1-3 3.24a34.87 34.87 0 0 1-3.22 2.62c-1 .69-2 1.35-3.07 2s-1.82 1-2.27 1.26l-1.08.51a1.53 1.53 0 0 1-1.32 0l-1.08-.51c-.45-.22-1.21-.64-2.27-1.26s-2.09-1.27-3.07-2A34.87 34.87 0 0 1 13.7 37a23.52 23.52 0 0 1-3-3.24A16.22 16.22 0 0 1 8.6 30a11.58 11.58 0 0 1-.85-4.32V6.13A1.64 1.64 0 0 1 9.38 4.5h29.24a1.64 1.64 0 0 1 1.63 1.63Z"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 210 | ShortDescription: "Open source implementation of Bitwarden password manager. Can be used with official client applications.", |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 211 | } |
| 212 | } |
| 213 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 214 | func CreateAppMatrix(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 215 | schema, err := fs.ReadFile("values-tmpl/matrix.jsonschema") |
| 216 | if err != nil { |
| 217 | panic(err) |
| 218 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 219 | return StoreApp{ |
| 220 | App{ |
| 221 | "matrix", |
| 222 | []string{"app-matrix"}, |
| 223 | []*template.Template{ |
| 224 | tmpls.Lookup("matrix-storage.yaml"), |
| 225 | tmpls.Lookup("matrix.yaml"), |
| 226 | }, |
| 227 | string(schema), |
| 228 | nil, |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 229 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 230 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 24 24"><path fill="currentColor" d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033a3.312 3.312 0 0 1 1.117-1.024c.433-.245.936-.365 1.5-.365c.54 0 1.033.107 1.481.314c.448.208.785.582 1.02 1.108c.254-.374.6-.706 1.034-.992c.434-.287.95-.43 1.546-.43c.453 0 .872.056 1.26.167c.388.11.716.286.993.53c.276.245.489.559.646.951c.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66a1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166c-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499a1.946 1.946 0 0 0-.231.696a5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688a1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19c-.111 0-.259.024-.439.074c-.18.051-.36.143-.53.282a1.637 1.637 0 0 0-.439.595c-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 231 | "An open network for secure, decentralised communication", |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 232 | } |
| 233 | } |
| 234 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 235 | func CreateAppPihole(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 236 | schema, err := fs.ReadFile("values-tmpl/pihole.jsonschema") |
| 237 | if err != nil { |
| 238 | panic(err) |
| 239 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 240 | return StoreApp{ |
| 241 | App{ |
| 242 | "pihole", |
| 243 | []string{"app-pihole"}, |
| 244 | []*template.Template{ |
| 245 | tmpls.Lookup("pihole.yaml"), |
| 246 | }, |
| 247 | string(schema), |
| 248 | tmpls.Lookup("pihole.md"), |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 249 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 250 | // "simple-icons:pihole", |
| 251 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 24 24"><path fill="currentColor" d="M4.344 0c.238 4.792 3.256 7.056 6.252 7.376c.165-1.692-4.319-5.6-4.319-5.6c-.008-.011.009-.025.019-.014c0 0 4.648 4.01 5.423 5.645c2.762-.15 5.196-1.947 5-4.912c0 0-4.12-.613-5 4.618C11.48 2.753 8.993 0 4.344 0zM12 7.682v.002a3.68 3.68 0 0 0-2.591 1.077L4.94 13.227a3.683 3.683 0 0 0-.86 1.356a3.31 3.31 0 0 0-.237 1.255A3.681 3.681 0 0 0 4.92 18.45l4.464 4.466a3.69 3.69 0 0 0 2.251 1.06l.002.001c.093.01.187.015.28.017l-.1-.008c.06.003.117.009.177.009l-.077-.001L12 24l-.004-.005a3.68 3.68 0 0 0 2.61-1.077l4.469-4.465a3.683 3.683 0 0 0 1.006-1.888l.012-.063a3.682 3.682 0 0 0 .057-.541l.003-.061c0-.017.003-.05.004-.06h-.002a3.683 3.683 0 0 0-1.077-2.607l-4.466-4.468a3.694 3.694 0 0 0-1.564-.927l-.07-.02a3.43 3.43 0 0 0-.946-.133L12 7.682zm3.165 3.357c.023 1.748-1.33 3.078-1.33 4.806c.164 2.227 1.733 3.207 3.266 3.146c-.035.003-.068.007-.104.009c-1.847.135-3.209-1.326-5.002-1.326c-2.23.164-3.21 1.736-3.147 3.27l-.008-.104c-.133-1.847 1.328-3.21 1.328-5.002c-.173-2.32-1.867-3.284-3.46-3.132c.1-.011.203-.021.31-.027c1.847-.133 3.209 1.328 5.002 1.328c2.082-.155 3.074-1.536 3.145-2.968zM4.344 0c.238 4.792 3.256 7.056 6.252 7.376c.165-1.692-4.319-5.6-4.319-5.6c-.008-.011.009-.025.019-.014c0 0 4.648 4.01 5.423 5.645c2.762-.15 5.196-1.947 5-4.912c0 0-4.12-.613-5 4.618C11.48 2.753 8.993 0 4.344 0zM12 7.682v.002a3.68 3.68 0 0 0-2.591 1.077L4.94 13.227a3.683 3.683 0 0 0-.86 1.356a3.31 3.31 0 0 0-.237 1.255A3.681 3.681 0 0 0 4.92 18.45l4.464 4.466a3.69 3.69 0 0 0 2.251 1.06l.002.001c.093.01.187.015.28.017l-.1-.008c.06.003.117.009.177.009l-.077-.001L12 24l-.004-.005a3.68 3.68 0 0 0 2.61-1.077l4.469-4.465a3.683 3.683 0 0 0 1.006-1.888l.012-.063a3.682 3.682 0 0 0 .057-.541l.003-.061c0-.017.003-.05.004-.06h-.002a3.683 3.683 0 0 0-1.077-2.607l-4.466-4.468a3.694 3.694 0 0 0-1.564-.927l-.07-.02a3.43 3.43 0 0 0-.946-.133L12 7.682zm3.165 3.357c.023 1.748-1.33 3.078-1.33 4.806c.164 2.227 1.733 3.207 3.266 3.146c-.035.003-.068.007-.104.009c-1.847.135-3.209-1.326-5.002-1.326c-2.23.164-3.21 1.736-3.147 3.27l-.008-.104c-.133-1.847 1.328-3.21 1.328-5.002c-.173-2.32-1.867-3.284-3.46-3.132c.1-.011.203-.021.31-.027c1.847-.133 3.209 1.328 5.002 1.328c2.082-.155 3.074-1.536 3.145-2.968z"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 252 | "Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network.", |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 253 | } |
| 254 | } |
| 255 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 256 | func CreateAppMaddy(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 257 | schema, err := fs.ReadFile("values-tmpl/maddy.jsonschema") |
| 258 | if err != nil { |
| 259 | panic(err) |
| 260 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 261 | return StoreApp{ |
| 262 | App{ |
| 263 | "maddy", |
| 264 | []string{"app-maddy"}, |
| 265 | []*template.Template{ |
| 266 | tmpls.Lookup("maddy.yaml"), |
| 267 | }, |
| 268 | string(schema), |
| 269 | nil, |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 270 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 271 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 48 48"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M9.5 13c13.687 13.574 14.825 13.09 29 0"/><rect width="37" height="31" x="5.5" y="8.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" rx="2"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 272 | "SMPT/IMAP server to communicate via email.", |
| giolekva | 050609f | 2021-12-29 15:51:40 +0400 | [diff] [blame] | 273 | } |
| 274 | } |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 275 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 276 | func CreateAppQBittorrent(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 277 | schema, err := fs.ReadFile("values-tmpl/qbittorrent.jsonschema") |
| 278 | if err != nil { |
| 279 | panic(err) |
| 280 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 281 | return StoreApp{ |
| 282 | App{ |
| 283 | "qbittorrent", |
| 284 | []string{"app-qbittorrent"}, |
| 285 | []*template.Template{ |
| 286 | tmpls.Lookup("qbittorrent.yaml"), |
| 287 | }, |
| 288 | string(schema), |
| 289 | tmpls.Lookup("qbittorrent.md"), |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 290 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 291 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 48 48"><circle cx="24" cy="24" r="21.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M26.651 22.364a5.034 5.034 0 0 1 5.035-5.035h0a5.034 5.034 0 0 1 5.034 5.035v3.272a5.034 5.034 0 0 1-5.034 5.035h0a5.034 5.034 0 0 1-5.035-5.035m0 5.035V10.533m-5.302 15.103a5.034 5.034 0 0 1-5.035 5.035h0a5.034 5.034 0 0 1-5.034-5.035v-3.272a5.034 5.034 0 0 1 5.034-5.035h0a5.034 5.034 0 0 1 5.035 5.035m0-5.035v20.138"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 292 | "qBittorrent is a cross-platform free and open-source BitTorrent client written in native C++. It relies on Boost, Qt 6 toolkit and the libtorrent-rasterbar library, with an optional search engine written in Python.", |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 293 | } |
| 294 | } |
| 295 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 296 | func CreateAppJellyfin(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 297 | schema, err := fs.ReadFile("values-tmpl/jellyfin.jsonschema") |
| 298 | if err != nil { |
| 299 | panic(err) |
| 300 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 301 | return StoreApp{ |
| 302 | App{ |
| 303 | "jellyfin", |
| 304 | []string{"app-jellyfin"}, |
| 305 | []*template.Template{ |
| 306 | tmpls.Lookup("jellyfin.yaml"), |
| 307 | }, |
| 308 | string(schema), |
| 309 | nil, |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 310 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 311 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 48 48"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M24 20c-1.62 0-6.85 9.48-6.06 11.08s11.33 1.59 12.12 0S25.63 20 24 20Z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M24 5.5c-4.89 0-20.66 28.58-18.25 33.4s34.13 4.77 36.51 0S28.9 5.5 24 5.5Zm12 29.21c-1.56 3.13-22.35 3.17-23.93 0S20.8 12.83 24 12.83s13.52 18.76 12 21.88Z"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 312 | "Jellyfin is a free and open-source media server and suite of multimedia applications designed to organize, manage, and share digital media files to networked devices.", |
| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 313 | } |
| 314 | } |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 315 | |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 316 | func CreateAppRpuppy(fs embed.FS, tmpls *template.Template) StoreApp { |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 317 | schema, err := fs.ReadFile("values-tmpl/rpuppy.jsonschema") |
| 318 | if err != nil { |
| 319 | panic(err) |
| 320 | } |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 321 | return StoreApp{ |
| 322 | App{ |
| 323 | "rpuppy", |
| 324 | []string{"app-rpuppy"}, |
| 325 | []*template.Template{ |
| 326 | tmpls.Lookup("rpuppy.yaml"), |
| 327 | }, |
| 328 | string(schema), |
| 329 | tmpls.Lookup("rpuppy.md"), |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 330 | }, |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 331 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 256 256"><path fill="currentColor" d="M100 140a8 8 0 1 1-8-8a8 8 0 0 1 8 8Zm64 8a8 8 0 1 0-8-8a8 8 0 0 0 8 8Zm64.94-9.11a12.12 12.12 0 0 1-5 1.11a11.83 11.83 0 0 1-9.35-4.62l-2.59-3.29V184a36 36 0 0 1-36 36H80a36 36 0 0 1-36-36v-51.91l-2.53 3.27A11.88 11.88 0 0 1 32.1 140a12.08 12.08 0 0 1-5-1.11a11.82 11.82 0 0 1-6.84-13.14l16.42-88a12 12 0 0 1 14.7-9.43h.16L104.58 44h46.84l53.08-15.6h.16a12 12 0 0 1 14.7 9.43l16.42 88a11.81 11.81 0 0 1-6.84 13.06ZM97.25 50.18L49.34 36.1a4.18 4.18 0 0 0-.92-.1a4 4 0 0 0-3.92 3.26l-16.42 88a4 4 0 0 0 7.08 3.22ZM204 121.75L150 52h-44l-54 69.75V184a28 28 0 0 0 28 28h44v-18.34l-14.83-14.83a4 4 0 0 1 5.66-5.66L128 186.34l13.17-13.17a4 4 0 0 1 5.66 5.66L132 193.66V212h44a28 28 0 0 0 28-28Zm23.92 5.48l-16.42-88a4 4 0 0 0-4.84-3.16l-47.91 14.11l62.11 80.28a4 4 0 0 0 7.06-3.23Z"/></svg>`, |
| Giorgi Lekveishvili | 27b2b57 | 2023-06-30 10:44:45 +0400 | [diff] [blame] | 332 | "Delights users with randomly generate puppy pictures. Can be configured to be reachable only from private network or publicly.", |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 333 | } |
| 334 | } |
| 335 | |
| Giorgi Lekveishvili | 672af5d | 2023-07-12 11:57:51 +0400 | [diff] [blame] | 336 | func CreateAppSoftServe(fs embed.FS, tmpls *template.Template) StoreApp { |
| 337 | schema, err := fs.ReadFile("values-tmpl/soft-serve.jsonschema") |
| 338 | if err != nil { |
| 339 | panic(err) |
| 340 | } |
| 341 | return StoreApp{ |
| 342 | App{ |
| 343 | "soft-serve", |
| 344 | []string{"app-soft-serve"}, |
| 345 | []*template.Template{ |
| 346 | tmpls.Lookup("soft-serve.yaml"), |
| 347 | }, |
| 348 | string(schema), |
| 349 | tmpls.Lookup("soft-serve.md"), |
| 350 | }, |
| 351 | `<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 48 48"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="4"><path stroke-linejoin="round" d="M15.34 22.5L21 37l3 6l3-6l5.66-14.5"/><path d="M19 32h10"/><path stroke-linejoin="round" d="M24 3c-6 0-8 6-8 6s-6 2-6 7s5 7 5 7s3.5-2 9-2s9 2 9 2s5-2 5-7s-6-7-6-7s-2-6-8-6Z"/></g></svg>`, |
| 352 | "A tasty, self-hostable Git server for the command line. 🍦", |
| 353 | } |
| 354 | } |
| 355 | |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 356 | func CreateAppHeadscale(fs embed.FS, tmpls *template.Template) App { |
| 357 | schema, err := fs.ReadFile("values-tmpl/headscale.jsonschema") |
| 358 | if err != nil { |
| 359 | panic(err) |
| 360 | } |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 361 | return App{ |
| 362 | "headscale", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 363 | []string{"app-headscale"}, |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 364 | []*template.Template{ |
| 365 | tmpls.Lookup("headscale.yaml"), |
| 366 | }, |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 367 | string(schema), |
| Giorgi Lekveishvili | 3a90705 | 2023-05-30 13:33:32 +0400 | [diff] [blame] | 368 | tmpls.Lookup("headscale.md"), |
| Giorgi Lekveishvili | 23ef7f8 | 2023-05-26 11:57:48 +0400 | [diff] [blame] | 369 | } |
| 370 | } |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 371 | |
| 372 | func CreateAppTailscaleProxy(fs embed.FS, tmpls *template.Template) App { |
| 373 | schema, err := fs.ReadFile("values-tmpl/tailscale-proxy.jsonschema") |
| 374 | if err != nil { |
| 375 | panic(err) |
| 376 | } |
| 377 | return App{ |
| 378 | "tailscale-proxy", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 379 | []string{"tailscale-proxy"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 380 | []*template.Template{ |
| 381 | tmpls.Lookup("tailscale-proxy.yaml"), |
| 382 | }, |
| 383 | string(schema), |
| 384 | tmpls.Lookup("tailscale-proxy.md"), |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | func CreateMetallbConfigEnv(fs embed.FS, tmpls *template.Template) App { |
| 389 | schema, err := fs.ReadFile("values-tmpl/metallb-config-env.jsonschema") |
| 390 | if err != nil { |
| 391 | panic(err) |
| 392 | } |
| 393 | return App{ |
| 394 | "metallb-config-env", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 395 | []string{"metallb-config"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 396 | []*template.Template{ |
| 397 | tmpls.Lookup("metallb-config-env.yaml"), |
| 398 | }, |
| 399 | string(schema), |
| 400 | tmpls.Lookup("metallb-config-env.md"), |
| 401 | } |
| 402 | } |
| 403 | |
| Giorgi Lekveishvili | 4fc2943 | 2023-07-20 10:03:28 +0400 | [diff] [blame^] | 404 | func CreateMetallbIPAddressPool(fs embed.FS, tmpls *template.Template) App { |
| 405 | schema, err := fs.ReadFile("values-tmpl/metallb-ipaddresspool.jsonschema") |
| 406 | if err != nil { |
| 407 | panic(err) |
| 408 | } |
| 409 | return App{ |
| 410 | "metallb-ipaddresspool", |
| 411 | []string{"metallb-ipaddresspool"}, |
| 412 | []*template.Template{ |
| 413 | tmpls.Lookup("metallb-ipaddresspool.yaml"), |
| 414 | }, |
| 415 | string(schema), |
| 416 | tmpls.Lookup("metallb-ipaddresspool.md"), |
| 417 | } |
| 418 | } |
| 419 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 420 | func CreateEnvManager(fs embed.FS, tmpls *template.Template) App { |
| 421 | schema, err := fs.ReadFile("values-tmpl/env-manager.jsonschema") |
| 422 | if err != nil { |
| 423 | panic(err) |
| 424 | } |
| 425 | return App{ |
| 426 | "env-manager", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 427 | []string{"env-manager"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 428 | []*template.Template{ |
| 429 | tmpls.Lookup("env-manager.yaml"), |
| 430 | }, |
| 431 | string(schema), |
| 432 | tmpls.Lookup("env-manager.md"), |
| 433 | } |
| 434 | } |
| 435 | |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 436 | func CreateWelcome(fs embed.FS, tmpls *template.Template) App { |
| 437 | schema, err := fs.ReadFile("values-tmpl/welcome.jsonschema") |
| 438 | if err != nil { |
| 439 | panic(err) |
| 440 | } |
| 441 | return App{ |
| 442 | "welcome", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 443 | []string{"app-welcome"}, |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 444 | []*template.Template{ |
| 445 | tmpls.Lookup("welcome.yaml"), |
| 446 | }, |
| 447 | string(schema), |
| 448 | tmpls.Lookup("welcome.md"), |
| 449 | } |
| 450 | } |
| 451 | |
| Giorgi Lekveishvili | 4257b90 | 2023-07-07 17:08:42 +0400 | [diff] [blame] | 452 | func CreateAppManager(fs embed.FS, tmpls *template.Template) App { |
| 453 | schema, err := fs.ReadFile("values-tmpl/appmanager.jsonschema") |
| 454 | if err != nil { |
| 455 | panic(err) |
| 456 | } |
| 457 | return App{ |
| 458 | "app-manager", |
| 459 | []string{"core-appmanager"}, |
| 460 | []*template.Template{ |
| 461 | tmpls.Lookup("appmanager.yaml"), |
| 462 | }, |
| 463 | string(schema), |
| 464 | tmpls.Lookup("appmanager.md"), |
| 465 | } |
| 466 | } |
| 467 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 468 | func CreateIngressPublic(fs embed.FS, tmpls *template.Template) App { |
| 469 | schema, err := fs.ReadFile("values-tmpl/ingress-public.jsonschema") |
| 470 | if err != nil { |
| 471 | panic(err) |
| 472 | } |
| 473 | return App{ |
| 474 | "ingress-public", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 475 | []string{"ingress-public"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 476 | []*template.Template{ |
| 477 | tmpls.Lookup("ingress-public.yaml"), |
| 478 | }, |
| 479 | string(schema), |
| 480 | tmpls.Lookup("ingress-public.md"), |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | func CreateCertManager(fs embed.FS, tmpls *template.Template) App { |
| 485 | schema, err := fs.ReadFile("values-tmpl/cert-manager.jsonschema") |
| 486 | if err != nil { |
| 487 | panic(err) |
| 488 | } |
| 489 | return App{ |
| 490 | "cert-manager", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 491 | []string{"cert-manager"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 492 | []*template.Template{ |
| 493 | tmpls.Lookup("cert-manager.yaml"), |
| 494 | }, |
| 495 | string(schema), |
| 496 | tmpls.Lookup("cert-manager.md"), |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | func CreateCertManagerWebhookGandi(fs embed.FS, tmpls *template.Template) App { |
| 501 | schema, err := fs.ReadFile("values-tmpl/cert-manager-webhook-gandi.jsonschema") |
| 502 | if err != nil { |
| 503 | panic(err) |
| 504 | } |
| 505 | return App{ |
| 506 | "cert-manager-webhook-gandi", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 507 | []string{}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 508 | []*template.Template{ |
| 509 | tmpls.Lookup("cert-manager-webhook-gandi.yaml"), |
| 510 | }, |
| 511 | string(schema), |
| 512 | tmpls.Lookup("cert-manager-webhook-gandi.md"), |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | func CreateCertManagerWebhookGandiRole(fs embed.FS, tmpls *template.Template) App { |
| 517 | schema, err := fs.ReadFile("values-tmpl/cert-manager-webhook-gandi-role.jsonschema") |
| 518 | if err != nil { |
| 519 | panic(err) |
| 520 | } |
| 521 | return App{ |
| 522 | "cert-manager-webhook-gandi-role", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 523 | []string{}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 524 | []*template.Template{ |
| 525 | tmpls.Lookup("cert-manager-webhook-gandi-role.yaml"), |
| 526 | }, |
| 527 | string(schema), |
| 528 | tmpls.Lookup("cert-manager-webhook-gandi-role.md"), |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | func CreateCSIDriverSMB(fs embed.FS, tmpls *template.Template) App { |
| 533 | schema, err := fs.ReadFile("values-tmpl/csi-driver-smb.jsonschema") |
| 534 | if err != nil { |
| 535 | panic(err) |
| 536 | } |
| 537 | return App{ |
| 538 | "csi-driver-smb", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 539 | []string{"csi-driver-smb"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 540 | []*template.Template{ |
| 541 | tmpls.Lookup("csi-driver-smb.yaml"), |
| 542 | }, |
| 543 | string(schema), |
| 544 | tmpls.Lookup("csi-driver-smb.md"), |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | func CreateResourceRendererController(fs embed.FS, tmpls *template.Template) App { |
| 549 | schema, err := fs.ReadFile("values-tmpl/resource-renderer-controller.jsonschema") |
| 550 | if err != nil { |
| 551 | panic(err) |
| 552 | } |
| 553 | return App{ |
| 554 | "resource-renderer-controller", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 555 | []string{"rr-controller"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 556 | []*template.Template{ |
| 557 | tmpls.Lookup("resource-renderer-controller.yaml"), |
| 558 | }, |
| 559 | string(schema), |
| 560 | tmpls.Lookup("resource-renderer-controller.md"), |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | func CreateHeadscaleController(fs embed.FS, tmpls *template.Template) App { |
| 565 | schema, err := fs.ReadFile("values-tmpl/headscale-controller.jsonschema") |
| 566 | if err != nil { |
| 567 | panic(err) |
| 568 | } |
| 569 | return App{ |
| 570 | "headscale-controller", |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 571 | []string{"headscale-controller"}, |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 572 | []*template.Template{ |
| 573 | tmpls.Lookup("headscale-controller.yaml"), |
| 574 | }, |
| 575 | string(schema), |
| 576 | tmpls.Lookup("headscale-controller.md"), |
| 577 | } |
| 578 | } |