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

Enable SMTP only with public ipv4 #2681

Merged
merged 5 commits into from
May 14, 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
4 changes: 4 additions & 0 deletions packages/playground/src/components/smtp_server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<p v-else>Configure your SMTP Server.</p>
</v-alert>

<v-alert variant="tonal" type="warning" class="mt-3">
SMTP functionality requires IPv4. Enabling SMTP will automatically activate IPv4.
</v-alert>
<input-tooltip
v-if="!persistent"
inline
Expand All @@ -31,6 +34,7 @@
v-model="$props.modelValue.username"
v-bind="props"
autofocus
class="mt-3"
/>
</input-tooltip>
</input-validator>
Expand Down
21 changes: 19 additions & 2 deletions packages/playground/src/weblets/tf_discourse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
:medium="{ cpu: 2, memory: 4, disk: 50 }"
:large="{ cpu: 4, memory: 16, disk: 100 }"
/>
<Networks v-model:mycelium="mycelium" />
<Networks v-model:mycelium="mycelium" v-model:ipv4="ipv4" />

<input-tooltip inline tooltip="Click to know more about dedicated machines." :href="manual.dedicated_machines">
<v-switch color="primary" inset label="Dedicated" v-model="dedicated" hide-details />
Expand Down Expand Up @@ -101,7 +101,7 @@
import type { GridClient } from "@threefold/grid_client";
import { Buffer } from "buffer";
import TweetNACL from "tweetnacl";
import { computed, type Ref, ref } from "vue";
import { computed, type Ref, ref, watch } from "vue";

import { manual } from "@/utils/manual";

Expand Down Expand Up @@ -236,6 +236,23 @@ function generatePubKey(): string {
function updateSSHkeyEnv(selectedKeys: string) {
selectedSSHKeys.value = selectedKeys;
}

watch(
Mahmoud-Emad marked this conversation as resolved.
Show resolved Hide resolved
() => smtp.value.enabled,
newValue => {
if (newValue) {
ipv4.value = true;
}
},
);
watch(
() => ipv4.value,
newValue => {
if (!newValue && smtp.value.enabled) {
smtp.value.enabled = false;
}
},
);
</script>

<script lang="ts">
Expand Down
22 changes: 19 additions & 3 deletions packages/playground/src/weblets/tf_mattermost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
:medium="{ cpu: 2, memory: 4, disk: 50 }"
:large="{ cpu: 4, memory: 16, disk: 100 }"
/>
<Networks v-model:mycelium="mycelium" />
<Networks v-model:mycelium="mycelium" v-model:ipv4="ipv4" />

<input-tooltip inline tooltip="Click to know more about dedicated machines." :href="manual.dedicated_machines">
<v-switch color="primary" inset label="Dedicated" v-model="dedicated" hide-details />
Expand All @@ -68,7 +68,6 @@

<manage-ssh-deployemnt @selected-keys="updateSSHkeyEnv($event)" />
</template>

<template #smtp>
<SmtpServer v-model="smtp" />
</template>
Expand All @@ -82,7 +81,7 @@

<script lang="ts" setup>
import type { GridClient } from "@threefold/grid_client";
import { computed, type Ref, ref } from "vue";
import { computed, type Ref, ref, watch } from "vue";

import { manual } from "@/utils/manual";

Expand Down Expand Up @@ -218,6 +217,23 @@ async function deploy() {
function updateSSHkeyEnv(selectedKeys: string) {
selectedSSHKeys.value = selectedKeys;
}

watch(
() => smtp.value.enabled,
newValue => {
if (newValue) {
ipv4.value = true;
}
},
);
watch(
() => ipv4.value,
newValue => {
if (!newValue && smtp.value.enabled) {
smtp.value.enabled = false;
}
},
);
</script>

<script lang="ts">
Expand Down
18 changes: 17 additions & 1 deletion packages/playground/src/weblets/tf_owncloud.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

<script lang="ts" setup>
import type { GridClient } from "@threefold/grid_client";
import { computed, type Ref, ref } from "vue";
import { computed, type Ref, ref, watch } from "vue";

import { manual } from "@/utils/manual";

Expand Down Expand Up @@ -264,6 +264,22 @@ async function deploy() {
function updateSSHkeyEnv(selectedKeys: string) {
selectedSSHKeys.value = selectedKeys;
}
watch(
() => smtp.value.enabled,
newValue => {
if (newValue) {
ipv4.value = true;
}
},
);
watch(
() => ipv4.value,
newValue => {
if (!newValue && smtp.value.enabled) {
smtp.value.enabled = false;
}
},
);
</script>

<script lang="ts">
Expand Down
21 changes: 19 additions & 2 deletions packages/playground/src/weblets/tf_taiga.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
:small="{ cpu: 2, memory: 4, disk: 100 }"
:medium="{ cpu: 4, memory: 8, disk: 150 }"
/>
<Networks v-model:mycelium="mycelium" />
<Networks v-model:mycelium="mycelium" v-model:ipv4="ipv4" />

<input-tooltip inline tooltip="Click to know more about dedicated machines." :href="manual.dedicated_machines">
<v-switch color="primary" inset label="Dedicated" v-model="dedicated" hide-details />
Expand Down Expand Up @@ -132,7 +132,7 @@

<script lang="ts" setup>
import type { GridClient } from "@threefold/grid_client";
import { computed, type Ref, ref } from "vue";
import { computed, type Ref, ref, watch } from "vue";

import { manual } from "@/utils/manual";

Expand Down Expand Up @@ -274,6 +274,23 @@ async function deploy() {
function updateSSHkeyEnv(selectedKeys: string) {
selectedSSHKeys.value = selectedKeys;
}

watch(
() => smtp.value.enabled,
newValue => {
if (newValue) {
ipv4.value = true;
}
},
);
watch(
() => ipv4.value,
newValue => {
if (!newValue && smtp.value.enabled) {
smtp.value.enabled = false;
}
},
);
</script>

<script lang="ts">
Expand Down
Loading