-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
33 lines (26 loc) · 921 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Install necessary packages
sudo apt update
sudo apt install -y python3 python3-pip git openssl
# Install the required Python packages
pip install -r requirements.txt
# Download the data file
echo "Downloading the data file..."
wget -O 200k.txt "https://www.dropbox.com/scl/fi/ripx1gu2s5w48pklln75f/200k.txt?rlkey=j7l29szvqw0hlyyfhw4i4b1on&e=9&dl=0"
# Set up the configuration file
echo "Creating the configuration file..."
cat <<EOL > config.ini
[Settings]
linuxpath = $(pwd)/200k.txt
reread_on_query = true
[Server]
host = localhost
port = 12345
ssl_enabled = true
EOL
# Generate SSL certificate and key
echo "Generating SSL certificate and key..."
openssl genpkey -algorithm RSA -out server.key -pkeyopt rsa_keygen_bits:2048
openssl req -new -key server.key -out server.csr -subj "/CN=localhost"
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
echo "Setup complete!"