blob: 6f311d93432b5e06172147091bc62cf4d248716e [file] [log] [blame]
gio36b23b32024-08-25 12:20:54 +04001input: {
2 name: string @name(Hostname)
3 username: string @name(Username)
gio29f6b872024-09-08 16:14:58 +04004 authKey?: string @name(Auth Key) @role(VPNAuthKey) @usernameField(username) @enabledField(vpnEnabled)
gio36b23b32024-08-25 12:20:54 +04005 cpuCores: int | *1 @name(CPU Cores)
6 memory: string | *"2Gi" @name(Memory)
gio29f6b872024-09-08 16:14:58 +04007 vpnEnabled: bool @name(Enable VPN)
gio36b23b32024-08-25 12:20:54 +04008}
9
10name: "Virutal Machine"
11namespace: "app-vm"
12readme: "Virtual Machine"
13description: "Virtual Machine"
14icon: """
gio7fbd4ad2024-08-27 10:06:39 +040015 <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 2048 2048"><path fill="currentColor" d="M1280 384H640V256h640zm0 1024H640v-128h640zm0 256H640v-128h640zM1408 0q27 0 50 10t40 27t28 41t10 50v1792H384V128q0-27 10-50t27-40t41-28t50-10zm0 128H512v1664h896z"/></svg>"""
gio36b23b32024-08-25 12:20:54 +040016
gio7fbd4ad2024-08-27 10:06:39 +040017out: {
18 vm: {
19 "\(input.name)": {
20 username: input.username
21 domain: global.domain
gio36b23b32024-08-25 12:20:54 +040022 cpuCores: input.cpuCores
23 memory: input.memory
gio29f6b872024-09-08 16:14:58 +040024 if !input.vpnEnabled {
25 vpn: enabled: false
26 }
27 if input.vpnEnabled {
28 vpn: {
29 enabled: true
30 loginServer: "https://headscale.\(global.domain)"
31 authKey: input.authKey
32 }
gio36b23b32024-08-25 12:20:54 +040033 }
gio36b23b32024-08-25 12:20:54 +040034 }
35 }
36}