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
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
sudo apt-get install curl gnupg apt-transport-https -y
## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Community mirror of Cloudsmith: modern Erlang repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Community mirror of Cloudsmith: RabbitMQ repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null
## Add apt repositories maintained by Team RabbitMQ
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu noble main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu noble main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu noble main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu noble main
## Provides RabbitMQ
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu noble main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu noble main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu noble main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.rabbitmq.com/rabbitmq/rabbitmq-server/deb/ubuntu noble main
EOF
## Install Erlang packages
sudo apt-get install -y erlang-base \
erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
erlang-runtime-tools erlang-snmp erlang-ssl \
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
+44
View File
@@ -0,0 +1,44 @@
systemctl start rabbitmq-server
rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins enable rabbitmq_stream
# 1. Users:
# regex: for resources for according permissions
rabbitmqctl add_user azaion_admin Az@1on
rabbitmqctl set_user_tags azaion_admin administrator
# set_permissions username config_regex write_regex read_regex
rabbitmqctl set_permissions azaion_admin ".*" ".*" ".*"
# Az@1onPr00ducc$ewr
rabbitmqctl add_user azaion_producer producer_pass
rabbitmqctl set_user_tags azaion_producer producer
rabbitmqctl set_permissions azaion_producer "" ".*" ""
# Az@1onRe$v777ve2r
rabbitmqctl add_user azaion_receiver receiver_pass
rabbitmqctl set_user_tags azaion_receiver receiver
rabbitmqctl set_permissions azaion_receiver "" "" ".*"
# 2. Streams declarations (5gb limits):
# 2.1 Download rabbitmqadmin
wget http://127.0.0.1:15672/cli/rabbitmqadmin
chmod +x rabbitmqadmin
mv rabbitmqadmin /etc/rabbitmq
# add to PATH:
# put export PATH="$PATH:/etc/rabbitmq" to the end of the ~/.profile
source ~/.profile
# 2.2 declare queues with x-queue-type stream:
rabbitmqadmin delete queue name=azaion-annotations
rabbitmqadmin declare queue name=azaion-annotations arguments='{"x-queue-type": "stream", "max-length-bytes": 5368709120}'
rabbitmqadmin delete queue name=azaion-annotations-confirm
rabbitmqadmin declare queue name=azaion-annotations-confirm arguments='{"x-queue-type": "stream", "max-length-bytes": 5368709120}'
rabbitmqadmin delete queue name=azaion-commands
rabbitmqadmin declare queue name=azaion-commands
# 2.3 configure rabbitmq
# edit /etc/rabbitmq/rabbitmq.conf
# put here:
# stream.advertised_host = 188.245.120.247
# (should be your IP)
# go to http://188.245.120.247:15672/ enter creds and see admin panel