Skip to content

Commit

Permalink
Merge pull request #3234 from threefoldtech/development_fix_gitea_smtp
Browse files Browse the repository at this point in the history
  • Loading branch information
zaelgohary authored Aug 7, 2024
2 parents c609551 + 4b7ae83 commit 4122be7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/playground/src/constants/deployment_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export const deploymentListEnvironments = {

gitea: {
SSH_KEY: _ssh,
GITEA_HOSTNAME: "Gitea Hostname",
GITEA__HOSTNAME: "Gitea Hostname",
GITEA__mailer__HOST: "Email Host",
GITEA__mailer__PORT: "Email Port",
GITEA__mailer__USER: "Email Host User",
GITEA__mailer__PASSWD: { label: "Email Host Password", type: "password" },
},
nostr: {
SSH_KEY: _ssh,
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/src/weblets/tf_deployment_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
icon="mdi-eye-outline"
@click="openDialog(tabs[activeTab].value, item)"
/>
<IconActionBtn tooltip="Visit" icon="mdi-web" color="anchor" :href="'https://' + item.env.GITEA_HOSTNAME" />
<IconActionBtn tooltip="Visit" icon="mdi-web" color="anchor" :href="'https://' + item.env.GITEA__HOSTNAME" />
</template>

<template #Nostr-actions="{ item }">
Expand Down
29 changes: 26 additions & 3 deletions packages/playground/src/weblets/tf_gitea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<manage-ssh-deployemnt @selected-keys="updateSSHkeyEnv($event)" />
</template>
<template #mail>
<SmtpServer v-model="smtp" :persistent="true" :tls="true">
<SmtpServer v-model="smtp" email tls ssl>
Gitea needs SMTP service so please configure these settings properly.
</SmtpServer>
</template>
Expand All @@ -92,7 +92,7 @@
</template>

<script lang="ts" setup>
import { computed, type Ref, ref } from "vue";
import { computed, type Ref, ref, watch } from "vue";
import { manual } from "@/utils/manual";
Expand Down Expand Up @@ -124,6 +124,20 @@ const gridStore = useGrid();
const grid = gridStore.client as GridClient;
const profileManager = useProfileManager();
watch(
() => smtp.value.enabled,
newSMTP => {
ipv4.value = newSMTP;
},
);
watch(
() => ipv4.value,
newIPv4 => {
smtp.value.enabled = newIPv4;
},
);
function finalize(deployment: any) {
layout.value.reloadDeploymentsList();
layout.value.setStatus("success", "Successfully deployed a Gitea instance.");
Expand Down Expand Up @@ -171,9 +185,18 @@ async function deploy() {
value: selectedSSHKeys.value,
},
{
key: "GITEA_HOSTNAME",
key: "GITEA__HOSTNAME",
value: domain,
},
...(smtp.value.enabled
? [
{ key: "GITEA__mailer__PROTOCOL", value: "smtp" },
{ key: "GITEA__mailer__HOST", value: smtp.value.hostname },
{ key: "GITEA__mailer__PORT", value: smtp.value.port.toString() },
{ key: "GITEA__mailer__USER", value: smtp.value.username },
{ key: "GITEA__mailer__PASSWD", value: smtp.value.password },
]
: []),
],
planetary: planetary.value,
mycelium: mycelium.value,
Expand Down

0 comments on commit 4122be7

Please sign in to comment.