Skip to content

Commit

Permalink
💂‍♂️ secure connections so no cross site warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
beseven committed Apr 10, 2018
1 parent 95ae9d8 commit ebb2cc2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
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

0 comments on commit ebb2cc2

Please sign in to comment.