diff --git a/.env b/.env index 7ab001a2e..0a75b8bd9 100644 --- a/.env +++ b/.env @@ -40,6 +40,18 @@ GITHUB_REPO_AGE_LIMIT = 30 URL_HOST = '0.0.0.0:3000' +MAILER_SENDER = +SUPPORT_EMAIL = +EMAIL_DOMAIN = +FEEDBACK_ALLOWED_ORIGIN = +NGINX_SERVER_NAME = +NGINX_STAGING_SERVER_NAME = +OPENHUB_BLOG_URL = +OPENHUB_OAUTH_BLOG_URL = +ANONYMOUS_ACCOUNT_EMAIL = +CRAWLER_ACCOUNT_EMAIL = +FORGE_USER_AGENT = + AIRBRAKE_API_KEY = AIRBRAKE_HOST = "http://oh-utility02.dc1.lan" AIRBRAKE_PORT = "4545" diff --git a/.env.test b/.env.test index 74751c6ec..20f72926d 100644 --- a/.env.test +++ b/.env.test @@ -16,6 +16,17 @@ AWS_SQS_BAD_EMAIL_QUEUE = "ses-bad-email-queue" AWS_REGION = 'us-east-1' URL_HOST = "localhost:3000" +MAILER_SENDER = 'mailer@openhub.example.com' +SUPPORT_EMAIL = 'info@openhub.example.com' +EMAIL_DOMAIN = 'openhub.example.com' +FEEDBACK_ALLOWED_ORIGIN = 'http://localhost:3000' +NGINX_SERVER_NAME = 'www.openhub.example.com' +NGINX_STAGING_SERVER_NAME = 'staging.openhub.example.com' +OPENHUB_BLOG_URL = 'http://blog.openhub.net/' +OPENHUB_OAUTH_BLOG_URL = 'http://blog.openhub.net/oauth/' +ANONYMOUS_ACCOUNT_EMAIL = 'anon@openhub.example.com' +CRAWLER_ACCOUNT_EMAIL = 'uber_data_crawler@openhub.example.com' +FORGE_USER_AGENT = 'openhub.example.com client' KB_PROJECT_SEARCH_URL = 'https://www.vcrlocalhost.org/kb?' KB_AUTH_KEY = 'dummy_test_key' @@ -42,7 +53,6 @@ NVD_LINK = "https://nvd.nist.gov/nvd.cfm?cvename=" # Configure AWS SDK for test environment before requiring other gems AWS_SES_ACCESS_KEY = 'test_access_key_id' AWS_SES_SECRET_ACCESS_KEY = 'test_secret_access_key' -AWS_REGION = 'us-east-1' TRAVIS_API_BASE_URL = 'https://api.travis-ci.org/' CII_API_BASE_URL = 'https://www.bestpractices.dev/en/' diff --git a/app/controllers/feedbacks_controller.rb b/app/controllers/feedbacks_controller.rb index 3ea83b1e9..4ef0dcc48 100644 --- a/app/controllers/feedbacks_controller.rb +++ b/app/controllers/feedbacks_controller.rb @@ -6,7 +6,7 @@ class FeedbacksController < ApplicationController before_action :set_access_control_header def set_access_control_header - headers['Access-Control-Allow-Origin'] = 'https://security.openhub.net' + headers['Access-Control-Allow-Origin'] = ENV.fetch('FEEDBACK_ALLOWED_ORIGIN') end def create diff --git a/app/exceptions/param_record_not_found.rb b/app/exceptions/param_record_not_found.rb index c5c3de142..e95f10a11 100644 --- a/app/exceptions/param_record_not_found.rb +++ b/app/exceptions/param_record_not_found.rb @@ -2,7 +2,7 @@ # This exception is used in the app to distiguish between user generated ActiveRecord::RecordNotFound # exceptions and ones generated internally. We do not want to jump on malformed URLs typed in by users -# (e.g. https://www.openhub.net/p/i_am_not_a_project), but do wish to alert and fix AR::RNF exceptions +# (e.g. https://www.openhub.blackduck.com/p/i_am_not_a_project), but do wish to alert and fix AR::RNF exceptions # thrown by our internal code. # # To prevent Airbrake exceptions from bad URLs, in controllers, catch AR::RNF exceptions that come from diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb index f13545076..30eec108f 100644 --- a/app/helpers/avatar_helper.rb +++ b/app/helpers/avatar_helper.rb @@ -57,7 +57,7 @@ def avatar_default_size(size) def gravatar_url(md5, size) default_url = if ActionController::Base.asset_host.blank? - 'https%3a%2f%2fopenhub.net' + "https%3a%2f%2f#{ENV.fetch('URL_HOST')}" else "http#{'s' if request&.ssl?}%3a%2f%2f#{ActionController::Base.asset_host}" end diff --git a/app/helpers/site_features_helper.rb b/app/helpers/site_features_helper.rb index ecee0ec49..ded6ea739 100644 --- a/app/helpers/site_features_helper.rb +++ b/app/helpers/site_features_helper.rb @@ -3,10 +3,12 @@ module SiteFeaturesHelper # rubocop:disable Metrics/MethodLength + BLOG_URL = ENV.fetch('OPENHUB_BLOG_URL').freeze + def features_hash { 'OpenHub' => [ - "you can subscribe to e-mail newsletters to receive update from the Open Hub blog", "data presented on the Open Hub is available through our API", @@ -18,7 +20,7 @@ def features_hash "compare projects before you chose one to use", "check out hot projects on the Open Hub", "anyone with an Open Hub account can update a project's tags", - "learn about Open Hub updates and features on the + "learn about Open Hub updates and features on the Open Hub blog" ], diff --git a/app/mailers/account_mailer.rb b/app/mailers/account_mailer.rb index fd80687cc..65f42472a 100644 --- a/app/mailers/account_mailer.rb +++ b/app/mailers/account_mailer.rb @@ -1,17 +1,17 @@ # frozen_string_literal: true class AccountMailer < ApplicationMailer - default from: 'mailer@openhub.net' + default from: ENV.fetch('MAILER_SENDER') def signup_notification(account) @account = account @url = activate_account_accesses_url(account_id: account.to_param, code: account.activation_code, - host: ENV.fetch('URL_HOST', nil), protocol: 'https') - mail to: account.email, subject: t('.subject'), bcc: 'info@openhub.net' + host: ENV.fetch('URL_HOST'), protocol: 'https') + mail to: account.email, subject: t('.subject'), bcc: ENV.fetch('SUPPORT_EMAIL') end def activation(account) - @url = root_url(host: ENV.fetch('URL_HOST', nil)) + @url = root_url(host: ENV.fetch('URL_HOST')) @account = account mail to: account.email, subject: t('.subject') end @@ -40,6 +40,6 @@ def reset_password(account_id) def review_account_data_for_spam(account) @account = account - mail to: 'info@openhub.net', subject: I18n.t('mailers.account_mailer.review_account_spam') + mail to: ENV.fetch('SUPPORT_EMAIL'), subject: I18n.t('mailers.account_mailer.review_account_spam') end end diff --git a/app/mailers/deleted_account_notifier_mailer.rb b/app/mailers/deleted_account_notifier_mailer.rb index 94f730f46..d0808c306 100644 --- a/app/mailers/deleted_account_notifier_mailer.rb +++ b/app/mailers/deleted_account_notifier_mailer.rb @@ -9,7 +9,7 @@ def deletion(account) mail( to: recipient, subject: I18n.t('mailers.deleted_account_notifier_mailer.account_deleted'), - from: 'mailer@openhub.net', + from: ENV.fetch('MAILER_SENDER'), template_path: 'mailers', template_name: 'account_deletion_notification' ) end diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index 6743e2282..4e1e80ae1 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class InviteMailer < ApplicationMailer - default from: 'mailer@openhub.net' + default from: ENV.fetch('MAILER_SENDER') default template_path: 'mailers' def send_invite(invite) diff --git a/app/mailers/manage_mailer.rb b/app/mailers/manage_mailer.rb index 6718c7a89..b66cfae0f 100644 --- a/app/mailers/manage_mailer.rb +++ b/app/mailers/manage_mailer.rb @@ -2,7 +2,7 @@ class ManageMailer < ApplicationMailer default to: proc { (@manager || @manage.account).email }, - from: 'mailer@openhub.net' + from: ENV.fetch('MAILER_SENDER') def rejection(manage) @manage = manage diff --git a/app/mailers/project_badge_mailer.rb b/app/mailers/project_badge_mailer.rb index c0420e059..bdd4ab40e 100644 --- a/app/mailers/project_badge_mailer.rb +++ b/app/mailers/project_badge_mailer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class ProjectBadgeMailer < ApplicationMailer - default from: 'mailer@openhub.net' + default from: ENV.fetch('MAILER_SENDER') def check_cii_projects(projects) @projects = projects diff --git a/app/mailers/project_mailer.rb b/app/mailers/project_mailer.rb index 89cf33694..9c118305d 100644 --- a/app/mailers/project_mailer.rb +++ b/app/mailers/project_mailer.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true class ProjectMailer < ApplicationMailer - default from: 'mailer@openhub.net' + default from: ENV.fetch('MAILER_SENDER') def report_outdated(account, project) @account = account @project = project - mail to: 'info@openhub.net', subject: "#{@project.name} is outdated" + mail to: ENV.fetch('SUPPORT_EMAIL'), subject: "#{@project.name} is outdated" end end diff --git a/app/models/anonymous_account.rb b/app/models/anonymous_account.rb index d1b67f4fa..6d2b905ad 100644 --- a/app/models/anonymous_account.rb +++ b/app/models/anonymous_account.rb @@ -6,7 +6,7 @@ module AnonymousAccount class << self def create! anonymous_account = Account.new(name: 'Anonymous Coward', login: LOGIN, - email: 'anon@openhub.net', password: 'mailpass') + email: ENV.fetch('ANONYMOUS_ACCOUNT_EMAIL'), password: 'mailpass') anonymous_account.save! anonymous_account.access.activate!(nil) diff --git a/app/models/concerns/account_scopes.rb b/app/models/concerns/account_scopes.rb index 64636e3f5..9e1f5786e 100644 --- a/app/models/concerns/account_scopes.rb +++ b/app/models/concerns/account_scopes.rb @@ -2,7 +2,8 @@ module AccountScopes ANONYMOUS_ACCOUNTS = %w[anonymous_coward ohloh_slave uber_data_crawler].freeze - ANONYMOUS_ACCOUNTS_EMAILS = %w[anon@openhub.net info@openhub.net uber_data_crawler@openhub.net].freeze + ANONYMOUS_ACCOUNTS_EMAILS = [ENV.fetch('ANONYMOUS_ACCOUNT_EMAIL'), ENV.fetch('SUPPORT_EMAIL'), + ENV.fetch('CRAWLER_ACCOUNT_EMAIL')].freeze extend ActiveSupport::Concern diff --git a/app/models/forge/match.rb b/app/models/forge/match.rb index c3ceb8869..0b8c2ebe5 100644 --- a/app/models/forge/match.rb +++ b/app/models/forge/match.rb @@ -49,7 +49,7 @@ def get_result(uri, request) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request['Content-Type'] = 'application/json' - request['User-Agent'] = 'openhub.net client' + request['User-Agent'] = ENV.fetch('FORGE_USER_AGENT') response = http.request(request) JSON.parse(response.body) end diff --git a/app/models/knowledge_base_status.rb b/app/models/knowledge_base_status.rb index e852153a3..387b981c3 100644 --- a/app/models/knowledge_base_status.rb +++ b/app/models/knowledge_base_status.rb @@ -23,7 +23,7 @@ def json_message message_hash = { ohloh_id: project_id, deleted: project.deleted?, - ohloh_url: "https://www.openhub.net/p/#{project_id}", + ohloh_url: "https://#{ENV.fetch('URL_HOST')}/p/#{project_id}", name: project.name, created_at: project.created_at.iso8601, updated_at: project.updated_at.iso8601, @@ -199,7 +199,7 @@ def get_organization org_hash = {} Organization::KB_SYNC_ATTRS.map { |attr| org_hash[attr] = project.organization.send(attr) } - org_hash['url'] = "https://www.openhub.net/orgs/#{project.organization.id}" + org_hash['url'] = "https://#{ENV.fetch('URL_HOST')}/orgs/#{project.organization.id}" org_hash end end diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index e97233382..5cf0a8de0 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -9,7 +9,7 @@ %meta{ content: h(@account.name).to_s, name: 'twitter:title' } %meta{ content: @twitter_detail.description.to_s, name: 'twitter:description' } %meta{ content: avatar_img_path(@account, 80).to_s, name: 'twitter:image' } - %meta{ content: 'https://www.openhub.net', name: 'twitter:domain' } + %meta{ content: "https://#{ENV.fetch('URL_HOST')}", name: 'twitter:domain' } = render partial: 'accounts/show/summary' .clearfix diff --git a/app/views/codeopenhub/index.html.haml b/app/views/codeopenhub/index.html.haml index c970a2477..5a08014d6 100644 --- a/app/views/codeopenhub/index.html.haml +++ b/app/views/codeopenhub/index.html.haml @@ -6,4 +6,4 @@ way we can continue to support the Open Source Software community. %p We apologize for any inconvenience that this has caused and thank you for your continued support. %div{ style: 'margin-bottom: 30px' } - %a{ href: 'https://www.openhub.net' } Return to the Open Hub + %a{ href: "https://#{ENV.fetch('URL_HOST')}" } Return to the Open Hub diff --git a/app/views/forums/_notice.html.haml b/app/views/forums/_notice.html.haml index eb28dfcfc..d31e6e2f5 100644 --- a/app/views/forums/_notice.html.haml +++ b/app/views/forums/_notice.html.haml @@ -1,5 +1,5 @@ - blog_link = 'https://community.blackduck.com/s/black-duck-open-hub' -- email = 'info@openhub.net' +- email = ENV.fetch('SUPPORT_EMAIL') .alert.alert-warning.margin_top_20 %p Dear Open Hub Users, @@ -13,5 +13,7 @@ %p %br - On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at + On May 1, 2020, we will be freezing + = "https://#{ENV.fetch('URL_HOST')}/forums" + and users will not be able to create new discussions. If you have any questions and concerns, please email us at %a{ href: "mailto:#{email}"} #{email} diff --git a/app/views/layouts/partials/_mast.html.haml b/app/views/layouts/partials/_mast.html.haml index f28f75c58..a93e08f4b 100644 --- a/app/views/layouts/partials/_mast.html.haml +++ b/app/views/layouts/partials/_mast.html.haml @@ -1,6 +1,6 @@ .navbar %span{ itemscope: '', itemtype: 'http://schema.org/CreativeWork' } - %span.hidden{ itemprop: 'author' } openhub.net + %span.hidden{ itemprop: 'author' }= ENV.fetch('URL_HOST') %span.hidden{ itemprop: 'publisher' } Black Duck Software, Inc. %span %div.logo-div diff --git a/app/views/licenses/_fields.haml b/app/views/licenses/_fields.haml index 554a8d181..40793fed4 100644 --- a/app/views/licenses/_fields.haml +++ b/app/views/licenses/_fields.haml @@ -9,7 +9,7 @@ %label.control-label.required= t('.url_name') .controls .input-prepend.pull-left - %span.add-on= 'http://www.openhub.net/licenses/' + %span.add-on= "https://#{ENV.fetch('URL_HOST')}/licenses/" - read_only = @license.persisted? ? true : false = f.text_field :vanity_url, readonly: read_only, :class => 'check-availability col-md-6', autocomplete: 'off', diff --git a/app/views/mailers/login_changed_notification.html.haml b/app/views/mailers/login_changed_notification.html.haml index 9f4e74d7d..ab329f629 100644 --- a/app/views/mailers/login_changed_notification.html.haml +++ b/app/views/mailers/login_changed_notification.html.haml @@ -8,7 +8,7 @@ The old name violated new system rules about allowed characters. Your new login name is "#{@account.login}" (without the quotation marks). You may edit your login name at Open Hub's - %a{ href: 'https://www.openhub.net/accounts/me/edit' } + %a{ href: "https://#{ENV.fetch('URL_HOST')}/accounts/me/edit" } Edit Account Page to any other legal value. diff --git a/app/views/organizations/_fields.html.haml b/app/views/organizations/_fields.html.haml index 16759848b..9a1ef4a40 100644 --- a/app/views/organizations/_fields.html.haml +++ b/app/views/organizations/_fields.html.haml @@ -11,7 +11,7 @@ %label.control-label.required= t('.url') .controls .input-prepend - %span.add-on= 'http://www.openhub.net/orgs/' + %span.add-on= "https://#{ENV.fetch('URL_HOST')}/orgs/" = f.text_field :vanity_url, class: 'check-availability', 'data-original-value' => Organization.find_by(id: @organization).try(:vanity_url), 'data-ajax-path' => organization_check_availabilities_path, diff --git a/app/views/organizations/claim_projects_list.html.haml b/app/views/organizations/claim_projects_list.html.haml index 2724f73cd..c186521f6 100644 --- a/app/views/organizations/claim_projects_list.html.haml +++ b/app/views/organizations/claim_projects_list.html.haml @@ -9,14 +9,16 @@ .clearfix = render partial: 'shared/search_dingus', locals: { collection: @projects, sort_context: :claim_projects_list } +- support_email = ENV.fetch('SUPPORT_EMAIL') + - if @projects.any? && @projects.detect { |p| !p.organization_id.blank? && p.organization_id != @organization.id } .alert.alert-block.margin_top_10 %h4.nomargin %i.icon-warning-sign = t('.already_claimed') = t('.report') - %a{ href: 'mailto:info@openhub.net' } - info@openhub.net + %a{ href: "mailto:#{support_email}" } + = support_email \. - unless @projects.empty? diff --git a/app/views/privacy/_privacy_text.html.haml b/app/views/privacy/_privacy_text.html.haml index fb55bb605..95cb11a34 100644 --- a/app/views/privacy/_privacy_text.html.haml +++ b/app/views/privacy/_privacy_text.html.haml @@ -10,4 +10,4 @@ .col-md-5 %ul.margin_left_40 %li= t('.opting_out') - %li= t('.openhub_oauth_html', href: link_to(t('.oauth_api'), 'http://blog.openhub.net/oauth/')) + %li= t('.openhub_oauth_html', href: link_to(t('.oauth_api'), ENV.fetch('OPENHUB_OAUTH_BLOG_URL'))) diff --git a/app/views/project_widgets/_ohloh_code_footer.html.haml b/app/views/project_widgets/_ohloh_code_footer.html.haml index a5d721bfb..5f3306aa7 100644 --- a/app/views/project_widgets/_ohloh_code_footer.html.haml +++ b/app/views/project_widgets/_ohloh_code_footer.html.haml @@ -1,5 +1,5 @@ %h2.footer.ohloh_widget_code_footer - = link_to 'http://code.openhub.net', target: '_blank', style: 'margin-right:11px' do + = link_to "https://#{ENV.fetch('URL_HOST')}", target: '_blank', style: 'margin-right:11px' do = t('.with') = image_tag widget_ohloh_logo_url, border: 0 = t('.code') diff --git a/app/views/projects/check_forge.html.haml b/app/views/projects/check_forge.html.haml index 09b945b9c..7a774e5a9 100644 --- a/app/views/projects/check_forge.html.haml +++ b/app/views/projects/check_forge.html.haml @@ -78,7 +78,7 @@ %label.control-label.required= t('.url') .controls .input-prepend - %span.add-on= 'http://www.openhub.net/p/' + %span.add-on= "https://#{ENV.fetch('URL_HOST')}/p/" = f.text_field :vanity_url, class: 'check-availability', autocomplete: 'off', style: 'width: 188px;', 'data-original-value' => Project.find_by(id: @project).try(:vanity_url), diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index cd8af0dac..aa40c9a64 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -26,7 +26,7 @@ %label.control-label.required= t('.oh_project_url') .controls .input-prepend - %span.add-on http://www.openhub.net/p/ + %span.add-on= "https://#{ENV.fetch('URL_HOST')}/p/" = f.text_field :vanity_url, class: 'check-availability', autocomplete: 'off', style: 'width:514px;', 'data-original-value' => Project.find_by(id: @project).try(:vanity_url), diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index f6a029249..1f4edde3d 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -10,7 +10,7 @@ %meta{ content: project_twitter_description(@project, @analysis), name: 'twitter:description' } - if @project.logo %meta{ content: @project.logo.attachment.url(:med), name: 'twitter:image' } - %meta{ content: 'https://www.openhub.net', name: 'twitter:domain' } + %meta{ content: "https://#{ENV.fetch('URL_HOST')}", name: 'twitter:domain' } %div.separator-div = project_analysis_timestamp(@project) diff --git a/app/views/topics/show.atom.builder b/app/views/topics/show.atom.builder index 075776c53..2ab25d316 100644 --- a/app/views/topics/show.atom.builder +++ b/app/views/topics/show.atom.builder @@ -5,7 +5,7 @@ atom_feed do |feed| xml.rss do xml.channel do feed.title "Recent Posts in '#{@topic.title}' | Open Hub" - feed.link "https://www.openhub.net#{topic_path(@topic)}" + feed.link "https://#{ENV.fetch('URL_HOST')}#{topic_path(@topic)}" feed.language 'en-us' feed.ttl 60 feed.description @topic.title diff --git a/app/views/widgets/metadata.xml.builder b/app/views/widgets/metadata.xml.builder index c6bd91136..1285f864d 100644 --- a/app/views/widgets/metadata.xml.builder +++ b/app/views/widgets/metadata.xml.builder @@ -4,7 +4,7 @@ prefs = {} prefs[:title] = @widget.title prefs[:title_url] = root_url prefs[:author] = 'Open Hub' -prefs[:author_email] = 'info@openhub.net' +prefs[:author_email] = ENV.fetch('SUPPORT_EMAIL') prefs[:author_link] = root_url prefs[:description] = @widget.description prefs[:width] = @widget.width + 10 diff --git a/config/application.rb b/config/application.rb index afaf2992e..8a93523c6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ class Application < Rails::Application config.generators.helper = false config.action_controller.include_all_helpers = false config.active_record.schema_format = :sql - config.action_mailer.default_url_options = { host: ENV.fetch('URL_HOST', nil) } + config.action_mailer.default_url_options = { host: ENV.fetch('URL_HOST') } config.active_job.queue_adapter = :sidekiq config.google_maps_api_key = ENV.fetch('GOOGLE_MAPS_API', nil) diff --git a/config/environments/production.rb b/config/environments/production.rb index 3c46d3d3f..e68fff4b2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -68,7 +68,7 @@ user_name: 'apikey', # This is the string literal 'apikey', NOT the ID of your API key password: ENV.fetch('SENDGRID_API_KEY', nil), # This is the secret sendgrid API key which was issued during API key creation - domain: 'openhub.net', + domain: ENV.fetch('EMAIL_DOMAIN'), address: 'smtp.sendgrid.net', port: 587, authentication: :plain, diff --git a/config/initializers/clearance.rb b/config/initializers/clearance.rb index 732b35493..58428d55b 100644 --- a/config/initializers/clearance.rb +++ b/config/initializers/clearance.rb @@ -2,7 +2,7 @@ Clearance.configure do |config| config.routes = false - config.mailer_sender = 'mailer@openhub.net' + config.mailer_sender = ENV.fetch('MAILER_SENDER') config.password_strategy = PasswordStrategy config.secure_cookie = Rails.env.staging? || Rails.env.production? config.redirect_url = '/accounts/me' diff --git a/config/locales/account_mailer.en.yml b/config/locales/account_mailer.en.yml index 29c966296..27475c6c6 100644 --- a/config/locales/account_mailer.en.yml +++ b/config/locales/account_mailer.en.yml @@ -5,14 +5,14 @@ en: body: "Your Open Hub account %{login} was created. Follow this link to activate your account:" notify_disabled_account_for_login_failure: subject: 'Open Hub account disabled notice' - body: '

We have encountered multiple failed login attempts for your Open Hub account, %{login}.

To keep your account secure, it has been disabled. Please contact the Open Hub team at info@openhub.net for assistance.

' + body: '

We have encountered multiple failed login attempts for your Open Hub account, %{login}.

To keep your account secure, it has been disabled. Please contact the Open Hub team at info@openhub.blackduck.com for assistance.

' activation: subject: "Your account has been activated!" dear: "Dear %{login};" body1: "

Thank you for activating your Open Hub account and becoming a member of the Black Duck Open Hub!

" body2: |

Please update your bio at %{edit_account_link} and start claming your open source activity at %{position_link}.

-

Please feel free to post any question on our Forums at %{forum_link} and contact us at info@openhub.net if you have any questions that haven't been answered on the Forums.

+

Please feel free to post any question on our Forums at %{forum_link} and contact us at info@openhub.blackduck.com if you have any questions that haven't been answered on the Forums.

Note that you can change your privacy options at %{privacy_link}.

sign: |

Sincerely Yours,

@@ -37,7 +37,7 @@ en: body_3: | P.S. You signed up for Open Hub kudo notifications. Visit %{email_settings_link} to change your email preferences or unsubscribe directly %{unsubscribe_emails_link}. - If you've received this email in error, please let us know by mailing us at info@openhub.net." + If you've received this email in error, please let us know by mailing us at info@openhub.blackduck.com." message: | "%{message}" - %{sender} diff --git a/config/locales/accounts.en.yml b/config/locales/accounts.en.yml index 7e2b5bcc2..b22fef4d9 100644 --- a/config/locales/accounts.en.yml +++ b/config/locales/accounts.en.yml @@ -53,7 +53,7 @@ en: about_raw_help: 'A short (less than 500 characters) description of you.' delete_account: 'Delete Account' account_basics: ' : Account Basics' - blocked_domain_error: 'contains a blocked spam pattern. Contact info@openhub.net if incorrect.' + blocked_domain_error: 'contains a blocked spam pattern. Contact info@openhub.blackduck.com if incorrect.' homepage_url: 'Homepage URL' help_1: Your login ID will be shown in many places on Open Hub, including in lists that highlight your contributions to projects, so please choose something you want to be seen. help_2: Your email address is used to show your Gravitar. In addition, your email address may be used by Open Hub to match against discovered, unclaimed committer IDs on projects as a convenient way to locate your FOSS contributions. You may change your email address; we will send an activiation letter to that address for confirmation. @@ -186,7 +186,7 @@ en: less: 'less...' disabled: disabled_account: "%{user}'s account is disabled." - disabled_message: 'This account has been disabled. If you are the account owner and wish to discuss this, send email to info@openhub.net.' + disabled_message: 'This account has been disabled. If you are the account owner and wish to discuss this, send email to info@openhub.blackduck.com.' settings: settings_title: '%{name} : Settings - Open Hub' settings: 'Settings' diff --git a/config/locales/activation_resends.en.yml b/config/locales/activation_resends.en.yml index e992f6250..38b590a9b 100644 --- a/config/locales/activation_resends.en.yml +++ b/config/locales/activation_resends.en.yml @@ -8,5 +8,5 @@ en: create: no_account: 'No account with that email address.' already_active: 'The account with this email is already active. You can log in anytime...' - recently_activated: "Activation mail has been resent to this email address recently. Please check email over the next 2 hours. If you haven't received it by then, you can try again. Alternatively, ask for help by emailing info@openhub.net" + recently_activated: "Activation mail has been resent to this email address recently. Please check email over the next 2 hours. If you haven't received it by then, you can try again. Alternatively, ask for help by emailing info@openhub.blackduck.com" success: 'Another copy of your activation mail was sent to your email address. Please also check if your spam filter put the mail in your junk folder.' diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml index f4409dff7..cff272a6c 100644 --- a/config/locales/doorkeeper.en.yml +++ b/config/locales/doorkeeper.en.yml @@ -11,7 +11,7 @@ en: redirect_uri: fragment_present: 'cannot contain a fragment.' invalid_uri: 'must be a valid URL.' - relative_uri: "a fully qualified URL is required for this field. For example 'https://www.openhub.net'" + relative_uri: "a fully qualified URL is required for this field. For example 'https://www.openhub.blackduck.com'" secured_uri: 'must be an HTTPS/SSL URL.' doorkeeper: diff --git a/config/locales/en.yml b/config/locales/en.yml index 403d2f936..61236d297 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -78,7 +78,7 @@ en: no_data: No Data sign_in_github: Sign in with Github github_sign_in_failed: Github sign in failed - api_exception: We apologize but we encountered an internal error. Please try again later or contact info@openhub.net if the problem persists. + api_exception: We apologize but we encountered an internal error. Please try again later or contact info@openhub.blackduck.com if the problem persists. kb_message: "Published message for project %{project_id}" layouts: diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml index 54368d3d7..30e9cb84e 100644 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -4,7 +4,7 @@ en: signature: "- The Open Hub Team" sign_off: greeting: Sincerely - unsubscribe_help_html: You're receiving this because your Privacy Settings are configured to get these notifications. You can %{link} your privacy settings to unsubscribe from getting these notifications or unsubscribe directly %{unsubscribe_emails_link}. If you've received this email in error, may we ask you please notify us by emailing us at info@openhub.net? Thanks! + unsubscribe_help_html: You're receiving this because your Privacy Settings are configured to get these notifications. You can %{link} your privacy settings to unsubscribe from getting these notifications or unsubscribe directly %{unsubscribe_emails_link}. If you've received this email in error, may we ask you please notify us by emailing us at info@openhub.blackduck.com? Thanks! post_notifier_mailer: post_begins: The post begins post_replied_notification: diff --git a/config/locales/organizations.en.yml b/config/locales/organizations.en.yml index 3391ffe7d..a4e6a6939 100644 --- a/config/locales/organizations.en.yml +++ b/config/locales/organizations.en.yml @@ -75,7 +75,7 @@ en: already_claimed: 'Some projects already claimed!' report: 'One or more projects below have already been claimed by Another organization. Please report any improper claims to' claim_link: 'Claim' - mailto: 'mailto:info@openhub.net?subject=Incorrect Claim by %{org} on %{p.name}' + mailto: 'mailto:info@openhub.blackduck.com?subject=Incorrect Claim by %{org} on %{p.name}' link_title: 'This project has already been claimed by %{org}.' report_text: 'Report' enter_project_name: 'Enter a project name or Code Location above to search for projects that you wish to claim.' diff --git a/config/locales/sessions.en.yml b/config/locales/sessions.en.yml index 3b50062bc..86c29e46d 100644 --- a/config/locales/sessions.en.yml +++ b/config/locales/sessions.en.yml @@ -21,7 +21,7 @@ en: create: success: "Logged in successfully" learn_about_privacy: "Almost done. Before using your account, please configure these email notification settings." - locked_message: 'This account is now locked. Please contact the Open Hub team at info@openhub.net for assistance in unlocking the account.' + locked_message: 'This account is now locked. Please contact the Open Hub team at info@openhub.blackduck.com for assistance in unlocking the account.' recaptcha_failure: 'Please verify the captcha to proceed.' destroy: success: "You have been logged out." diff --git a/config/nginx.conf b/config/nginx.conf index 38beefe10..0ddee76fa 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name www.openhub.net; + server_name _; root /home/app/webapp/public; passenger_enabled on; diff --git a/config/nginx/nginx.yml b/config/nginx/nginx.yml index 7e37b98f9..9e74cd337 100644 --- a/config/nginx/nginx.yml +++ b/config/nginx/nginx.yml @@ -27,9 +27,9 @@ upstream: sites: openhub: - server_name: <%= { production: "www.openhub.net", staging: "staging.openhub.net", development: "0.0.0.0" }[ENV['RAILS_ENV']] %> + server_name: <%= { production: ENV.fetch('NGINX_SERVER_NAME'), staging: ENV.fetch('NGINX_STAGING_SERVER_NAME'), development: "0.0.0.0" }[ENV['RAILS_ENV']] %> - # openhub.net => www.openhub.net + # apex host => canonical www host always_www: <%= production? || staging? %> # Which root to use. You can add a custom one here, too. diff --git a/lib/reverification/mailer.rb b/lib/reverification/mailer.rb index ff6e0850e..94a672fe8 100644 --- a/lib/reverification/mailer.rb +++ b/lib/reverification/mailer.rb @@ -3,7 +3,7 @@ module Reverification class Mailer extend Amazon - FROM = 'info@openhub.net' + FROM = ENV.fetch('SUPPORT_EMAIL') class << self def first_notice_template(account) diff --git a/lib/reverification/template.rb b/lib/reverification/template.rb index 6f75e4746..78fde80f0 100644 --- a/lib/reverification/template.rb +++ b/lib/reverification/template.rb @@ -20,17 +20,17 @@ def final_warning_notice(email) This is the fourth and final notice from the Black Duck OpenHub about reverifying your account. Without an immediate response, your account will be permanently deleted within the next two weeks. To prevent your account from being permanently deleted, please contact us at - info@openhub.net.

+ #{ENV.fetch('SUPPORT_EMAIL')}.

We understand that this can seem severe and ask for your understanding as we continue to provide the OpenHub as a free and open service to the Open Source Software community. If you would like more background on this issue, we invite you to read our blog postings, - Oh dear, we’ve built a spammers heaven and - New + Oh dear, we’ve built a spammers heaven and + New Accounts are Back. But so are the spammers.

We thank you for your understanding and for being a member of the OpenHub and the Open Source Software community.

Sincerely,

The Black Duck OpenHub Team

Black Duck Software
781.891.5100
8 New England Executive Park
Burlington, MA 01803
- www.openhub.net

" + www.openhub.blackduck.com

" } } } @@ -53,19 +53,19 @@ def account_is_disabled_notice(email) At this point, it is not possible to access the account on the OpenHub. At some point in the next few months, this account will be deleted permanently. If you feel that this has been done in error, please contact us immediately at - info@openhub.net so that + #{ENV.fetch('SUPPORT_EMAIL')} so that we may restore the account and give you the opportunity to verify the account. We understand that this can seem severe and ask for your understanding as we continue to provide the OpenHub as a free and open service to the Open Source Software community. If you would like more background on this issue, we invite you to read our blog postings, - Oh dear, we’ve built a spammers heaven and - New + Oh dear, we’ve built a spammers heaven and + New Accounts are Back. But so are the spammers.

We thank you for your understanding and for being a member of the OpenHub and the Open Source Software community.

Sincerely,

The Black Duck OpenHub Team

Black Duck Software
781.891.5100
8 New England Executive Park
Burlington, MA 01803
- www.openhub.net

" + www.openhub.blackduck.com

" } } } @@ -94,14 +94,14 @@ def marked_for_disable_notice(email) deleted within a few months. We understand that this can seem severe and ask for your understanding as we continue to provide the OpenHub as a free and open service to the Open Source Software community. If you would like more background on this issue, - we invite you to read our blog postings, + we invite you to read our blog postings, Oh dear, we’ve built a spammers heaven and - New + New Accounts are Back. But so are the spammers.

We thank you for your understanding and for being a member of the OpenHub and the Open Source Software community.

Sincerely,

The Black Duck OpenHub Team

Black Duck Software
781.891.5100
8 New England Executive Park
Burlington, MA 01803
- www.openhub.net

" + www.openhub.blackduck.com

" } } } @@ -130,14 +130,14 @@ def first_reverification_notice(email) and permanently deleted within a few months. We understand that this can seem severe and ask for your understanding as we continue to provide the OpenHub as a free and open service to the Open Source Software community. If you would like more background on this issue, we invite you - to read our blog postings, Oh dear, + to read our blog postings, Oh dear, we’ve built a spammers heaven and - New + New Accounts are Back. But so are the spammers.

We thank you for your understanding and for being a member of the OpenHub and the Open Source Software community.

Sincerely,

The Black Duck OpenHub Team

Black Duck Software
781.891.5100
8 New England Executive Park
Burlington, MA 01803
- www.openhub.net

" + www.openhub.blackduck.com

" } } } diff --git a/spec/javascripts/enlistments_spec.coffee b/spec/javascripts/enlistments_spec.coffee index 94a708591..8caa5c551 100644 --- a/spec/javascripts/enlistments_spec.coffee +++ b/spec/javascripts/enlistments_spec.coffee @@ -30,7 +30,7 @@ describe 'Enlistments', -> submitBtn = $('.enlistment .submit') submitBtn.click() expect($(enlistmentForm).attr('action')) - .toEqual('https://www.openhub.net/p/owasp-owtf/enlistments') + .toEqual('https://www.openhub.blackduck.com/p/owasp-owtf/enlistments') expect('submit').toHaveBeenTriggeredOn(enlistmentForm) expect(spyEvent).toHaveBeenTriggered() diff --git a/spec/javascripts/fixtures/enlistments.html.haml b/spec/javascripts/fixtures/enlistments.html.haml index 314edfe74..3380572be 100644 --- a/spec/javascripts/fixtures/enlistments.html.haml +++ b/spec/javascripts/fixtures/enlistments.html.haml @@ -32,6 +32,6 @@ %p Github User Description %input{ type: 'text', name: 'url' } - %form.new_repository#new_repository{ action: 'https://www.openhub.net/p/owasp-owtf/enlistments' } + %form.new_repository#new_repository{ action: 'https://www.openhub.blackduck.com/p/owasp-owtf/enlistments' } %p.spinner{ style: 'display: none;' } Spinner Image %button.submit{ type: 'submit' } Submit diff --git a/test/helpers/avatar_helper_test.rb b/test/helpers/avatar_helper_test.rb index 5323fec9c..061ff94e6 100644 --- a/test/helpers/avatar_helper_test.rb +++ b/test/helpers/avatar_helper_test.rb @@ -63,7 +63,8 @@ class AvatarHelperTest < ActionView::TestCase end it 'should contain openhub host name' do - _(gravatar_url('123', 12)).must_equal 'https://gravatar.com/avatar/123?&s=12&rating=PG&d=https%3a%2f%2fopenhub.net%2fanon32.gif' + expected_url = "https://gravatar.com/avatar/123?&s=12&rating=PG&d=https%3a%2f%2f#{ENV.fetch('URL_HOST')}%2fanon32.gif" + _(gravatar_url('123', 12)).must_equal expected_url end end end diff --git a/test/lib/reverification/mailer_test.rb b/test/lib/reverification/mailer_test.rb index 32e4d6568..8beceaba0 100644 --- a/test/lib/reverification/mailer_test.rb +++ b/test/lib/reverification/mailer_test.rb @@ -11,7 +11,7 @@ class Reverification::MailerTest < ActiveSupport::TestCase assert_equal 140, ReverificationTracker::NOTIFICATION2_DUE_DAYS assert_equal 28, ReverificationTracker::NOTIFICATION3_DUE_DAYS assert_equal 14, ReverificationTracker::NOTIFICATION4_DUE_DAYS - assert_equal 'info@openhub.net', Reverification::Mailer::FROM + assert_equal ENV.fetch('SUPPORT_EMAIL'), Reverification::Mailer::FROM end end diff --git a/test/mailers/account_mailer_test.rb b/test/mailers/account_mailer_test.rb index de0f11a8d..e50e4148f 100644 --- a/test/mailers/account_mailer_test.rb +++ b/test/mailers/account_mailer_test.rb @@ -12,7 +12,7 @@ email = AccountMailer.signup_notification(user).deliver_now _(ActionMailer::Base.deliveries.count).must_equal before + 1 _(email.to).must_equal [user.email] - _(email[:from].value).must_equal 'mailer@openhub.net' + _(email[:from].value).must_equal ENV.fetch('MAILER_SENDER') _(email.subject).must_equal I18n.t('account_mailer.signup_notification.subject') _(email.body.encoded).must_match I18n.t('.account_mailer.signup_notification.body', login: user.login) end @@ -25,7 +25,7 @@ end it 'should have the from address' do - _(mail.from).must_equal ['mailer@openhub.net'] + _(mail.from).must_equal [ENV.fetch('MAILER_SENDER')] end it 'should have the receiver address' do @@ -55,7 +55,7 @@ let(:mail) { AccountMailer.reset_password(account.id) } it 'should have the from address' do - _(mail.from).must_equal ['mailer@openhub.net'] + _(mail.from).must_equal [ENV.fetch('MAILER_SENDER')] end it 'should have the receiver address' do diff --git a/test/mailers/project_badge_mailer_test.rb b/test/mailers/project_badge_mailer_test.rb index 73c2b3586..80059a3f7 100644 --- a/test/mailers/project_badge_mailer_test.rb +++ b/test/mailers/project_badge_mailer_test.rb @@ -16,7 +16,7 @@ it 'should send email the cii projects detail' do email = ProjectBadgeMailer.check_cii_projects(@cii_projects) _(email.to).must_equal [ENV.fetch('CII_PROJECTS_EMAIL_RECEIPIENT', nil)] - _(email[:from].value).must_equal 'mailer@openhub.net' + _(email[:from].value).must_equal ENV.fetch('MAILER_SENDER') _(email.subject).must_equal "CII Best Practices Badge - Found #{@cii_projects.size} new projects" assert_difference('ActionMailer::Base.deliveries.count', 1) { email.deliver_now } end