Skip to content

Commit

Permalink
[DEV] Fix Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Nov 19, 2021
1 parent 5fcfada commit 67eb3b0
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 33 deletions.
182 changes: 169 additions & 13 deletions .env.vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ DOCTRINE_CACHE_NAMESPACE=IXPMANAGERNAMESPACE


IDENTITY_LEGALNAME="Vagrant City IXP"
IDENTITY_CITY"Dublin"
IDENTITY_COUNTRY"Ireland"
IDENTITY_CITY="Dublin"
IDENTITY_COUNTRY="Ireland"
IDENTITY_IXFID=0
IDENTITY_ORGNAME="${IDENTITY_LEGALNAME}"
IDENTITY_NAME="${IDENTITY_LEGALNAME}"
Expand All @@ -47,38 +47,194 @@ IDENTITY_BIGLOGO_OFFSET="offset4"
IDENTITY_MISC_IRC_PASSWORD="xxxxxxx"
IDENTITY_DEFAULT_VLAN=1

IXP_API_JSONEXPORTSCHEMA_PUBLIC=true

IXP_RESELLER_ENABLED=false



#######################################################################################
### Features
#

# See: http://docs.ixpmanager.org/features/reseller/
IXP_RESELLER_ENABLED=true

# See: http://docs.ixpmanager.org/features/as112/
IXP_AS112_UI_ACTIVE=true


#######################################################################################
### Frontend controllers and controller configuration
#
# Some frontend controllers are disabled by default. This is for a variety of reasons
# including: additional configuration may be required, maintain backwards
# compatibility, etc.

# Allow customers / admins to upload logos for members. Set to false to enabled.
# See: http://docs.ixpmanager.org/usage/customers/#customer-logos
IXP_FE_FRONTEND_DISABLED_LOGO=false


# Send email notifications when a customer's billing details are updated.
# See: http://docs.ixpmanager.org/usage/customers/#notification-of-billing-details-changed
# IXP_FE_CUSTOMER_BILLING_UPDATES_NOTIFY="mail@example.com"


# Disable links to the peering matrix if you have not set it up (with sflow):
# IXP_FE_FRONTEND_DISABLED_PEERING_MATRIX=true


#######################################################################################
### Email Settings.
#
# We use Laravel's mail system which in turn uses SwiftMailer.
#
# See config/mail.php abd https://laravel.com/docs/5.5/mail
#
# The default setting is 'sendmail' which tries to use your local systems mail client.
#
# MAIL_MAILER="sendmail"
# MAIL_HOST="localhost"
# MAIL_PORT=25
# MAIL_ENCRYPTION="tls"

MAIL_MAILER=log



#######################################################################################
### Graphing - see https://ixp-manager.readthedocs.org/en/latest/features/grapher.html
### Graphing - see https://docs.ixpmanager.org/grapher/introduction

# Enable the backends you have configured. E.g.:
# GRAPHER_BACKENDS="mrtg|sflow|smokeping"

# On a new installation, we just use placeholders from the dummy backend:
GRAPHER_BACKENDS="dummy"

#GRAPHER_BACKEND_MRTG_WORKDIR="/tmp"
#GRAPHER_BACKEND_MRTG_LOGDIR="http://stats.example.com/mrtg"
#GRAPHER_BACKEND_SFLOW_ROOT="http://sflow.example.com/sflow"
#GRAPHER_CACHE_ENABLED=true
# With the cache enabled, IXP Manager does not have to regenerate / reload / reprocess
# log / rrd / image files if we have cached them and they are less than 5mins old. This
# is enabled by default which is the recommended setting.
GRAPHER_CACHE_ENABLED=true

#################################################################################
## Grapher - Mrtg - see: https://docs.ixpmanager.org/grapher/mrtg/
##

# For backwards compatibility, the default is 'log' but 'rrd' is more modern:
GRAPHER_BACKEND_MRTG_DBTYPE="rrd"

# The defaults for these are '/tmp' to require you to change them to something
# more sensible such as:
# GRAPHER_BACKEND_MRTG_WORKDIR="/srv/mrtg"
# GRAPHER_BACKEND_MRTG_LOGDIR="/srv/mrtg"

#################################################################################
## Grapher - sflow - see: https://docs.ixpmanager.org/grapher/sflow/
##

# GRAPHER_BACKEND_SFLOW_ENABLED=false
# GRAPHER_BACKEND_SFLOW_ROOT="http://sflow-server.example.com/grapher-sflow"


#################################################################################
## Grapher - smokeping - see: https://docs.ixpmanager.org/grapher/smokeping/
##

# Mark it as enabled (this just affects whether certain UI elements are shown):
# GRAPHER_BACKEND_SMOKEPING_ENABLED=true

# And set the default location to fetch the Smokeping graphs from:
# GRAPHER_BACKEND_SMOKEPING_URL="http://www.example.com/smokeping"


#################################################################################
## IX-F Member Export - see: https://docs.ixpmanager.org/features/ixf-export/


IXP_API_JSONEXPORTSCHEMA_PUBLIC=true


#######################################################################################
### Skinning: see https://ixp-manager.readthedocs.org/en/latest/features/skinning.html
### Skinning
#
# See https://ixp-manager.readthedocs.io/en/latest/features/skinning.html
#
# VIEW_SKIN="myskin"


IXP_API_JSONEXPORTSCHEMA_PUBLIC=true
#######################################################################################
# See config/cache.php
CACHE_DRIVER=array

#######################################################################################
# Session Lifetimes - standard and remember me.
#
# See https://docs.ixpmanager.org/usage/authentication/
#
# SESSION_LIFETIME=120
# AUTH_TOKEN_EXPIRE=43200

#######################################################################################
# PeeringDB Authentication
#
# PeeringDb's API is used, for example, to pre-populate new customer details. If you
# provide a working PeeringDb username/password then these will be used to get more
# complete information.
#
# IXP_API_PEERING_DB_USERNAME=username
# IXP_API_PEERING_DB_PASSWORD=password



#######################################################################################
# Options for updating RIR Objects - see https://docs.ixpmanager.org/features/rir-objects/

# Your RIR password to allow the updating of a RIR object by email:
# IXP_API_RIR_PASSWORD=soopersecret

# Rather than specifiying the destination address on the command line, you can set it here
# (useful for cronjobs and required for use with artisan schedule:run in >=v5.0)
# IXP_API_RIR_EMAIL_TO=test-dbm@ripe.net

# Rather than specifiying the from address on the command line, you can set it here
# (useful for cronjobs and required for use with artisan schedule:run in >=v5.0)
# IXP_API_RIR_EMAIL_FROM=ixp@example.com



#######################################################################################
# Utility paths

# See: https://docs.ixpmanager.org/features/irrdb/
IXP_IRRDB_BGPQ3_PATH=/usr/local/bin/bgpq3

# See: https://docs.ixpmanager.org/features/rpki/
# IXP_RPKI_RTR1_HOST=192.0.2.11
# IXP_RPKI_RTR1_PORT=3323
# IXP_RPKI_RTR2_HOST=192.0.2.12
# IXP_RPKI_RTR2_PORT=3323


#########################################################################################
### Development Helpers
###

# Disable HTML5 validation to test PHP code based request validators
# FORMER_LIVE_VALIDATION=false


#########################################################################################
### PeeringDB OAuth
###
### https://docs.ixpmanager.org/features/peeringdb-oauth/
###

IXP_IRRDB_BGPQ3_PATH=/usr/bin/bgpq3
# AUTH_PEERINGDB_ENABLED=true

IXP_FE_BETA_CORE_BUNDLES=true
# PEERINGDB_OAUTH_CLIENT_ID="xxx"
# PEERINGDB_OAUTH_CLIENT_SECRET="xxx"
# PEERINGDB_OAUTH_REDIRECT="https://www.example.com/auth/login/peeringdb/callback"

2FA_ENABLED=false

#IXP_NO_TRANSIT_ASNS_EXCLUDE=174,1299
#IXP_NO_TRANSIT_ASNS_OVERRIDE=25,45,174
16 changes: 6 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,28 @@
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.box = "ubuntu/focal64"

config.vm.network "forwarded_port", guest: 80, host: 8088

config.vm.synced_folder ".", "/vagrant/", id: "vagrant-root0",
owner: "ubuntu"
owner: "vagrant"

config.vm.synced_folder "./storage", "/vagrant/storage", id: "vagrant-root1",
owner: "ubuntu",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]

config.vm.synced_folder "./database/Proxies", "/vagrant/database/Proxies", id: "vagrant-root3",
owner: "ubuntu",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]

config.vm.synced_folder "./bootstrap/cache", "/vagrant/bootstrap/cache", id: "vagrant-root4",
owner: "ubuntu",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]


config.vm.provider "virtualbox" do |vb|
vb.memory = "1536"
vb.gui = true
end

config.vm.provision :shell, path: "bootstrap.sh"
# config.vm.provision :shell, path: "bootstrap.sh"
end
23 changes: 13 additions & 10 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## VAGRANT provisioning script - IXP Manager v5 / 18.04 LTS / php7.3
##
## Barry O'Donovan 2015-2019
## Barry O'Donovan 2015-2021

apt update

Expand All @@ -42,10 +42,11 @@ apt-get update
apt full-upgrade -y
apt autoremove -y

apt-get install -y apache2 php7.3 php7.3-intl php7.3-mysql php-rrd php7.3-cgi php7.3-cli php7.3-snmp php7.3-curl \
php-memcached libapache2-mod-php7.3 mysql-server mysql-client php-mysql memcached snmp \
php7.3-mbstring php7.3-xml php7.3-gd php-gettext bgpq3 php-memcache unzip php-zip git php-yaml php-ds php7.3-bcmath \
libconfig-general-perl libnetaddr-ip-perl mrtg libconfig-general-perl libnetaddr-ip-perl rrdtool librrds-perl
apt-get install -y apache2 php8.0 php8.0-intl php8.0-mysql php-rrd php8.0-cgi php8.0-cli \
php8.0-snmp php8.0-curl php8.0-memcached libapache2-mod-php8.0 mysql-server mysql-client \
php8.0-mysql memcached snmp php8.0-mbstring php8.0-xml php8.0-gd bgpq3 php8.0-memcache \
unzip php8.0-zip git php8.0-yaml php8.0-ds php8.0-bcmath libconfig-general-perl joe \
libnetaddr-ip-perl mrtg libconfig-general-perl libnetaddr-ip-perl rrdtool librrds-perl

if ! [ -L /var/www ]; then
rm -rf /var/www
Expand All @@ -59,8 +60,10 @@ export MYSQL_PWD=password
mysql -u root <<END_SQL
DROP DATABASE IF EXISTS \`ixp\`;
CREATE DATABASE \`ixp\` CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_unicode_ci';
GRANT ALL ON \`ixp\`.* TO \`ixp\`@\`127.0.0.1\` IDENTIFIED BY 'password';
GRANT ALL ON \`ixp\`.* TO \`ixp\`@\`localhost\` IDENTIFIED BY 'password';
CREATE USER \`ixp\`@\`127.0.0.1\` IDENTIFIED BY 'password';
CREATE USER \`ixp\`@\`localhost\` IDENTIFIED BY 'password';
GRANT ALL ON \`ixp\`.* TO \`ixp\`@\`127.0.0.1\`;
GRANT ALL ON \`ixp\`.* TO \`ixp\`@\`localhost\`;
FLUSH PRIVILEGES;
END_SQL

Expand All @@ -79,7 +82,7 @@ php /vagrant/artisan key:generate --force


cd /vagrant
su - ubuntu -c "cd /vagrant && composer install --prefer-dist --no-dev"
su - vagrant -c "cd /vagrant && composer install"

cat >/etc/apache2/sites-available/000-default.conf <<END_APACHE
<VirtualHost *:80>
Expand Down Expand Up @@ -108,7 +111,7 @@ chmod -R a+rwX /vagrant/storage /vagrant/bootstrap/cache
service apache2 restart

# Useful screen settings for barryo:
cat >/home/ubuntu/.screenrc <<END_SCREEN
cat >/home/vagrant/.screenrc <<END_SCREEN
termcapinfo xterm* ti@:te@
vbell off
startup_message off
Expand All @@ -124,6 +127,6 @@ END_SCREEN


# enable scheduler
echo -e "\n\n# IXP Manager cron jobs:\n* * * * * www-data /usr/bin/php /vagrant/artisan schedule:run\n\n" >>/etc/crontab
#echo -e "\n\n# IXP Manager cron jobs:\n* * * * * www-data /usr/bin/php /vagrant/artisan schedule:run\n\n" >>/etc/crontab

cd /vagrant

0 comments on commit 67eb3b0

Please sign in to comment.