add isDev gate in deno server

This commit is contained in:
akdeb 2026-01-22 16:48:44 +07:00
parent fb54601205
commit 75ab16eae3
4 changed files with 8 additions and 5 deletions

View file

@ -8,10 +8,12 @@
<div style="display:flex; flex-direction:row; align-items:center; flex-wrap:wrap; justify-content:center;">
<a style="display:inline-flex;" href="https://cookbook.openai.com/examples/voice_solutions/running_realtime_api_speech_on_esp32_arduino_edge_runtime_elatoai"><img src="assets/oai.png" height="42" style="width: auto;"></a>
<a style="display:inline-flex;" href="https://discord.gg/KJWxDPBRUj"><img src="assets/discord.png" height="42" style="width: auto;"></a>
<a style="display:inline-flex;" href="https://www.elatoai.com/docs"><img src="assets/docs.png" height="42" style="width: auto;"></a>
<a style="display:inline-flex;" href="https://discord.gg/KJWxDPBRUj"><img src="assets/discord.png" height="42" style="width: auto;"></a>
<a style="display:inline-flex;" href="https://elatoai.com/home"><img src="assets/try.png" height="42" style="width: auto;"></a>
<!-- <a style="display:inline-flex;" href="https://www.elatoai.com/products/ai-devkit"><img src="assets/diy.png" height="42" style="width: auto;"></a> -->
<a style="display:inline-flex;" href="https://www.kickstarter.com/projects/elatoai/elato-make-toys-talk-with-ai-voices"><img src="assets/ks.png" height="44" style="width: auto;"></a>
<!-- <a style="display:inline-flex;" href="https://www.kickstarter.com/projects/elatoai/elato-make-toys-talk-with-ai-voices"><img src="assets/ks.png" height="42" style="width: auto;"></a> -->
<!-- <a style="display:inline-flex;" href="https://www.kickstarter.com/projects/elatoai/elato-make-toys-talk-with-ai-voices"><img src="assets/ks.png" height="44" style="width: auto;"></a>
<a href="https://elatoai.com"><img src="assets/try.png" height="44" style="width: auto;"></a> -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -33,11 +33,11 @@ volatile bool sleepRequested = false;
*/
#ifdef DEV_MODE
const char *ws_server = "172.20.10.2";
const char *ws_server = "192.168.1.155";
const uint16_t ws_port = 8000;
const char *ws_path = "/";
// Backend server details
const char *backend_server = "172.20.10.2";
const char *backend_server = "192.168.1.155";
const uint16_t backend_port = 3000;
#elif defined(PROD_MODE)

View file

@ -142,8 +142,9 @@ server.on("upgrade", async (req, socket, head) => {
supabase = getSupabaseClient(authToken as string);
user = await authenticateUser(supabase, authToken as string);
// allow any mac address for dev
const expectedMac = user.device?.mac_address;
if (deviceMac && deviceMac !== expectedMac) {
if (!isDev && deviceMac && deviceMac !== expectedMac) {
socket.write("HTTP/1.1 401 Unauthorized\r\n\r\n");
socket.destroy();
return;