├── Nextcloud Windows development environment.md ├── Nextcloud macOS development environment.md ├── README.md ├── nextcloud-koding.sh ├── nextcloud-on-android.md ├── nextcloud-setup-opensuse.sh ├── nextcloud-setup.sh ├── nextcloud-update-opensuse.sh ├── nextcloud-update.sh ├── owncloud-client-arm-update.sh ├── owncloud-client-arm.sh └── owncloud-raspberrypi.sh /Nextcloud Windows development environment.md: -------------------------------------------------------------------------------- 1 | # Nextcloud development environment on Windows 2 | 3 | 4 | ## Set up a Virtual Machine with Ubuntu to act as the server 5 | 6 | - Install VirtualBox: https://www.virtualbox.org/wiki/Downloads (click »Windows hosts«) 7 | - Download Ubuntu Desktop https://www.ubuntu.com/download/desktop (Server if your laptop is slower) https://www.ubuntu.com/download/server 8 | - Set up the virtual machine 9 | - Standard settings 10 | - Choose the Ubuntu file you downloaded as image 11 | - At the »Erase disk and install Ubuntu« it’s safe to do it because the virtual machine does not have access to your system :) 12 | - At the step of where to install additional packages, choose »LAMP server« – enable with spacebar (if you missed it, just do `sudo apt-get install lamp-server^` in the installed Ubuntu) 13 | - Install the guest additions to make shared folders work: `sudo apt-get install virtualbox-guest-dkms` (http://en.ig.ma/notebook/2012/virtualbox-guest-additions-on-ubuntu-server) 14 | - Install the additional needed packages for Nextcloud: `sudo apt-get install php7.0-curl php7.0-gd php7.0-mbstring php7.0-sqlite3 php7.0-xml php7.0-zip` 15 | - For that virtual machine, change the »network attached to« from NAT to Host-only so the VM is accessible by Windows: https://www.youtube.com/watch?v=1DtLEmqaOxw (This will also cut off internet access for the VM, but it’s not needed anymore) (TODO: Try the IP it gives out for bridged so it gets both?) 16 | 17 | 18 | ## Get the Nextcloud code 19 | 20 | - Install Github Desktop: https://desktop.github.com/ (If you like to do it manually or via the command line, use Git for Windows instead: https://git-for-windows.github.io/) 21 | - In Github Desktop, clone the Nextcloud server repository to Windows https://github.com/nextcloud/server 22 | 23 | 24 | ## Enable the VM to access the Nextcloud code folder 25 | 26 | - In VirtualBox, go to Settings -> Shared Folders and add that Nextcloud folder http://www.howtogeek.com/187703/how-to-access-folders-on-your-host-machine-from-an-ubuntu-virtual-machine-in-virtualbox/ 27 | - As manual mount because otherwise there are permission issues: 28 | `sudo -H -u username mount -t vboxsf -o uid=$UID,gid=$(id -g) nextcloud /var/www/html/nextcloud` (TODO: do on startup, and maybe for www-data directly?) (http://www.htpcbeginner.com/mount-virtualbox-shared-folder-on-ubuntu-linux/) 29 | - (if that doesn't work try `sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) nextcloud /var/www/html/nextcloud`) 30 | - add this command to sudo nano /etc/rc.local before »exit 0« https://askubuntu.com/questions/294736/run-a-shell-script-as-another-user-that-has-no-password 31 | - create a folder »nextcloud-data« in /var/www: `mkdir /var/www/nextcloud-data` 32 | - give the web server user permission: `chown www-data:www-data nextcloud-data` 33 | 34 | 35 | ## (optional) Give a nice address to access the VM 36 | 37 | - Add `192.168.56.101 nextcloud.dev` to the Windows hosts file (or whatever the IP of the virtual machine is, you can find out via the command `ifconfig` in the Ubuntu VM) https://askubuntu.com/questions/52147/how-can-i-access-apache-on-virtualbox-guest-from-host 38 | - TODO: How to make it HTTPS so Spreed / WebRTC works? 39 | 40 | 41 | ## Finish installation 42 | 43 | - In your browser on Windows, go to nextcloud.dev/nextcloud (or whatever you changed it to in the previous step) 44 | - You should see the installation screen of Nextcloud, asking for admin username and password 45 | - So choose an admin username & password 46 | - Expand the change data folder to `/var/www/nextcloud-data` 47 | 48 | :tada: 49 | 50 | Now do your changes and use Github Desktop to push them! Every time you want to develop on Nextcloud, you just need to start your VM. :) 51 | -------------------------------------------------------------------------------- /Nextcloud macOS development environment.md: -------------------------------------------------------------------------------- 1 | # Nextcloud development environment on macOS 2 | 3 | (If you use macOS 10.12 Sierra or earlier, you also need to install dependencies: Get php71 and sqlite via [Homebrew](https://brew.sh/).) 4 | 5 | 1. **Get the Nextcloud code:** Either using [Github Desktop](https://desktop.github.com/) (or using the Terminal if you prefer that), clone the Nextcloud server repository https://github.com/nextcloud/server 6 | 7 | 2. **Get Nextcloud submodules:** Using the Terminal, run this command in the nextcloud folder you just cloned: `git submodule update --init` 8 | 9 | 3. **Start the server:** In the Terminal, run the command: `php -S localhost:8000` 10 | 11 | 4. **Finish installation:** In your browser, go to http://localhost:8000. You should see the setup screen asking for username and password. 12 | 13 | :tada: Now do your changes and use Github Desktop to push them! :) 14 | 15 | (Special thanks to @xMartin for his [quick start guide](https://twitter.com/xMartin/status/844117579237068800)!) 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :rainbow: :dancer: :hammer: How to 2 | 3 | Set the permissions to run the script: 4 | 5 | ``` 6 | $ chmod a+x nextcloud--.sh 7 | ``` 8 | 9 | Run it: 10 | ``` 11 | $ chmod a+x nextcloud--.sh 12 | ``` 13 | ## :pencil2: Apache configuration for symlinks 14 | 15 | ### :bangbang: “Symbolic link not allowed or link target not accessible" 16 | :pushpin: The script creates a symlink from your home directory to the server folder. Apache will throw the error “Symbolic link not allowed or link target not accessible" in /var/log/apache2/error_log if you do not to configure it properly as described bellow. 17 | 18 | #### :crocodile: openSUSE Linux 19 | 20 | Add the following lines to /etc/apache2/default-server.conf: 21 | 22 | ``` 23 | Options Indexes FollowSymLinks 24 | AllowOverride None 25 | ``` 26 | 27 | The settings need to be in ``````: 28 | 29 | ``` 30 | DocumentRoot "/srv/www/htdocs" 31 | 32 | # 33 | # Configure the DocumentRoot 34 | # 35 | 36 | Options Indexes FollowSymLinks 37 | AllowOverride None 38 | #Require all granted 39 | ``` 40 | 41 | Restart Apache: 42 | 43 | ``` 44 | $ sudo apache2ctl restart 45 | ``` 46 | 47 | 48 | ### :smiley_cat: Ubuntu 49 | 50 | WIP 51 | 52 | ### 🔒 If your home folder is encrypted 53 | 54 | The symlinks will not work, so you need to work around that as described at this link: https://stackoverflow.com/a/39037942 55 | 56 | ``` 57 | $ sudo apt-get install lsyncd 58 | ``` 59 | Starting the background service 60 | ``` 61 | $ sudo lsyncd -rsync /home//nextcloud/ /var/www/html/nextcloud/ 62 | ``` 63 | Additionally set the permissions on the lsynced files in /var/www 64 | ``` 65 | sudo chown www-data:www-data /var/www/data 66 | sudo chown :www-data /var/www/config/ 67 | sudo chmod 775 /var/www/config/ 68 | sudo chown :www-data /var/www/apps/ 69 | sudo chmod 775 /var/www/apps/ 70 | ``` 71 | -------------------------------------------------------------------------------- /nextcloud-koding.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Set up Nextcloud dev environment for Koding.com 3 | # Jan-Christoph Borchardt, http://jancborchardt.net 4 | # 5 | # One-liner to run from your terminal: 6 | # wget https://raw.github.com/jancborchardt/nextcloud-scripts/master/nextcloud-koding.sh; sh nextcloud-koding.sh 7 | 8 | 9 | # Change this to "git@github.com:" if you are a core developer 10 | GITPREFIX="https://github.com/" 11 | 12 | # Change this path if you want to install Nextcloud somewhere else 13 | INSTALLFOLDER=$HOME/Web/ 14 | 15 | echo 16 | echo "This script sets up a development environment for Nextcloud." 17 | echo "You’ll get the latest version from https://github.com/nextcloud to play around with." 18 | echo 19 | echo 20 | echo 21 | echo "Installing dependencies ..." 22 | sudo apt-get install -y php-xml-parser php5-intl sqlite php5-sqlite curl php5-curl 23 | echo 24 | echo 25 | echo 26 | echo "Downloading Nextcloud server ..." 27 | cd $INSTALLFOLDER 28 | git clone ${GITPREFIX}nextcloud/server.git nextcloud 29 | cd nextcloud 30 | echo 31 | echo 32 | echo 33 | echo "Setting up 3rdparty ..." 34 | git submodule init 35 | git submodule update 36 | echo 37 | echo 38 | echo 39 | echo "Setting permissions ..." 40 | mkdir data 41 | sudo chown -R www-data:www-data data 42 | # Keep user permissions for apps and config so you can still develop on them 43 | sudo chown -R www-data:$USER config 44 | sudo chown -R www-data:$USER apps 45 | echo 46 | echo 47 | echo 48 | echo "Enabling .htaccess ..." 49 | sudo a2enmod rewrite 50 | sudo service apache2 restart 51 | echo 52 | echo 53 | echo 54 | echo "All set up!" 55 | echo "To finish the installation, go to http://$USER.kd.io/nextcloud" 56 | echo 57 | -------------------------------------------------------------------------------- /nextcloud-on-android.md: -------------------------------------------------------------------------------- 1 | # 🤖☁️ [Nextcloud](https://nextcloud.com) on Android 2 | 3 | **Set up a [Nextcloud](https://nextcloud.com) server and development environment on your Android device.** This is useful if you are on the move and need to test things, or have an extra device you want to use as your own server. 4 | 5 | ## Clone code using [MGit](https://f-droid.org/packages/com.manichord.mgit/) (optional, you can also just use the terminal) 6 | - Set "root storage location for repos" to something like `/storage/emulated/0` 7 | - Clone with: Remote URL `https://github.com/nextcloud/server.git`, Local Path `nextcloud` (doesn’t support 2FA – if you use that [get an app token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and log in with that) 8 | - Clone the 3rdparty submodule too, local path `nextcloud/3rdparty` 9 | 10 | ## Install (and optionally clone as well) with [Termux](https://termux.com/) 11 | - First install some dependencies `pkg install php php-fpm sqlite coreutils openssl-tool` 12 | - Allow Termux to access storage outside of own folder `termux-setup-storage` 13 | - (If you want to clone with Termux: `cd /storage/emulated/0/ && git clone https://github.com/nextcloud/server.git nextcloud`) 14 | - Get the Nextcloud submodules `cd /storage/emulated/0/nextcloud/ && git submodule update --init` 15 | - Start the server `php -S 0.0.0.0:8080 -t /storage/emulated/0/nextcloud/` 16 | 17 | ## Finish setup in [Firefox](https://www.mozilla.org/firefox/android/) 18 | - Go to `http://0.0.0.0:8080` 19 | - Set an admin username and password in the 20 | - (SQLite will be used as database) 21 | 22 | ## 🎉 23 | Now you can check out branches and test them, or even edit files in some code editor. :) 24 | -------------------------------------------------------------------------------- /nextcloud-setup-opensuse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Set up Nextcloud server & apps from latest git master 3 | # Perfect for local development environment 4 | # Jan-Christoph Borchardt, http://jancborchardt.net 5 | 6 | # Change this to git://github.com/ if you’re not a core developer 7 | GITPREFIX="git@github.com:" 8 | 9 | # Change this path if you want to install Nextcloud somewhere else 10 | INSTALLFOLDER=$HOME/Projects/Nextcloud 11 | 12 | echo 13 | echo "Installing dependencies ..." 14 | # TODO fix the package names for zypper 15 | #sudo zypper install -y git apache2 sqlite3 libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-sqlite3 php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip composer 16 | 17 | echo "Setting up server ..." 18 | cd $INSTALLFOLDER 19 | git clone ${GITPREFIX}nextcloud/server.git nextcloud 20 | cd nextcloud 21 | echo 22 | 23 | echo "Setting up 3rdparty ..." 24 | git submodule update --init 25 | echo 26 | 27 | cd apps 28 | for APP in activity bookmarks calendar circles contacts deck files_filter files_pdfviewer files_texteditor files_videoplayer firstrunwizard gallery jsxc.nextcloud logreader mail maps news nextcloud_announcements notes notifications password_policy richdocuments serverinfo socialsharing spreed survey_client tasks user_external end_to_end_encryption 29 | do 30 | echo "Setting up $APP ..." 31 | git clone ${GITPREFIX}nextcloud/$APP.git 32 | echo 33 | done 34 | cd .. 35 | 36 | echo "Setting permissions ..." 37 | mkdir data 38 | sudo chown wwwrun:www data 39 | sudo chown :www config/ 40 | sudo chmod 775 config/ 41 | sudo chown :www apps/ 42 | sudo chmod 775 apps/ 43 | 44 | echo "Symlinking to /srv/www/htdocs/ ..." 45 | sudo ln -s $INSTALLFOLDER/nextcloud /srv/www/htdocs/ 46 | 47 | echo "Settings from .htaccess ..." 48 | sudo a2enmod rewrite 49 | sudo a2enmod headers 50 | 51 | echo "Starting server ..." 52 | sudo apache2ctl restart 53 | 54 | echo 55 | echo "All set up!" 56 | echo "Now go to http://localhost/nextcloud to finish the installation" 57 | echo 58 | -------------------------------------------------------------------------------- /nextcloud-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Set up Nextcloud server & apps from latest git master 3 | # Perfect for local development environment 4 | # Jan-Christoph Borchardt, http://jancborchardt.net 5 | 6 | # Change this to git://github.com/ if you’re not a core developer 7 | GITPREFIX="git@github.com:" 8 | 9 | # Change this path if you want to install Nextcloud somewhere else 10 | INSTALLPATH=$HOME 11 | 12 | # Change this folder if you want a different name for the Nextcloud folder 13 | INSTALLFOLDER="nextcloud" 14 | 15 | echo 16 | echo "Installing dependencies ..." 17 | sudo apt-get install -y git apache2 sqlite3 libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-sqlite3 php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip composer 18 | 19 | 20 | echo "Setting up server ..." 21 | cd $INSTALLPATH 22 | git clone ${GITPREFIX}nextcloud/server.git $INSTALLFOLDER 23 | cd $INSTALLFOLDER 24 | echo 25 | 26 | echo "Setting up 3rdparty ..." 27 | git submodule update --init 28 | echo 29 | 30 | cd apps 31 | for APP in activity bookmarks calendar circles contacts deck files_filter files_pdfviewer files_rightclick files_texteditor files_videoplayer firstrunwizard gallery jsxc.nextcloud logreader mail maps news nextcloud_announcements notes notifications password_policy richdocuments serverinfo socialsharing spreed survey_client tasks user_external 32 | do 33 | echo "Setting up $APP ..." 34 | git clone ${GITPREFIX}nextcloud/$APP.git 35 | echo 36 | done 37 | cd .. 38 | 39 | echo "Setting permissions ..." 40 | mkdir data 41 | sudo chown www-data:www-data data 42 | sudo chown :www-data config/ 43 | sudo chmod 775 config/ 44 | sudo chown :www-data apps/ 45 | sudo chmod 775 apps/ 46 | 47 | echo "Symlinking to /var/www ..." 48 | sudo mkdir /var/www 49 | sudo ln -s $INSTALLPATH/$INSTALLFOLDER /var/www/ 50 | 51 | 52 | echo "Creating Apache configuration ..." 53 | # https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#apache-web-server-configuration 54 | sudo cat >/etc/apache2/sites-available/$INSTALLFOLDER.conf < 58 | Options +FollowSymlinks 59 | AllowOverride All 60 | 61 | 62 | Dav off 63 | 64 | 65 | SetEnv HOME /var/www/${INSTALLFOLDER} 66 | SetEnv HTTP_HOME /var/www/${INSTALLFOLDER} 67 | 68 | 69 | EOL 70 | 71 | sudo cat /etc/apache2/sites-available/$INSTALLFOLDER.conf 72 | 73 | sudo a2ensite $INSTALLFOLDER.conf 74 | 75 | 76 | echo "Settings from .htaccess ..." 77 | sudo a2enmod rewrite 78 | sudo a2enmod headers 79 | 80 | echo "Starting server ..." 81 | sudo service apache2 restart 82 | sudo systemctl reload apache2 83 | sudo systemctl restart httpd.service 84 | 85 | echo 86 | echo "All set up!" 87 | echo "Now go to http://localhost/${INSTALLFOLDER} to finish the installation" 88 | echo 89 | -------------------------------------------------------------------------------- /nextcloud-update-opensuse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Update Nextcloud server & apps from latest git master 3 | # Perfect for local development environment 4 | # Jan-Christoph Borchardt, http://jancborchardt.net 5 | 6 | # Change this path if you installed Nextcloud somewhere else 7 | cd $HOME/Projects/Nextcloud/nextcloud 8 | 9 | echo 10 | echo "Updating core ..." 11 | git checkout master 12 | git pull --quiet 13 | echo "core updated. Latest changes:" 14 | git --no-pager log -5 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" 15 | echo 16 | echo "Removing merged branches ..." 17 | git branch --merged master | grep -v 'master$' | xargs git branch -d 18 | git fetch --prune --quiet 19 | echo 20 | 21 | echo "Updating 3rdparty submodule ..." 22 | git submodule update --init 23 | echo 24 | 25 | cd apps 26 | for APP in activity bookmarks calendar circles contacts deck files_filter files_pdfviewer files_texteditor files_videoplayer firstrunwizard gallery jsxc.nextcloud logreader mail maps news nextcloud_announcements notes notifications password_policy richdocuments serverinfo socialsharing spreed survey_client tasks user_external end_to_end_encryption 27 | do 28 | if [ -d "$APP" ]; then 29 | echo "Updating $APP ..." 30 | cd $APP 31 | git checkout master 32 | git pull --quiet 33 | echo $APP "updated. Latest changes:" 34 | git --no-pager log -5 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" 35 | echo 36 | echo "Removing merged branches ..." 37 | git branch --merged master | grep -v 'master$' | xargs git branch -d 38 | git fetch --prune --quiet 39 | cd .. 40 | echo 41 | else 42 | echo "$APP folder not found. If you want to install it clone it first. Otherwise ignore this note." 43 | fi 44 | done 45 | 46 | echo 47 | echo "Everything updated!" 48 | echo "Now get coding and fix some bugs! :)" 49 | echo 50 | -------------------------------------------------------------------------------- /nextcloud-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Update Nextcloud server & apps from latest git master 3 | # Perfect for local development environment 4 | # Jan-Christoph Borchardt, http://jancborchardt.net 5 | 6 | # Change this path if you installed Nextcloud somewhere else 7 | cd $HOME/nextcloud 8 | 9 | echo 10 | echo "Updating core ..." 11 | git checkout master 12 | git pull --quiet 13 | echo "core updated. Latest changes:" 14 | git --no-pager log -5 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" 15 | echo 16 | echo "Removing merged branches ..." 17 | git branch --merged master | grep -v 'master$' | xargs git branch -d 18 | git fetch --prune --quiet 19 | echo 20 | 21 | echo "Updating 3rdparty submodule ..." 22 | git submodule update --init 23 | echo 24 | 25 | cd apps 26 | for APP in activity bookmarks calendar circles contacts deck files_filter files_pdfviewer files_rightclick files_texteditor files_videoplayer firstrunwizard gallery jsxc.nextcloud logreader mail maps news nextcloud_announcements notes notifications password_policy richdocuments serverinfo socialsharing spreed survey_client tasks user_external 27 | do 28 | if [ -d "$APP" ]; then 29 | echo "Updating $APP ..." 30 | cd $APP 31 | git checkout master 32 | git pull --quiet 33 | echo $APP "updated. Latest changes:" 34 | git --no-pager log -5 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" 35 | echo 36 | echo "Removing merged branches ..." 37 | git branch --merged master | grep -v 'master$' | xargs git branch -d 38 | git fetch --prune --quiet 39 | cd .. 40 | echo 41 | else 42 | echo "$APP folder not found. If you want to install it clone it first. Otherwise ignore this note." 43 | fi 44 | done 45 | 46 | echo 47 | echo "Everything updated!" 48 | echo "Now get coding and fix some bugs! :)" 49 | echo 50 | -------------------------------------------------------------------------------- /owncloud-client-arm-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Update ownCloud sync client on Samsung ARM Chromebook with Ubuntu 3 | # Based on the build instructions: http://doc.owncloud.org/desktop/1.3/building.html 4 | # Possibly outdated 5 | 6 | 7 | # Get latest csync and mirall dev versions 8 | cd ocsync 9 | git checkout dav 10 | git pull 11 | cd ../mirall 12 | git pull 13 | cd .. 14 | 15 | 16 | # Build and install csync 17 | mkdir ocsync-build 18 | cd ocsync-build 19 | cmake -DCMAKE_BUILD_TYPE="Debug" ../ocsync 20 | make 21 | sudo make install 22 | cd .. 23 | sudo rm -r ocsync-build 24 | 25 | 26 | # Build and install mirall (adjust /home/user to your path) 27 | mkdir mirall-build 28 | cd mirall-build 29 | cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall \ 30 | -DCSYNC_BUILD_PATH=/home/user/ocsync-build \ 31 | -DCSYNC_INCLUDE_PATH=/home/user/ocsync/src 32 | make 33 | sudo make install 34 | cd .. 35 | sudo rm -r mirall-build 36 | 37 | 38 | # Copy to global 39 | sudo cp /usr/local/lib/libowncloudsync.so* /usr/lib/ 40 | sudo cp /usr/local/lib/libocsync.so* /usr/lib/ 41 | 42 | 43 | echo 44 | echo 'Aaand ownCloud is updated!' 45 | echo -------------------------------------------------------------------------------- /owncloud-client-arm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Install ownCloud sync client on Samsung ARM Chromebook with Ubuntu 3 | # Based on the build instructions: http://doc.owncloud.org/desktop/1.3/building.html 4 | # Possibly outdated 5 | 6 | 7 | # Add repository from Open Build Service 8 | #sudo su 9 | #echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list 10 | #exit 11 | #sudo apt-get update 12 | wget http://download.opensuse.org/repositories/isv:ownCloud:devel/xUbuntu_12.04/Release.key 13 | sudo apt-key add - < Release.key 14 | rm Release.key 15 | 16 | 17 | # Install dependencies 18 | sudo apt-get install build-essential build-dep cmake qt-sdk libsqlite3-dev libneon27-dev 19 | 20 | 21 | # Get latest QTKeyChain and Mirall dev version 22 | git clone https://github.com/frankosterfeld/qtkeychain.git 23 | git clone git://github.com/owncloud/mirall.git 24 | 25 | 26 | # Build and install QTKeyChain 27 | mkdir qtkeychain-build 28 | cd qtkeychain-build 29 | cmake ../qtkeychain 30 | make 31 | sudo make install 32 | cd .. 33 | sudo rm -r qtkeychain-build 34 | 35 | 36 | # Build and install Mirall 37 | mkdir mirall-build 38 | cd mirall-build 39 | cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall 40 | make 41 | sudo make install 42 | cd .. 43 | sudo rm -r mirall-build 44 | 45 | 46 | # Create proper library link 47 | sudo ldconfig 48 | sudo ln -s /usr/local/lib/arm-linux-gnueabihf/libqtkeychain.so.0 /usr/local/lib/ 49 | 50 | 51 | echo 52 | echo 'Aaand ownCloud is installed!' 53 | echo 54 | -------------------------------------------------------------------------------- /owncloud-raspberrypi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Set up ownCloud on a Raspberry Pi 3 | # Plus extras (easy access and backups) 4 | # Making it a fully capable home server 5 | 6 | 7 | 8 | # Some prerequisites: 9 | # 1. Get a Raspberry Pi, including power supply, SD card and network cable 10 | # 2. Install Raspbian on the SD card using your computer 11 | # http://www.raspberrypi.org/documentation/installation/installing-images/README.md 12 | # 3. Put the SD card in your Rasperry Pi, connect it to the router or your computer using the network cable and let it start up. 13 | # 4. Use SSH to log in to the Pi from your laptop: ssh pi@raspberrypi 14 | # http://www.raspberrypi.org/documentation/remote-access/ssh/unix.md 15 | 16 | 17 | 18 | # Now run this script! 19 | # 5. Use raspi-config to expand the filesystem and set a password 20 | # http://www.raspberrypi.org/documentation/configuration/raspi-config.md 21 | sudo raspi-config 22 | 23 | 24 | 25 | # 6. Install Apache & PHP: http://www.raspberrypi.org/documentation/remote-access/web-server/apache.md 26 | sudo apt-get install apache2 -y 27 | sudo apt-get install php5 libapache2-mod-php5 -y 28 | 29 | # 6.1 (optional instead of using SQLite) 30 | # Install MySQL, set a password, and create a database 31 | # http://www.raspberrypi.org/documentation/usage/wordpress/README.md 32 | # sudo apt-get install mysql-server php5-mysql -y 33 | # mysql -uroot -p 34 | # In MySQL: create database owncloud; exit; 35 | 36 | 37 | 38 | # 7. Download and set up ownCloud 39 | # Install ownCloud from packages https://owncloud.org/install/#instructions-packages 40 | sudo sh -c 'echo "deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /" >> /etc/apt/sources.list.d/owncloud.list' 41 | wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key 42 | sudo apt-key add - < Release.key 43 | rm Release.key 44 | sudo apt-get update 45 | sudo apt-get install owncloud 46 | 47 | echo 'Setting up APC for caching ...' 48 | sudo apt-get install php-apc php5-dev -y 49 | sudo pecl install apc 50 | sudo sh -c 'echo "extension=apc.so" >> /etc/php5/cgi/conf.d/apc.ini' 51 | sudo sh -c 'echo "apc.enabled=1" >> /etc/php5/cgi/conf.d/apc.ini' 52 | sudo sh -c 'echo "apc.shm_size=30" >> /etc/php5/cgi/conf.d/apc.ini' 53 | 54 | # TODO 55 | # Further optimizations from http://www.instructables.com/id/Raspberry-Pi-Owncloud-dropbox-clone/?ALLSTEPS 56 | # (Especially modifications to the php.ini, 000-default and .htaccess) 57 | 58 | sudo a2enmod rewrite 59 | sudo a2enmod headers 60 | echo "Restarting server ..." 61 | sudo service apache2 restart 62 | 63 | 64 | 65 | # 8. Finish the ownCloud installation using the web interface 66 | echo 'Now go to http://raspberrypi/owncloud and finish the installation' 67 | echo "Choose an admin username and password, and you're done! :)" 68 | 69 | 70 | 71 | # 9. Install PageKite to be able to access your Pi remotely with ease 72 | # https://pagekite.net/wiki/Howto/GNULinux/DebianPackage/ 73 | echo deb http://pagekite.net/pk/deb/ pagekite main | sudo tee -a /etc/apt/sources.list 74 | sudo apt-key adv --recv-keys --keyserver keys.gnupg.net AED248B1C7B2CAC3 75 | sudo apt-get update 76 | sudo apt-get install pagekite 77 | 78 | # Configure the system https://pagekite.net/wiki/Howto/GNULinux/ConfigureYourSystem/ 79 | sudo nano /etc/pagekite.d/10_account.rc 80 | # TODO prompt to input kite name and secret 81 | sudo mv /etc/pagekite.d/80_httpd.rc.sample /etc/pagekite.d/80_httpd.rc 82 | sudo mv /etc/pagekite.d/80_sshd.rc.sample /etc/pagekite.d/80_sshd.rc 83 | sudo invoke-rc.d pagekite restart 84 | # TODO set up SSH connection: https://pagekite.net/wiki/Howto/SshOverPageKite/ 85 | # add this to ~/.ssh/config 86 | Host *.pagekite.me 87 | CheckHostIP no 88 | ProxyCommand /bin/nc -X connect -x %h:443 %h %p 89 | 90 | 91 | # 10. Set up backups 92 | # http://www.raspberrypi.org/documentation/linux/filesystem/backup.md 93 | # TODO 94 | 95 | 96 | 97 | # 11. Automatic updates 98 | # TODO set as cronjob 99 | sudo apt-get update && sudo apt-get upgrade -y 100 | 101 | 102 | 103 | # 12. Configure wifi usb dongle 104 | # http://raspberrypihq.com/how-to-add-wifi-to-the-raspberry-pi/ 105 | # TODO 106 | 107 | 108 | 109 | # 13. Add IP address to known_hosts in ownCloud config.php 110 | sudo nano /var/www/owncloud/config/config.php 111 | # TODO 112 | 113 | 114 | # 14. If you have an SSH key, add the public key to the Pi for easier log in 115 | mkdir .ssh 116 | cd .ssh 117 | nano authorized_keys 118 | #TODO: properly check if there is a key and copy it over 119 | cd .. 120 | chmod 700 .ssh/ 121 | chmod 600 .ssh/authorized_keys 122 | #TODO: add ssh pi@raspberrypi to .bashrc on laptop 123 | --------------------------------------------------------------------------------