Skip to content

Commit

Permalink
feat: update to use newer versions of mongodb/redis & add more automa…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
GrowlyX committed May 23, 2023
1 parent c3a3980 commit 625598a
Show file tree
Hide file tree
Showing 4 changed files with 1,163 additions and 304 deletions.
29 changes: 22 additions & 7 deletions completeInstall.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# author - gorlwx
# author - growlyx
# update & upgrade if required
apt-get update
apt-get upgrade
Expand Down Expand Up @@ -31,12 +31,14 @@ systemctl restart sshd
echo "configured ssh (please test)"

# configure default UFW rules
current_ip=$(echo "$SSH_CLIENT" | cut -d' ' -f 1)

ufw allow 22
ufw allow in from ${current_ip}
ufw default deny incoming
ufw enable

echo "we've configured ufw, but you should allow your ip through:"
echo "ufw allow in from <your IP>"
echo "we've configured ufw and allowed your IP to access services."

# install & configure docker.io & UFW rules
echo "should we configure docker & its UFW rules?"
Expand Down Expand Up @@ -66,7 +68,12 @@ echo "should we configure redis?"
read -r configure_redis

if [ "$configure_redis" = true ]; then
apt install redis
sudo apt install lsb-release
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis

cp -R resources/redis.conf /etc/redis/
systemctl restart redis

Expand All @@ -78,9 +85,17 @@ echo "should we configure mongo?"
read -r configure_mongo

if [ "$configure_mongo" = true ]; then
apt install mongodb
cp -R resources/mongodb.conf /etc/
systemctl restart mongodb
sudo apt-get install gnupg
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

sudo apt-get update
sudo apt-get install -y mongodb-org

cp -R resources/mongod.conf /etc/
systemctl restart mongod

echo "configured mongo"
fi
Expand Down
43 changes: 43 additions & 0 deletions resources/mongod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:

# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

# network interfaces
net:
port: 27017
bindIp: 0.0.0.0


# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:
101 changes: 0 additions & 101 deletions resources/mongodb.conf

This file was deleted.

Loading

0 comments on commit 625598a

Please sign in to comment.