GitRoot

craft your forge, build your project, grow your community freely
 1// SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 2//
 3// SPDX-License-Identifier: EUPL-1.2
 4
 5package configuration
 6
 7type ExecConf struct {
 8	BareMetal BareMetalConf
 9	Bwrap     BwrapConf
10	Container ContainerConf
11	Ssh       SshConf
12}
13
14var ExecDefaultConf = ExecConf{
15	BareMetal: BareMetalDefaultConf,
16	Bwrap:     BwrapDefaultConf,
17	Container: ContainerDefaultConf,
18	Ssh:       SshDefaultConf,
19}
20
21type BareMetalConf struct {
22	Enabled bool
23}
24
25var BareMetalDefaultConf = BareMetalConf{
26	Enabled: false,
27}
28
29type BwrapConf struct {
30	Enabled bool
31	User    string
32	Uid     int
33	Group   string
34	Gid     int
35	RoBind  []string
36	Bind    []string
37}
38
39var BwrapDefaultConf = BwrapConf{
40	Enabled: false,
41	User:    "nobody",
42	Uid:     65534,
43	Group:   "nogroup",
44	Gid:     65534,
45}
46
47type ContainerConf struct {
48	Enabled bool
49	Bin     string
50}
51
52var ContainerDefaultConf = ContainerConf{
53	Enabled: false,
54	Bin:     "podman",
55}
56
57type SshConf struct {
58	Enabled bool
59	Hosts   []Host
60}
61
62type Host struct {
63	User      string
64	Address   string
65	Port      int
66	PublicKey string
67}
68
69var SshDefaultConf = SshConf{
70	Enabled: false,
71	Hosts:   []Host{{User: "myUSer", Address: "127.0.0.1", Port: 22, PublicKey: "ssh-ed25519 AAAAC3NzaC1..."}},
72}