Louis
Louis
Explore posts from servers
CDCloudflare Developers
Created by Louis on 7/31/2024 in #workers-help
File Upload in Workers via Formdata
Hello im currently trying to build an endpoint which lets me upload files to a R2 Bucket. But the formdata gives me a string in result instead of an object. I used to do this before but now its not an object anymore. Did this got changed? Can someone give me a example code snippet? Thanks yall! With kind regards Louis
1 replies
DTDrizzle Team
Created by Louis on 6/26/2024 in #help
Normal boolean conditions
Hello, i want to achieve the following:
const record = await drizzle(c.env.DATABASE)
.select()
.from(dataProject)
.where(and(eq(dataProject.id, id), and(eq(dataProject.userId, user.id), user.role == "manager")))
.limit(1);
const record = await drizzle(c.env.DATABASE)
.select()
.from(dataProject)
.where(and(eq(dataProject.id, id), and(eq(dataProject.userId, user.id), user.role == "manager")))
.limit(1);
Show everything for managers (user is an object outside of drizzle) or the records where the userId is the current users id. the user.role == "manager" part doesnt work. is there a alternative for this without unnecessary if statements? Thanks yall
4 replies
DTDrizzle Team
Created by Louis on 6/7/2024 in #help
Reference the same table
Hello, I use drizzle with a sqlite d1 database. I have the following schema: export const authUser = sqliteTable("auth_user", { id: text("id").notNull().primaryKey(), email: text("email").notNull().unique(), firstName: text("first_name").notNull(), lastName: text("last_name").notNull(), role: text("role").notNull(), // unassigned, office, construction verified: integer("verified", { mode: "boolean" }).notNull(), manager: text("user_id").references(() => authUser.id), }); But it get the following error: typescript: 'authUser' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. How can i fix this?
4 replies
CDCloudflare Developers
Created by Louis on 5/21/2024 in #workers-help
Communication with local system via websocket
Hello, I need following. I have a Worker running. This worker needs access to a rest api in an local network which isnt exposed. The plan is to write a program like a gateway which runs locally and is 24/7 connected to the worker via a websocket. When I send a "task" like "GET the json from http://exampleservice.local:8121/exampleendpoint/" the gateway queries the data and responds to the worker also via the websocket. So i would be a async call. Would this work? Especially with the 24/7 connection to the websocket or would this spike my cloudflare bill? I heard that websockets in workers only get billed on messages sent in the websocket. Or does anyone has an better idea? Thanks yall!
1 replies
DTDrizzle Team
Created by Louis on 1/16/2024 in #help
D1 Migrations
No description
1 replies
DTDrizzle Team
Created by Louis on 1/14/2024 in #help
Migrate all data from Turso to Cloudflare D1
Hello, is there some tool or function to migrate all data from Database Provider A to B?
2 replies
CDCloudflare Developers
Created by Louis on 1/13/2024 in #general-help
Webapp behind Cloudflare Access cant access Cookies
Hello I have a Webapp which is behind Access. I want to validate the CF_Authorization Cookie but when i try to get document.cookie i only get an empty string. On the same page when i open the DevTools and go to Application > Cookies > DOMAIN.TLD > I see the cookies with the current domain. Do i have to enable anything to get this working?
52 replies
CDCloudflare Developers
Created by Louis on 1/11/2024 in #general-help
.../cdn-cgi/access/get-identity ->{"err":"could not retrieve identity"}
As the title says. When i try to get the identity of the current gateway user i get the following response. Does anyone have an idea?
36 replies
CDCloudflare Developers
Created by Louis on 1/9/2024 in #general-help
Is there something like Cf-Access-Authenticated-User-Email for Gateway?
Im building an app which is only accessable via Gateway. Now the question in the title so i dont have to implement some 2nd level login system
23 replies
CDCloudflare Developers
Created by Louis on 1/9/2024 in #general-help
Cant delete Access Groups and Service Tokens
Hello, I created a servicetoken for testing and deleted the application where i used it. Now i wanted to delete the servicetoken but it says it still gets used by a policy. The same thing with 2 access groups. Do I need to wait so the system can clean this up automatically or something or do I need to open a support ticket or something? Thanks!
1 replies
CDCloudflare Developers
Created by Louis on 1/8/2024 in #general-help
Zero Trust bypass login when Gateway/Warp is enabled
Hello, i would like to setup an application to bypass the access login when gateway is enabled. It doesnt show me neither warp or gateway on /cdn-cgi/trace. Even when i enable "Install CA to system certificate store" it doesnt work. I read like every forum entry about this thing and nothing helped. Thanks yall!
10 replies
DTDrizzle Team
Created by Louis on 12/18/2023 in #help
Best way to seperate environments
Hello, I use drizzle with cf workers and turso database. Whats the best way to split my project into a dev and prod database? So i can develop and change the dev database and push it to the prod database? Any ideas someone? Thanks yall
5 replies
DTDrizzle Team
Created by Louis on 12/9/2023 in #help
Unix Timestamp conditions
Hello everyone, Im trying to build a select statement rn but u dont get it done and could need some help. I have a database (turso sqlite) where i store timestamps in the unix epoch format (like: 1702132073000). Now i want to select all rows where the timestamp is TODAY so only compare the date and ignore the time. how can i do this? Thanks everyone!
4 replies
DTDrizzle Team
Created by Louis on 10/11/2023 in #help
between operator
Hello i have a table where i have 2 columns where i save timestamps (epoch time) as integer. when i try to query it with the between operator i get no response. .where(between(1697013797353, table.startDate, table.endDate)) the number gets red underlined. Also when i use sqlCURRENT_TIME and so on it doesnt work either. Any idea anyone? Thanks!
6 replies
DTDrizzle Team
Created by Louis on 10/2/2023 in #help
No such table: main.__old_push_[TABLENAME]
Hello, I tried to setup Lucia Auth with DrizzleORM and Torso LibSQL. The database reads/writes work via drizzleORM but when i want to create a user via Lucia Auth i get the error from the title. Does anyone have an idea?
77 replies
CDCloudflare Developers
Created by Louis on 9/23/2023 in #workers-help
Best way to deploy microservices
Hello im going to build my backend on cloudflare workers as different microservices. Should i handle everything (auth, …) in each microservice or should i build a api gateway which handles auth and so on and redirects the the microservices? Also does anyone has some examples? THX!
1 replies