Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mail server config in Gitea #3234

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading