From 8a6ab742e006c6dbcdb59c22df120f141eeae8e0 Mon Sep 17 00:00:00 2001 From: joshfng <121190566+joshfng@users.noreply.github.com> Date: Sun, 8 Sep 2024 09:06:48 -0400 Subject: [PATCH] Working on getting views and assets to properly reneder again (still broken) --- .env.development | 1 + .env.test | 1 + app/controllers/home_controller.rb | 2 -- app/views/home/index.html.erb | 2 +- app/views/layouts/_footer.html.erb | 2 +- app/views/layouts/application.html.erb | 17 +++-------------- app/views/layouts/home.html.erb | 26 -------------------------- config/initializers/lockbox.rb | 3 ++- config/webpacker.yml | 4 ++-- dev-docker-entrypoint.sh | 2 ++ docker-compose.yml | 20 ++++++++++++++++++++ 11 files changed, 33 insertions(+), 47 deletions(-) delete mode 100644 app/views/layouts/home.html.erb diff --git a/.env.development b/.env.development index fdc7592..a8f2b3a 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,4 @@ DATABASE_URL="postgres://postgres:postgres@db/detonate_development" +LOCKBOX_MASTER_KEY=0000000000000000000000000000000000000000000000000000000000000000 RAILS_ENV=development REDIS_URL="redis://redis:6379/0" diff --git a/.env.test b/.env.test index 3837262..02fd816 100644 --- a/.env.test +++ b/.env.test @@ -1,3 +1,4 @@ DATABASE_URL="postgres://postgres:postgres@db/detonate_test" +LOCKBOX_MASTER_KEY=0000000000000000000000000000000000000000000000000000000000000000 RAILS_ENV=test REDIS_URL="redis://redis:6379/2" diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 5faf53d..25098a0 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,7 +5,5 @@ class HomeController < ApplicationController def index return redirect_to(switches_path) if current_user - - render 'index', layout: 'home' end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index fc24106..1763fc7 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -6,7 +6,7 @@ +

--> diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index abc3338..1885a0e 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -1,5 +1,5 @@ diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 79a833a..025a783 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,18 +22,7 @@ <%= content_for?(:content) ? yield(:content) : yield %> - - - - - - \ No newline at end of file + <%= render 'layouts/footer' %> + + diff --git a/app/views/layouts/home.html.erb b/app/views/layouts/home.html.erb deleted file mode 100644 index b02fef7..0000000 --- a/app/views/layouts/home.html.erb +++ /dev/null @@ -1,26 +0,0 @@ - - - - - <%= content_for?(:title) ? yield(:title) : 'Detonate' %> - - - - - - Bad Request - - - - - - \ No newline at end of file diff --git a/config/initializers/lockbox.rb b/config/initializers/lockbox.rb index 75e82fb..983c1be 100644 --- a/config/initializers/lockbox.rb +++ b/config/initializers/lockbox.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true -Lockbox.master_key = Rails.application.credentials.lockbox[:master_key] +# Lockbox.master_key = Rails.application.credentials.lockbox[:master_key] +Lockbox.master_key = ENV['LOCKBOX_MASTER_KEY'] diff --git a/config/webpacker.yml b/config/webpacker.yml index deffc65..650b397 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -54,9 +54,9 @@ development: # Reference: https://webpack.js.org/configuration/dev-server/ dev_server: https: false - host: localhost + host: 0.0.0.0 port: 3035 - public: localhost:3035 + public: 0.0.0.0:3035 hmr: false # Inline should be set to true if using HMR inline: true diff --git a/dev-docker-entrypoint.sh b/dev-docker-entrypoint.sh index d17b894..fb8bdb4 100644 --- a/dev-docker-entrypoint.sh +++ b/dev-docker-entrypoint.sh @@ -7,6 +7,8 @@ echo "Environment: $RAILS_ENV" # Check if we need to install new gems bundle check || bundle install --jobs 20 --retry 5 +yarn install + # Remove pre-existing puma/passenger server.pid rm -f $APP_PATH/tmp/pids/server.pid || true diff --git a/docker-compose.yml b/docker-compose.yml index d560828..fcdc4f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,6 +55,26 @@ services: - redis restart: "always" + # webpack: + # container_name: webpack + # build: + # context: . + # dockerfile: Dockerfile.dev + # volumes: + # - .:/var/app + # - shared_data:/var/shared + # - gem_cache:/usr/local/bundle/gems + # networks: + # - development + # ports: + # - 3035:3035 + # stdin_open: true + # tty: true + # env_file: .env.development + # entrypoint: dev-entrypoint.sh + # command: ["./bin/webpack-dev-server"] + # restart: "always" + worker: container_name: worker build: