Skip to content

Commit

Permalink
Tidy up config options, better documentation of same
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Mar 5, 2018
1 parent ecd8fd7 commit 4af1324
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 58 deletions.
5 changes: 0 additions & 5 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,11 @@ IDENTITY_SUPPORT_HOURS="24x7"
IDENTITY_BILLING_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_BILLING_PHONE="+1 111 555 5555"
IDENTITY_BILLING_HOURS="24x7"
IDENTITY_AUTOBOT_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_AUTOBOT_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_MAILER_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_MAILER_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_SITENAME="Docker IXP Manager"
IDENTITY_CORPORATE_URL="http://www.example.com/"
IDENTITY_LOGO="/srv/ixpmanager/public/images/ixp-manager.png"
IDENTITY_BIGLOGO="http://www.ixpmanager.org/images/logos/ixp-manager.png"
IDENTITY_BIGLOGO_OFFSET="offset4"
IDENTITY_SWITCH_DOMAIN="example.com"

# For some actions (e.g. peering matrix) we need to know what VLAN to show by default.
# This is the vlan.id database entry (i.e. not the VLAN number/tag!)
Expand Down
49 changes: 35 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,52 @@ DB_USERNAME="ixp"
DB_PASSWORD="password"

#######################################################################################
# Identity. Used throughout IXP Manager in various ways.
### Identity
#
# Used throughout IXP Manager in various ways.
#
# This has grown organically and we intend to clean this up in a coming release and
# documenting where and how each one is spceifically used.

# Shown in title bar of web portal:
IDENTITY_SITENAME="Vagrant IXP Manager"

IDENTITY_LEGALNAME="Vagrant City IXP"
IDENTITY_CITY="Dublin"
IDENTITY_COUNTRY="IE"
IDENTITY_ORGNAME="${IDENTITY_LEGALNAME}"

# As well as uses in other places, emails are sent from the following name/email:
IDENTITY_NAME="${IDENTITY_LEGALNAME}"
IDENTITY_EMAIL="[email protected]"

IDENTITY_TESTEMAIL="${IDENTITY_EMAIL}"

# Used on some traffic graphs:
IDENTITY_WATERMARK="Vagrant City IXP"

IDENTITY_SUPPORT_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_SUPPORT_PHONE="+1 111 555 5555"
IDENTITY_SUPPORT_HOURS="24x7"

IDENTITY_BILLING_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_BILLING_PHONE="+1 111 555 5555"
IDENTITY_BILLING_HOURS="24x7"
IDENTITY_AUTOBOT_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_AUTOBOT_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_MAILER_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_MAILER_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_SITENAME="Vagrant IXP Manager"

# Web address of your IXP's website. Used in IX-F Export schema, etc.
IDENTITY_CORPORATE_URL="http://www.example.com/"

IDENTITY_LOGO="/srv/ixpmanager/public/images/ixp-manager.png"
IDENTITY_BIGLOGO="http://www.ixpmanager.org/images/logos/ixp-manager.png"
IDENTITY_BIGLOGO_OFFSET="offset4"
IDENTITY_SWITCH_DOMAIN="example.com"

# For some actions (e.g. peering matrix) we need to know what VLAN to show by default.
# This is the vlan.id database entry (i.e. not the VLAN number/tag!)
IDENTITY_DEFAULT_VLAN=1


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

# See: http://docs.ixpmanager.org/features/reseller/
Expand All @@ -81,10 +91,18 @@ IXP_AS112_UI_ACTIVE=false


#######################################################################################
# See config/mail.php
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_ENCRYPTION=""
### 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_DRIVER="sendmail"
# MAIL_HOST="localhost"
# MAIL_PORT=25
# MAIL_ENCRYPTION="tls"


#######################################################################################
Expand All @@ -111,7 +129,10 @@ GRAPHER_BACKENDS="dummy"


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

Expand All @@ -127,7 +148,7 @@ SESSION_DRIVER=file

#######################################################################################
# see config/doctrine.php
DOCTRINE_PROXY_AUTOGENERATE=true
DOCTRINE_PROXY_AUTOGENERATE=false
DOCTRINE_CACHE=array
DOCTRINE_CACHE_NAMESPACE=IXPMANAGERNAMESPACE

Expand Down
5 changes: 0 additions & 5 deletions .env.vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,13 @@ IDENTITY_SUPPORT_HOURS="24x7"
IDENTITY_BILLING_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_BILLING_PHONE="+1 111 555 5555"
IDENTITY_BILLING_HOURS="24x7"
IDENTITY_AUTOBOT_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_AUTOBOT_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_MAILER_NAME="${IDENTITY_NAME} Autobot"
IDENTITY_MAILER_EMAIL="${IDENTITY_EMAIL}"
IDENTITY_SITENAME="Vagrant IXP Manager"
IDENTITY_CORPORATE_URL="http://www.example.com/"
IDENTITY_LOGO="/vagrant/public/images/ixp-manager.png"
IDENTITY_BIGLOGO="http://www.ixpmanager.org/images/logos/ixp-manager.png"
IDENTITY_BIGLOGO_OFFSET="offset4"
IDENTITY_MISC_IRC_PASSWORD="xxxxxxx"
IDENTITY_DEFAULT_VLAN=1
IDENTITY_SWITCH_DOMAIN="example.com"

IXP_API_JSONEXPORTSCHEMA_PUBLIC=true

Expand Down
5 changes: 0 additions & 5 deletions app/Providers/ZendFrameworkServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ private function setupIdentity( array $options ): array {
$options['identity']['ixfid'] = config( 'identity.ixfid' );
$options['identity']['name'] = config( 'identity.name' );
$options['identity']['email'] = config( 'identity.email' );
$options['identity']['email'] = config( 'identity.email' );
$options['identity']['autobot']['name'] = config( 'identity.autobot.name' );
$options['identity']['autobot']['email'] = config( 'identity.autobot.email' );
$options['identity']['mailer']['name'] = config( 'identity.mailer.name' );
$options['identity']['mailer']['email'] = config( 'identity.mailer.email' );
$options['identity']['sitename'] = config( 'identity.sitename' );
$options['identity']['url'] = config( 'app.url' );
$options['identity']['logo'] = config( 'identity.logo' );
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/PeeringManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function peeringRequestAction()
if( $bccOk )
{
$mail = new Zend_Mail('UTF-8');
$mail->setFrom( $this->_options['identity']['mailer']['email'], $this->getCustomer()->getName() . ' Peering Team' )
$mail->setFrom( config( 'identity.email' ), $this->getCustomer()->getName() . ' Peering Team' )
->setReplyTo( $this->getCustomer()->getPeeringemail(), $this->getCustomer()->getName() . ' Peering Team' )
->setSubject( $f->getValue( 'subject' ) )
->setBodyText( $f->getValue( 'message' ) );
Expand Down
2 changes: 1 addition & 1 deletion application/modules/apiv1/controllers/RirController.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private function emailRIR( $tmpl, $content, $email, $force = false )
$mailer = $this->getMailer()
->setBodyText( $content )
->addTo( $email )
->setFrom( $this->_options['identity']['autobot']['email'], $this->_options['identity']['autobot']['name'] )
->setFrom( config( 'identity.email' ), config( 'identity.name' ) )
->setSubject( "Changes to {$tmpl} via IXP Manager" );

try
Expand Down
16 changes: 1 addition & 15 deletions config/identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@
'billing_phone' => env( 'IDENTITY_BILLING_PHONE', '*** CONFIG IDENTITY IN .env ***' ),
'billing_hours' => env( 'IDENTITY_BILLING_HOURS', '*** CONFIG IDENTITY IN .env ***' ),


'autobot' => [
'name' => env( 'IDENTITY_AUTOBOT_NAME', '*** CONFIG IDENTITY IN .env ***' ),
'email' => env( 'IDENTITY_AUTOBOT_EMAIL', '*** CONFIG IDENTITY IN .env ***' ),
],

'mailer' => [
'name' => env( 'IDENTITY_MAILER_NAME', '*** CONFIG IDENTITY IN .env ***' ),
'email' => env( 'IDENTITY_MAILER_EMAIL', '*** CONFIG IDENTITY IN .env ***' ),
],

'sitename' => env( 'IDENTITY_SITENAME', '*** CONFIG IDENTITY IN .env ***' ),
'corporate_url' => env( 'IDENTITY_CORPORATE_URL', '*** CONFIG IDENTITY IN .env ***' ),
'url' => env( 'APP_URL', '*** CONFIG APP_URL IN .env ***' ),
Expand All @@ -60,9 +49,6 @@

'vlans' => [
'default' => env( 'IDENTITY_DEFAULT_VLAN', 1 ),
],

// appended to switch names in some places. If you use FQDNs for your switches in IXP Manager then leave blank.
'switch_domain' => env( 'IDENTITY_SWITCH_DOMAIN', '*** CONFIG IDENTITY IN .env ***' ),
],

];
9 changes: 5 additions & 4 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| "sparkpost", "log", "array" |
*/

'driver' => env( 'MAIL_DRIVER', 'mail' ),
'driver' => env( 'MAIL_DRIVER', 'sendmail' ),

/*
|--------------------------------------------------------------------------
Expand All @@ -28,7 +28,7 @@
|
*/

'host' => env( 'MAIL_HOST', 'smtp.mailgun.org' ),
'host' => env( 'MAIL_HOST', 'localhost' ),

/*
|--------------------------------------------------------------------------
Expand All @@ -41,7 +41,7 @@
|
*/

'port' => env( 'MAIL_PORT', 587 ),
'port' => env( 'MAIL_PORT', 25 ),

/*
|--------------------------------------------------------------------------
Expand All @@ -63,7 +63,8 @@
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
| transport layer security protocol should provide great security. An
| empty string means no encryption.
|
*/

Expand Down
6 changes: 3 additions & 3 deletions library/OSS/Controller/Trait/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function lostPasswordAction()
$this->view->token = $pwdResetToken;

$mailer = $this->getMailer();
$mailer->setFrom( $this->getOptions()['identity']['mailer']['email'], $this->getOptions()['identity']['mailer']['name'] );
$mailer->setFrom( config( 'identity.email' ), config( 'identity.name' ) );
$mailer->addTo( $user->getEmail(), $user->getFormattedName() );
$mailer->setSubject( $this->getOptions()['identity']['sitename'] . ' - Password Reset Information' );
$this->resolveTemplate( $mailer, 'lost-password' );
Expand Down Expand Up @@ -395,7 +395,7 @@ public function resetPasswordAction()
$this->view->user = $user;

$mailer = $this->getMailer();
$mailer->setFrom( $this->_options['identity']['mailer']['email'], $this->_options['identity']['mailer']['name'] );
$mailer->setFrom( config( 'identity.email' ), config( 'identity.name' ) );
$mailer->addTo( $user->getEmail(), $user->getFormattedName() );
$mailer->setSubject( $this->_options['identity']['sitename'] . ' - Your Password Has Been Reset' );
$this->resolveTemplate( $mailer, 'reset-password' );
Expand Down Expand Up @@ -475,7 +475,7 @@ public function lostUsernameAction()
if( count( $users ) )
{
$mailer = $this->getMailer();
$mailer->setFrom( $this->_options['identity']['mailer']['email'], $this->_options['identity']['mailer']['name'] );
$mailer->setFrom( config( 'identity.email' ), config( 'identity.name' ) );
$mailer->addTo( $form->getValue( 'email' ) );
$mailer->setSubject( $this->_options['identity']['sitename'] . ' - Your Accounts' );
$this->resolveTemplate( $mailer, 'lost-username' );
Expand Down
5 changes: 0 additions & 5 deletions tools/installers/ubuntu-lts-1604-ixp-manager-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,12 @@ IDENTITY_SUPPORT_HOURS="24x7"
IDENTITY_BILLING_EMAIL="\${IDENTITY_EMAIL}"
IDENTITY_BILLING_PHONE="${IXPNOCEMAIL}"
IDENTITY_BILLING_HOURS="24x7"
IDENTITY_AUTOBOT_NAME="\${IDENTITY_NAME} Autobot"
IDENTITY_AUTOBOT_EMAIL="\${IDENTITY_EMAIL}"
IDENTITY_MAILER_NAME="\${IDENTITY_NAME} Autobot"
IDENTITY_MAILER_EMAIL="\${IDENTITY_EMAIL}"
IDENTITY_SITENAME="${IXPSNAME} IXP Manager"
IDENTITY_CORPORATE_URL="${IXPWWW}"
IDENTITY_LOGO="/srv/ixpmanager/public/images/ixp-manager.png"
IDENTITY_BIGLOGO="http://www.ixpmanager.org/images/logos/ixp-manager.png"
IDENTITY_BIGLOGO_OFFSET="offset4"
IDENTITY_DEFAULT_VLAN=1
IDENTITY_SWITCH_DOMAIN="example.com"
# get your IXF ID from https://www.peeringdb.com/api/ix ('id' field)
IDENTITY_IXFID=0
Expand Down

0 comments on commit 4af1324

Please sign in to comment.