Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hansson authored Jan 30, 2017
2 parents 63f7ba3 + 60c5abe commit 8f083ee
Show file tree
Hide file tree
Showing 17 changed files with 2,036 additions and 184 deletions.
61 changes: 15 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,29 @@
# Nextcloud VM
[![irc](https://img.shields.io/badge/irc%20channel-%23nextcloud--vm%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=techandme)
# Nextcloud for your RaspberryPI 2 or 3

[![irc](https://img.shields.io/badge/irc%20channel-%23techandme%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=techandme)

## What is NextBerry?
[More info](https://www.techandme.se/nextberry-vm/)

## Maintainers
* [Daniel Hanson](https://github.com/enoch85) @ [Tech and Me](https://www.techandme.se)
* [Ezra Holm](https://github.com/ezraholm50) @ [Tech and Me](https://www.techandme.se)
* [Luis Guzman](https://github.com/Ark74) @ [SwITNet](https://switnet.net)
* You? :)

## Image
[Image link](https://cloud.waaromzomoeilijk.nl/s/dxFxgOqs6crjQYe)

## Build Requirements
These requirements are only applied if you build from the scripts:
* Ubuntu Server 16.04.X Server
* OpenSSH (preferred)
## Documentation
[How to](https://github.com/ezraholm50/NextBerry/wiki)

If you install this on a clean Ubuntu 16.04.X VM, the only script you need to run is "nextcloud_install_production.sh". All the other scripts are fetched from this repository during the installation.

It would be really nice if someone could develop the scripts so that they worked "out of the box", without having to use a "base VM" with Ubuntu 16.04 pre-installed. Vagrant is an option.
## Version info
[Versions](https://github.com/ezraholm50/NextBerry/wiki/Versions)

## Machine configuration
Please check the configuration here: https://www.techandme.se/machine-setup-nextcloud/

## FAQ

Keep asking questions so that we can add them here.

**Q:** The script says: "WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts"
<br />
**A:** http://askubuntu.com/a/463966

**Q:** I get NETWORK NOT OK when booting the VM. How do I solve that?
<br />
**A:** There are a few causes to this error, most of them are your own network or firewall settings.
<br />
- Remove the VM NIC adapter in settings on VMware/Virtualbox and then re-adding a NIC adapter.
![alt_tag](https://goo.gl/gWg9JN)
<br />
- Check your firewall so that it doesn't block this specific IP
<br />
- Check your router/firewall that you have DHCP enabled.
Note: this build does not inlude Webmin.

**Q:** Which Hyper-V generation should we chose when creating a machine to load this image?
<br />
**A:** You currently need to use a 1st generation machine.

**Q:** Do you have a pre-configured Hyper-V VM?
<br />
**A:** Yes we have, you can download it here: https://shop.techandme.se/index.php/product/nextcloud-vm-microsoft-hyper-v-vhd/

**Q:** I want a bigger version of this VM, where can I find that?
<br />
**A:** You can download it here: https://shop.techandme.se/index.php/product/nextcloud-vm-500gb/

**Q:** I have found a bug that I want to report, where do I do that?
<br />
**A:** Just submit your report here: https://github.com/nextcloud/vm/issues/new

## First look

![alt tag](https://raw.githubusercontent.com/nextcloud/screenshots/master/vm/first-look.jpg)
## FAQ
[FAQ](https://github.com/ezraholm50/NextBerry/wiki/FAQ)
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
51 changes: 51 additions & 0 deletions initial-root.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi

mesg n || true

# Resize or use hd
mkdir -p /var/scripts

if [ -f bash /var/scripts/resize-sd.sh ]; then

rm bash /var/scripts/resize-sd.sh
else
wget https://raw.githubusercontent.com/ezraholm50/NextBerry/master/static/resize-sd.sh -P /var/scripts
chmod +x /var/scripts/resize-sd.sh
fi
if [[ $? > 0 ]]
then
echo "Download of scripts failed. System will reboot in 10 seconds..."
sleep 10
reboot
else
clear
fi

bash /var/scripts/resize-sd.sh

# Grab install scripts
mkdir -p /var/scripts

if [ -f /var/scripts/nextcloud_install_production.sh ]; then

rm /var/scripts/nextcloud_install_production.sh
else
wget https://raw.githubusercontent.com/ezraholm50/NextBerry/master/nextcloud_install_production.sh -P /var/scripts
chmod +x /var/scripts/nextcloud_install_production.sh
fi
if [[ $? > 0 ]]
then
echo "Download of scripts failed. System will reboot in 10 seconds..."
sleep 10
reboot
else
clear
fi

bash /var/scripts/nextcloud_install_production.sh
4 changes: 2 additions & 2 deletions issue_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Thank you for reporting your issue to us!
Please report only issues corresponding to the VM for Nextcloud 9 or later. If you found a bug that is related to core,
Please report only issues corresponding to NextBerry for Nextcloud 11 or later. If you found a bug that is related to core,
you can file your report here: https://github.com/nextcloud/server
-->
## Steps to reproduce
Expand All @@ -19,7 +19,7 @@ Tell us what happens instead

**Server version:** (see your admin page)

**VM version**
**Raspberry 2 or 3?**

**Updated from an older installed version or fresh install:**

Expand Down
59 changes: 36 additions & 23 deletions nextcloud-startup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ SCRIPTS=/var/scripts
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}')
CLEARBOOT=$(dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt -y purge)
PHPMYADMIN_CONF="/etc/apache2/conf-available/phpmyadmin.conf"
GITHUB_REPO="https://raw.githubusercontent.com/nextcloud/vm/master"
STATIC="https://raw.githubusercontent.com/nextcloud/vm/master/static"
LETS_ENC="https://raw.githubusercontent.com/nextcloud/vm/master/lets-encrypt"
TECHANDTOOL="https://raw.githubusercontent.com/ezraholm50/techandtool/master"
GITHUB_REPO="https://raw.githubusercontent.com/ezraholm50/NextBerry/master"
STATIC="https://raw.githubusercontent.com/ezraholm50/NextBerry/master/static"
LETS_ENC="https://raw.githubusercontent.com/ezraholm50/NextBerry/master/lets-encrypt"
UNIXUSER=ncadmin
UNIXPASS=nextcloud

Expand All @@ -29,6 +30,34 @@ else
sleep 1
fi

# Whiptail size
WT_HEIGHT=17
WT_WIDTH=$(tput cols)

if [ -z "$WT_WIDTH" ] || [ "$WT_WIDTH" -lt 60 ]; then
WT_WIDTH=80
fi
if [ "$WT_WIDTH" -gt 178 ]; then
WT_WIDTH=120
fi
WT_MENU_HEIGHT=$((WT_HEIGHT-7))

# Whiptail check
if [ $(dpkg-query -W -f='${Status}' whiptail 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "Whiptail is already installed..."
clear
else

{
i=1
while read -r line; do
i=$(( i + 1 ))
echo $i
done < <(apt update; apt install whiptail -y)
} | whiptail --title "Progress" --gauge "Please wait while installing Whiptail..." 6 60 0

fi

# Check if root
if [ "$(whoami)" != "root" ]
then
Expand Down Expand Up @@ -110,7 +139,7 @@ then
sleep 0.1
else
echo "nextant failed"
echo "Script failed to download. Please run: 'sudo bash /var/scripts/nextcloud-startup-script.sh' again."
echo "Script failed to download. Please run: 'sudo bash /var/scripts/nextcloud-startup-script.sh' again."
exit 1
fi

Expand Down Expand Up @@ -401,7 +430,7 @@ clear
echo -e "\e[0m"

# Set keyboard layout
echo "Current keyboard layout is Swedish"
echo "Current keyboard layout is English"
echo "You must change keyboard layout to your language"
echo -e "\e[32m"
read -p "Press any key to change keyboard layout... " -n1 -s
Expand Down Expand Up @@ -595,7 +624,7 @@ fi
clear

# Change Timezone
echo "Current timezone is $(cat /etc/timezone)"
echo "Current timezone is Europe/Stockholm"
echo "You must change timezone to your timezone"
echo -e "\e[32m"
read -p "Press any key to change timezone... " -n1 -s
Expand Down Expand Up @@ -730,24 +759,8 @@ echo "+--------------------------------------------------------------------+"
echo
echo -e "\e[0m"

#### Needs testing
# VPS?
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "yes" == $(ask_yes_or_no "Do you run this on a *remote* VPS?") ]]
then
echo "Ok, then your IP are probably wrong, we will use the backup file to recover it so that you can connect after reboot"
echo -e "\e[32m"
read -p "Press any key to continue... " -n1 -s
echo -e "\e[0m"
mv /etc/network/interfaces.backup /etc/network/interfaces
else
sleep 1
fi
clear

cat << LETSENC
Expand Down
Loading

0 comments on commit 8f083ee

Please sign in to comment.