From 37702c94dc098cce57c497e80106ba732e6e3277 Mon Sep 17 00:00:00 2001 From: Claude Ayitey Date: Wed, 8 May 2024 00:41:12 +0000 Subject: [PATCH 1/5] Add custom port option to env.example --- .env.example | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 36b277fc..5391e0a4 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,7 @@ +# Custom port config +# For users who have other applications listening at 3000, this allows them to set a value puma will listen to. +PORT= + # Exchange Rate API # This is used to convert between different currencies in the app. We use Synth, which is a Maybe product. You can sign up for a free account at synthfinance.com. SYNTH_API_KEY= @@ -54,7 +58,7 @@ SECRET_KEY_BASE=secret-value # UPGRADES_MODE: Controls how the app will upgrade. `manual` means the user must manually upgrade the app. `auto` means the app will upgrade automatically (great for self-hosting) # UPGRADES_TARGET: Controls what the app will upgrade to. `release` means the app will upgrade to the latest release. `commit` means the app will upgrade to the latest commit. # -UPGRADES_ENABLED=false # unless editing the flow, you should keep this `false` locally in development +UPGRADES_ENABLED=false # unless editing the flow, you should keep this `false` locally in development UPGRADES_MODE=manual # `manual` or `auto` UPGRADES_TARGET=release # `release` or `commit` @@ -63,7 +67,7 @@ UPGRADES_TARGET=release # `release` or `commit` # Git Repository Module - responsible for fetching latest commit data for upgrades # ====================================================================================================== # -GITHUB_REPO_OWNER=maybe-finance +GITHUB_REPO_OWNER=maybe-finance GITHUB_REPO_NAME=maybe GITHUB_REPO_BRANCH=main @@ -71,7 +75,7 @@ GITHUB_REPO_BRANCH=main # Active Storage Configuration - responsible for storing file uploads # ====================================================================================================== # -# * Defaults to disk storage but you can also use Amazon S3, Google Cloud Storage, or Microsoft Azure Storage. +# * Defaults to disk storage but you can also use Amazon S3, Google Cloud Storage, or Microsoft Azure Storage. # * Set the appropriate environment variables to use these services. # * Ensure libvips is installed on your system for image processing - https://github.com/libvips/libvips # @@ -81,4 +85,4 @@ GITHUB_REPO_BRANCH=main # S3_ACCESS_KEY_ID= # S3_SECRET_ACCESS_KEY= # S3_REGION= # defaults to `us-east-1` if not set -# S3_BUCKET= \ No newline at end of file +# S3_BUCKET= -- 2.53.0 From 3d8474619662b8ba22600b8dc5205cec95945113 Mon Sep 17 00:00:00 2001 From: Claude Ayitey Date: Wed, 8 May 2024 00:41:23 +0000 Subject: [PATCH 2/5] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06a8a994..b9aa524e 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ bin/dev rake demo_data:reset ``` -And visit http://localhost:3000 to see the app. You can use the following credentials to log in (generated by DB seed): +And visit http://localhost:3000 to see the app. You can also set a custom port with the `PORT` variable in .env file. You can use the following credentials to log in (generated by DB seed): - Email: `user@maybe.local` - Password: `password` -- 2.53.0 From 7c17631930f18cb5c07c1700a8759b828d3dfb7e Mon Sep 17 00:00:00 2001 From: Claude Ayitey Date: Wed, 8 May 2024 00:41:58 +0000 Subject: [PATCH 3/5] Port in bin/dev looks for env var before defaulting to 3000 --- bin/dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dev b/bin/dev index ad72c7d5..3bf6122f 100755 --- a/bin/dev +++ b/bin/dev @@ -6,7 +6,7 @@ if ! gem list foreman -i --silent; then fi # Default to port 3000 if not specified -export PORT="${PORT:-3000}" +export PORT="${PORT:-ENV.fetch("PORT") { 3000 }}" # Let the debug gem allow remote connections, # but avoid loading until `debugger` is called -- 2.53.0 From 78396ecb2ea93186a89b1d5deaa89c44b0fe0258 Mon Sep 17 00:00:00 2001 From: Claude Ayitey Date: Wed, 8 May 2024 00:42:46 +0000 Subject: [PATCH 4/5] Change port for mailer in dev environment. --- config/environments/development.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index a7efe3e8..907b2b93 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -56,7 +56,7 @@ Rails.application.configure do config.action_mailer.perform_deliveries = true - config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + config.action_mailer.default_url_options = { host: "localhost", port: ENV.fetch("PORT") { 3000 } } # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log -- 2.53.0 From f37124db123de546a913fcaf015231111d37b06c Mon Sep 17 00:00:00 2001 From: Claude Ayitey Date: Wed, 8 May 2024 19:34:06 +0000 Subject: [PATCH 5/5] Revisions in dev and readme files. --- README.md | 2 +- bin/dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9aa524e..06a8a994 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ bin/dev rake demo_data:reset ``` -And visit http://localhost:3000 to see the app. You can also set a custom port with the `PORT` variable in .env file. You can use the following credentials to log in (generated by DB seed): +And visit http://localhost:3000 to see the app. You can use the following credentials to log in (generated by DB seed): - Email: `user@maybe.local` - Password: `password` diff --git a/bin/dev b/bin/dev index 3bf6122f..ad72c7d5 100755 --- a/bin/dev +++ b/bin/dev @@ -6,7 +6,7 @@ if ! gem list foreman -i --silent; then fi # Default to port 3000 if not specified -export PORT="${PORT:-ENV.fetch("PORT") { 3000 }}" +export PORT="${PORT:-3000}" # Let the debug gem allow remote connections, # but avoid loading until `debugger` is called -- 2.53.0