SageSphinx63920
SageSphinx63920
CDCloudflare Developers
Created by SageSphinx63920 on 11/13/2024 in #general-help
Cloudflared for tunnels for internet-to-site and warp for vnets at the same time?
Is it possible to have cloudflared and a warp connector installed at one machine and have it working? I use cloudflared for Internet-to-site access and zero trust from outside access to private websites exposed on some hostnames and want to use warp for the vnets so i can access my infrastructure over ipv4 with my warp app installed on macos. Everything itself works, so warp works and cloudflared works but if i start warp when cloudflared is already running the tunnel status goes to degraded and i get 502 errors on my public pages. Any ideas?
1 replies
CDCloudflare Developers
Created by SageSphinx63920 on 7/16/2024 in #general-help
Simple API request failing
No description
3 replies
CDCloudflare Developers
Created by SageSphinx63920 on 3/8/2024 in #workers-help
Email worker never sends my mail out
I did some stuff with AI workers and email workers fixed but i have a problem: My email is never sent my mail our. This is my wrangler.toml
name = "email-classification"
main = "src/index.ts"
compatibility_date = "2024-03-04"

node_compat = true

send_email = [
{name = "MAILS"},
]

d1_databases = [
{ binding = "STATISTICS", database_name = "mail_classification_stats", database_id = "a0165a55-ffa1-4b39-96bf-9118979c0f77" }
]

[vars]
MAXIMAL_NEGATIVE_SCORE = "60"

[ai]
binding = "AI"

[[kv_namespaces]]
binding = "EMAIL_ALLOCATIONS"
id = "bec1eaf6acf14936b088e68a6a3feb76"
name = "email-classification"
main = "src/index.ts"
compatibility_date = "2024-03-04"

node_compat = true

send_email = [
{name = "MAILS"},
]

d1_databases = [
{ binding = "STATISTICS", database_name = "mail_classification_stats", database_id = "a0165a55-ffa1-4b39-96bf-9118979c0f77" }
]

[vars]
MAXIMAL_NEGATIVE_SCORE = "60"

[ai]
binding = "AI"

[[kv_namespaces]]
binding = "EMAIL_ALLOCATIONS"
id = "bec1eaf6acf14936b088e68a6a3feb76"
13 replies
CDCloudflare Developers
Created by SageSphinx63920 on 2/28/2024 in #workers-help
Email workers send email
Hello im trying to send an email within the email woker. I tried this:
import { EmailMessage } from "cloudflare:email";
import { createMimeMessage } from "mimetext";

export default {
async fetch(request, env, ctx) {
return new Response('Hello World!');
},

async email(message, env, ctx) {
console.log("Email received", message);
const msg = createMimeMessage();

msg.setSender({ name: message.from, addr: message.from});

msg.setSubject("Message");
msg.addMessage({
contentType: 'text/plain',
data: `${ message.raw }`
});

msg.setHeaders(message.headers)

console.log("Msg object ready");

var message = new EmailMessage(
message.from,
msg.asRaw()
);


console.log("Messages ready");

try {
await env.SEB.send(message);
console.log("Message sent");
} catch (e) {
console.error(e.message);
}
}
};
import { EmailMessage } from "cloudflare:email";
import { createMimeMessage } from "mimetext";

export default {
async fetch(request, env, ctx) {
return new Response('Hello World!');
},

async email(message, env, ctx) {
console.log("Email received", message);
const msg = createMimeMessage();

msg.setSender({ name: message.from, addr: message.from});

msg.setSubject("Message");
msg.addMessage({
contentType: 'text/plain',
data: `${ message.raw }`
});

msg.setHeaders(message.headers)

console.log("Msg object ready");

var message = new EmailMessage(
message.from,
msg.asRaw()
);


console.log("Messages ready");

try {
await env.SEB.send(message);
console.log("Message sent");
} catch (e) {
console.error(e.message);
}
}
};
but i get the error: Cannot read properties of undefined (reading 'send'). Im not the best at JS and workers but my guess is that "SEB" is not defined or not the object i need, but i dont have any clue how to fix this. I took code from https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/#example-worker and https://developers.cloudflare.com/email-routing/email-workers/reply-email-workers/
38 replies
CDCloudflare Developers
Created by SageSphinx63920 on 2/25/2024 in #general-help
Do tunnels apply general settings?
Hello, i did work with tunnels for quite some time but i never figured this out: Do they apply my general settings? Tunnels do show up as CNAME record at least for the HTTP(S) tunnels with proxy enabled. Do they actually apply my settings like Brotli or my Edge Certificate settings as well as workers? I do also have antoher question: how do i configure the catch all rule in the tunnels settings?
9 replies