diff --git a/app/controllers/home_pages_controller.rb b/app/controllers/home_pages_controller.rb index 78fa42e..f8a9598 100644 --- a/app/controllers/home_pages_controller.rb +++ b/app/controllers/home_pages_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true class HomePagesController < ApplicationController + skip_before_action :require_login + def index; end end diff --git a/app/controllers/microposts_controller.rb b/app/controllers/microposts_controller.rb index 8db1a19..10283da 100644 --- a/app/controllers/microposts_controller.rb +++ b/app/controllers/microposts_controller.rb @@ -1,10 +1,11 @@ # frozen_string_literal: true class MicropostsController < ApplicationController + skip_before_action :require_login, only: [:index, :show] before_action :set_micropost, only: [:show] def index - @microposts = helpers.current_user.microposts + @microposts = Micropost.all end def new diff --git a/app/views/home_pages/index.html.erb b/app/views/home_pages/index.html.erb index 12af00d..e650b47 100644 --- a/app/views/home_pages/index.html.erb +++ b/app/views/home_pages/index.html.erb @@ -1 +1,10 @@ -

Hello, <%= current_user.full_name %>

+

Hello.

+ +

Welcome to my site! I’m a software engineer specialising in Ruby and Rails, with a love for *nix systems, +NixOS and free software in general. I’m also a maker and dad, and here is where my thoughts get dumped.

+ +

Find me:

+
+
Mastodon
+
<%= link_to "@tsvallender@ruby.social", "https://ruby.social/@tsvallender" %>
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2459fcf..0c50034 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,14 +17,11 @@ <% end %> diff --git a/app/views/microposts/index.html.erb b/app/views/microposts/index.html.erb index 61078b3..566c0c3 100644 --- a/app/views/microposts/index.html.erb +++ b/app/views/microposts/index.html.erb @@ -1,6 +1,6 @@

<%= t(".microposts") %>

-<%= link_to t(".new"), new_micropost_path %> +<%= link_to t(".new"), new_micropost_path if logged_in? %> <% if @microposts.empty? %>

<%= t(".empty") %>

diff --git a/config/deploy.yml b/config/deploy.yml index a703155..093b644 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -4,6 +4,9 @@ image: tsvallender/soc traefik: host_port: 8000 + args: + entryPoints.web.address: ':80' + entryPoints.web.forwardedHeaders.trustedIPs: 0.0.0.0/0 servers: - tsvallender.co.uk