Skip to content

Commit

Permalink
Merge pull request #229 from goinvo/fermion/lightsail
Browse files Browse the repository at this point in the history
Changes made moving the host to Lightsail.
  • Loading branch information
fermion authored Jul 3, 2024
2 parents ba46afb + a715a3e commit d8ad571
Show file tree
Hide file tree
Showing 25 changed files with 1,139 additions and 2,096 deletions.
2 changes: 1 addition & 1 deletion .env.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ AWS_ACCESS_KEY_ID=<%= `op read "op://StaffplanRedux/AWS_ACCESS_KEY_ID/credential
AWS_SECRET_ACCESS_KEY=<%= `op read "op://StaffplanRedux/AWS_SECRET_ACCESS_KEY/credential"`.strip %>
<% else raise ArgumentError, "Session token missing" end %>

REDIS_URL=redis://159.203.142.226:6379/1
REDIS_URL=redis://172.26.4.66:6379/1
12 changes: 6 additions & 6 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
<div class="ml-10 flex items-baseline space-x-4">
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/people/<%= current_user.id %>" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">My StaffPlan</a>
<a href="https://ui.staffplan.com/people/<%= current_user.id %>" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">My StaffPlan</a>
<% else %>
<%= header_link_to "My StaffPlan", "http://localhost:8080/people/#{current_user.id}" %>
<% end %>
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/projects" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Projects</a>
<a href="https://ui.staffplan.com/projects" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Projects</a>
<% else %>
<%= header_link_to "Projects", "http://localhost:8080/projects" %>
<% end %>
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/people" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">People</a>
<a href="https://ui.staffplan.com/people" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">People</a>
<% else %>
<%= header_link_to "People", "http://localhost:8080/people" %>
<% end %>
Expand Down Expand Up @@ -110,17 +110,17 @@
<div class="border-b border-gray-700 md:hidden hidden" id="mobile-menu">
<div class="space-y-1 px-2 py-3 sm:px-3">
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/people/<%= current_user.id %>" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">My StaffPlan</a>
<a href="https://ui.staffplan.com/people/<%= current_user.id %>" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">My StaffPlan</a>
<% else %>
<%= mobile_header_link_to "My StaffPlan", "http://localhost:8080/people/#{current_user.id}" %>
<% end %>
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/projects" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">Projects</a>
<a href="https://ui.staffplan.com/projects" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">Projects</a>
<% else %>
<%= mobile_header_link_to "Projects", "http://localhost:8080/projects" %>
<% end %>
<% if Rails.env.production? %>
<a href="https://staffplan-ui.fermion.dev/people" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">People</a>
<a href="https://ui.staffplan.com/people" class="text-gray-300 hover:bg-gray-700 hover:text-white block rounded-md px-3 py-2 text-base font-medium">People</a>
<% else %>
<%= mobile_header_link_to "People", "http://localhost:8080/people" %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion config/credentials/production.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0Mw6tx/Szcjc6flHoA6m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2Zjde/Xp0k8PU6MKuTd44hhsxcjKcnxCNikRIdOzIuxMWpHEuQEX+rKDR1mtC2Fr9x5BhM5wUYMNLqGa9wxYsVHTLYVrfr9NyVbc6qODKfv/BOxKBHV5eNg5Z2Tr3j//V1j7XomNUGl7b+DBLIuGkIKcXJZhhDvJqeObDWrQFsyTPkQE5/lG+sxZeyr2vIZq7FOLGYohOWLGYjmBSxTXgKmUB2FXbWszDothlBLHNKVocenxfnMCnFlhtzNQzV5emHq4VwOQfmhG3Yo3nTCIvYqrNEMRKjvctuxWgBwgrx8KvyatAz1EUKoSWrsbq5cWZs4T8OGXqtP8BQ9zuh45jS+smj/rR/miumCrX240YJhaouj31tJmWSt4I0MvOTFlXo1pgPFJ/8rv7gdNOr7PMYzNOq5hJPvvkn4WctFNfDmcMEGbcnRBstLIF5x/9cSsN3li7mxUYWist0ZCALNT6im4UsI8ONYJDM4CptSYihL5CvnsiKPjZCFFtHcm+d3/LXoLpkGO5/XyFh9Ge8h+CmEkQlXmrBIkiTqt4gYGqvl3DP4kYZr6WabBfvmhgusYxjvMkIOTdQDMggTwhSv8yuUhmqdkJgVPrHatPMpxg7wtCZFjBsss/+bRAxo/hyD8PWn28lF2Ee8ixtDheLbSbHS4a8HknvkJnMX4JvlRXKU25WYn+VzKROYKC5HKVXdNO06rDx2vWGGQtMUfA1pkFK3aiYxyPa0RW86BqoKqWn2wxC9+lD7cc2tc3moVJgUrnHW3bDJTpNf3ip4PgJnyLhlnkTLsC6h9glMdo5pWLy4bfvN3BqnjKvp5Smw+Hssm9z+NvN9/HHxKPTjvxJDh4kyIjChVw3J+dlLBHKxeFVylvH87+g5FWMvJrQIRStXOOY=--gFLFbWAnFyZrMK5a--vcbWU38iCOm4yiNU8cWTbQ==
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ test:
#
production:
<<: *default
host: 159.203.142.226
host: 172.26.4.66
database: staffplan_redux_production
username: staffplan_redux
password: <%= ENV["POSTGRES_PASSWORD"] %>
53 changes: 0 additions & 53 deletions config/deploy.aws.yml

This file was deleted.

13 changes: 6 additions & 7 deletions config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ image: fermion/staffplan-redux
servers:
web:
hosts:
- 159.203.142.226
- 34.192.107.71
cmd: bundle exec puma -C config/puma.rb
options:
"add-host": host.docker.internal:host-gateway
job:
hosts:
- 159.203.142.226
- 34.192.107.71
cmd: bundle exec sidekiq -C config/sidekiq.yml
options:
"add-host": host.docker.internal:host-gateway
Expand All @@ -29,7 +29,7 @@ registry:
# Remember to run `kamal env push` after making changes!
env:
clear:
DB_HOST: 159.203.142.226
DB_HOST: 34.192.107.71
secret:
- RAILS_MASTER_KEY
- POSTGRES_PASSWORD
Expand All @@ -39,9 +39,8 @@ env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

# Use a different ssh user than root
# ssh:
# user: app
ssh:
user: ubuntu

# Configure builder setup.
# builder:
Expand All @@ -57,7 +56,7 @@ env:
accessories:
db:
image: postgres:15
host: 159.203.142.226
host: 34.192.107.71
port: 5432
env:
clear:
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
ActionMailer::Base.smtp_settings = {
:user_name => 'apikey',
:password => Rails.application.credentials.sendgrid_api_key,
:domain => 'prettygood.software',
:domain => 'em7128.staffplan.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
Expand All @@ -105,6 +105,6 @@
# Skip DNS rebinding protection for the default health check endpoint.
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }

Rails.application.routes.default_url_options[:host] = 'staffplan.fermion.dev'
Rails.application.routes.default_url_options[:host] = 'staffplan.com'
Rails.application.routes.default_url_options[:protocol] = 'https'
end
2 changes: 1 addition & 1 deletion config/initializers/cors.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins "http://localhost:8080"
"https://staffplan-ui.fermion.dev"
"https://ui.staffplan.com"

resource "*",
headers: :any,
Expand Down
Loading

0 comments on commit d8ad571

Please sign in to comment.