diff --git a/README.md b/README.md index 65874ac..61d10b1 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,27 @@ These instructions will get you a copy of the project up and running on your loc - Monoprice powered USB hubs (7 ports) (4 total) - Monoprice SD card readers (26 total, rpi2 will stall on any more) +### Installer Script + +The installer script will take you through a brand new Raspian system through getting the OS completely prepared for running OSID. + +On your RPi, open up a terminal window and type in the following: + +wget https://raw.githubusercontent.com/GeoDirk/osid-python3/master/install_osid.sh + +Once that file has downloaded type in: + +`chmod 755 install_osid.sh` + +which will change the file permissions to executable. Follow that with: + +`sudo ./install_osid.sh` + +To start the process running. Once the script has completed, you'll need to reboot your machine to finalize the settings. After reboot, there will be a new icon on your Desktop called "rPi SD Card Duplicator". Double clicking this will launch the GUI. + +Samba has been installed on your machine and has opened up a file share that you can see from your network. (Note: that you may have to fix the Workgroup setting in the file: /etc/samba/smb.conf). Either copy the image that you want to burn using the file share or copy it in locally by putting it in the directory `/etc/osid/imageroot`. + + ### Prerequisites What things you need to install the software and how to install them diff --git a/install_osid.sh b/install_osid.sh new file mode 100644 index 0000000..96b432c --- /dev/null +++ b/install_osid.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +function pause(){ + read -p "$*" +} + +echo "===Updating System===" +apt-get update -y +apt-get upgrade -y + +echo "===Installing Required Libraries===" +apt-get install python3 python3-pip dcfldd -y +pip3 install cherrypy + +echo "===Setup Hostname to osid===" +bash -c "echo 'osid' > /etc/hostname" + +echo "===Cloning OSID Project===" +git clone https://github.com/aaronnguyen/osid-python3.git + +mkdir /var/osid +mkdir /etc/osid +mkdir /etc/osid/imgroot +cd osid-python3 +mv * /etc/osid +cd .. +rm -rf osid-python3 + +echo "===Installing Apache===" +apt-get install apache2 -y + +echo "===Configuring Apache===" +apt-get install php-pear -y +defaultweb=' + + ServerAdmin webmaster@localhost + DocumentRoot /etc/osid/www + + Options FollowSymLinks + AllowOverride None + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Require all granted + + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + Require all granted + + ErrorLog ${APACHE_LOG_DIR}/error.log + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/access.log combined +' +echo "$defaultweb" > /etc/apache2/sites-enabled/000-default.conf + +bash -c "echo 'ServerName localhost' > /etc/apache2/conf-available/servername.conf" +ln -s /etc/apache2/conf-available/servername.conf /etc/apache2/conf-enabled/servername.conf + +echo "===Fixing OSID Settings===" +cd /etc/osid/system +mv server.ini.sample server.ini +mv run_app.sh.sample run_app.sh + +sed -i 's/localhost/127.0.0.1/g' server.ini +sed -i 's/80/8080/g' server.ini +sed -i 's/localhost/127.0.0.1/g' server.ini +sed -i 's/\/path_to_folder\/osid-python3/\/etc\/osid/g' server.ini + +sed -i 's/cd \/path_to\/py-rpi-dupe/cd \/etc\/osid/g' run_app.sh +sed -i 's/hostname:port/127.0.0.1:8080/g' run_app.sh + +sed -i 's/\/home\/pi\/Documents\/py-rpi-dupe/\/etc\/osid/g' osid.desktop.sample + +echo "===Make Desktop Icons===" +mv osid.desktop.sample /home/pi/Desktop/osid.desktop +echo "[Desktop Entry] +Name=Root File Manager +Comment=Opens up File Manager with Root Permissions +Icon=/usr/share/pixmaps/gksu-root-terminal.png +Exec=sudo pcmanfm +Type=Application +Encoding=UTF-8 +Terminal=false +Categories=None;" > /home/pi/Desktop/RootFileMan.desktop + +echo "===Configuring Directory Permissions===" +chown www-data:www-data /etc/osid/imgroot -R +chown www-data:www-data /etc/osid/system -R +chown www-data:www-data /etc/osid/www -R + +echo "===Restarting Apache===" +/etc/init.d/apache2 reload +/etc/init.d/apache2 restart + +echo "===Setting up Samba===" +apt-get install samba -y + +sambasettings=" +[global] +workgroup = WORKGROUP +server string = Open Source Image Duplicator +map to guest = Bad User +security = user + +log file = /var/log/samba/%m.log +max log size = 50 + +interfaces = lo eth0 +guest account = www-data + +dns proxy = no + +[Images] +path = /etc/osid/imgroot +public = yes +only guest = yes +writable = yes" +echo "$sambasettings" > /etc/samba/smb.conf + + +echo "===Restart Your System===" + +