blob: 2f702d841939a8f31648a48bd66772fe3125e29e [file] [log] [blame]
giolekva8aa73e82022-07-09 11:34:39 +04001package installer
giolekva050609f2021-12-29 15:51:40 +04002
giolekva8aa73e82022-07-09 11:34:39 +04003import (
4 "embed"
5 "log"
6 "text/template"
7)
giolekva050609f2021-12-29 15:51:40 +04008
9type App struct {
10 Name string
11 Templates []*template.Template
12}
13
giolekva8aa73e82022-07-09 11:34:39 +040014//go:embed values-tmpl
15var valuesTmpls embed.FS
16
17func CreateAllApps() []App {
18 tmpls, err := template.ParseFS(valuesTmpls, "values-tmpl/*.yaml")
19 if err != nil {
20 log.Fatal(err)
21 }
giolekvaef76a3e2022-01-10 12:22:28 +040022 return []App{
Giorgi Lekveishvili23ef7f82023-05-26 11:57:48 +040023 // CreateAppIngressPublic(tmpls),
giolekvaef76a3e2022-01-10 12:22:28 +040024 CreateAppIngressPrivate(tmpls),
25 CreateAppCoreAuth(tmpls),
26 CreateAppVaultwarden(tmpls),
27 CreateAppMatrix(tmpls),
28 CreateAppPihole(tmpls),
29 CreateAppMaddy(tmpls),
30 CreateAppQBittorrent(tmpls),
31 CreateAppJellyfin(tmpls),
Giorgi Lekveishvili23ef7f82023-05-26 11:57:48 +040032 CreateAppRpuppy(tmpls),
33 CreateAppHeadscale(tmpls),
34 }
35}
36
37func CreateAppIngressPublic(tmpls *template.Template) App {
38 return App{
39 "ingress-public",
40 []*template.Template{
41 tmpls.Lookup("ingress-public.yaml"),
42 },
giolekvaef76a3e2022-01-10 12:22:28 +040043 }
44}
45
giolekva050609f2021-12-29 15:51:40 +040046func CreateAppIngressPrivate(tmpls *template.Template) App {
47 return App{
48 "ingress-private",
49 []*template.Template{
Giorgi Lekveishvili23ef7f82023-05-26 11:57:48 +040050 // tmpls.Lookup("vpn-mesh-config.yaml"),
giolekva050609f2021-12-29 15:51:40 +040051 tmpls.Lookup("ingress-private.yaml"),
52 tmpls.Lookup("certificate-issuer.yaml"),
53 },
54 }
55}
56
57func CreateAppCoreAuth(tmpls *template.Template) App {
58 return App{
59 "core-auth",
60 []*template.Template{
61 tmpls.Lookup("core-auth-storage.yaml"),
62 tmpls.Lookup("core-auth.yaml"),
63 },
64 }
65}
66
67func CreateAppVaultwarden(tmpls *template.Template) App {
68 return App{
69 "vaultwarden",
70 []*template.Template{
71 tmpls.Lookup("vaultwarden.yaml"),
72 },
73 }
74}
75
76func CreateAppMatrix(tmpls *template.Template) App {
77 return App{
78 "matrix",
79 []*template.Template{
80 tmpls.Lookup("matrix-storage.yaml"),
81 tmpls.Lookup("matrix.yaml"),
82 },
83 }
84}
85
86func CreateAppPihole(tmpls *template.Template) App {
87 return App{
88 "pihole",
89 []*template.Template{
90 tmpls.Lookup("pihole.yaml"),
91 },
92 }
93}
94
95func CreateAppMaddy(tmpls *template.Template) App {
96 return App{
97 "maddy",
98 []*template.Template{
99 tmpls.Lookup("maddy.yaml"),
100 },
101 }
102}
giolekvaef76a3e2022-01-10 12:22:28 +0400103
104func CreateAppQBittorrent(tmpls *template.Template) App {
105 return App{
106 "qbittorrent",
107 []*template.Template{
108 tmpls.Lookup("qbittorrent.yaml"),
109 },
110 }
111}
112
113func CreateAppJellyfin(tmpls *template.Template) App {
114 return App{
115 "jellyfin",
116 []*template.Template{
117 tmpls.Lookup("jellyfin.yaml"),
118 },
119 }
120}
Giorgi Lekveishvili23ef7f82023-05-26 11:57:48 +0400121
122func CreateAppRpuppy(tmpls *template.Template) App {
123 return App{
124 "rpuppy",
125 []*template.Template{
126 tmpls.Lookup("rpuppy.yaml"),
127 },
128 }
129}
130
131func CreateAppHeadscale(tmpls *template.Template) App {
132 return App{
133 "headscale",
134 []*template.Template{
135 tmpls.Lookup("headscale.yaml"),
136 },
137 }
138}