Commit 0a11231f by source_reader

tweaks to clean up deployment

parent 206c54ce
...@@ -2,6 +2,8 @@ class InterfacesController < ActionController::Base ...@@ -2,6 +2,8 @@ class InterfacesController < ActionController::Base
before_action :authenticate_interface_user!, except: [:authenticate] before_action :authenticate_interface_user!, except: [:authenticate]
before_action :create_adapter, only: [:get, :put, :post, :delete] before_action :create_adapter, only: [:get, :put, :post, :delete]
skip_before_action :verify_authenticity_token
after_action :allow_wattsworth_iframe after_action :allow_wattsworth_iframe
#GET /authenticate #GET /authenticate
def authenticate def authenticate
......
<h1>You are not logged in. <h1>You are not logged in.
Use the Data Explorer to access this interface.</h1> Use the Data Explorer to access this interface.</h1>
<% url="http://wattsworth.local/api#{image_path 'robot_stop_707x707.jpg'}"%> <% url="#{image_path 'robot_stop_707x707.jpg'}"%>
<img src='<%= url %>'> <img src='<%= url %>'>
...@@ -14,11 +14,6 @@ development: ...@@ -14,11 +14,6 @@ development:
database: db/development.sqlite3 database: db/development.sqlite3
timeout: 10000 timeout: 10000
local:
<<: *default
database: db/local.sqlite3
timeout: 10000
# Warning: The database defined as "test" will be erased and # Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake". # re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production. # Do not set this db to the same as development or production.
...@@ -26,9 +21,5 @@ test: &test ...@@ -26,9 +21,5 @@ test: &test
<<: *default <<: *default
database: db/test.sqlite3 database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
cucumber: cucumber:
<<: *test <<: *test
...@@ -56,7 +56,7 @@ Rails.application.configure do ...@@ -56,7 +56,7 @@ Rails.application.configure do
# config.active_job.queue_adapter = :resque # config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "control_panel_#{Rails.env}" # config.active_job.queue_name_prefix = "control_panel_#{Rails.env}"
config.action_mailer.perform_caching = false config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = {:host => 'www.wattsworth.net'} config.action_mailer.default_url_options = {:host => 'cloud.wattsworth.net'}
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = :smtp
...@@ -88,8 +88,26 @@ Rails.application.configure do ...@@ -88,8 +88,26 @@ Rails.application.configure do
# Do not dump schema after migrations. # Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false config.active_record.dump_schema_after_migration = false
# ------- Lumen Custom Settings ----------
#
# display custom label in page header
#
config.node_name = ""
# enable password recovery and e-mail invitations
# NOTE: configure smtp.rb with SMTP server details
#
config.send_emails = true
config.interface_url_template = lambda do |id| config.interface_url_template = lambda do |id|
return "http://#{id}.interfaces.wattsworth.net" # change to subdomains for additional security
# NOTE: this requires a DNS server
# return "http://#{id}.interfaces.wattsworth.local"
#
return "/api/interfaces/#{id}/"
end end
end end
...@@ -66,8 +66,24 @@ Rails.application.configure do ...@@ -66,8 +66,24 @@ Rails.application.configure do
end end
end end
# ------- Lumen Custom Settings ----------
#
# display custom label in page header
#
config.node_name = "Development"
# enable password recovery and e-mail invitations
# NOTE: configure smtp.rb with SMTP server details
#
config.send_emails = false
config.interface_url_template = lambda do |id| config.interface_url_template = lambda do |id|
#return "http://#{id}.interfaces.wattsworth.local" # change to subdomains for additional security
return "http://wattsworth.local/api/interfaces/#{id}/" # NOTE: this requires a DNS server
# return "http://#{id}.interfaces.wattsworth.local"
#
return "http://localhost:3000/interfaces/#{id}/"
end end
end end
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = false
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :warn
# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "control_panel_#{Rails.env}"
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
config.interface_url_template = lambda do |id|
#return "http://#{id}.interfaces.wattsworth.local"
return "http://wattsworth.localhost/api/interfaces/#{id}/"
end
end
...@@ -26,8 +26,8 @@ Rails.application.configure do ...@@ -26,8 +26,8 @@ Rails.application.configure do
config.assets.js_compressor = :uglifier config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass # config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed. # TODO: add asset compilation to pipeline
config.assets.compile = false config.assets.compile = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
...@@ -44,11 +44,11 @@ Rails.application.configure do ...@@ -44,11 +44,11 @@ Rails.application.configure do
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true config.force_ssl = false
# Use the lowest log level to ensure availability of diagnostic information # Use the lowest log level to ensure availability of diagnostic information
# when problems arise. # when problems arise.
config.log_level = :info config.log_level = :warn
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [ :request_id ] config.log_tags = [ :request_id ]
...@@ -59,23 +59,6 @@ Rails.application.configure do ...@@ -59,23 +59,6 @@ Rails.application.configure do
# Use a real queuing backend for Active Job (and separate queues per environment) # Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque # config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "control_panel_#{Rails.env}" # config.active_job.queue_name_prefix = "control_panel_#{Rails.env}"
config.action_mailer.perform_caching = false
config.action_mailer.default_url_options = {:host => 'beta.wattsworth.net'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "mail.wattsworth.net",
:port => 25,
:domain => "wattsworth.net",
:user_name => ENV['SMTP_USERNAME'],
:password => ENV['SMTP_PASSWORD'],
:authentication => "login",
:enable_starttls_auto => true
}
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found). # the I18n.default_locale when a translation cannot be found).
...@@ -100,5 +83,24 @@ Rails.application.configure do ...@@ -100,5 +83,24 @@ Rails.application.configure do
# Do not dump schema after migrations. # Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false config.active_record.dump_schema_after_migration = false
# ------- Lumen Custom Settings ----------
#
# display custom label in page header
#
config.node_name = ""
# enable password recovery and e-mail invitations
# NOTE: configure smtp.rb with SMTP server details
#
config.send_emails = false
config.interface_url_template = lambda do |id|
# change to subdomains for additional security
# NOTE: this requires a DNS server
# return "http://#{id}.interfaces.wattsworth.local"
#
return "/api/interfaces/#{id}/"
end
end end
Rails.application.configure do
# display custom label in page header
#
config.node_name = "Donnal House"
# enable password recovery and e-mail invitations
# NOTE: configure smtp.rb with smtp server details
#
config.send_emails = true
end
\ No newline at end of file
...@@ -19,15 +19,5 @@ ...@@ -19,15 +19,5 @@
development: development:
secret_key_base: 5378da95ac37be4d4bab4010596a835b639e01dd084ea37e151bf05fc5dec0c6f46f1b162e9325121d757a4683df9880819ba269f488f93a647c935f9b1453d0 secret_key_base: 5378da95ac37be4d4bab4010596a835b639e01dd084ea37e151bf05fc5dec0c6f46f1b162e9325121d757a4683df9880819ba269f488f93a647c935f9b1453d0
local:
secret_key_base: 7c6333cf4833d556c050d005c198903bd5af6377ab706d92c03089ca9a42b3573ec7e5d30f7590214c29775438483fbf82cc12dae5f1cf396441b28fc1d64e81
test: test:
secret_key_base: 4bb907a33b2b802d006591923f59fa1d0c355f0005dea53efee24b842b17b6b2addd264b20d2d51283c7a0d291efe6888cd1c7e1959f07ccb56304a713696b1e secret_key_base: 4bb907a33b2b802d006591923f59fa1d0c355f0005dea53efee24b842b17b6b2addd264b20d2d51283c7a0d291efe6888cd1c7e1959f07ccb56304a713696b1e
# Do not keep production secrets in the unencrypted secrets file.
# Instead, either read values from the environment.
# Or, use `bin/rails secrets:setup` to configure encrypted secrets
# and move the `production:` environment over there.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment