mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +02:00
parent
01696fc196
commit
affa83d37f
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Vagrant.configure('2') do |config|
|
Vagrant.configure('2') do |config|
|
||||||
|
|
||||||
config.vm.box = 'raspiblitz'
|
config.vm.box = 'rootzoll/raspiblitz'
|
||||||
|
|
||||||
config.vm.network "private_network", type: "dhcp"
|
config.vm.network "private_network", type: "dhcp"
|
||||||
|
|
||||||
|
@ -14,11 +14,10 @@ On MacOS you need to install:
|
|||||||
3. vagrant: `brew install vagrant`
|
3. vagrant: `brew install vagrant`
|
||||||
4. virtualbox: `brew cask install virtualbox` (maybe re-run after you changed the requested secruity permission to be successfull)
|
4. virtualbox: `brew cask install virtualbox` (maybe re-run after you changed the requested secruity permission to be successfull)
|
||||||
|
|
||||||
```sha
|
```
|
||||||
cd alternative.platforms/amd64/packer
|
cd alternative.platforms/amd64/packer
|
||||||
packer build raspiblitz.json
|
packer build raspiblitz.json
|
||||||
|
vagrant box add --force rotzoll/raspiblitz output/raspiblitz.box
|
||||||
vagrant box add --force raspiblitz output/raspiblitz.box
|
|
||||||
cd ../../..
|
cd ../../..
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -36,4 +35,4 @@ You will need to connect a virtual data drive to the RaspiBlitzVM ... todo so:
|
|||||||
Every file in `home.admin` will be linked to `/home/admin` inside the VM,
|
Every file in `home.admin` will be linked to `/home/admin` inside the VM,
|
||||||
if you add a new file you should run `vagrant provision` to make sure it gets linked inside the VM. Every time you boot the VM, `home.admin` files will be linked automatically.
|
if you add a new file you should run `vagrant provision` to make sure it gets linked inside the VM. Every time you boot the VM, `home.admin` files will be linked automatically.
|
||||||
|
|
||||||
The content of the `/home/admin/assets` folder is not kept in sync at the moment (see [#1578](https://github.com/rootzoll/raspiblitz/issues/1578)). You can still access your development assets file inside the VM in `/vagrant/home.admin/assets/`.
|
The content of the `/home/admin/assets` folder is not kept in sync at the moment (see [#1578](https://github.com/rootzoll/raspiblitz/issues/1578)). You can still access your development assets file inside the VM in `/vagrant/home.admin/assets/`.
|
@ -1,26 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
echo "************* Vagrant Provisioning ********************"
|
||||||
|
|
||||||
echo "************* Vagrant provisioning ********************"
|
echo 'Syncing local code with RaspiBlitzVM'
|
||||||
|
|
||||||
echo 'linking development files'
|
# make sure the lastest sync script is in place
|
||||||
source_dir=/vagrant/home.admin
|
cp /vagrant/home.admin/XXsyncScripts.sh /home/admin/XXsyncScripts.sh
|
||||||
dest_dir=$HOME
|
|
||||||
|
|
||||||
cd $source_dir
|
# execute 'patch' command to sync laptop with VM
|
||||||
for f in *; do
|
/home/admin/XXsyncScripts.sh -run
|
||||||
if [ "$f" = "assets" ] ; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
source_file="$source_dir/$f"
|
echo
|
||||||
dest_file="$dest_dir/$f"
|
echo "************* NEXT ********************"
|
||||||
|
echo "vagrant ssh --> ssh into your RaspiBlitzVM"
|
||||||
if [ -L $dest_file ] && [ "$(readlink "$dest_file")" = "$source_file" ]; then
|
echo "vagrant provision --> trigger code sync from outside VM"
|
||||||
continue
|
echo "patch --> trigger code sync from inside the VM"
|
||||||
fi
|
echo
|
||||||
|
|
||||||
rm -rf "$dest_file"
|
|
||||||
ln -s "$source_file" "$dest_file"
|
|
||||||
done
|
|
@ -20,6 +20,20 @@ if [ ${isMounted} -eq 0 ] && [ ${#hddCandidate} -eq 0 ]; then
|
|||||||
echo "***********************************************************"
|
echo "***********************************************************"
|
||||||
echo "WARNING: NO HDD FOUND -> Shutdown, connect HDD and restart."
|
echo "WARNING: NO HDD FOUND -> Shutdown, connect HDD and restart."
|
||||||
echo "***********************************************************"
|
echo "***********************************************************"
|
||||||
|
vagrant=$(df | grep -c "/vagrant")
|
||||||
|
if [ ${vagrant} ]; then
|
||||||
|
echo "To connect a HDD data disk to your VagrantVM:"
|
||||||
|
echo "- shutdown VM with command: off"
|
||||||
|
echo "- open your VirtualBox GUI and select RaspiBlitzVM"
|
||||||
|
echo "- change the 'mass storage' settings"
|
||||||
|
echo "- add a second 'Primary Slave' drive to the already existing controller"
|
||||||
|
echo "- close VirtualBox GUI and run: vagrant up & vagrant ssh"
|
||||||
|
echo "***********************************************************"
|
||||||
|
echo "You can either create a new dynamic VDI with around 900GB or download"
|
||||||
|
echo "a VDI with a presynced blockchain to speed up setup. If you dont have 900GB"
|
||||||
|
echo "space on your laptop you can store the VDI file on an external drive."
|
||||||
|
echo "***********************************************************"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
0
home.admin/XXsendNotification.py
Normal file → Executable file
0
home.admin/XXsendNotification.py
Normal file → Executable file
@ -30,6 +30,7 @@ if [ "$1" == "info" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# change branch if set as parameter
|
# change branch if set as parameter
|
||||||
|
vagrant=0
|
||||||
clean=0
|
clean=0
|
||||||
install=0
|
install=0
|
||||||
wantedBranch="$1"
|
wantedBranch="$1"
|
||||||
@ -38,6 +39,12 @@ if [ "${wantedBranch}" = "-run" ]; then
|
|||||||
# "-run" ist just used by "patch" command and will ignore all further parameter
|
# "-run" ist just used by "patch" command and will ignore all further parameter
|
||||||
wantedBranch="${activeBranch}"
|
wantedBranch="${activeBranch}"
|
||||||
wantedGitHubUser="${activeGitHubUser}"
|
wantedGitHubUser="${activeGitHubUser}"
|
||||||
|
# detect if running in vagrant VM
|
||||||
|
vagrant=$(df | grep -c "/vagrant")
|
||||||
|
if [ "$2" = "git" ]; then
|
||||||
|
echo "# forcing guthub over vagrant sync"
|
||||||
|
vagrant=0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "${wantedBranch}" = "-clean" ]; then
|
if [ "${wantedBranch}" = "-clean" ]; then
|
||||||
clean=1
|
clean=1
|
||||||
@ -57,7 +64,7 @@ if [ "${wantedBranch}" = "-justinstall" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# set to another GutHub repo as origin
|
# set to another GutHub repo as origin
|
||||||
if [ ${#wantedGitHubUser} -gt 0 ]; then
|
if [ ${#wantedGitHubUser} -gt 0 ] && [ ${vagrant} -eq 0 ]; then
|
||||||
echo "# your active GitHubUser is: ${activeGitHubUser}"
|
echo "# your active GitHubUser is: ${activeGitHubUser}"
|
||||||
echo "# your wanted GitHubUser is: ${wantedGitHubUser}"
|
echo "# your wanted GitHubUser is: ${wantedGitHubUser}"
|
||||||
if [ "${activeGitHubUser}" = "${wantedGitHubUser}" ]; then
|
if [ "${activeGitHubUser}" = "${wantedGitHubUser}" ]; then
|
||||||
@ -77,7 +84,7 @@ if [ ${#wantedGitHubUser} -gt 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${#wantedBranch} -gt 0 ]; then
|
if [ ${#wantedBranch} -gt 0 ] && [ ${vagrant} -eq 0 ]; then
|
||||||
echo "# your active branch is: ${activeBranch}"
|
echo "# your active branch is: ${activeBranch}"
|
||||||
echo "# your wanted branch is: ${wantedBranch}"
|
echo "# your wanted branch is: ${wantedBranch}"
|
||||||
if [ "${wantedBranch}" = "${activeBranch}" ]; then
|
if [ "${wantedBranch}" = "${activeBranch}" ]; then
|
||||||
@ -109,26 +116,35 @@ if [ ${#wantedBranch} -gt 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
origin=$(git remote -v | grep 'origin' | tail -n1)
|
|
||||||
checkSumBlitzPyBefore=$(find /home/admin/raspiblitz/home.admin/BlitzPy -type f -exec md5sum {} \; | md5sum)
|
checkSumBlitzPyBefore=$(find /home/admin/raspiblitz/home.admin/BlitzPy -type f -exec md5sum {} \; | md5sum)
|
||||||
checkSumBlitzTUIBefore=$(find /home/admin/raspiblitz/home.admin/BlitzTUI -type f -exec md5sum {} \; | md5sum)
|
checkSumBlitzTUIBefore=$(find /home/admin/raspiblitz/home.admin/BlitzTUI -type f -exec md5sum {} \; | md5sum)
|
||||||
|
|
||||||
echo "# *** SYNCING SHELL SCRIPTS WITH GITHUB ***"
|
if [ ${vagrant} -eq 0 ]; then
|
||||||
echo "# This is for developing on your RaspiBlitz."
|
origin=$(git remote -v | grep 'origin' | tail -n1)
|
||||||
echo "# THIS IS NOT THE REGULAR UPDATE MECHANISM"
|
echo "# *** SYNCING RASPIBLITZ CODE WITH GITHUB ***"
|
||||||
echo "# and can lead to dirty state of your scripts."
|
echo "# This is for developing on your RaspiBlitz."
|
||||||
echo "# REPO ----> ${origin}"
|
echo "# THIS IS NOT THE REGULAR UPDATE MECHANISM"
|
||||||
echo "# BRANCH --> ${activeBranch}"
|
echo "# and can lead to dirty state of your scripts."
|
||||||
echo "# ******************************************"
|
echo "# REPO ----> ${origin}"
|
||||||
git pull 1>&2
|
echo "# BRANCH --> ${activeBranch}"
|
||||||
cd ..
|
echo "# ******************************************"
|
||||||
|
git pull 1>&2
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
cd ..
|
||||||
|
echo "# --> VAGRANT IS ACTIVE"
|
||||||
|
echo "# *** SYNCING RASPIBLITZ CODE WITH VAGRANT LINKED DIRECTORY ***"
|
||||||
|
echo "# This is for developing on your RaspiBlitz with a VM."
|
||||||
|
sudo rm -r /home/admin/raspiblitz
|
||||||
|
sudo cp -r /vagrant /home/admin/raspiblitz
|
||||||
|
sudo chown admin:admin -R /home/admin/raspiblitz
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${clean} -eq 1 ]; then
|
if [ ${clean} -eq 1 ]; then
|
||||||
echo "# Cleaning scripts & assets/config.scripts"
|
echo "# Cleaning assets .. "
|
||||||
sudo rm -f *.sh
|
sudo rm -f *.sh
|
||||||
sudo rm -rf assets
|
sudo rm -rf assets
|
||||||
mkdir assets
|
sudo -u admin mkdir assets
|
||||||
sudo rm -rf config.scripts
|
|
||||||
mkdir config.scripts
|
|
||||||
else
|
else
|
||||||
echo "# ******************************************"
|
echo "# ******************************************"
|
||||||
echo "# NOT cleaning/deleting old files"
|
echo "# NOT cleaning/deleting old files"
|
||||||
@ -137,16 +153,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# COPYING from GIT-Directory to /home/admin/"
|
echo "# COPYING from GIT-Directory to /home/admin/"
|
||||||
|
sudo rm -r /home/admin/config.scripts
|
||||||
sudo -u admin cp -r -f /home/admin/raspiblitz/home.admin/*.* /home/admin
|
sudo -u admin cp -r -f /home/admin/raspiblitz/home.admin/*.* /home/admin
|
||||||
echo "# .."
|
|
||||||
sudo -u admin cp -r -f /home/admin/raspiblitz/home.admin/assets /home/admin
|
sudo -u admin cp -r -f /home/admin/raspiblitz/home.admin/assets /home/admin
|
||||||
echo "# .."
|
|
||||||
sudo -u admin chmod +x /home/admin/*.sh
|
sudo -u admin chmod +x /home/admin/*.sh
|
||||||
echo "# .."
|
|
||||||
sudo -u admin chmod +x /home/admin/*.py
|
sudo -u admin chmod +x /home/admin/*.py
|
||||||
echo "# .."
|
|
||||||
sudo -u admin chmod +x /home/admin/config.scripts/*.sh
|
sudo -u admin chmod +x /home/admin/config.scripts/*.sh
|
||||||
echo "# .."
|
|
||||||
sudo -u admin chmod +x /home/admin/config.scripts/*.py
|
sudo -u admin chmod +x /home/admin/config.scripts/*.py
|
||||||
echo "# ******************************************"
|
echo "# ******************************************"
|
||||||
|
|
||||||
|
0
home.admin/config.scripts/blitz.subscriptions.ip2tor.py
Normal file → Executable file
0
home.admin/config.scripts/blitz.subscriptions.ip2tor.py
Normal file → Executable file
0
home.admin/config.scripts/blitz.subscriptions.letsencrypt.py
Normal file → Executable file
0
home.admin/config.scripts/blitz.subscriptions.letsencrypt.py
Normal file → Executable file
0
home.admin/config.scripts/blitz.subscriptions.py
Normal file → Executable file
0
home.admin/config.scripts/blitz.subscriptions.py
Normal file → Executable file
0
home.admin/config.scripts/bonus.angular_cli.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.angular_cli.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.circuitbreaker.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.circuitbreaker.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.mempool.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.mempool.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.typescript.sh
Normal file → Executable file
0
home.admin/config.scripts/bonus.typescript.sh
Normal file → Executable file
0
home.admin/config.scripts/lnd.initwallet.py
Normal file → Executable file
0
home.admin/config.scripts/lnd.initwallet.py
Normal file → Executable file
Loading…
Reference in New Issue
Block a user