From 0f4bdb473c2a2780588dc89c3d03e1cd94c7fb33 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Sun, 1 Dec 2024 07:08:20 +0200 Subject: [PATCH 1/5] Add deployment scripts for Gitea, Jenkins, Jitsi, and Nostr --- .../grid_client/scripts/applications/gitea.ts | 124 ++++++++++++++++++ .../scripts/applications/jenkins.ts | 119 +++++++++++++++++ .../grid_client/scripts/applications/jitsi.ts | 117 +++++++++++++++++ .../scripts/applications/nostor.ts | 117 +++++++++++++++++ 4 files changed, 477 insertions(+) create mode 100644 packages/grid_client/scripts/applications/gitea.ts create mode 100644 packages/grid_client/scripts/applications/jenkins.ts create mode 100644 packages/grid_client/scripts/applications/jitsi.ts create mode 100644 packages/grid_client/scripts/applications/nostor.ts diff --git a/packages/grid_client/scripts/applications/gitea.ts b/packages/grid_client/scripts/applications/gitea.ts new file mode 100644 index 0000000000..249239c336 --- /dev/null +++ b/packages/grid_client/scripts/applications/gitea.ts @@ -0,0 +1,124 @@ +import { FilterOptions, GatewayNameModel, MachinesModel } from "../../src"; +import { config, getClient } from "../client_loader"; +import { log, pingNodes } from "../utils"; + +async function deploy(client, vms, subdomain, gatewayNode) { + const resultVM = await client.machines.deploy(vms); + log("================= Deploying VM ================="); + log(resultVM); + log("================= Deploying VM ================="); + + const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; + // Name Gateway Model + const gw: GatewayNameModel = { + name: subdomain, + node_id: gatewayNode.nodeId, + tls_passthrough: false, + backends: ["http://[" + vmPlanetary + "]:3000"], + }; + + const resultGateway = await client.gateway.deploy_name(gw); + log("================= Deploying name gateway ================="); + log(resultGateway); + log("================= Deploying name gateway ================="); +} + +async function getDeployment(client, vms, gw) { + const resultVM = await client.machines.getObj(vms.name); + const resultGateway = await client.gateway.getObj(gw); + log("================= Getting deployment information ================="); + log(resultVM); + log(resultGateway); + log("https://" + resultGateway[0].domain); + log("================= Getting deployment information ================="); +} + +async function cancel(client, vms, gw) { + const resultVM = await client.machines.delete(vms); + const resultGateway = await client.gateway.delete_name(gw); + log("================= Canceling the deployment ================="); + log(resultVM); + log(resultGateway); + log("================= Canceling the deployment ================="); +} + +async function main() { + const name = "newgitea"; + const grid3 = await getClient(`gitea/${name}`); + const subdomain = "gt" + grid3.twinId + name; + const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; + + // VMNode Selection + const vmQueryOptions: FilterOptions = { + cru: instanceCapacity.cru, + mru: instanceCapacity.mru, + sru: instanceCapacity.sru, + availableFor: grid3.twinId, + farmId: 1, + }; + // GatewayNode Selection + const gatewayQueryOptions: FilterOptions = { + gateway: true, + availableFor: grid3.twinId, + }; + const gatewayNode = (await grid3.capacity.filterNodes(gatewayQueryOptions))[0]; + const nodes = await grid3.capacity.filterNodes(vmQueryOptions); + const vmNode = await pingNodes(grid3, nodes); + const domain = subdomain + "." + gatewayNode.publicConfig.domain; + + const vms: MachinesModel = { + name, + network: { + name: "gitnet1", + ip_range: "10.253.0.0/16", + }, + machines: [ + { + name: "gitea1", + node_id: vmNode, + disks: [ + { + name: "gitDisk", + size: instanceCapacity.sru, + mountpoint: "/mnt/data", + }, + ], + planetary: true, + public_ip: false, + public_ip6: false, + mycelium: true, + cpu: instanceCapacity.cru, + memory: 1024 * instanceCapacity.mru, + rootfs_size: 0, + flist: "https://hub.grid.tf/tf-official-apps/gitea-mycelium.flist", + entrypoint: "/sbin/zinit init", + env: { + SSH_KEY: config.ssh_key, + GITEA__HOSTNAME: domain, + GITEA__mailer__PROTOCOL: "smtp", + GITEA__mailer__ENABLED: "true", + GITEA__mailer__HOST: "smtp.example.com", + GITEA__mailer__FROM: "admin@example.com", + GITEA__mailer__PORT: "587", + GITEA__mailer__USER: "admin", + GITEA__mailer__PASSWD: "123456", + }, + }, + ], + metadata: "", + description: "test deploying Gitea via ts grid3 client", + }; + + // Deploy VMs + await deploy(grid3, vms, subdomain, gatewayNode); + + // Get the deployment + await getDeployment(grid3, vms, subdomain); + + // Uncomment the line below to cancel the deployment + // await cancel(grid3, { name }, { name: subdomain }); + + await grid3.disconnect(); +} + +main(); diff --git a/packages/grid_client/scripts/applications/jenkins.ts b/packages/grid_client/scripts/applications/jenkins.ts new file mode 100644 index 0000000000..d9e6595302 --- /dev/null +++ b/packages/grid_client/scripts/applications/jenkins.ts @@ -0,0 +1,119 @@ +import { FilterOptions, GatewayNameModel, MachinesModel } from "../../src"; +import { config, getClient } from "../client_loader"; +import { log, pingNodes } from "../utils"; + +async function deploy(client, vms, subdomain, gatewayNode) { + const resultVM = await client.machines.deploy(vms); + log("================= Deploying VM ================="); + log(resultVM); + log("================= Deploying VM ================="); + + const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; + // Name Gateway Model + const gw: GatewayNameModel = { + name: subdomain, + node_id: gatewayNode.nodeId, + tls_passthrough: false, + backends: ["http://[" + vmPlanetary + "]:80"], + }; + + const resultGateway = await client.gateway.deploy_name(gw); + log("================= Deploying name gateway ================="); + log(resultGateway); + log("================= Deploying name gateway ================="); +} + +async function getDeployment(client, vms, gw) { + const resultVM = await client.machines.getObj(vms.name); + const resultGateway = await client.gateway.getObj(gw); + log("================= Getting deployment information ================="); + log(resultVM); + log(resultGateway); + log("https://" + resultGateway[0].domain); + log("================= Getting deployment information ================="); +} + +async function cancel(client, vms, gw) { + const resultVM = await client.machines.delete(vms); + const resultGateway = await client.gateway.delete_name(gw); + log("================= Canceling the deployment ================="); + log(resultVM); + log(resultGateway); + log("================= Canceling the deployment ================="); +} + +async function main() { + const name = "newjenkins"; + const grid3 = await getClient(`jenkins/${name}`); + const subdomain = "jk" + grid3.twinId + name; + const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; // Medium flavor as an example + + // VMNode Selection + const vmQueryOptions: FilterOptions = { + cru: instanceCapacity.cru, + mru: instanceCapacity.mru, + sru: instanceCapacity.sru, + availableFor: grid3.twinId, + farmId: 1, + }; + // GatewayNode Selection + const gatewayQueryOptions: FilterOptions = { + gateway: true, + availableFor: grid3.twinId, + }; + const gatewayNode = (await grid3.capacity.filterNodes(gatewayQueryOptions))[0]; + const nodes = await grid3.capacity.filterNodes(vmQueryOptions); + const vmNode = await pingNodes(grid3, nodes); + const domain = subdomain + "." + gatewayNode.publicConfig.domain; + + const vms: MachinesModel = { + name, + network: { + name: "jknet", + ip_range: "10.254.0.0/16", + }, + machines: [ + { + name: "jenkins", + node_id: vmNode, + disks: [ + { + name: "jkDisk", + size: instanceCapacity.sru, + mountpoint: "/mnt/data", + }, + ], + planetary: true, + public_ip: false, + public_ip6: false, + mycelium: true, + cpu: instanceCapacity.cru, + memory: 1024 * instanceCapacity.mru, + rootfs_size: 0, + flist: "https://hub.grid.tf/tf-official-apps/jenkins-latest.flist", + entrypoint: "/sbin/zinit init", + env: { + SSH_KEY: config.ssh_key, + JENKINS_HOSTNAME: domain, + JENKINS_ADMIN_USERNAME: "admin", // Default username + JENKINS_ADMIN_PASSWORD: "12345678", // Default password + }, + }, + ], + metadata: "", + description: "test deploying Jenkins via ts grid3 client", + }; + + // Deploy VMs + await deploy(grid3, vms, subdomain, gatewayNode); + + // Get the deployment + await getDeployment(grid3, vms, subdomain); + + // Uncomment the line below to cancel the deployment + // await cancel(grid3, { name }, { name: subdomain }); + + await grid3.disconnect(); +} + +main(); diff --git a/packages/grid_client/scripts/applications/jitsi.ts b/packages/grid_client/scripts/applications/jitsi.ts new file mode 100644 index 0000000000..6975143435 --- /dev/null +++ b/packages/grid_client/scripts/applications/jitsi.ts @@ -0,0 +1,117 @@ +import { FilterOptions, GatewayNameModel, MachinesModel } from "../../src"; +import { config, getClient } from "../client_loader"; +import { log, pingNodes } from "../utils"; + +async function deploy(client, vms, subdomain, gatewayNode) { + const resultVM = await client.machines.deploy(vms); + log("================= Deploying VM ================="); + log(resultVM); + log("================= Deploying VM ================="); + + const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; + // Name Gateway Model + const gw: GatewayNameModel = { + name: subdomain, + node_id: gatewayNode.nodeId, + tls_passthrough: false, + backends: ["http://[" + vmPlanetary + "]:80"], + }; + + const resultGateway = await client.gateway.deploy_name(gw); + log("================= Deploying name gateway ================="); + log(resultGateway); + log("================= Deploying name gateway ================="); +} + +async function getDeployment(client, vms, gw) { + const resultVM = await client.machines.getObj(vms.name); + const resultGateway = await client.gateway.getObj(gw); + log("================= Getting deployment information ================="); + log(resultVM); + log(resultGateway); + log("https://" + resultGateway[0].domain); + log("================= Getting deployment information ================="); +} + +async function cancel(client, vms, gw) { + const resultVM = await client.machines.delete(vms); + const resultGateway = await client.gateway.delete_name(gw); + log("================= Canceling the deployment ================="); + log(resultVM); + log(resultGateway); + log("================= Canceling the deployment ================="); +} + +async function main() { + const name = "newjitsi"; + const grid3 = await getClient(`jitsi/${name}`); + const subdomain = "jt" + grid3.twinId + name; + const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; // Update the instance capacity values according to your requirements. + + // VMNode Selection + const vmQueryOptions: FilterOptions = { + cru: instanceCapacity.cru, + mru: instanceCapacity.mru, + sru: instanceCapacity.sru, + availableFor: grid3.twinId, + farmId: 1, + }; + // GatewayNode Selection + const gatewayQueryOptions: FilterOptions = { + gateway: true, + availableFor: grid3.twinId, + }; + const gatewayNode = (await grid3.capacity.filterNodes(gatewayQueryOptions))[0]; + const nodes = await grid3.capacity.filterNodes(vmQueryOptions); + const vmNode = await pingNodes(grid3, nodes); + const domain = subdomain + "." + gatewayNode.publicConfig.domain; + + const vms: MachinesModel = { + name, + network: { + name: "jitnet", + ip_range: "10.251.0.0/16", + }, + machines: [ + { + name: "jitsi", + node_id: vmNode, + disks: [ + { + name: "jitDisk", + size: instanceCapacity.sru, + mountpoint: "/mnt/data", + }, + ], + planetary: true, + public_ip: false, + public_ip6: false, + mycelium: true, + cpu: instanceCapacity.cru, + memory: 1024 * instanceCapacity.mru, + rootfs_size: 0, + flist: "https://hub.grid.tf/tf-official-apps/jitsi-latest.flist", + entrypoint: "/sbin/zinit init", + env: { + SSH_KEY: config.ssh_key, + JITSI_HOSTNAME: domain, + }, + }, + ], + metadata: "", + description: "test deploying Jitsi via ts grid3 client", + }; + + // Deploy VMs + await deploy(grid3, vms, subdomain, gatewayNode); + + // Get the deployment + await getDeployment(grid3, vms, subdomain); + + // Uncomment the line below to cancel the deployment + // await cancel(grid3, { name }, { name: subdomain }); + + await grid3.disconnect(); +} + +main(); diff --git a/packages/grid_client/scripts/applications/nostor.ts b/packages/grid_client/scripts/applications/nostor.ts new file mode 100644 index 0000000000..345719469e --- /dev/null +++ b/packages/grid_client/scripts/applications/nostor.ts @@ -0,0 +1,117 @@ +import { FilterOptions, GatewayNameModel, MachinesModel } from "../../src"; +import { config, getClient } from "../client_loader"; +import { log, pingNodes } from "../utils"; + +async function deploy(client, vms, subdomain, gatewayNode) { + const resultVM = await client.machines.deploy(vms); + log("================= Deploying VM ================="); + log(resultVM); + log("================= Deploying VM ================="); + + const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; + // Name Gateway Model + const gw: GatewayNameModel = { + name: subdomain, + node_id: gatewayNode.nodeId, + tls_passthrough: false, + backends: ["http://[" + vmPlanetary + "]:8080"], + }; + + const resultGateway = await client.gateway.deploy_name(gw); + log("================= Deploying name gateway ================="); + log(resultGateway); + log("================= Deploying name gateway ================="); +} + +async function getDeployment(client, vms, gw) { + const resultVM = await client.machines.getObj(vms.name); + const resultGateway = await client.gateway.getObj(gw); + log("================= Getting deployment information ================="); + log(resultVM); + log(resultGateway); + log("https://" + resultGateway[0].domain); + log("================= Getting deployment information ================="); +} + +async function cancel(client, vms, gw) { + const resultVM = await client.machines.delete(vms); + const resultGateway = await client.gateway.delete_name(gw); + log("================= Canceling the deployment ================="); + log(resultVM); + log(resultGateway); + log("================= Canceling the deployment ================="); +} + +async function main() { + const name = "newnostr"; + const grid3 = await getClient(`nostr/${name}`); + const subdomain = "nt" + grid3.twinId + name; + const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; + + // VMNode Selection + const vmQueryOptions: FilterOptions = { + cru: instanceCapacity.cru, + mru: instanceCapacity.mru, + sru: instanceCapacity.sru, + availableFor: grid3.twinId, + farmId: 1, + }; + // GatewayNode Selection + const gatewayQueryOptions: FilterOptions = { + gateway: true, + availableFor: grid3.twinId, + }; + const gatewayNode = (await grid3.capacity.filterNodes(gatewayQueryOptions))[0]; + const nodes = await grid3.capacity.filterNodes(vmQueryOptions); + const vmNode = await pingNodes(grid3, nodes); + const domain = subdomain + "." + gatewayNode.publicConfig.domain; + + const vms: MachinesModel = { + name, + network: { + name: "ntnet", + ip_range: "10.252.0.0/16", + }, + machines: [ + { + name: "nostr", + node_id: vmNode, + disks: [ + { + name: "ntDisk", + size: instanceCapacity.sru, + mountpoint: "/mnt/data", + }, + ], + planetary: true, + public_ip: false, + public_ip6: false, + mycelium: true, + cpu: instanceCapacity.cru, + memory: 1024 * instanceCapacity.mru, + rootfs_size: 0, + flist: "https://hub.grid.tf/tf-official-apps/nostr_relay-mycelium.flist", + entrypoint: "/sbin/zinit init", + env: { + SSH_KEY: config.ssh_key, + NOSTR_HOSTNAME: domain, + }, + }, + ], + metadata: "", + description: "test deploying Nostr via ts grid3 client", + }; + + // Deploy VMs + await deploy(grid3, vms, subdomain, gatewayNode); + + // Get the deployment + await getDeployment(grid3, vms, subdomain); + + // Uncomment the line below to cancel the deployment + // await cancel(grid3, { name }, { name: subdomain }); + + await grid3.disconnect(); +} + +main(); From 9e85413fe0c0137cfdf52afd07e5cc174c32a53a Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Mon, 2 Dec 2024 18:02:53 +0200 Subject: [PATCH 2/5] fixed jitsi and nostr --- packages/grid_client/scripts/applications/nostor.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/grid_client/scripts/applications/nostor.ts b/packages/grid_client/scripts/applications/nostor.ts index 345719469e..aadbe61e3c 100644 --- a/packages/grid_client/scripts/applications/nostor.ts +++ b/packages/grid_client/scripts/applications/nostor.ts @@ -9,7 +9,7 @@ async function deploy(client, vms, subdomain, gatewayNode) { log("================= Deploying VM ================="); const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; - // Name Gateway Model + const gw: GatewayNameModel = { name: subdomain, node_id: gatewayNode.nodeId, @@ -48,7 +48,6 @@ async function main() { const subdomain = "nt" + grid3.twinId + name; const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; - // VMNode Selection const vmQueryOptions: FilterOptions = { cru: instanceCapacity.cru, mru: instanceCapacity.mru, @@ -56,11 +55,12 @@ async function main() { availableFor: grid3.twinId, farmId: 1, }; - // GatewayNode Selection + const gatewayQueryOptions: FilterOptions = { gateway: true, availableFor: grid3.twinId, }; + const gatewayNode = (await grid3.capacity.filterNodes(gatewayQueryOptions))[0]; const nodes = await grid3.capacity.filterNodes(vmQueryOptions); const vmNode = await pingNodes(grid3, nodes); @@ -69,7 +69,7 @@ async function main() { const vms: MachinesModel = { name, network: { - name: "ntnet", + name: "nostrnet", ip_range: "10.252.0.0/16", }, machines: [ @@ -78,7 +78,7 @@ async function main() { node_id: vmNode, disks: [ { - name: "ntDisk", + name: "nsDisk", size: instanceCapacity.sru, mountpoint: "/mnt/data", }, @@ -99,7 +99,7 @@ async function main() { }, ], metadata: "", - description: "test deploying Nostr via ts grid3 client", + description: "Deploying Nostr instance via TS Grid3 client", }; // Deploy VMs From 4c9e99df4f0688bab1598eebfaaa2606ef8762a3 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 17 Dec 2024 09:05:47 +0200 Subject: [PATCH 3/5] fixes for gitea --- .../grid_client/scripts/applications/gitea.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/grid_client/scripts/applications/gitea.ts b/packages/grid_client/scripts/applications/gitea.ts index 249239c336..fa3bf51d52 100644 --- a/packages/grid_client/scripts/applications/gitea.ts +++ b/packages/grid_client/scripts/applications/gitea.ts @@ -13,7 +13,7 @@ async function deploy(client, vms, subdomain, gatewayNode) { const gw: GatewayNameModel = { name: subdomain, node_id: gatewayNode.nodeId, - tls_passthrough: false, + tls_passthrough: true, backends: ["http://[" + vmPlanetary + "]:3000"], }; @@ -43,7 +43,7 @@ async function cancel(client, vms, gw) { } async function main() { - const name = "newgitea"; + const name = "ng"; const grid3 = await getClient(`gitea/${name}`); const subdomain = "gt" + grid3.twinId + name; const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; @@ -78,7 +78,7 @@ async function main() { node_id: vmNode, disks: [ { - name: "gitDisk", + name: "gitDisk1", size: instanceCapacity.sru, mountpoint: "/mnt/data", }, @@ -95,13 +95,14 @@ async function main() { env: { SSH_KEY: config.ssh_key, GITEA__HOSTNAME: domain, - GITEA__mailer__PROTOCOL: "smtp", - GITEA__mailer__ENABLED: "true", - GITEA__mailer__HOST: "smtp.example.com", - GITEA__mailer__FROM: "admin@example.com", - GITEA__mailer__PORT: "587", - GITEA__mailer__USER: "admin", - GITEA__mailer__PASSWD: "123456", + // incase of using smtp mail serever + // GITEA__mailer__PROTOCOL: "smtp", + // GITEA__mailer__ENABLED: "true", + // GITEA__mailer__HOST: "smtp.example.com", + // GITEA__mailer__FROM: "admin@example.com", + // GITEA__mailer__PORT: "587", + // GITEA__mailer__USER: "admin", + // GITEA__mailer__PASSWD: "123456", }, }, ], @@ -115,7 +116,7 @@ async function main() { // Get the deployment await getDeployment(grid3, vms, subdomain); - // Uncomment the line below to cancel the deployment + // // Uncomment the line below to cancel the deployment // await cancel(grid3, { name }, { name: subdomain }); await grid3.disconnect(); From 524a2d5cad984bc2d1ca3d319c18334016ee6558 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Wed, 18 Dec 2024 09:44:39 +0200 Subject: [PATCH 4/5] randomize name generation fixing gateway creation --- .../grid_client/scripts/applications/gitea.ts | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/grid_client/scripts/applications/gitea.ts b/packages/grid_client/scripts/applications/gitea.ts index fa3bf51d52..ffda494613 100644 --- a/packages/grid_client/scripts/applications/gitea.ts +++ b/packages/grid_client/scripts/applications/gitea.ts @@ -8,13 +8,14 @@ async function deploy(client, vms, subdomain, gatewayNode) { log(resultVM); log("================= Deploying VM ================="); - const vmPlanetary = (await client.machines.getObj(vms.name))[0].planetary; + const VMmyceliumIP = (await client.machines.getObj(vms.name))[0].myceliumIP; + // Name Gateway Model const gw: GatewayNameModel = { name: subdomain, node_id: gatewayNode.nodeId, - tls_passthrough: true, - backends: ["http://[" + vmPlanetary + "]:3000"], + tls_passthrough: false, + backends: [`http://[${VMmyceliumIP}]:3000`], }; const resultGateway = await client.gateway.deploy_name(gw); @@ -43,10 +44,11 @@ async function cancel(client, vms, gw) { } async function main() { - const name = "ng"; + const name = `newgitea${Math.random().toString(36).substring(2, 8)}`; + const networkName = `net${Math.random().toString(36).substring(2, 8)}`; const grid3 = await getClient(`gitea/${name}`); - const subdomain = "gt" + grid3.twinId + name; const instanceCapacity = { cru: 2, mru: 4, sru: 50 }; + const subdomain = `gt${grid3.twinId}${name}${Math.random().toString(36).substring(2, 6)}`; // VMNode Selection const vmQueryOptions: FilterOptions = { @@ -56,6 +58,7 @@ async function main() { availableFor: grid3.twinId, farmId: 1, }; + // GatewayNode Selection const gatewayQueryOptions: FilterOptions = { gateway: true, @@ -69,16 +72,16 @@ async function main() { const vms: MachinesModel = { name, network: { - name: "gitnet1", + name: networkName, ip_range: "10.253.0.0/16", }, machines: [ { - name: "gitea1", + name: `vm${Math.random().toString(36).substring(2, 8)}`, node_id: vmNode, disks: [ { - name: "gitDisk1", + name: `disk${Math.random().toString(36).substring(2, 8)}`, size: instanceCapacity.sru, mountpoint: "/mnt/data", }, @@ -95,19 +98,18 @@ async function main() { env: { SSH_KEY: config.ssh_key, GITEA__HOSTNAME: domain, - // incase of using smtp mail serever - // GITEA__mailer__PROTOCOL: "smtp", - // GITEA__mailer__ENABLED: "true", + // GITEA__mailer__PROTOCOL: "smtp", // Optional: SMTP Configuration + // GITEA__mailer__ENABLED: "false", // Set to true if enabling mail server // GITEA__mailer__HOST: "smtp.example.com", // GITEA__mailer__FROM: "admin@example.com", // GITEA__mailer__PORT: "587", // GITEA__mailer__USER: "admin", - // GITEA__mailer__PASSWD: "123456", + // GITEA__mailer__PASSWD: "password123", }, }, ], metadata: "", - description: "test deploying Gitea via ts grid3 client", + description: "Deploying Gitea via TS Grid3 client", }; // Deploy VMs @@ -116,7 +118,7 @@ async function main() { // Get the deployment await getDeployment(grid3, vms, subdomain); - // // Uncomment the line below to cancel the deployment + // Uncomment to cancel the deployment // await cancel(grid3, { name }, { name: subdomain }); await grid3.disconnect(); From c256363829820d3b1dee0f543d070ad813660564 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Wed, 18 Dec 2024 09:48:33 +0200 Subject: [PATCH 5/5] using public ip for gitea --- packages/grid_client/scripts/applications/gitea.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grid_client/scripts/applications/gitea.ts b/packages/grid_client/scripts/applications/gitea.ts index ffda494613..ef6f7004a9 100644 --- a/packages/grid_client/scripts/applications/gitea.ts +++ b/packages/grid_client/scripts/applications/gitea.ts @@ -8,7 +8,7 @@ async function deploy(client, vms, subdomain, gatewayNode) { log(resultVM); log("================= Deploying VM ================="); - const VMmyceliumIP = (await client.machines.getObj(vms.name))[0].myceliumIP; + const GatewayIP = (await client.machines.getObj(vms.name))[0].publicIP; // Name Gateway Model const gw: GatewayNameModel = { @@ -87,7 +87,7 @@ async function main() { }, ], planetary: true, - public_ip: false, + public_ip: true, public_ip6: false, mycelium: true, cpu: instanceCapacity.cru,