From 8744c96b260027ec1f538f751dfee23152df74a2 Mon Sep 17 00:00:00 2001 From: GeoDirk Date: Thu, 7 Jun 2018 08:22:09 +0300 Subject: [PATCH 1/4] Create install_osid.sh --- install_osid.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 install_osid.sh diff --git a/install_osid.sh b/install_osid.sh new file mode 100644 index 0000000..d16956c --- /dev/null +++ b/install_osid.sh @@ -0,0 +1 @@ +#/bin/bash From cf5015b5f4f4cbafb9c68523cb23a15e10154398 Mon Sep 17 00:00:00 2001 From: GeoDirk Date: Fri, 8 Jun 2018 08:42:13 +0300 Subject: [PATCH 2/4] created auto installer --- README.md | 21 +++++++++ install_osid.sh | 120 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65874ac..91db935 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 "". 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/imaageroot`. + + ### Prerequisites What things you need to install the software and how to install them diff --git a/install_osid.sh b/install_osid.sh index d16956c..37ac6bb 100644 --- a/install_osid.sh +++ b/install_osid.sh @@ -1 +1,119 @@ -#/bin/bash +#!/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 + +mv osid.desktop.sample /home/pi/Desktop/osid.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===" + + From 6bcfc054387d9738bc1431d0c1b7adb47862fd07 Mon Sep 17 00:00:00 2001 From: GeoDirk Date: Fri, 8 Jun 2018 19:30:49 +0300 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91db935..61d10b1 100755 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ 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 "". Double clicking this will launch the GUI. +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/imaageroot`. +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 From 06e9e29215e8efdd89927f9d31cafa2dbd409ef4 Mon Sep 17 00:00:00 2001 From: GeoDirk Date: Tue, 8 Jan 2019 13:13:13 +0300 Subject: [PATCH 4/4] Added in root file manager desktop icon --- install_osid.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install_osid.sh b/install_osid.sh index 37ac6bb..96b432c 100644 --- a/install_osid.sh +++ b/install_osid.sh @@ -76,8 +76,17 @@ 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