Skip to content

Commit

Permalink
Allow users to set port in env (maybe-finance#726)
Browse files Browse the repository at this point in the history
* Add custom port option to env.example

* Update readme.

* Port in bin/dev looks for env var before defaulting to 3000

* Change port for mailer in dev environment.

* Revisions in dev and readme files.
  • Loading branch information
claudey authored May 8, 2024
1 parent 6b0ef3a commit d240c59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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=
Expand Down Expand Up @@ -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`

Expand All @@ -63,15 +67,15 @@ 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

# ======================================================================================================
# 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
#
Expand All @@ -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=
# S3_BUCKET=
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

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
Expand Down

0 comments on commit d240c59

Please sign in to comment.