add scripts for cdn

change aes mode to cfb in encrypt / decrypt in Security
This commit is contained in:
Alex Bezdieniezhnykh
2025-02-25 19:48:27 +02:00
parent 32955e4c66
commit 6d28085b7e
17 changed files with 104 additions and 7 deletions
+14
View File
@@ -0,0 +1,14 @@
# 01 install postgres, login via system acc, and start psql:
sudo apt install -y postgresql
sudo -i -u postgres
psql
# 02 Edit /etc/postgres/{Version}/main/postgresql.conf and set next:
# listen_addresses = '*' # by default it's bound to localhost, * allows connect from all addresses
# port = 4312 # security reasons
# 03 Edit /etc/postgres/{Version}/main/pg_hba.conf and set next to the end of the file:
# host all all all md5
# 04 restart to apply changes
systemctl restart postgresql
+14
View File
@@ -0,0 +1,14 @@
-- run these commands in psql under admin acc:
create role azaion_superadmin superuser login password 'superadmin-pass';
create database azaion owner azaion_superadmin;
\c azaion
--writer user
create role azaion_admin with login password 'admin-pass';
grant connect on database azaion to azaion_admin;
grant usage on schema public to azaion_admin;
--readonly user
create role azaion_reader with login password 'readonly-pass';
grant connect on database azaion to azaion_reader;
grant usage on schema public to azaion_reader;
+29
View File
@@ -0,0 +1,29 @@
-- users table
drop table users;
create table users
(
id uuid primary key,
email varchar(160) not null,
password_hash varchar(255) not null,
hardware text null,
hardware_hash varchar(120) null,
role varchar(20) not null
);
grant select, insert, update, delete on public.users to azaion_admin;
grant select on table public.users to azaion_reader;
INSERT INTO public.users (id, email, password_hash, hardware, hardware_hash, role)
VALUES ('d90a36ca-e237-4fbd-9c7c-127040ac8556',
'admin@azaion.com',
'282wqVHZU0liTxphiGkKIaJtUA1W6rILdvfEOx8Ez350x0XLbgNtrSUYCK1r/ajq',
null,
null,
'ApiAdmin');
INSERT INTO public.users (id, email, password_hash, hardware, hardware_hash, role)
VALUES ('48adb269-ecd5-4197-a9d1-cd36254cf104',
'uploader@azaion.com',
'2zHX1eSnbdCirc+KRNepcr5g4ZFQhhrII0FggYyMezQzxD+gBxwISCZ48fe1wxAk',
null,
null,
'ResourceUploader');