Skip to content

Commit 04cd430

Browse files
author
Andrea Usuelli
committed
Change project's name to Git Notifier
1 parent c6d0fd4 commit 04cd430

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+205
-134
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ script:
2626

2727
addons:
2828
hosts:
29-
- githubnotifier.local
29+
- gitnotifier.local

README.md

+5-5

app.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'github_api'
66
require 'pp'
77

8-
class GitHubNotifier < Sinatra::Base
8+
class GitNotifier < Sinatra::Base
99

1010
@additional_js = nil
1111

@@ -69,13 +69,13 @@ class GitHubNotifier < Sinatra::Base
6969
email_addresses.map! { |e| e.is_a?(String) ? e : e.email}
7070
@additional_js = ['mailcheck.min.js']
7171
@custom_url = 'signup/homepage'
72-
NewRelic::Agent.set_transaction_name("GitHubNotifier/GET #{@custom_url}")
72+
NewRelic::Agent.set_transaction_name("GitNotifier/GET #{@custom_url}")
7373
haml :signup, :locals => {:email_addresses => email_addresses}
7474
else
7575
session[:email] = email
7676
@additional_js = ['spin.js', 'jquery.spin.js']
7777
@custom_url = 'timeline'
78-
NewRelic::Agent.set_transaction_name("GitHubNotifier/GET #{@custom_url}")
78+
NewRelic::Agent.set_transaction_name("GitNotifier/GET #{@custom_url}")
7979
@page_title = 'Profile'
8080
haml :events, :locals => {:github_id => session[:github_id]}
8181
end

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "github-notifier",
3-
"version": "0.1.0",
2+
"name": "git-notifier",
3+
"version": "0.2.0",
44
"authors": [
55
"Andrea Usuelli <[email protected]>"
66
],

config.ru

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ require_relative 'app.rb'
1313
require 'newrelic-redis'
1414
require 'newrelic_rpm' # it should be the last entry in the require list
1515

16-
run GitHubNotifier
16+
run GitNotifier

config.yml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ redis:
1111

1212
mail:
1313
method: smtp
14-
from: GitHub Notifier <[email protected]>
14+
from: Git Notifier <[email protected]>
1515
host: smtp.example.org
1616
port: 587
1717

config/deploy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
lock '3.3.5'
33

44
set :application, 'github-notifier'
5-
set :repo_url, '[email protected]:andreausu/github-notifier.git'
5+
set :repo_url, '[email protected]:andreausu/git-notifier.git'
66

77
set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || ask('the branch or revison to deploy', `git rev-parse --abbrev-ref HEAD`.chomp) unless ARGV[1] && ARGV[1].include?('rollback')
88
# We need /usr/sbin/service

config/deploy/production.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
set :sidekiq_concurrency, 25
1313
set :newrelic_rails_env, 'production'
1414

15-
role :web, %w{ghntfr@web01.githubnotifier.io:91}
16-
role :sidekiq, %w{ghntfr@web01.githubnotifier.io:91}
15+
role :web, %w{ghntfr@web01.gitnotifier.io:91}
16+
role :sidekiq, %w{ghntfr@web01.gitnotifier.io:91}

config/newrelic.example.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ common: &default_settings
4949
# See https://newrelic.com/docs/site/renaming-applications for more details
5050
# on renaming your New Relic applications.
5151
#
52-
app_name: GitHub Notifier
52+
app_name: Git Notifier
5353

5454
# When "true", the agent collects performance data about your
5555
# application and reports this data to the New Relic service at
@@ -192,7 +192,7 @@ development:
192192
<<: *default_settings
193193
# Turn on communication to New Relic service in development mode
194194
monitor_mode: true
195-
app_name: GitHub Notifier (Development)
195+
app_name: Git Notifier (Development)
196196

197197
# Rails Only - when running in Developer Mode, the New Relic Agent will
198198
# present performance information on the last 100 transactions you have
@@ -221,4 +221,4 @@ production:
221221
staging:
222222
<<: *default_settings
223223
monitor_mode: true
224-
app_name: GitHub Notifier (Staging)
224+
app_name: Git Notifier (Staging)
-13.9 KB
Binary file not shown.
-19.5 KB
Binary file not shown.
-2.67 KB
Binary file not shown.
-3.72 KB
Binary file not shown.
-6.06 KB
Binary file not shown.
-8.59 KB
Binary file not shown.
-10.6 KB
Binary file not shown.
-11.2 KB
Binary file not shown.
-13.9 KB
Binary file not shown.
-14.9 KB
Binary file not shown.
-18.1 KB
Binary file not shown.
-4.58 KB
Binary file not shown.
-4.88 KB
Binary file not shown.
-6.06 KB
Binary file not shown.
-6.48 KB
Binary file not shown.
Binary file not shown.
-18.1 KB
Binary file not shown.

public/img/favicon/browserconfig.xml

-12
This file was deleted.

public/img/favicon/favicon-16x16.png

-1.4 KB
Binary file not shown.

public/img/favicon/favicon-32x32.png

-2.34 KB
Binary file not shown.

public/img/favicon/favicon-96x96.png

-8.59 KB
Binary file not shown.

public/img/favicon/favicon.ico

-11.7 KB
Binary file not shown.

public/img/favicon/manifest.json

-41
This file was deleted.

public/img/favicon/mstile-144x144.png

-13.5 KB
Binary file not shown.

public/img/favicon/mstile-150x150.png

-12.5 KB
Binary file not shown.

public/img/favicon/mstile-310x150.png

-13.4 KB
Binary file not shown.

public/img/favicon/mstile-310x310.png

-30.4 KB
Binary file not shown.

public/img/favicon/mstile-70x70.png

-8.26 KB
Binary file not shown.

scripts/add_users.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
obj = {"github_id"=> "",
1212
"last_event_id"=>"2425257958",
1313
"followers"=>
14-
"[\"matteosister\",\"frapontillo\",\"robbixc\",\"alpacaaa\",\"davidefedrigo\",\"rvitaliy\",\"aleinside\",\"thomasvargiu\",\"runcom\",\"anatolinicolae\",\"giordan83\",\"maxcanna\",\"peelandsee\",\"nigrosimone\",\"squaini\",\"riccamastellone\",\"usutest\",\"githubnotifier\"]",
14+
"[\"matteosister\",\"frapontillo\",\"robbixc\",\"alpacaaa\",\"davidefedrigo\",\"rvitaliy\",\"aleinside\",\"thomasvargiu\",\"runcom\",\"anatolinicolae\",\"giordan83\",\"maxcanna\",\"peelandsee\",\"nigrosimone\",\"squaini\",\"riccamastellone\",\"usutest\",\"gitnotifier\"]",
1515
"registered_on"=>"1416911683",
1616
"last_email_sent_on"=>"1424189703",
1717
"login"=>"andreausu",

scripts/send_email.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#Sidekiq::Client.push(
2828
# 'queue' => 'send_email_signup',
2929
# 'class' => SendEmail,
30-
# 'args' => ['[email protected]', "Confirm your GitHub Notifer email!", 'html', 'confirm', {:confirm_link => 'https://staging.githubnotifier.io/signup/confirm?id=623986&email=andreausu%2Bstaging%40gmail.com&expiry=1454598210&v=953ff69c7ddeaf10aeda12a6eec032a92c21511fb5f87dff1130904cfe0b3143570bd5dfc64062c84fbf1c54995e894d1f51fb126cfd1e3dd916c04ef6b86e35'}]
30+
# 'args' => ['[email protected]', "Confirm your GitHub Notifer email!", 'html', 'confirm', {:confirm_link => 'https://staging.gitnotifier.io/signup/confirm?id=623986&email=andreausu%2Bstaging%40gmail.com&expiry=1454598210&v=953ff69c7ddeaf10aeda12a6eec032a92c21511fb5f87dff1130904cfe0b3143570bd5dfc64062c84fbf1c54995e894d1f51fb126cfd1e3dd916c04ef6b86e35'}]
3131
#)
3232

3333
Sidekiq::Client.push(
@@ -70,8 +70,8 @@
7070
:day => "Sunday, February 10"
7171
},
7272
],
73-
:site_url => "https://githubnotifier.io",
74-
:unsubscribe_url => "https://githubnotifier.io"
73+
:site_url => "https://gitnotifier.io",
74+
:unsubscribe_url => "https://gitnotifier.io"
7575
}
7676
]
7777
)

scripts/send_newsletter.rb

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'sidekiq'
4+
require 'redis'
5+
require 'pp'
6+
require_relative '../workers/send_email'
7+
require 'newrelic_rpm' # it should be the last entry in the require list
8+
9+
config_file = File.dirname(__FILE__) + '/../config.yml'
10+
fail "Configuration file " + config_file + " missing!" unless File.exist?(config_file)
11+
CONFIG = YAML.load_file(config_file)
12+
13+
redis_conn = proc {
14+
Redis.new(
15+
:driver => :hiredis,
16+
:host => CONFIG['redis']['host'],
17+
:port => CONFIG['redis']['port'],
18+
:db => CONFIG['redis']['db'],
19+
network_timeout: 5
20+
)
21+
}
22+
23+
Sidekiq.configure_client do |config|
24+
config.redis = ConnectionPool.new(size: 25, &redis_conn)
25+
end
26+
27+
users_keys = Sidekiq.redis do |conn|
28+
conn.keys("#{CONFIG['redis']['namespace']}:users:*")
29+
end
30+
31+
users_keys.each do |user_key|
32+
puts "#{Time.now.strftime("%Y-%m-%dT%l:%M:%S%z")} Enqueueing #{user_key}..."
33+
user = Sidekiq.redis { |conn| conn.hgetall(user_key) }
34+
email = user['email']
35+
next if user['email_confirmed'] == 0 || user['disabled_notifications_type'].include?('site-news') # The user doesn't want to receive newsletters
36+
37+
expiry = (Time.now + 31536000).to_i.to_s
38+
39+
digest = OpenSSL::Digest.new('sha512')
40+
hmac = OpenSSL::HMAC.hexdigest(digest, CONFIG['secret'], user['github_id'] + expiry)
41+
42+
unsubscribe_url = URI.escape("https://#{CONFIG['domain']}/unsubscribe?id=#{user['github_id']}&expiry=#{expiry}&v=#{hmac}")
43+
44+
Sidekiq::Client.push(
45+
'queue' => 'send_email',
46+
'class' => SendEmail,
47+
'args' => [
48+
email,
49+
"GitHub Notifier changes its name",
50+
'html',
51+
'newsletter',
52+
{
53+
:content => "Hi #{user['login']},<br /><br />sorry about the extra email, we just wanted to let you know that due to trademark concerns raised by the GitHub legal team we are changing the website name and all its associated entities from GitHub Notifier to Git Notifier.<br /><br />Thank you for using our service!",
54+
:site_url => "https://#{CONFIG['domain']}",
55+
:unsubscribe_url => unsubscribe_url
56+
}
57+
]
58+
)
59+
60+
end

test/casper/authenticated.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
casper.test.setUp(function () {
22
phantom.addCookie({
3-
domain: 'githubnotifier.local',
3+
domain: 'gitnotifier.local',
44
name: 'rack.session',
55
value: casper.cli.get("cookie")
66
});
77
});
88

99
casper.test.begin("Home page", 3, function suite(test) {
10-
casper.start("http://githubnotifier.local/", function() {
11-
test.assertTitle("GitHub Notifier - Profile", "Page title is correct");
10+
casper.start("http://gitnotifier.local/", function() {
11+
test.assertTitle("Git Notifier - Profile", "Page title is correct");
1212
test.assertExists('table#events', "Events table found found");
1313
test.assertEval(function() {
1414
return __utils__.findAll("table#events tr").length >= 5;

test/casper/signup.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ casper.test.on('fail', function () {
2121
});
2222

2323
casper.test.begin("Signup process", 24, function suite(test) {
24-
casper.start("http://githubnotifier.local/", function() {
25-
test.assertTitle("GitHub Notifier - Notifications for stars, forks, follow and unfollow", "Page title is correct");
24+
casper.start("http://gitnotifier.local/", function() {
25+
test.assertTitle("Git Notifier - Notifications for stars, forks, follow and unfollow", "Page title is correct");
2626
test.assertExists('a.btn-github', "Signup button found");
2727
this.click('a.btn-github');
2828
});
@@ -44,19 +44,19 @@ casper.test.begin("Signup process", 24, function suite(test) {
4444
});
4545

4646
casper.then(function() {
47-
test.assertUrlMatch(/githubnotifier/, "We are back on GitHub Notifier");
47+
test.assertUrlMatch(/gitnotifier/, "We are back on Git Notifier");
4848
this.waitForSelector('button#signup_button', function() {
4949
test.assertVisible('input[name="email"]', 'Main email is visible');
5050
test.assertVisible('input[name="other_email"]', 'Other email is visible');
5151
test.assertVisible('button#signup_button', 'Signup button is visible');
5252
this.click('input#other_email_radio');
5353
this.fillSelectors('form#signup', {
54-
'input[name="other_email"]' : 'githubnotifier@gnail.com',
54+
'input[name="other_email"]' : 'gitnotifier@gnail.com',
5555
}, false);
5656
this.waitUntilVisible('div#other_email_suggestion a.domain', function() {
5757
test.assertVisible('div#other_email_suggestion a.domain', 'Wrong domain suggestion is visible');
5858
this.click('div#other_email_suggestion a.domain');
59-
test.assertField({type: 'css', path: 'input#other_email'}, 'githubnotifier@gmail.com', 'Domain replaced!');
59+
test.assertField({type: 'css', path: 'input#other_email'}, 'gitnotifier@gmail.com', 'Domain replaced!');
6060
this.wait('500', function() {
6161
test.assertNotVisible('div#other_email_suggestion a.domain', 'Suggestion is not visible anymore');
6262
this.click('button#signup_button');
@@ -67,7 +67,7 @@ casper.test.begin("Signup process", 24, function suite(test) {
6767

6868
casper.then(function() {
6969
this.waitUntilVisible('button#button_save_preferences', function() {
70-
test.assertTextExists('We have sent an email to githubnotifier@gmail.com, please open it and click on the link inside to activate your account', 'Flash alert "confirm e-mail address" is present');
70+
test.assertTextExists('We have sent an email to gitnotifier@gmail.com, please open it and click on the link inside to activate your account', 'Flash alert "confirm e-mail address" is present');
7171
test.assertVisible('div.alert.alert-success', 'Flash alert "confirm e-mail address" is visible');
7272
test.assertTextExists('Choose the type of notifications you wish to receive', 'Text type of notifications is present');
7373
test.assertTextExists('Choose at which frequency we should send you the notifications', 'Text frequency of notifications is present');

test/casper/unauthenticated.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
casper.test.begin("Home page", 2, function suite(test) {
2-
casper.start("http://githubnotifier.local/", function() {
3-
test.assertTitle("GitHub Notifier - Notifications for stars, forks, follow and unfollow", "Page title is correct");
2+
casper.start("http://gitnotifier.local/", function() {
3+
test.assertTitle("Git Notifier - Notifications for stars, forks, follow and unfollow", "Page title is correct");
44
test.assertExists('a.btn-github', "Signup button found");
55
});
66

views/email/confirm.haml

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
%table{:cellpadding => "0", :cellspacing => "0", :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;", :width => "100%"}
6262
%tr{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"}
6363
%td.aligncenter.content-block{:align => "center", :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 25px; font-weight: bold; vertical-align: top; margin: 0; padding: 0 0 10px;", :valign => "top"}
64-
GitHub Notifier
64+
Git Notifier
6565
%tr{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"}
6666
%td.content-block{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;", :valign => "top"}
6767
Before you can start receiving GitHub notifications you need to confirm your email address.
@@ -73,12 +73,12 @@
7373
%a.btn-primary{:href => confirm_link, :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background: #efae3c; margin: 0; border-color: #efae3c; border-style: solid; border-width: 10px 20px;"} Confirm email address
7474
%tr{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"}
7575
%td.content-block{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;", :valign => "top"}
76-
\- The GitHub Notifier Team
76+
\- The Git Notifier Team
7777
.footer{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;"}
7878
%table{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;", :width => "100%"}
7979
%tr{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"}
8080
%td.aligncenter.content-block{:align => "center", :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; text-align: center; margin: 0; padding: 0 0 20px;", :valign => "top"}
8181
Follow
82-
%a{:href => "https://twitter.com/githubnotifier", :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;"} @GitHubNotifier
82+
%a{:href => "https://twitter.com/gitnotifier", :style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;"} @GitNotifier
8383
on Twitter.
8484
%td{:style => "font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;", :valign => "top"}

0 commit comments

Comments
 (0)