laserlemon / figaro

Simple Rails app configuration
MIT License
3.77k stars 288 forks source link

How to disable 'WARNING: Use strings for Figaro configuration'? #248

Closed zulhfreelancer closed 8 years ago

zulhfreelancer commented 8 years ago

Everytime I run my rails console on enter heroku rails console, I got this:

WARNING: Use strings for Figaro configuration. false was converted to "false".
WARNING: Use strings for Figaro configuration. 120 was converted to "120".

I'm aware of that. How do I turn this warnings off?

Thanks.

laserlemon commented 8 years ago

Currently, the only way to turn off those warnings are to follow their instruction and change your application.yml file to use quoted string values.

UbuntuEvangelist commented 5 years ago

@laserlemon please give me an example where to change application.yml file to use quoted string values.

defaults: &defaults TIMEZONE: 'Paris'

Configure Redis URL, for a TCP connection:

redis://:[password]@[hostname]:[port]/[db]

(password, port and database are optional).

REDIS_URL: redis://localhost:6379

Comma-separated list of administrators.

ADMIN: 'admin@peatio.tech'

Application URL configuration variables.

URL_HOST: peatio.tech URL_SCHEME: http FORCE_SECURE_CONNECTION: 'false' # Set to "true" to disable access via unsecured HTTP, send HSTS headers and use secure cookies.

Session lifetime in seconds.

SESSION_LIFETIME: '3600'

Configuration variables for logger.

LOG_LEVEL: ~ # Default level for production is warn, otherwise – debug.

Enabled OAuth2 provider.

Don't forget to check out configuration at config/initializers/omniauth.rb.

OAUTH2_SIGN_IN_PROVIDER: ~

Configuration variables for sign in with Google.

See https://github.com/zquestz/omniauth-google-oauth2

GOOGLE_CLIENT_ID: GOOGLE_CLIENT_SECRET: GOOGLE_OAUTH2_REDIRECT_URL: ~ # Specify URL address to which user will be redirected after successful sign in.

Configuration variables for sign in with Auth0.

See https://github.com/auth0/omniauth-auth0

AUTH0_OAUTH2_DOMAIN: AUTH0_OAUTH2_CLIENT_ID: AUTH0_OAUTH2_CLIENT_SECRET: AUTH0_OAUTH2_REDIRECT_URL: ~ # Specify URL address to which user will be redirected after successful sign in.

Configuration variables for sign in with Barong OAuth2 server.

See https://github.com/rubykube/omniauth-barong

#

Barong uses Doorkeeper under the hood so you can refer to it's docs any time.

See more information at https://github.com/doorkeeper-gem/doorkeeper/wiki/Testing-your-provider-with-OAuth2-gem

BARONG_CLIENT_ID: ~ BARONG_CLIENT_SECRET: ~ BARONG_DOMAIN: ~ BARONG_OAUTH2_REDIRECT_URL: ~ # Specify URL address to which user will be redirected after successful sign in.

Configuration variables for API CORS.

#

Set list of allowed origins using the variable below.

By default it allows access to API from all origins.

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin

API_CORS_ORIGINS: '*' API_CORS_ALLOW_CREDENTIALS: ~

Configuration variables for Sentry.

SENTRY_DSN_BACKEND: ~ # Specify Sentry DSN used for Rails application. SENTRY_DSN_FRONTEND: ~ # Specify Sentry DSN used for JavaScript application.

Customize page metadata like title, description & keywords for landing, cabinet & admin modules.

METADATA_TITLE: Peatio Exchange METADATA_DESCRIPTION: The Opensource Cryptocurrency Exchange METADATA_KEYWORDS: Peatio,Opensource,Exchange,Cryptocurrency

Customize bank details which is shown at fiat deposit page. You are free to supply HTML here.

BANK_DETAILS_HTML: |

Use this bank to make a deposit:
<div>Bank: National Bank of World</div>
<div>Account: 1234567890</div>

Set to "true" to disable markets UI (admins still have access).

DISABLE_MARKETS_UI: ~

Set to "true" to disable cabinet UI (admins still have access).

DISABLE_CABINET_UI: ~

Configuration variables for JWT verification.

Get explanation at https://en.wikipedia.org/wiki/JSON_Web_Token.

#

JWT_PUBLIC_KEY

#

JWT provider uses private key for encoding JSON Web Tokens

while public key is used for decoding by resources.

#

For example, Barong is JWT provider, Peatio is resource accepting JWT.

Barong must have private key installed, Peatio must have public key installed.

#

You can generate keypair by running:

#

ruby -e "require 'openssl'; require 'base64'; OpenSSL::PKey::RSA.generate(2048).tap { |p| puts '', 'PRIVATE RSA KEY (URL-safe Base64 encoded, PEM):', '', Base64.urlsafe_encode64(p.to_pem), '', 'PUBLIC RSA KEY (URL-safe Base64 encoded, PEM):', '', Base64.urlsafe_encode64(p.public_key.to_pem) }"

#

Copy the generated private key and put it's value to appropriate variable at JWT provider (for example, at Barong it will be JWT_SHARED_SECRET_KEY).

Copy the generated public key and put it's value to variable JWT_PUBLIC_KEY (at Peatio).

#

Peatio and JWT provider should have the same keypair installed, or they would not understand each other.

#

You may want to adjust key length or cipher.

#

Development and test environments already don't include sample keys.

#

You can generate valid JWT by running:

#

JWT.encode(payload, OpenSSL::PKey.read(Base64.urlsafe_decode64(ENCODED_PRIVATE_KEY)), ENV.fetch('JWT_ALGORITHM'))

#

Replace ENCODED_PRIVATE_KEY with private key printed by previous command.

#

You can decode JWT by running:

#

JWT.decode(token, OpenSSL::PKey.read(Base64.urlsafe_decode64(ENCODED_PUBLIC_KEY)), true, algorithms: [ENV.fetch('JWT_ALGORITHM')])

#

To authenticate using JWT send it's value in "Authorization" header:

#

curl -H "Authorization: Bearer TOKEN" http://localhost:3000/api/v2/members/me

# JWT_PUBLIC_KEY: ~ JWT_ALGORITHM: RS256 # JWT signing algorithm (mandatory). JWT_ISSUER: ~ # JWT issuer name (optional). JWT_AUDIENCE: peatio # Could be comma-separated value (optional). JWT_DEFAULT_LEEWAY: ~ # Seconds (optional). JWT_ISSUED_AT_LEEWAY: '180' # Seconds (optional). JWT_EXPIRATION_LEEWAY: ~ # Seconds (optional). JWT_NOT_BEFORE_LEEWAY: ~ # Seconds (optional).

Capybara configuration variables.

TEST_SERVER_HOST: 127.0.0.1 TEST_SERVER_PORT: '3000' TEST_APP_HOST: peatio.tech TEST_APP_PORT: '80'

Scout APM configuration variables.

SCOUT_KEY: ~ # Your organization key for Scout APM. Found on the settings screen. SCOUT_APP_NAME: ~ # Application name in APM Web UI. SCOUT_LOG_LEVEL: warn # Verboseness of logs (debug, info, warn, error) SCOUT_ENV: production # List of Rails environments for which Scout should be enabled.

Specify the code of currency which is used to display the equivalent of the amounts of other currencies.

The specified currency should exist in database.

DISPLAY_CURRENCY: usd

Configuration variables for dynamic Barong levels (1.8+).

MINIMUM_MEMBER_LEVEL_FOR_DEPOSIT: '3' MINIMUM_MEMBER_LEVEL_FOR_WITHDRAW: '3' MINIMUM_MEMBER_LEVEL_FOR_TRADING: '3'

Event API configuration.

JWT configuration.

You can generate keypair using:

#

ruby -e "require 'openssl'; require 'base64'; OpenSSL::PKey::RSA.generate(2048).tap { |p| puts '', 'PRIVATE RSA KEY (URL-safe Base64 encoded, PEM):', '', Base64.urlsafe_encode64(p.to_pem), '', 'PUBLIC RSA KEY (URL-safe Base64 encoded, PEM):', '', Base64.urlsafe_encode64(p.public_key.to_pem) }"

# EVENT_API_JWT_PRIVATE_KEY: ~ # Private key. Must be URL-safe Base64 encoded in PEM format. EVENT_API_JWT_ALGORITHM: RS256

RabbitMQ configuration.

You can use just «EVENT_API_RABBITMQ_URL» or specify configuration per separate variable.

EVENT_API_RABBITMQ_URL: ~ EVENT_API_RABBITMQ_HOST: localhost EVENT_API_RABBITMQ_PORT: "5672" EVENT_API_RABBITMQ_USERNAME: guest EVENT_API_RABBITMQ_PASSWORD: guest

RANGER_HOST: '0.0.0.0' RANGER_PORT: '8081' RANGER_CONNECT_SECURE: false

BULLET: 'false'

development: <<: *defaults

Development OAuth2 provider.

OAUTH2_SIGN_IN_PROVIDER: google

Development configuration variables for sign in with Google.

GOOGLE_CLIENT_ID: 1044454023387-emhp5vmfnp5cf1n9juk09g8gcckrova7.apps.googleusercontent.com GOOGLE_CLIENT_SECRET: tAFZvO200-0z3MpCyOpkPH0G

Development configuration variables for sign in with Auth0.

AUTH0_OAUTH2_DOMAIN: peatio-playground.auth0.com AUTH0_OAUTH2_CLIENT_ID: lGKS9ADpknQr415RNZrrQTf3Jh8k2Fvc AUTH0_OAUTH2_CLIENT_SECRET: LxUPnrrrpRHSB-vVgWU3TwmakQ8acY5mYVTaVgkREQL3i9avjpOnWTXSSEsrbLzK

Development configuration variables for Event API JWT.

EVENT_API_JWT_PRIVATE_KEY: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBb3VLVHh2SFVJVDJENmdXaWJRcS9kbW9BUUw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tCg==

Event API JWT public key value is.

EVENT_API_JWT_PUBLIC_KEY: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFvdUtUeHZIVUlUMkQ2Z1dpYlFxLwpkbW9BUUwyeWJ6SGFiUXRlc1AyL2o1VjkvUExaaEc1a0tWSk9aNzFVV0xDcGNlNDF4dnNDSUp3RDkydUM1bktqCk5wblRDTWpwTUJNMGg0aFF4a2VOeHdNeU41N1gzVDNtYUJWZnNRM0JuUStKbzgvS3N1TGE4OW9jR0N4OC9iVTIKOGNld2FxRk8ydUVMWWJiaUZadGFCenFJd0ZCdVMzeEZCa3o0TXowaC9YQjFOOXlkODl3bk4ybWhZUGxTTGtMZQpUdFoyeWswK2krZHhZd2V4MEozOXJDS0hnRWRKSjU1Nkc2Z21laklnd21wc1V4cml2RUlFTmNHT084d2ZBUFRXCi92SFZmc2ROTExHejRtZE9CWmxsa2orcFFQODZOcVJSNEpKcUN0SDd0djJpdUFIYjg2cHlqdWVmRUZTeWMybFkKRXdJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==

test: <<: *defaults

production: <<: *defaultsroot@back:~/peatio-1-9-stable#

Screenshot from 2019-05-05 13-58-48

vfonic commented 1 year ago

@UbuntuEvangelist how about here:

RANGER_CONNECT_SECURE: false