V2 and MAPS Configuration
Introduction
Main configuration items:
- Settings
- Database access
- Message catalogs
Application Settings Variables
Settings Variables
Application configuration are managed with the RailsConfig gem.
The file config/initializers/rails_config.rb (automatically generated when RailsConfig is installed) contains the definition of the top-level variable name for configuration settings. For MAPS and V2 it is set to Settings, as follows:
RailsConfig.setup do |config| config.const_name = "Settings" end
Settings are be defined as a hash of hashes, they define a hierarchical structure.
We further prefix all MAPS and V2 application configuration settings with the prefix SXS.
Setting Files
Settings are defined in the following files:
- General application settings file:
config/settings.yml
- Environment specific settings files:
config/settings/production.yml
config/settings/test.yml
config/settings/development.yml
- Instance specific settings:
config/settings.local.yml
- Rails also recognizes environment specific configuration files, which we are not using:
config/settings/#{environment}.local.yml
config/environments/#{environment}.local.yml
The settings variables can be accessed in Ruby code, including access by Ruby code embedded in .erb template files, as follows:
Settings.SXS.SomeVar
Other Configuration Files
config/application.rb - Application basic settings, probably never needs to be changed
config/database.yml - Defines the application database name and access mechanism
config/authorization_rules.rb - Defines application roles and what controllers and actions they can perform
V2 Configuration
V2 Settings Variables
The following is a complete list of the V2 configuration settings:
Settings Variable
Typical Value
Description
SXS.Application.Name
V2p0
Used in navbar
SXS.Application.Supplier
SoftXS
Used in supplier link
SXS.Application.SupplierUrl
http://wiki.softxs.ch/softxs
Used in supplier link
SXS.Application.Logo
small_company_logo.png
Used in navbar
SXS.Application.FooterEnabled
true
Enable footer display
SXS.Application.DebugEnabled
true
Enable debug footer. Development only
SXS.Application.BaseTitle
SoftXS GmbH
Page base title
SXS.Application.Version
AMVA
Used by cucumber testing
SXS.Application.Versions.AMVA
0.1
Used by cucumber testing
SXS.Application.Versions.MVA
0.9
Used by cucumber testing
SXS.Application.Versions.V2
2.0
Used by cucumber testing
SXS.Application.Versions.V3
3.0
Used by cucumber testing
SXS.Application.BaseUrl
localhost:4010
Application Base URL, used in emails
SXS.LocalAuthentication
true
Enables local signon independent of MAPS
SXS.ActionMailer.UrlHost
localhost:4010
Used for building links in emails
SXS.ActionMailer.PerformDeliveries
false
Send or suppress sending of emails
SXS.ActionMailer.RaiseDeliveryErrors
false
Raise error when email delivery fails
SXS.ActionMailer.DeliveryMethod
:smtp
Email delivery method
SXS.ActionMailer.Smtp.address
mbox.softxs.ch
Address of email server
SXS.ActionMailer.Smtp.domain
softxs.ch
Domain for sent emails
SXS.SSO.AppID
V2P0_Dev
Application identifier used in MAPS
SXS.SSO.AppSecret
79d3...f173
Application secret key used by MAPS
SXS.SSO.Provider_URL
http://localhost:4000
MAPS URL
SXS.SSO.Register_URL
http://localhost:4000/users/sign_up
Signup page
SXS.SSO.Profile_URL
http://localhost:4000/users
User profile page
SXS.SSO.ChangePassword_URL
http://localhost:4000/users/edit
Change password page
Notes:
to be completed
Default V2 Configuration
The following is the contents of config/settings.yml:
# v2p0:config/settings.yml SXS: Application: BaseUrl: localhost:3010 Name: V2p0 Supplier: SoftXS SupplierUrl: http://wiki.softxs.ch/softxs Logo: small_company_logo.png FooterEnabled: true DebugEnabled: true BaseTitle: <%= Rails.env == "production" ? "SoftXs GmbH" : "SoftXs GmbH [#{Rails.env.to_s}]" %> Version: AMVA Versions: AMVA: 0.1 MVA: 0.9 V2: 2.0 V3: 3.0 # -- Signon and authentication # Disable local authentication (may be overridden in other settings files) LocalAuthentication: true # Drop copy email address for invitations. Feature suppressed if this item isn't configured. # InvitationsDropCopyEmailAddress: invitations_drop_copy@softxs.ch # -- Configure Single Sign On SSO: AppID: V2P0_Dev AppSecret: 05633317798e59a75f3279cba84cdefa32e89c0182ef9339caaea9caa6a7a367 Provider_URL: http://localhost:3000 Register_URL: http://localhost:3000/users/sign_up Profile_URL: http://localhost:3000/users ChangePassword_URL: http://localhost:3000/users/edit UserWS_URL: http://localhost:3000/service/users InviteLanding_URL: http://localhost:3000/invitations/landing # -- Gem config ActionMailer: PerformDeliveries: false RaiseDeliveryErrors: false
Example V2 Local Settings Configuration
The following is the contents of an example config/settings.local.yml file:
# config/settings.local.yml # app: v2p0, site: proto, instance: vor.softxs.ch-v2p0 SXS: Application: BaseUrl: "vor.softxs.ch:4010" LocalAuthentication: true # -- Gem settings ActionMailerUrlHost: "localhost:4010" ActionMailer: PerformDeliveries: false RaiseDeliveryErrors: false DeliveryMethod: :smtp Smtp: address: "mbox.softxs.ch" domain: "softxs.ch" SSO: AppID: V2P0_Dev AppSecret: 79d3d6d046d61aa8eb0bdc360e417ae7fef51e1981f64c077d97c8cc1837f173 Provider_URL: http://localhost:4000 Register_URL: http://localhost:4000/users/sign_up Profile_URL: http://localhost:4000/users ChangePassword_URL: http://localhost:4000/users/edit UserWS_URL: http://localhost:4000/service/users InviteLanding_URL: http://localhost:4000/invitations/landing
MAPS Configuration
MAPS Settings Variables
The following is a complete list of the MAPS configuration settings:
Settings Variable
Typical Value
Description
SXS.Application.BaseUrl
localhost:4000
Application Base URL, used in emails
SXS.Application.Name
SoftXS
Displayed in navbar
SXS.Application.Logo
small_company_logo.png
Displayed in navbar
SXS.Application.BaseTitle
SoftXS GmbH
Used as part of page titles
SXS.Devise.MailSender
maps@softxs.ch
Sender address for generated emails
SXS.ActionMailer.RaiseDeliveryErrors
true
Raise error when email delivery fails
SXS.ActionMailer.PerformDeliveries
true
Send or suppress sending of email
SXS.ActionMailer.DeliveryMethod
:smtp
Email delivery method
SXS.ActionMailer.Smtp.address
mbox.softxs.ch
Address of email server
SXS.ActionMailer.Smtp.domain
softxs.ch
Domain for sent emails
OpenSSL.CertsFile
path to certs file
For payment processing
Notes:
Even if SXS.ActionMailer.PerformDeliveries is set to false the other ActionMailer settings must also be set, in order to avoid undefined variable errors when email is sent.
Note the use of lower case in the SXS.ActionMailer.Smtp sub-settings: address and domain. This is because config.action_mailer.smtp_settings requires these names in lower case. See the ActionMailer configuration setup at the end of the files config/environments/*.yml.
Default MAPS Configuration
The following is the contents of config/settings.yml:
# ----------------------------------------------------------------- # Configruation Settings for SoftXS MAPS # ----------------------------------------------------------------- SXS: Application: BaseUrl: "localhost:3000" Name: "SoftXS" Logo: "small_company_logo.png" BaseTitle: <%= Rails.env == "production" ? "SoftXS GmbH" : "SoftXS GmbH [#{Rails.env.to_s}]" %> # -- Gem configuration Devise: MailSender: "maps@softxs.ch" ActionMailer: RaiseDeliveryErrors: false PerformDeliveries: false # -- Payment Processing OpenSSL: CertsFile: &CERTSFILE <%= "#{Rails.root}/app/assets/cacert.pem" %>
Example MAPS Local Settings Configuration
The following is the contents of an example config/settings.local.yml file:
# MAPS Configuration -- Instance settings SXS: Application: BaseUrl: "vor.softxs.ch:4000" ActionMailer: PerformDeliveries: false RaiseDeliveryErrors: false DeliveryMethod: :smtp Smtp: address: "mbox.softxs.ch" domain: "softxs.ch"