From 494235686c094756cb71934eb88ddd0f456d585a Mon Sep 17 00:00:00 2001 From: meaz Date: Fri, 16 Jul 2021 10:13:55 +0200 Subject: [PATCH 1/3] Fix some errors with vagrant --- vagrant/README.md | 6 +++--- vagrant/Vagrantfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vagrant/README.md b/vagrant/README.md index 9aa30446..57f29aa9 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -68,15 +68,15 @@ ``` 7. Clone Disroot Changelog repo to Disroot folder ``` - git clone https://git.disroot.org/Disroot/CHANGELOG.git ~/Disroot/Disroot-Privacy-Policy + git clone https://git.disroot.org/Disroot/CHANGELOG.git ~/Disroot/Disroot-Changelog ``` 8. Add the local domain name for the hub to your host machine's `/etc/hosts` file. ``` - echo "192.168.33.12 disroot.lan" >> /etc/hosts + sudo "192.168.33.12 disroot.lan" >> /etc/hosts ``` 9. Launch Vagrant to build the virtual machine (VM). This will take several minutes. ``` - cd ~/Disroot/disroot-website/vagrant + cd ~/DisrootWebsite/vagrant vagrant up disroot_lan ``` diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index cdc8c280..7d1f9730 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -22,6 +22,6 @@ Vagrant.configure("2") do |config| disroot_lan.vm.synced_folder "../../grav-theme-disrootblog/", "/var/www/grav-theme-disrootblog", owner: "www-data", group: "www-data" disroot_lan.vm.synced_folder "../../grav-plugin-language-selector/", "/var/www/grav-plugin-language-selector", owner: "www-data", group: "www-data" disroot_lan.vm.synced_folder "../../Disroot-Privacy-Policy/", "/var/www/privacy_policy/", owner: "www-data", group: "www-data" - disroot_lan.vm.synced_folder "../../CHANGELOG/", "/var/www/changelog/", owner: "www-data", group: "www-data" + disroot_lan.vm.synced_folder "../../Disroot-Changelog/", "/var/www/changelog/", owner: "www-data", group: "www-data" end end From 29d3dc00469543750c7217b6c46fce18b7dede3d Mon Sep 17 00:00:00 2001 From: meaz Date: Fri, 16 Jul 2021 10:27:31 +0200 Subject: [PATCH 2/3] fix more errors + update on vagrant and virtualbox --- vagrant/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vagrant/README.md b/vagrant/README.md index 57f29aa9..b83dec17 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -3,13 +3,13 @@ # Disroot Website Development Environment using Vagrant ## requirements -1. vagrant 2.2.10 +1. vagrant 2.2.17 for install on Debian run commands: ``` - wget https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_x86_64.deb + wget https://releases.hashicorp.com/vagrant/2.2.17/vagrant_2.2.17_x86_64.deb ``` ``` - sudo dpkg -i vagrant_2.2.10_x86_64.deb + sudo dpkg -i vagrant_2.2.17_x86_64.deb ``` ``` sudo apt install -f @@ -26,7 +26,7 @@ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - ``` ``` - sudo apt-get update ; sudo apt-get install virtualbox-6.0 + sudo apt-get update ; sudo apt-get install virtualbox-6.1 ``` 3. vagrant plugins vagrant-vbguest: @@ -72,17 +72,17 @@ ``` 8. Add the local domain name for the hub to your host machine's `/etc/hosts` file. ``` - sudo "192.168.33.12 disroot.lan" >> /etc/hosts + sudo echo "192.168.33.12 disroot.lan" >> /etc/hosts ``` 9. Launch Vagrant to build the virtual machine (VM). This will take several minutes. ``` - cd ~/DisrootWebsite/vagrant + cd ~/Disroot/Website/vagrant vagrant up disroot_lan ``` Congratulations, you should now have a fully functioning apache+GRAV server running locally in a Virtualbox-hosted VM managed by Vagrant. Next time you want to run vagrant simply run command ``` - cd ~/Disroot/disroot-website/vagrant + cd ~/Disroot/Website/vagrant vagrant up disroot_lan vagrant provision ``` @@ -98,7 +98,7 @@ To make your development workflow more efficient, you may wish to use an SSH con ``` 2. Use `vagrant ssh disroot_lan` to log in to the virtual machine. ``` - user@host:~$ cd ~/Disroot/disroot-website/vagrant + user@host:~$ cd ~/Disroot/Website/vagrant user@host:hubzilla-vagrant$ vagrant ssh disroot_lan ``` 3. Switch to root and add your host user public key. From b329cb08ed82fd0208d4ee61f59e7891cd509c56 Mon Sep 17 00:00:00 2001 From: meaz Date: Fri, 16 Jul 2021 11:08:04 +0200 Subject: [PATCH 3/3] Add a script to deploy Website easily on Debian. --- vagrant/README.md | 2 + vagrant/vagrant.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 vagrant/vagrant.sh diff --git a/vagrant/README.md b/vagrant/README.md index 9aa30446..58d4473d 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -2,6 +2,8 @@ # Disroot Website Development Environment using Vagrant +If you prefer the easy way, just execute the vagrant.sh script provided. Make sure your user is in sudoers first. ⚠️ It has been tested with Debian Buster only. ⚠️ + ## requirements 1. vagrant 2.2.10 for install on Debian run commands: diff --git a/vagrant/vagrant.sh b/vagrant/vagrant.sh new file mode 100644 index 00000000..85412191 --- /dev/null +++ b/vagrant/vagrant.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +# Disroot Website Development Environment using Vagrant on DEBIAN + +# !! Make sure your user is in sudoers !! + +sudo apt update ; sudo apt -y dist-upgrade ; sudo apt -y install wget + +## Requirements +### Vagrant 2.2.17 + +dpkg -s vagrant | grep "install ok installed" &> /dev/null ## INSTALL AGAIN even when already installed!! + +if [ $? -eq 0 ]; then + echo "====> Vagrant is installed!" +else + wget https://releases.hashicorp.com/vagrant/2.2.17/vagrant_2.2.17_x86_64.deb + sudo dpkg -i vagrant_2.2.17_x86_64.deb + sudo apt install -f -y +fi + + +### Virtuabox + +dpkg -s virtualbox-6.1 | grep "install ok installed" &> /dev/null + +if [ $? -eq 0 ]; then + echo "====> Virtualbox is installed!" +else + echo 'deb http://download.virtualbox.org/virtualbox/debian buster contrib' | sudo tee /etc/apt/sources.list.d/virtualbox.list + wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - + wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - + sudo apt-get update ; sudo apt-get install -y virtualbox-6.1 +fi + + +### Vagrant plugins vagrant-vbguest: +vagrant plugin list | grep vbguest &> /dev/null + +if [ $? -eq 0 ]; then + echo "====> vagrant-vbguest is installed!" +else + vagrant plugin install vagrant-vbguest +fi + + + +### Git +sudo apt install -y git + + +## Installation +echo "====> Downloading all needed Disroot repos..." + +if [ ! -d ~/Disroot ]; then + mkdir ~/Disroot; +fi + +if [ ! -d ~/Disroot/Website ]; then + git clone https://git.disroot.org/Disroot/Website.git ~/Disroot/Website +fi + +if [ ! -d ~/Disroot/grav-theme-disroot ]; then + git clone https://git.disroot.org/Disroot/grav-theme-disroot.git ~/Disroot/grav-theme-disroot +fi + +if [ ! -d ~/Disroot/grav-theme-disrootblog ]; then + git clone https://git.disroot.org/Disroot/grav-theme-disrootblog.git ~/Disroot/grav-theme-disrootblog +fi + +if [ ! -d ~/Disroot/grav-plugin-language-selector ]; then + git clone https://git.disroot.org/Disroot/grav-plugin-language-selector.git ~/Disroot/grav-plugin-language-selector +fi + +if [ ! -d ~/Disroot/Disroot-Privacy-Policy ]; then + git clone https://git.disroot.org/Disroot/Disroot-Privacy-Policy.git ~/Disroot/Disroot-Privacy-Policy +fi + +if [ ! -d ~/Disroot/Disroot-Changelog ]; then + git clone https://git.disroot.org/Disroot/CHANGELOG.git ~/Disroot/Disroot-Changelog +fi + + +cat /etc/hosts | grep '192.168.33.12' + +if [ $? -eq 0 ]; then + echo "====> Disroot Website Host is already set!" +else + echo '192.168.33.12 disroot.lan' | sudo tee -a /etc/hosts +fi + +echo "====> Booting Disroot Website Virtual Environment..." +cd ~/Disroot/Website/vagrant +vagrant up disroot_lan +vagrant provision + + +echo "====> You can now access Disroot Website VE with your browser at http://disroot.lan"