Skip to content

Commit cfd424b

Browse files
lorenzocorallototo04Copilot
authored
feat: new Cipher and tg.users table and router (#17)
* feat: new cipher class with custom salted key * fix: some errors in message route * feat: users table with info encryption * release: v0.12.0 * chore: biome * fix: no await in Promise.all Co-authored-by: Copilot <[email protected]> * fix: optimize users map promises * build: ENCRYPTION_KEY env does not need to be exactly 32 bytes anymore * fix: i am stupid * feat(utils): user encryption helpers, db upsert set builder * fix: not decrypting and not sorting, what am I doing --------- Co-authored-by: Tommaso Morganti <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent b6d0b67 commit cfd424b

File tree

17 files changed

+1197
-117
lines changed

17 files changed

+1197
-117
lines changed

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DB_USER=""
88
DB_PASS=""
99
DB_NAME="polinetwork_backend"
1010

11-
ENCRYPTION_KEY="" # you generate it with `openssl rand -hex 32` !!! LENGTH IS IMPORTANT !!!
11+
ENCRYPTION_KEY="" # you generate it with `openssl rand -hex 32` !!! MINIMUM LENGTH = 32 bytes !!!
1212

1313
BETTER_AUTH_SECRET="" # you generate it with `openssl rand -hex 20`
1414
# github provider https://www.better-auth.com/docs/authentication/github
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE "tg_users" (
2+
"user_id" bigint PRIMARY KEY NOT NULL,
3+
"first_name" varchar(192) NOT NULL,
4+
"last_name" varchar(192),
5+
"username" varchar(128),
6+
"is_bot" boolean NOT NULL,
7+
"lang_code" varchar(35),
8+
"updated_at" timestamp (0),
9+
"created_at" timestamp (0) DEFAULT now() NOT NULL
10+
);

0 commit comments

Comments
 (0)