owncloud-archive / vm

Scripts to build an ownCloud community production VM - this was in use until 9.1.x releases. Since 10.0.1 we build appliances with Univention
https://www.univention.de/produkte/univention-app-center/app-katalog/owncloud/
23 stars 14 forks source link

Install script for Ubuntu 14.04 #3

Closed enoch85 closed 9 years ago

enoch85 commented 9 years ago

As disscussed with @jnweiger we need to add a install scipt that takes care of all the initial settings when the VM box is downloaded and mounted by the user.

How would we add this?

1, Add a script during the build of the box that is inluded in the box something like this (not tested, just wrote from my head):

STARTUP=".../scripts/startup.sh"

cat <<-FIRST-INSTALL > "$STARTUP" 

#!bin/bash

# Activate self-signed SSL 
a2enmod ssl  
a2dissite default-ssl  
a2ensite owncloud-self-signed-ssl.conf  (We have to make a Vhost that is included in the box from start, or add it afterwards in the same way as the startup-script)
service apache2 reload  

# Update the system
apt-get update
apt-get upgrade --force-yes -y

# Set keyboard layout 
echo "Current keyboard layout is US" 
echo "You must change keyboard layout to your language" 
echo -e "\e[32m" 
read -p "Press any key to change keyboard layout... " -n1 -s 
echo -e "\e[0m" 
dpkg-reconfigure keyboard-configuration  
echo 
clear  

 # Change Timezone 
echo "Current Timezone is US" 
echo "You must change timezone to your timezone" 
echo -e "\e[32m" 
read -p "Press any key to change timezone... " -n1 -s 
echo -e "\e[0m" 
dpkg-reconfigure tzdata 
echo 
# Sleep so that the user can check that it´s correct
sleep 2
clear  

FIRST-INSTALL
exit 0

2, Add the script so that it's "hardcoded" inside the VM afterwards

3, Some other alternative

jnweiger commented 9 years ago

I suggest to run the 'initial settings script' when the root user logs in for the first time. This would also cover the '@enoch85 use-case' (run vagrant up and use the Appliance right away).

The procedure for the current eval appliance is:

enoch85 commented 9 years ago

@jnweiger Yes, I agree. That´s exactly how I do it today except the update process it automated from start as well, including updating ownCloud through the .occ command (Usecase: If I'm one day late with updating the VM the inital-script takes care of that as well)

@karlitschek The Ubuntu VM that I provide already does all the things that this box would do, and even more. I could strip it down to include only the most nessesary things (exclude installation of Webmin and such) and use my VM as the offical Ubuntu VM for ownCloud.

The difference would be that we wouln't build the box every time, just do the updates needed when a new ownCloud version is released in the same way as I do today. Or do you think it's better to build it with scripts like suggested?

karlitschek commented 9 years ago

@enoch85 so how do you build your appliance? Would it be possible to add everything that is needed to this repository here? I like to be transparent and open source. @jnweiger What do you think?

enoch85 commented 9 years ago

@karlitschek I just build it one time, and update it when a new release comes and save the changes in the same VM. In other words it's a regular VM with a full version of Ubuntu Server 14.04, inlcuding LAMP and OpenSSH. I could publish the scripts I use on Github so that others can help improve them. Do you think that´s transperant enough? Please feel free to download it and test it yourself: https://www.en0ch.se/pre-configured-owncloud-installaton/

The scripts are located in /var/scripts/

enoch85 commented 9 years ago

@jnweiger FYI: I played around a little bit yesterday, and it would be possible to create the "FIRST-INSTALL" script when the box is created so that the user only have to run it by themselves, or if we pre activate it when the user becomes root.

jnweiger commented 9 years ago

My goal is to have it fully scripted, so that the VM build is repeatable from jenkins without any human intervention.

@enoch85 in /var/scripts I see histroy.sh owncloud_update.sh instructions.sh setup_secure_permissions_owncloud.sh The script that creates the VM and installs the owncloud packages is missing there. Something comparable to my ApplianceEngine.sh script.

jnweiger commented 9 years ago

@enoch85, I'll strip down the first install scripts from the enterprise eval appliance and add it to the Tree here.

jnweiger commented 9 years ago

I've added the Tree.SUSE with the 'old cruft' that we used for the enterprise eval appliance. Refernce only. The scripts that I saw from @enoch85 are in much better shape than this.

enoch85 commented 9 years ago

This is in. Closing.