Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure connections so no cross site warnings, vertical alignment and dockersing #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ruby:2.4.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /activities-app
WORKDIR /activities-app
COPY Gemfile /activities-app/Gemfile
COPY Gemfile.lock /activities-app/Gemfile.lock
RUN bundle install
COPY . /activities-app
2 changes: 1 addition & 1 deletion app/decorators/participant_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def name
object.name
end

DEFAULT_AVATAR = 'http://www.gravatar.com/avatar/00000000000000000000000000000000.png?s=%{size}'
DEFAULT_AVATAR = 'https://www.gravatar.com/avatar/00000000000000000000000000000000.png?s=%{size}'

def avatar_url(size)
return DEFAULT_AVATAR % { size: size } unless object.show_participation
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ApplicationHelper
def gravatar_avatar_url(user, size)
gravatar_id = Digest::MD5::hexdigest(user.email).downcase
"http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
"https://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
end

def twitter_avatar_url(handle)
Expand Down
4 changes: 2 additions & 2 deletions app/views/partials/_chrome_frame.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
You are using an
%strong outdated
browser. Please
%a(href="http://browsehappy.com/")
%a(href="https://browsehappy.com/")
upgrade your browser
or
%a(href="http://www.google.com/chromeframe/?redirect=true")
%a(href="https://www.google.com/chromeframe/?redirect=true")
activate Google Chrome Frame
to improve your experience.
4 changes: 2 additions & 2 deletions app/views/registrations/_oauth.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%ul
%li
- if resource.connected_with_github?
= link_to "http://github.com/#{resource.github_handle}", class: "github connected" do
= link_to "https://github.com/#{resource.github_handle}", class: "github connected" do
= image_tag "user/connected.png"
%h4
= t("user.#{domain}.oauth.github.connected").html_safe
Expand All @@ -16,7 +16,7 @@

%li
- if resource.connected_with_twitter?
= link_to "http://twitter.com/#{resource.twitter_handle}", class: "twitter connected" do
= link_to "https://twitter.com/#{resource.twitter_handle}", class: "twitter connected" do
= image_tag "user/connected.png"
%h4
= t("user.#{domain}.oauth.twitter.connected").html_safe
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/activities-app
ports:
- "3000:3000"
depends_on:
- db
3 changes: 3 additions & 0 deletions scripts/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
docker-compose down -v
docker-compose up --build --force-recreate web
2 changes: 1 addition & 1 deletion spec/decorators/participant_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

context 'when the user does not want to be shown in activities' do
it 'is the default Gravatar image' do
default = 'http://www.gravatar.com/avatar/00000000000000000000000000000000.png?s=48'
default = 'https://www.gravatar.com/avatar/00000000000000000000000000000000.png?s=48'
user.twitter_handle = 'foobar'
user.show_participation = false
expect(subject.avatar_url(48)).to eq(default)
Expand Down