diff --git a/app/models/user.rb b/app/models/user.rb index ed7165aa..769d0fef 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -36,6 +36,10 @@ def to_s email end + def is_admin + has_role?(:admin) || has_role?(:admin, Site.instance) + end + def is_superadmin has_role? :superadmin end diff --git a/config/environments/production.rb b/config/environments/production.rb index 311b9696..eea9afea 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -61,6 +61,7 @@ config.active_job.queue_adapter = ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq') # config.active_job.queue_name_prefix = "hyku_#{Rails.env}" + config.action_mailer.default_options = { from: ENV.fetch('HYKU_CONTACT_EMAIL', 'changeme@example.com') } if ENV['SMTP_ENABLED'].present? && ENV['SMTP_ENABLED'].to_s == 'true' config.action_mailer.smtp_settings = { user_name: ENV['SMTP_USER_NAME'], diff --git a/config/initializers/mailboxer.rb b/config/initializers/mailboxer.rb index 39bcf7b7..823d1a7c 100644 --- a/config/initializers/mailboxer.rb +++ b/config/initializers/mailboxer.rb @@ -4,7 +4,7 @@ config.uses_emails = true #Configures the default from for emails sent for Messages and Notifications - config.default_from = "no-reply@mailboxer.com" + config.default_from = ENV.fetch('HYKU_CONTACT_EMAIL', 'changeme@example.com') #Configures the methods needed by mailboxer config.email_method = :mailboxer_email diff --git a/config/routes.rb b/config/routes.rb index f08a9431..757c8620 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,12 +6,12 @@ concern :iiif_search, BlacklightIiifSearch::Routes.new concern :oai_provider, BlacklightOaiProvider::Routes.new - + mount Hyrax::IiifAv::Engine, at: '/' mount Riiif::Engine => 'images', as: :riiif if Hyrax.config.iiif_image_server? - authenticate :user, lambda { |u| u.is_superadmin } do - mount Sidekiq::Web => '/sidekiq' + authenticate :user, lambda { |u| u.is_superadmin || u.is_admin } do + mount Sidekiq::Web => '/jobs' end if ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYKU_MULTITENANT', false)) diff --git a/docker-compose.yml b/docker-compose.yml index af73aec2..2577999a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -134,6 +134,9 @@ services: web: <<: *app + # Uncomment command to access container with out starting Rails. Useful for debugging + # command: sleep infinity + # command: sh -l -c "bundle && bundle exec rails s -b 0.0.0.0" environment: - VIRTUAL_PORT=3000 - VIRTUAL_HOST=.hyku.test diff --git a/ops/production-deploy.tmpl.yaml b/ops/production-deploy.tmpl.yaml index 597a035e..04a2f3d5 100644 --- a/ops/production-deploy.tmpl.yaml +++ b/ops/production-deploy.tmpl.yaml @@ -111,7 +111,7 @@ extraEnvVars: &envVars - name: HYKU_BULKRAX_ENABLED value: 'true' - name: HYKU_CONTACT_EMAIL - value: dev-oops@scientist.com + value: noreply@atlamail.org - name: HYKU_DEFAULT_HOST value: "%{tenant}.ir.atla.com" - name: HYKU_FILE_ACL @@ -151,13 +151,13 @@ extraEnvVars: &envVars - name: SMTP_ADDRESS value: email-smtp.us-east-1.amazonaws.com - name: SMTP_DOMAIN - value: atla.com + value: atlamail.org - name: SMTP_ENABLED value: 'true' - name: SMTP_PASSWORD value: $SMTP_PASSWORD - name: SMTP_PORT - value: '465' + value: '587' - name: SMTP_STARTTLS value: 'true' - name: SMTP_TYPE