Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Vagrant.configure("2") do |config|
config.ssh.forward_agent = true

config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = false
config.vm.hostname = 'prax'

config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 443, host: 4343

config.vm.provider :virtualbox do |vb, override|
vb.gui = false
end

config.vm.provider :lxc do |lxc, override|
override.vm.box = "fgrehm/trusty64-lxc"
lxc.container_name = config.vm.hostname
end

config.vm.define :rvm do |app|
app.vm.provision :shell, inline: <<-SH
set -e
sudo apt-get install iptables --yes

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable

addgroup vagrant rvm
echo "source /usr/local/rvm/scripts/rvm\nrvm use 2.1" | sudo -u vagrant tee /home/vagrant/.praxconfig
echo "install: --no-ri --no-rdoc --env-shebang\nupdate: --no-ri --no-rdoc --env-shebang" | sudo -u vagrant tee /home/vagrant/.gemrc

source /usr/local/rvm/scripts/rvm
rvm install 2.1
rvm use 2.1 && gem install rack

rvm install 1.9
rvm use 1.9 && gem install rack
SH
end
end
21 changes: 15 additions & 6 deletions libexec/prax-start
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/usr/bin/env bash
# Usage: prax start
# Summary: Start Prax proxy server

# cleanup RVM from $PATH
for path in "$HOME/.rvm", "/usr/local/rvm"; do
if [ -f "$path/scripts/rvm" ]; then
source "$path/scripts/rvm"
rvm use system > /dev/null
fi
done

set -e

# Loads user config (if present)
# keep a copy of original path (to spawn ruby sub-processes)
export ORIG_PATH="$PATH"

# load user config (if present)
[ -f "$HOME/.praxconfig" ] && source "$HOME/.praxconfig"

# kills any running instance
# kill any running instance
prax stop

# keeps a copy of original path (to spawn ruby sub-processes)
export ORIG_PATH="$PATH"

# starts instance
# start instance
cd "$PRAX_ROOT"
exec "ruby" "$PRAX_ROOT/lib/prax/command.rb" $*