diff --git a/Gemfile b/Gemfile index 269ee339..f3274188 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ # frozen_string_literal: true + source "https://rubygems.org" gem "authie" gem "autoprefixer-rails" diff --git a/Rakefile b/Rakefile index 4237d413..d2a78aa2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/api/authenticator.rb b/api/authenticator.rb index 8c6d504a..a69b291f 100644 --- a/api/authenticator.rb +++ b/api/authenticator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + authenticator :server do friendly_name "Server Authenticator" header "X-Server-API-Key", "The API token for a server that you wish to authenticate with.", example: "f29a45f0d4e1744ebaee" diff --git a/api/controllers/messages_api_controller.rb b/api/controllers/messages_api_controller.rb index d362813d..35f30177 100644 --- a/api/controllers/messages_api_controller.rb +++ b/api/controllers/messages_api_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + controller :messages do friendly_name "Messages API" description "This API allows you to access message details" diff --git a/api/controllers/send_api_controller.rb b/api/controllers/send_api_controller.rb index 5dd3164b..c22935f0 100644 --- a/api/controllers/send_api_controller.rb +++ b/api/controllers/send_api_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + controller :send do friendly_name "Send API" description "This API allows you to send messages" diff --git a/api/structures/delivery_api_structure.rb b/api/structures/delivery_api_structure.rb index a813849f..69cf82d8 100644 --- a/api/structures/delivery_api_structure.rb +++ b/api/structures/delivery_api_structure.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + structure :delivery do basic :id basic :status diff --git a/api/structures/message_api_structure.rb b/api/structures/message_api_structure.rb index 8e6356bd..a48512a2 100644 --- a/api/structures/message_api_structure.rb +++ b/api/structures/message_api_structure.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + structure :message do basic :id basic :token diff --git a/app/controllers/address_endpoints_controller.rb b/app/controllers/address_endpoints_controller.rb index d1968759..3d1f9282 100644 --- a/app/controllers/address_endpoints_controller.rb +++ b/app/controllers/address_endpoints_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AddressEndpointsController < ApplicationController include WithinOrganization diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2f096101..e25615ba 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "authie/session" class ApplicationController < ActionController::Base diff --git a/app/controllers/concerns/within_organization.rb b/app/controllers/concerns/within_organization.rb index a918d11d..429a85b8 100644 --- a/app/controllers/concerns/within_organization.rb +++ b/app/controllers/concerns/within_organization.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module WithinOrganization extend ActiveSupport::Concern diff --git a/app/controllers/credentials_controller.rb b/app/controllers/credentials_controller.rb index 87448b7f..c40fa891 100644 --- a/app/controllers/credentials_controller.rb +++ b/app/controllers/credentials_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CredentialsController < ApplicationController include WithinOrganization diff --git a/app/controllers/domains_controller.rb b/app/controllers/domains_controller.rb index dab606d2..f1ef2580 100644 --- a/app/controllers/domains_controller.rb +++ b/app/controllers/domains_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class DomainsController < ApplicationController include WithinOrganization diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 69cff7df..29445d84 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class HelpController < ApplicationController include WithinOrganization diff --git a/app/controllers/http_endpoints_controller.rb b/app/controllers/http_endpoints_controller.rb index c3cae1be..56212f3e 100644 --- a/app/controllers/http_endpoints_controller.rb +++ b/app/controllers/http_endpoints_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class HTTPEndpointsController < ApplicationController include WithinOrganization diff --git a/app/controllers/ip_addresses_controller.rb b/app/controllers/ip_addresses_controller.rb index 7a88dbfa..3e7bbb45 100644 --- a/app/controllers/ip_addresses_controller.rb +++ b/app/controllers/ip_addresses_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class IPAddressesController < ApplicationController before_action :admin_required diff --git a/app/controllers/ip_pool_rules_controller.rb b/app/controllers/ip_pool_rules_controller.rb index bb309745..566820a1 100644 --- a/app/controllers/ip_pool_rules_controller.rb +++ b/app/controllers/ip_pool_rules_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class IPPoolRulesController < ApplicationController include WithinOrganization diff --git a/app/controllers/ip_pools_controller.rb b/app/controllers/ip_pools_controller.rb index 797a9b82..ed7e55f8 100644 --- a/app/controllers/ip_pools_controller.rb +++ b/app/controllers/ip_pools_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class IPPoolsController < ApplicationController before_action :admin_required diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 0ec6b3dd..ff88ef59 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class MessagesController < ApplicationController include WithinOrganization diff --git a/app/controllers/organization_ip_pools_controller.rb b/app/controllers/organization_ip_pools_controller.rb index 125a128e..78f6740f 100644 --- a/app/controllers/organization_ip_pools_controller.rb +++ b/app/controllers/organization_ip_pools_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class OrganizationIPPoolsController < ApplicationController include WithinOrganization diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index bc6e863d..1e953fa2 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class OrganizationsController < ApplicationController before_action :admin_required, only: [:new, :create, :delete, :destroy] diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index b50d5d1a..594b34bd 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class RoutesController < ApplicationController include WithinOrganization diff --git a/app/controllers/servers_controller.rb b/app/controllers/servers_controller.rb index 43e8bbf4..6f8cfe8b 100644 --- a/app/controllers/servers_controller.rb +++ b/app/controllers/servers_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ServersController < ApplicationController include WithinOrganization diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 727a61cd..4af90e5c 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class SessionsController < ApplicationController layout "sub" diff --git a/app/controllers/smtp_endpoints_controller.rb b/app/controllers/smtp_endpoints_controller.rb index 76719121..9659f269 100644 --- a/app/controllers/smtp_endpoints_controller.rb +++ b/app/controllers/smtp_endpoints_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class SMTPEndpointsController < ApplicationController include WithinOrganization diff --git a/app/controllers/track_domains_controller.rb b/app/controllers/track_domains_controller.rb index 52a41ff2..b2a4f3ec 100644 --- a/app/controllers/track_domains_controller.rb +++ b/app/controllers/track_domains_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class TrackDomainsController < ApplicationController include WithinOrganization diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 337b2bed..2448871c 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class UserController < ApplicationController skip_before_action :login_required, only: [:new, :create, :join] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 30930fea..4e3fb081 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class UsersController < ApplicationController before_action :admin_required diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb index 561852db..0d76f5b5 100644 --- a/app/controllers/webhooks_controller.rb +++ b/app/controllers/webhooks_controller.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class WebhooksController < ApplicationController include WithinOrganization diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4d80ce5c..c87fd7d1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module ApplicationHelper def format_delivery_details(server, text) diff --git a/app/jobs/action_deletion_job.rb b/app/jobs/action_deletion_job.rb index df298e53..e598a858 100644 --- a/app/jobs/action_deletion_job.rb +++ b/app/jobs/action_deletion_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ActionDeletionJob < Postal::Job def perform diff --git a/app/jobs/action_deletions_job.rb b/app/jobs/action_deletions_job.rb index 3cd2bd9b..f68b1d98 100644 --- a/app/jobs/action_deletions_job.rb +++ b/app/jobs/action_deletions_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ActionDeletionsJob < Postal::Job def perform diff --git a/app/jobs/check_all_dns_job.rb b/app/jobs/check_all_dns_job.rb index b09f8434..0393afaa 100644 --- a/app/jobs/check_all_dns_job.rb +++ b/app/jobs/check_all_dns_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class CheckAllDNSJob < Postal::Job def perform diff --git a/app/jobs/cleanup_authie_sessions_job.rb b/app/jobs/cleanup_authie_sessions_job.rb index 06095eb7..36a93d0c 100644 --- a/app/jobs/cleanup_authie_sessions_job.rb +++ b/app/jobs/cleanup_authie_sessions_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "authie/session" class CleanupAuthieSessionsJob < Postal::Job diff --git a/app/jobs/expire_held_messages_job.rb b/app/jobs/expire_held_messages_job.rb index cbd560ca..e54d0521 100644 --- a/app/jobs/expire_held_messages_job.rb +++ b/app/jobs/expire_held_messages_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ExpireHeldMessagesJob < Postal::Job def perform diff --git a/app/jobs/process_message_retention_job.rb b/app/jobs/process_message_retention_job.rb index 87a07d79..35c3bf38 100644 --- a/app/jobs/process_message_retention_job.rb +++ b/app/jobs/process_message_retention_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ProcessMessageRetentionJob < Postal::Job def perform diff --git a/app/jobs/prune_suppression_lists_job.rb b/app/jobs/prune_suppression_lists_job.rb index 004e6032..ece9db7e 100644 --- a/app/jobs/prune_suppression_lists_job.rb +++ b/app/jobs/prune_suppression_lists_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class PruneSuppressionListsJob < Postal::Job def perform diff --git a/app/jobs/prune_webhook_requests_job.rb b/app/jobs/prune_webhook_requests_job.rb index 04bd58cf..632bc4a7 100644 --- a/app/jobs/prune_webhook_requests_job.rb +++ b/app/jobs/prune_webhook_requests_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class PruneWebhookRequestsJob < Postal::Job def perform diff --git a/app/jobs/requeue_webhooks_job.rb b/app/jobs/requeue_webhooks_job.rb index abe13d53..736f0b66 100644 --- a/app/jobs/requeue_webhooks_job.rb +++ b/app/jobs/requeue_webhooks_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class RequeueWebhooksJob < Postal::Job def perform diff --git a/app/jobs/send_notifications_job.rb b/app/jobs/send_notifications_job.rb index ac9a6212..9d519c69 100644 --- a/app/jobs/send_notifications_job.rb +++ b/app/jobs/send_notifications_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class SendNotificationsJob < Postal::Job def perform diff --git a/app/jobs/send_webhook_job.rb b/app/jobs/send_webhook_job.rb index f5eadbca..71364cfc 100644 --- a/app/jobs/send_webhook_job.rb +++ b/app/jobs/send_webhook_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class SendWebhookJob < Postal::Job def perform diff --git a/app/jobs/sleep_job.rb b/app/jobs/sleep_job.rb index a92d6d65..9604b76d 100644 --- a/app/jobs/sleep_job.rb +++ b/app/jobs/sleep_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class SleepJob < Postal::Job def perform diff --git a/app/jobs/tidy_raw_messages_job.rb b/app/jobs/tidy_raw_messages_job.rb index cfc3f022..151188f3 100644 --- a/app/jobs/tidy_raw_messages_job.rb +++ b/app/jobs/tidy_raw_messages_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class TidyRawMessagesJob < Postal::Job def perform diff --git a/app/jobs/unqueue_message_job.rb b/app/jobs/unqueue_message_job.rb index 9ba30852..8eca51cd 100644 --- a/app/jobs/unqueue_message_job.rb +++ b/app/jobs/unqueue_message_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class UnqueueMessageJob < Postal::Job def perform diff --git a/app/jobs/webhook_delivery_job.rb b/app/jobs/webhook_delivery_job.rb index 8c2a6855..a7369f58 100644 --- a/app/jobs/webhook_delivery_job.rb +++ b/app/jobs/webhook_delivery_job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class WebhookDeliveryJob < Postal::Job def perform diff --git a/app/mailers/app_mailer.rb b/app/mailers/app_mailer.rb index c2dd8ccf..dca1d84c 100644 --- a/app/mailers/app_mailer.rb +++ b/app/mailers/app_mailer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AppMailer < ApplicationMailer def verify_email_address(user) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index bf39d805..95b7f19c 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ApplicationMailer < ActionMailer::Base default from: "#{Postal.smtp_from_name} <#{Postal.smtp_from_address}>" diff --git a/app/models/additional_route_endpoint.rb b/app/models/additional_route_endpoint.rb index b8330af9..5d4aa306 100644 --- a/app/models/additional_route_endpoint.rb +++ b/app/models/additional_route_endpoint.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: additional_route_endpoints diff --git a/app/models/address_endpoint.rb b/app/models/address_endpoint.rb index 234996f7..18de1307 100644 --- a/app/models/address_endpoint.rb +++ b/app/models/address_endpoint.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: address_endpoints diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 8627f76a..aecc7706 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class ApplicationRecord < ActiveRecord::Base self.abstract_class = true diff --git a/app/models/concerns/has_authentication.rb b/app/models/concerns/has_authentication.rb index c9c4b309..26a9f98d 100644 --- a/app/models/concerns/has_authentication.rb +++ b/app/models/concerns/has_authentication.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module HasAuthentication extend ActiveSupport::Concern diff --git a/app/models/concerns/has_dns_checks.rb b/app/models/concerns/has_dns_checks.rb index 13d2c9ae..3147e896 100644 --- a/app/models/concerns/has_dns_checks.rb +++ b/app/models/concerns/has_dns_checks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "resolv" module HasDNSChecks diff --git a/app/models/concerns/has_message.rb b/app/models/concerns/has_message.rb index 5e4acef2..16fca600 100644 --- a/app/models/concerns/has_message.rb +++ b/app/models/concerns/has_message.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module HasMessage def self.included(base) diff --git a/app/models/concerns/has_soft_destroy.rb b/app/models/concerns/has_soft_destroy.rb index 493bbc19..55cfcaf8 100644 --- a/app/models/concerns/has_soft_destroy.rb +++ b/app/models/concerns/has_soft_destroy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module HasSoftDestroy def self.included(base) diff --git a/app/models/concerns/has_uuid.rb b/app/models/concerns/has_uuid.rb index 56ba5a75..0c85bf79 100644 --- a/app/models/concerns/has_uuid.rb +++ b/app/models/concerns/has_uuid.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module HasUUID def self.included(base) diff --git a/app/models/credential.rb b/app/models/credential.rb index 6d544215..1af484d0 100644 --- a/app/models/credential.rb +++ b/app/models/credential.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: credentials diff --git a/app/models/domain.rb b/app/models/domain.rb index d9a3ff9f..a248546b 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: domains diff --git a/app/models/http_endpoint.rb b/app/models/http_endpoint.rb index 5e107ddb..a2e2faab 100644 --- a/app/models/http_endpoint.rb +++ b/app/models/http_endpoint.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: http_endpoints diff --git a/app/models/incoming_message_prototype.rb b/app/models/incoming_message_prototype.rb index 0916882f..b8fb00ae 100644 --- a/app/models/incoming_message_prototype.rb +++ b/app/models/incoming_message_prototype.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class IncomingMessagePrototype attr_accessor :to diff --git a/app/models/ip_address.rb b/app/models/ip_address.rb index d6a71009..451c7a17 100644 --- a/app/models/ip_address.rb +++ b/app/models/ip_address.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: ip_addresses diff --git a/app/models/ip_pool.rb b/app/models/ip_pool.rb index e0d6d20a..7d118dc5 100644 --- a/app/models/ip_pool.rb +++ b/app/models/ip_pool.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: ip_pools diff --git a/app/models/ip_pool_rule.rb b/app/models/ip_pool_rule.rb index 1cfa635b..5fc20a24 100644 --- a/app/models/ip_pool_rule.rb +++ b/app/models/ip_pool_rule.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: ip_pool_rules diff --git a/app/models/organization.rb b/app/models/organization.rb index 991a8e25..85b2938c 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: organizations diff --git a/app/models/organization_ip_pool.rb b/app/models/organization_ip_pool.rb index 715323ae..d0fefac2 100644 --- a/app/models/organization_ip_pool.rb +++ b/app/models/organization_ip_pool.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: organization_ip_pools diff --git a/app/models/organization_user.rb b/app/models/organization_user.rb index 13b27891..d602a48e 100644 --- a/app/models/organization_user.rb +++ b/app/models/organization_user.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: organization_users diff --git a/app/models/outgoing_message_prototype.rb b/app/models/outgoing_message_prototype.rb index 0fd1b0bd..a54a1481 100644 --- a/app/models/outgoing_message_prototype.rb +++ b/app/models/outgoing_message_prototype.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "resolv" class OutgoingMessagePrototype diff --git a/app/models/queued_message.rb b/app/models/queued_message.rb index 884b1968..5fc413bc 100644 --- a/app/models/queued_message.rb +++ b/app/models/queued_message.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: queued_messages diff --git a/app/models/route.rb b/app/models/route.rb index 7c49f5c6..febe22fd 100644 --- a/app/models/route.rb +++ b/app/models/route.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: routes diff --git a/app/models/server.rb b/app/models/server.rb index c672b3ea..762ed60f 100644 --- a/app/models/server.rb +++ b/app/models/server.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: servers diff --git a/app/models/smtp_endpoint.rb b/app/models/smtp_endpoint.rb index 439e2830..cda9dac6 100644 --- a/app/models/smtp_endpoint.rb +++ b/app/models/smtp_endpoint.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: smtp_endpoints diff --git a/app/models/statistic.rb b/app/models/statistic.rb index c7ec358d..e344ba17 100644 --- a/app/models/statistic.rb +++ b/app/models/statistic.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: statistics diff --git a/app/models/track_domain.rb b/app/models/track_domain.rb index d545c8e3..810b6ea0 100644 --- a/app/models/track_domain.rb +++ b/app/models/track_domain.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: track_domains diff --git a/app/models/user.rb b/app/models/user.rb index 90083b25..b2831f3c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: users diff --git a/app/models/user_invite.rb b/app/models/user_invite.rb index 92202f65..2b8b4de9 100644 --- a/app/models/user_invite.rb +++ b/app/models/user_invite.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: user_invites diff --git a/app/models/webhook.rb b/app/models/webhook.rb index f6ccf93d..a334632c 100644 --- a/app/models/webhook.rb +++ b/app/models/webhook.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: webhooks diff --git a/app/models/webhook_event.rb b/app/models/webhook_event.rb index dd20d87e..a0a2236d 100644 --- a/app/models/webhook_event.rb +++ b/app/models/webhook_event.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: webhook_events diff --git a/app/models/webhook_request.rb b/app/models/webhook_request.rb index 5a94527e..567c1bb4 100644 --- a/app/models/webhook_request.rb +++ b/app/models/webhook_request.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: webhook_requests diff --git a/bin/rails b/bin/rails index cbfe38b1..22f2d8de 100755 --- a/bin/rails +++ b/bin/rails @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + APP_PATH = File.expand_path("../config/application", __dir__) require_relative "../config/boot" require "rails/commands" diff --git a/bin/rake b/bin/rake index d648cf02..e436ea54 100755 --- a/bin/rake +++ b/bin/rake @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require_relative "../config/boot" require "rake" Rake.application.run diff --git a/bin/setup b/bin/setup index f216f6fe..e413f40e 100755 --- a/bin/setup +++ b/bin/setup @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require "pathname" require "fileutils" include FileUtils diff --git a/bin/update b/bin/update index 31499ea2..998dedea 100755 --- a/bin/update +++ b/bin/update @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require "pathname" require "fileutils" include FileUtils diff --git a/config.ru b/config.ru index 2e2c5e2c..9f3cd864 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require_relative "config/environment" diff --git a/config/application.rb b/config/application.rb index bebd5c78..a7879aa7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative "boot" require "rails" diff --git a/config/boot.rb b/config/boot.rb index 37023fe6..73db71c1 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) $stdout.sync = true diff --git a/config/cron.rb b/config/cron.rb index 2d7e6f98..ab18723d 100644 --- a/config/cron.rb +++ b/config/cron.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Clockwork configure do |config| diff --git a/config/environment.rb b/config/environment.rb index a21c0c58..7df99e89 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Load the Rails application. require_relative "application" diff --git a/config/environments/development.rb b/config/environments/development.rb index f556ed8a..b13af629 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/environments/production.rb b/config/environments/production.rb index 40ba9d3e..788e5f3b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/environments/test.rb b/config/environments/test.rb index be3dbc53..f88be04a 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index b4e1da0f..1be14d32 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 2a729595..ee8dff9c 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index b7fe1231..7a4f47b4 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 82b99495..38cceed7 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/mail_extensions.rb b/config/initializers/mail_extensions.rb index 20a6cc6f..0d37a1c4 100644 --- a/config/initializers/mail_extensions.rb +++ b/config/initializers/mail_extensions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "mail" module Mail diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index 28e0e3ba..420535c8 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 5.0 upgrade. diff --git a/config/initializers/postal.rb b/config/initializers/postal.rb index 5acc334c..7c93a5c9 100644 --- a/config/initializers/postal.rb +++ b/config/initializers/postal.rb @@ -1,2 +1,3 @@ # frozen_string_literal: true + require "postal" diff --git a/config/initializers/record_key_for_dom.rb b/config/initializers/record_key_for_dom.rb index 41e4668f..e0152c18 100644 --- a/config/initializers/record_key_for_dom.rb +++ b/config/initializers/record_key_for_dom.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module ActionView module RecordIdentifier diff --git a/config/initializers/secret_key.rb b/config/initializers/secret_key.rb index bd4df029..d4f48f19 100644 --- a/config/initializers/secret_key.rb +++ b/config/initializers/secret_key.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + if Postal.config.rails&.secret_key Rails.application.secrets.secret_key_base = Postal.config.rails.secret_key else diff --git a/config/initializers/secure_headers.rb b/config/initializers/secure_headers.rb index 36b72275..71894cf3 100644 --- a/config/initializers/secure_headers.rb +++ b/config/initializers/secure_headers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + SecureHeaders::Configuration.default do |config| config.hsts = SecureHeaders::OPT_OUT diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index ec4390c1..88d45888 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "postal/config" if Postal.config.general&.exception_url diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 7c8845eb..51fd0d7f 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: "_postal_session" diff --git a/config/initializers/smtp.rb b/config/initializers/smtp.rb index b0c616b8..a9a1de21 100644 --- a/config/initializers/smtp.rb +++ b/config/initializers/smtp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "postal/config" if Postal.config&.smtp ActionMailer::Base.delivery_method = :smtp diff --git a/config/initializers/smtp_extensions.rb b/config/initializers/smtp_extensions.rb index 7a6a2d9f..85dd1e64 100644 --- a/config/initializers/smtp_extensions.rb +++ b/config/initializers/smtp_extensions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class Net::SMTP::Response def message diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb index 651e5cbe..59b1b852 100644 --- a/config/initializers/trusted_proxies.rb +++ b/config/initializers/trusted_proxies.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Rack class Request diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 18c38252..2f3c0db4 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb index 2c80862e..4941321f 100644 --- a/config/initializers/zeitwerk.rb +++ b/config/initializers/zeitwerk.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Rails.autoloaders.each do |autoloader| # Ignore the message DB migrations directory as it doesn't follow # Zeitwerk's conventions and is always loaded and executed in order. diff --git a/config/puma.rb b/config/puma.rb index 148bba9f..72aae6af 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require_relative "../lib/postal/config" threads_count = Postal.config.web_server&.max_threads&.to_i || 5 threads threads_count, threads_count diff --git a/config/routes.rb b/config/routes.rb index 82ba97f8..727ed2be 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Rails.application.routes.draw do scope "org/:org_permalink", as: "organization" do resources :domains, only: [:index, :new, :create, :destroy] do diff --git a/db/migrate/20161003195209_create_authie_sessions.authie.rb b/db/migrate/20161003195209_create_authie_sessions.authie.rb index 0a6d7d55..1b6e990a 100644 --- a/db/migrate/20161003195209_create_authie_sessions.authie.rb +++ b/db/migrate/20161003195209_create_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20141012174250) class CreateAuthieSessions < ActiveRecord::Migration diff --git a/db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb b/db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb index bfbc714c..8cb984e9 100644 --- a/db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb +++ b/db/migrate/20161003195210_add_indexes_to_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20141013115205) class AddIndexesToAuthieSessions < ActiveRecord::Migration diff --git a/db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb b/db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb index d28b3fa1..0bd5bd1b 100644 --- a/db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb +++ b/db/migrate/20161003195211_add_parent_id_to_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20150109144120) class AddParentIdToAuthieSessions < ActiveRecord::Migration diff --git a/db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb b/db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb index 709e552b..9ae1f440 100644 --- a/db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb +++ b/db/migrate/20161003195212_add_two_factor_auth_fields_to_authie.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20150305135400) class AddTwoFactorAuthFieldsToAuthie < ActiveRecord::Migration diff --git a/db/migrate/20170418200606_initial_schema.rb b/db/migrate/20170418200606_initial_schema.rb index f3a7fc60..76c3eb1c 100644 --- a/db/migrate/20170418200606_initial_schema.rb +++ b/db/migrate/20170418200606_initial_schema.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class InitialSchema < ActiveRecord::Migration def up diff --git a/db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb b/db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb index e6e90d0f..90baa7d8 100644 --- a/db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb +++ b/db/migrate/20170421195414_add_token_hashes_to_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20170417170000) class AddTokenHashesToAuthieSessions < ActiveRecord::Migration diff --git a/db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb b/db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb index 1aeae15a..7cb9b330 100644 --- a/db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb +++ b/db/migrate/20170421195415_add_index_to_token_hashes_on_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20170421174100) class AddIndexToTokenHashesOnAuthieSessions < ActiveRecord::Migration diff --git a/db/migrate/20170428153353_remove_type_from_ip_pools.rb b/db/migrate/20170428153353_remove_type_from_ip_pools.rb index bbba5542..3d027631 100644 --- a/db/migrate/20170428153353_remove_type_from_ip_pools.rb +++ b/db/migrate/20170428153353_remove_type_from_ip_pools.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class RemoveTypeFromIPPools < ActiveRecord::Migration[5.0] def change diff --git a/db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb b/db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb index 3c12d3c0..179e4dca 100644 --- a/db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb +++ b/db/migrate/20180216114344_add_host_to_authie_sessions.authie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This migration comes from authie (originally 20180215152200) class AddHostToAuthieSessions < ActiveRecord::Migration[4.2] diff --git a/db/migrate/20200717083943_add_uuid_to_credentials.rb b/db/migrate/20200717083943_add_uuid_to_credentials.rb index 69525553..6aecd3b1 100644 --- a/db/migrate/20200717083943_add_uuid_to_credentials.rb +++ b/db/migrate/20200717083943_add_uuid_to_credentials.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AddUUIDToCredentials < ActiveRecord::Migration[5.2] def change diff --git a/db/migrate/20210727210551_add_priority_to_ip_addresses.rb b/db/migrate/20210727210551_add_priority_to_ip_addresses.rb index 74589a9b..85b792ea 100644 --- a/db/migrate/20210727210551_add_priority_to_ip_addresses.rb +++ b/db/migrate/20210727210551_add_priority_to_ip_addresses.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AddPriorityToIPAddresses < ActiveRecord::Migration[5.2] def change diff --git a/db/migrate/20240206173036_add_privacy_mode_to_servers.rb b/db/migrate/20240206173036_add_privacy_mode_to_servers.rb index cb1843a8..691e2adf 100644 --- a/db/migrate/20240206173036_add_privacy_mode_to_servers.rb +++ b/db/migrate/20240206173036_add_privacy_mode_to_servers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + class AddPrivacyModeToServers < ActiveRecord::Migration[6.1] def change add_column :servers, :privacy_mode, :boolean, default: false diff --git a/db/schema.rb b/db/schema.rb index 28752753..305d56ba 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. diff --git a/lib/postal.rb b/lib/postal.rb index dac6e7eb..4589dbe8 100644 --- a/lib/postal.rb +++ b/lib/postal.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true + module Postal end diff --git a/lib/postal/app_logger.rb b/lib/postal/app_logger.rb index d0be66df..adda3201 100644 --- a/lib/postal/app_logger.rb +++ b/lib/postal/app_logger.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "logger" module Postal diff --git a/lib/postal/bounce_message.rb b/lib/postal/bounce_message.rb index 31136fb9..e5a98d0c 100644 --- a/lib/postal/bounce_message.rb +++ b/lib/postal/bounce_message.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class BounceMessage diff --git a/lib/postal/config.rb b/lib/postal/config.rb index b86e84be..548bc99d 100644 --- a/lib/postal/config.rb +++ b/lib/postal/config.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "erb" require "yaml" require "pathname" diff --git a/lib/postal/countries.rb b/lib/postal/countries.rb index 308cc93f..d7db9e42 100644 --- a/lib/postal/countries.rb +++ b/lib/postal/countries.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module Countries diff --git a/lib/postal/dkim_header.rb b/lib/postal/dkim_header.rb index d9206c35..20ab04af 100644 --- a/lib/postal/dkim_header.rb +++ b/lib/postal/dkim_header.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class DKIMHeader diff --git a/lib/postal/error.rb b/lib/postal/error.rb index 2c4fa889..3eb0b34a 100644 --- a/lib/postal/error.rb +++ b/lib/postal/error.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module Errors diff --git a/lib/postal/helpers.rb b/lib/postal/helpers.rb index f2d8f0fd..551e2227 100644 --- a/lib/postal/helpers.rb +++ b/lib/postal/helpers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module Helpers diff --git a/lib/postal/http.rb b/lib/postal/http.rb index 4b9393bb..8bd0c8f1 100644 --- a/lib/postal/http.rb +++ b/lib/postal/http.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "net/https" require "uri" diff --git a/lib/postal/http_sender.rb b/lib/postal/http_sender.rb index 158ffc04..686c06e5 100644 --- a/lib/postal/http_sender.rb +++ b/lib/postal/http_sender.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class HTTPSender < Sender diff --git a/lib/postal/job.rb b/lib/postal/job.rb index 78451459..32759cb2 100644 --- a/lib/postal/job.rb +++ b/lib/postal/job.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "nifty/utils/random_string" module Postal diff --git a/lib/postal/message_db.rb b/lib/postal/message_db.rb index ac46b5fd..0d01c89d 100644 --- a/lib/postal/message_db.rb +++ b/lib/postal/message_db.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB end diff --git a/lib/postal/message_db/click.rb b/lib/postal/message_db/click.rb index 0de25e25..9a060ad4 100644 --- a/lib/postal/message_db/click.rb +++ b/lib/postal/message_db/click.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Click diff --git a/lib/postal/message_db/connection_pool.rb b/lib/postal/message_db/connection_pool.rb index 7cbb3b23..d98e1cee 100644 --- a/lib/postal/message_db/connection_pool.rb +++ b/lib/postal/message_db/connection_pool.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class ConnectionPool diff --git a/lib/postal/message_db/database.rb b/lib/postal/message_db/database.rb index 5e2ab5c0..97376d7a 100644 --- a/lib/postal/message_db/database.rb +++ b/lib/postal/message_db/database.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Database diff --git a/lib/postal/message_db/delivery.rb b/lib/postal/message_db/delivery.rb index 07121221..6923df3d 100644 --- a/lib/postal/message_db/delivery.rb +++ b/lib/postal/message_db/delivery.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Delivery diff --git a/lib/postal/message_db/live_stats.rb b/lib/postal/message_db/live_stats.rb index 379af133..7d0b3b79 100644 --- a/lib/postal/message_db/live_stats.rb +++ b/lib/postal/message_db/live_stats.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class LiveStats diff --git a/lib/postal/message_db/load.rb b/lib/postal/message_db/load.rb index 0a2a3a33..302fd3ce 100644 --- a/lib/postal/message_db/load.rb +++ b/lib/postal/message_db/load.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Load diff --git a/lib/postal/message_db/message.rb b/lib/postal/message_db/message.rb index 5b333ec3..ce7a72af 100644 --- a/lib/postal/message_db/message.rb +++ b/lib/postal/message_db/message.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Message diff --git a/lib/postal/message_db/migration.rb b/lib/postal/message_db/migration.rb index 0acbabf8..5664895a 100644 --- a/lib/postal/message_db/migration.rb +++ b/lib/postal/message_db/migration.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Migration diff --git a/lib/postal/message_db/migrations/01_create_migrations.rb b/lib/postal/message_db/migrations/01_create_migrations.rb index 1fe2a6cd..79f34d08 100644 --- a/lib/postal/message_db/migrations/01_create_migrations.rb +++ b/lib/postal/message_db/migrations/01_create_migrations.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/02_create_messages.rb b/lib/postal/message_db/migrations/02_create_messages.rb index ad476d1c..051e6b72 100644 --- a/lib/postal/message_db/migrations/02_create_messages.rb +++ b/lib/postal/message_db/migrations/02_create_messages.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/03_create_deliveries.rb b/lib/postal/message_db/migrations/03_create_deliveries.rb index 684877da..2f75c35e 100644 --- a/lib/postal/message_db/migrations/03_create_deliveries.rb +++ b/lib/postal/message_db/migrations/03_create_deliveries.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/04_create_live_stats.rb b/lib/postal/message_db/migrations/04_create_live_stats.rb index acf19e90..9637e1b2 100644 --- a/lib/postal/message_db/migrations/04_create_live_stats.rb +++ b/lib/postal/message_db/migrations/04_create_live_stats.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/05_create_raw_message_sizes.rb b/lib/postal/message_db/migrations/05_create_raw_message_sizes.rb index c57ca0c8..e6b5939f 100644 --- a/lib/postal/message_db/migrations/05_create_raw_message_sizes.rb +++ b/lib/postal/message_db/migrations/05_create_raw_message_sizes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/06_create_clicks.rb b/lib/postal/message_db/migrations/06_create_clicks.rb index bcb4b13c..27f867e6 100644 --- a/lib/postal/message_db/migrations/06_create_clicks.rb +++ b/lib/postal/message_db/migrations/06_create_clicks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/07_create_loads.rb b/lib/postal/message_db/migrations/07_create_loads.rb index 3f6caa77..a6e7e3d4 100644 --- a/lib/postal/message_db/migrations/07_create_loads.rb +++ b/lib/postal/message_db/migrations/07_create_loads.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/08_create_stats.rb b/lib/postal/message_db/migrations/08_create_stats.rb index d583f662..1b532c68 100644 --- a/lib/postal/message_db/migrations/08_create_stats.rb +++ b/lib/postal/message_db/migrations/08_create_stats.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/09_create_links.rb b/lib/postal/message_db/migrations/09_create_links.rb index ade26290..4d0d7fa2 100644 --- a/lib/postal/message_db/migrations/09_create_links.rb +++ b/lib/postal/message_db/migrations/09_create_links.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/10_create_spam_checks.rb b/lib/postal/message_db/migrations/10_create_spam_checks.rb index 64e2ca12..f1802810 100644 --- a/lib/postal/message_db/migrations/10_create_spam_checks.rb +++ b/lib/postal/message_db/migrations/10_create_spam_checks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/11_add_time_to_deliveries.rb b/lib/postal/message_db/migrations/11_add_time_to_deliveries.rb index f7569284..d460b5f8 100644 --- a/lib/postal/message_db/migrations/11_add_time_to_deliveries.rb +++ b/lib/postal/message_db/migrations/11_add_time_to_deliveries.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/12_add_hold_expiry.rb b/lib/postal/message_db/migrations/12_add_hold_expiry.rb index 30dda0a1..5541698d 100644 --- a/lib/postal/message_db/migrations/12_add_hold_expiry.rb +++ b/lib/postal/message_db/migrations/12_add_hold_expiry.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/13_add_index_to_message_status.rb b/lib/postal/message_db/migrations/13_add_index_to_message_status.rb index 55673da7..8b3f0560 100644 --- a/lib/postal/message_db/migrations/13_add_index_to_message_status.rb +++ b/lib/postal/message_db/migrations/13_add_index_to_message_status.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/14_create_suppressions.rb b/lib/postal/message_db/migrations/14_create_suppressions.rb index cba6348b..42b624e3 100644 --- a/lib/postal/message_db/migrations/14_create_suppressions.rb +++ b/lib/postal/message_db/migrations/14_create_suppressions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/15_create_webhook_requests.rb b/lib/postal/message_db/migrations/15_create_webhook_requests.rb index fec24021..601dbc47 100644 --- a/lib/postal/message_db/migrations/15_create_webhook_requests.rb +++ b/lib/postal/message_db/migrations/15_create_webhook_requests.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/16_add_url_and_hook_to_webhooks.rb b/lib/postal/message_db/migrations/16_add_url_and_hook_to_webhooks.rb index 726712fe..f1df5a3d 100644 --- a/lib/postal/message_db/migrations/16_add_url_and_hook_to_webhooks.rb +++ b/lib/postal/message_db/migrations/16_add_url_and_hook_to_webhooks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/17_add_replaced_link_count_to_messages.rb b/lib/postal/message_db/migrations/17_add_replaced_link_count_to_messages.rb index 2616d014..0d99d9ad 100644 --- a/lib/postal/message_db/migrations/17_add_replaced_link_count_to_messages.rb +++ b/lib/postal/message_db/migrations/17_add_replaced_link_count_to_messages.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/18_add_endpoints_to_messages.rb b/lib/postal/message_db/migrations/18_add_endpoints_to_messages.rb index 551b58ca..87d286fc 100644 --- a/lib/postal/message_db/migrations/18_add_endpoints_to_messages.rb +++ b/lib/postal/message_db/migrations/18_add_endpoints_to_messages.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/19_convert_database_to_utf8mb4.rb b/lib/postal/message_db/migrations/19_convert_database_to_utf8mb4.rb index 192cf7e8..20960a44 100644 --- a/lib/postal/message_db/migrations/19_convert_database_to_utf8mb4.rb +++ b/lib/postal/message_db/migrations/19_convert_database_to_utf8mb4.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/migrations/20_increase_links_url_size.rb b/lib/postal/message_db/migrations/20_increase_links_url_size.rb index 5fc406b0..eb31247a 100644 --- a/lib/postal/message_db/migrations/20_increase_links_url_size.rb +++ b/lib/postal/message_db/migrations/20_increase_links_url_size.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB module Migrations diff --git a/lib/postal/message_db/provisioner.rb b/lib/postal/message_db/provisioner.rb index 70753c50..31619dbd 100644 --- a/lib/postal/message_db/provisioner.rb +++ b/lib/postal/message_db/provisioner.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Provisioner diff --git a/lib/postal/message_db/statistics.rb b/lib/postal/message_db/statistics.rb index 5e410a10..11dd460f 100644 --- a/lib/postal/message_db/statistics.rb +++ b/lib/postal/message_db/statistics.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Statistics diff --git a/lib/postal/message_db/suppression_list.rb b/lib/postal/message_db/suppression_list.rb index 4dc041f1..51f91d19 100644 --- a/lib/postal/message_db/suppression_list.rb +++ b/lib/postal/message_db/suppression_list.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class SuppressionList diff --git a/lib/postal/message_db/webhooks.rb b/lib/postal/message_db/webhooks.rb index 6ccd25a7..cfe4bcd6 100644 --- a/lib/postal/message_db/webhooks.rb +++ b/lib/postal/message_db/webhooks.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageDB class Webhooks diff --git a/lib/postal/message_inspection.rb b/lib/postal/message_inspection.rb index 67809d39..125f594c 100644 --- a/lib/postal/message_inspection.rb +++ b/lib/postal/message_inspection.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class MessageInspection diff --git a/lib/postal/message_inspector.rb b/lib/postal/message_inspector.rb index ad808d9c..5eeadc80 100644 --- a/lib/postal/message_inspector.rb +++ b/lib/postal/message_inspector.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class MessageInspector diff --git a/lib/postal/message_inspectors.rb b/lib/postal/message_inspectors.rb index 200bb1b5..8ddb5845 100644 --- a/lib/postal/message_inspectors.rb +++ b/lib/postal/message_inspectors.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageInspectors end diff --git a/lib/postal/message_inspectors/clamav.rb b/lib/postal/message_inspectors/clamav.rb index 28cab163..e16fc229 100644 --- a/lib/postal/message_inspectors/clamav.rb +++ b/lib/postal/message_inspectors/clamav.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageInspectors class Clamav < MessageInspector diff --git a/lib/postal/message_inspectors/rspamd.rb b/lib/postal/message_inspectors/rspamd.rb index 506256a9..7f79a4d3 100644 --- a/lib/postal/message_inspectors/rspamd.rb +++ b/lib/postal/message_inspectors/rspamd.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "net/http" module Postal diff --git a/lib/postal/message_inspectors/spam_assassin.rb b/lib/postal/message_inspectors/spam_assassin.rb index e2c40881..24395e1a 100644 --- a/lib/postal/message_inspectors/spam_assassin.rb +++ b/lib/postal/message_inspectors/spam_assassin.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module MessageInspectors class SpamAssassin < MessageInspector diff --git a/lib/postal/message_parser.rb b/lib/postal/message_parser.rb index dd00c677..7b9055b8 100644 --- a/lib/postal/message_parser.rb +++ b/lib/postal/message_parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class MessageParser diff --git a/lib/postal/message_requeuer.rb b/lib/postal/message_requeuer.rb index be8a7885..a42732fd 100644 --- a/lib/postal/message_requeuer.rb +++ b/lib/postal/message_requeuer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class MessageRequeuer diff --git a/lib/postal/mx_lookup.rb b/lib/postal/mx_lookup.rb index 9e899a03..21aa7eb9 100644 --- a/lib/postal/mx_lookup.rb +++ b/lib/postal/mx_lookup.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class MXLookup diff --git a/lib/postal/query_string.rb b/lib/postal/query_string.rb index 41a22e7f..75df96a2 100644 --- a/lib/postal/query_string.rb +++ b/lib/postal/query_string.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class QueryString diff --git a/lib/postal/rabbit_mq.rb b/lib/postal/rabbit_mq.rb index cab04133..2703cd5f 100644 --- a/lib/postal/rabbit_mq.rb +++ b/lib/postal/rabbit_mq.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "postal/config" require "bunny" diff --git a/lib/postal/received_header.rb b/lib/postal/received_header.rb index 29d0d38c..a3fe3722 100644 --- a/lib/postal/received_header.rb +++ b/lib/postal/received_header.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class ReceivedHeader diff --git a/lib/postal/reply_separator.rb b/lib/postal/reply_separator.rb index ae46e848..9f6d4163 100644 --- a/lib/postal/reply_separator.rb +++ b/lib/postal/reply_separator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class ReplySeparator diff --git a/lib/postal/rspec_helpers.rb b/lib/postal/rspec_helpers.rb index 353091e2..44fd0ab4 100644 --- a/lib/postal/rspec_helpers.rb +++ b/lib/postal/rspec_helpers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module RspecHelpers diff --git a/lib/postal/send_result.rb b/lib/postal/send_result.rb index 9142db7b..af4c40a5 100644 --- a/lib/postal/send_result.rb +++ b/lib/postal/send_result.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class SendResult diff --git a/lib/postal/sender.rb b/lib/postal/sender.rb index b1b2cb61..ff5cd493 100644 --- a/lib/postal/sender.rb +++ b/lib/postal/sender.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class Sender diff --git a/lib/postal/smtp_sender.rb b/lib/postal/smtp_sender.rb index f5a65f92..dff04f4b 100644 --- a/lib/postal/smtp_sender.rb +++ b/lib/postal/smtp_sender.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "resolv" module Postal diff --git a/lib/postal/smtp_server.rb b/lib/postal/smtp_server.rb index e35dcee4..154ae626 100644 --- a/lib/postal/smtp_server.rb +++ b/lib/postal/smtp_server.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal module SMTPServer end diff --git a/lib/postal/smtp_server/client.rb b/lib/postal/smtp_server/client.rb index 9e2df8fa..6e8514d3 100644 --- a/lib/postal/smtp_server/client.rb +++ b/lib/postal/smtp_server/client.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "resolv" require "nifty/utils/random_string" diff --git a/lib/postal/smtp_server/server.rb b/lib/postal/smtp_server/server.rb index 30ca6322..19bed685 100644 --- a/lib/postal/smtp_server/server.rb +++ b/lib/postal/smtp_server/server.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "ipaddr" require "nio" diff --git a/lib/postal/spam_check.rb b/lib/postal/spam_check.rb index 3c0270d2..61c1d716 100644 --- a/lib/postal/spam_check.rb +++ b/lib/postal/spam_check.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class SpamCheck diff --git a/lib/postal/tracking_middleware.rb b/lib/postal/tracking_middleware.rb index bba9ee7e..3156b727 100644 --- a/lib/postal/tracking_middleware.rb +++ b/lib/postal/tracking_middleware.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class TrackingMiddleware diff --git a/lib/postal/user_creator.rb b/lib/postal/user_creator.rb index 57dd8f1a..39286768 100644 --- a/lib/postal/user_creator.rb +++ b/lib/postal/user_creator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "highline" module Postal diff --git a/lib/postal/version.rb b/lib/postal/version.rb index 0991253f..1e0c1ac4 100644 --- a/lib/postal/version.rb +++ b/lib/postal/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal VERSION_PATH = File.expand_path("../../VERSION", __dir__) diff --git a/lib/postal/worker.rb b/lib/postal/worker.rb index f00d7c00..caaa8c06 100644 --- a/lib/postal/worker.rb +++ b/lib/postal/worker.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Postal class Worker diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake index 069c1a5f..948f883e 100644 --- a/lib/tasks/auto_annotate_models.rake +++ b/lib/tasks/auto_annotate_models.rake @@ -1,4 +1,5 @@ # frozen_string_literal: true + # NOTE: only doing this in development as some production environments (Heroku) # NOTE: are sensitive to local FS writes, and besides -- it's just not proper # NOTE: to have a dev-mode tool do its thing in production. diff --git a/lib/tasks/postal.rake b/lib/tasks/postal.rake index fb8cdda2..81770f68 100644 --- a/lib/tasks/postal.rake +++ b/lib/tasks/postal.rake @@ -1,4 +1,5 @@ # frozen_string_literal: true + namespace :postal do desc "Start the cron worker" task cron: :environment do diff --git a/script/default_dkim_record.rb b/script/default_dkim_record.rb index 5f25d049..5444a383 100644 --- a/script/default_dkim_record.rb +++ b/script/default_dkim_record.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true + require File.expand_path("../lib/postal/config", __dir__) puts Postal.rp_dkim_dns_record diff --git a/script/generate_initial_config.rb b/script/generate_initial_config.rb index 67635410..d3564c9f 100755 --- a/script/generate_initial_config.rb +++ b/script/generate_initial_config.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require File.expand_path("../lib/postal/config", __dir__) require "openssl" require "securerandom" diff --git a/script/make_user.rb b/script/make_user.rb index 11a40679..f5986c7a 100755 --- a/script/make_user.rb +++ b/script/make_user.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + trap("INT") do puts exit diff --git a/script/queue_size.rb b/script/queue_size.rb index a39b616b..aa0f0d23 100755 --- a/script/queue_size.rb +++ b/script/queue_size.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require_relative "../lib/postal/config" require "mysql2" diff --git a/script/test_app_smtp.rb b/script/test_app_smtp.rb index cacc6d61..94f507f6 100755 --- a/script/test_app_smtp.rb +++ b/script/test_app_smtp.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true + trap("INT") do puts exit diff --git a/script/version.rb b/script/version.rb index f58848e4..c8db8972 100755 --- a/script/version.rb +++ b/script/version.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require File.expand_path("../lib/postal/version", __dir__) puts Postal.version diff --git a/script/worker.rb b/script/worker.rb index 834de2af..121f5ce5 100755 --- a/script/worker.rb +++ b/script/worker.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby # frozen_string_literal: true + require_relative "../config/environment" Postal::Worker.new([:main]).work diff --git a/spec/app/models/organization_spec.rb b/spec/app/models/organization_spec.rb index 61b7f396..2340af40 100644 --- a/spec/app/models/organization_spec.rb +++ b/spec/app/models/organization_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Organization do diff --git a/spec/app/models/outgoing_message_prototype_spec.rb b/spec/app/models/outgoing_message_prototype_spec.rb index e40f336e..01c3d57a 100644 --- a/spec/app/models/outgoing_message_prototype_spec.rb +++ b/spec/app/models/outgoing_message_prototype_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe OutgoingMessagePrototype do diff --git a/spec/app/models/server_spec.rb b/spec/app/models/server_spec.rb index 6b56a112..f8714083 100644 --- a/spec/app/models/server_spec.rb +++ b/spec/app/models/server_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Server do diff --git a/spec/app/models/user_spec.rb b/spec/app/models/user_spec.rb index d4137fd9..ca9366bb 100644 --- a/spec/app/models/user_spec.rb +++ b/spec/app/models/user_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe User do diff --git a/spec/factories/domain_factory.rb b/spec/factories/domain_factory.rb index 8a209076..e1284973 100644 --- a/spec/factories/domain_factory.rb +++ b/spec/factories/domain_factory.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: domains diff --git a/spec/factories/organization_factory.rb b/spec/factories/organization_factory.rb index 8f49098f..937a33d5 100644 --- a/spec/factories/organization_factory.rb +++ b/spec/factories/organization_factory.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: organizations diff --git a/spec/factories/server_factory.rb b/spec/factories/server_factory.rb index 61433109..bd8c74e2 100644 --- a/spec/factories/server_factory.rb +++ b/spec/factories/server_factory.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: servers diff --git a/spec/factories/track_domain_factory.rb b/spec/factories/track_domain_factory.rb index 4d2aafd6..836af3f6 100644 --- a/spec/factories/track_domain_factory.rb +++ b/spec/factories/track_domain_factory.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: track_domains diff --git a/spec/factories/user_factory.rb b/spec/factories/user_factory.rb index b2660922..03373491 100644 --- a/spec/factories/user_factory.rb +++ b/spec/factories/user_factory.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # == Schema Information # # Table name: users diff --git a/spec/lib/postal/message_db/connection_pool_spec.rb b/spec/lib/postal/message_db/connection_pool_spec.rb index a8cd9d2e..62190bbc 100644 --- a/spec/lib/postal/message_db/connection_pool_spec.rb +++ b/spec/lib/postal/message_db/connection_pool_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Postal::MessageDB::ConnectionPool do diff --git a/spec/lib/postal/message_db/database_spec.rb b/spec/lib/postal/message_db/database_spec.rb index 66f22a1b..0e2639f1 100644 --- a/spec/lib/postal/message_db/database_spec.rb +++ b/spec/lib/postal/message_db/database_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Postal::MessageDB::Database do diff --git a/spec/lib/postal/message_parser_spec.rb b/spec/lib/postal/message_parser_spec.rb index f27de679..3aba42fb 100644 --- a/spec/lib/postal/message_parser_spec.rb +++ b/spec/lib/postal/message_parser_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Postal::MessageParser do diff --git a/spec/lib/postal/query_string_spec.rb b/spec/lib/postal/query_string_spec.rb index 2778cacc..88e96092 100644 --- a/spec/lib/postal/query_string_spec.rb +++ b/spec/lib/postal/query_string_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rails_helper" describe Postal::QueryString do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 76fbfc1f..2d480a6e 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + ENV["POSTAL_ENV"] = "test" require File.expand_path("../config/environment", __dir__) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd7237d0..64bf63e7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + RSpec.configure do |config| config.color = true