INSTALL 1.4 KB
Newer Older
1
#!/bin/bash
Edvard Rejthar's avatar
Edvard Rejthar committed
2 3 4 5
# Installation file for MDMaug
# If environment variable LC_ALL is empty, you may have some troubles with setting system locale as I had.

DESTINATION=/opt/mdmaug
6 7
PROFILE_COUNT=21

Edvard Rejthar's avatar
Edvard Rejthar committed
8 9 10 11 12

# sometimes, there is no repository with pip on the machine, trying to add some sources
apt install software-properties-common
add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
apt update
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
apt-get install firefox python3 mariadb-server # X should be distributed with python python3-pip
pip3 install xvfbwrapper pymysql peewee jinja2 pyyaml bs4 pygments pillow requests

# mariadb setup
mysql -u root < /opt/mdmaug-installer/mdmaug-installation.sql # populate db
mysql -uroot -e "CREATE USER 'mdmaug'@'localhost' IDENTIFIED BY 'fidFDSs676'; GRANT ALL PRIVILEGES ON mdmaug. * TO 'mdmaug'@'%';" # new user

# adding user the server will be run under
useradd -m -d $DESTINATION mdmaug

# copy all important files
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
cp -r mdmaug $DESTINATION
cp -r .mozilla $DESTINATION
cp *.md $DESTINATION
cd $DESTINATION

# copy firefox profiles (about:config is stored at prefs.js file)
for(( i=1; i<=$((PROFILE_COUNT-1)); i++ )) 
do
    DEST=$DESTINATION/.mozilla/firefox/$i/
    [ -d $DEST ] && "profile $i already exists, wont change" || cp -R .mozilla/firefox/0 $DEST
done 


chown mdmaug:mdmaug -R $DESTINATION
          
   
Edvard Rejthar's avatar
Edvard Rejthar committed
42