-
Notifications
You must be signed in to change notification settings - Fork 344
/
application.example.yml
259 lines (237 loc) · 10.1 KB
/
application.example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# First, copy the contents of this file to a new file called "application.yml"
# in the same "config" directory.
# This file is used by the "figaro" gem to allow you to store and use
# environment variables in the app without having to set them via the
# command line each time you run the app in development. Another advantage
# is that you can make changes in a production environment (such as Heroku)
# by simply changing the value of the environment variable, as opposed to
# making code changes and having to push them to apply the new setting.
# Read more about figaro here: https://github.com/laserlemon/figaro
# Note that changes to this file require a server restart to take effect.
# Each entry sets a local environment variable and overrides ENV variables
# in the Unix shell. For example, setting `API_PATH: api` makes "api" available
# as ENV['API_PATH'] in the app. See app/config/routes.rb for a usage example.
# Below, you will find descriptions for each variable, followed by default
# settings for the development, production, and test environments.
####################################
#
# ENVIRONMENT VARIABLE DESCRIPTIONS
#
####################################
################
#
# API_SUBDOMAIN
#
################
# If you'd like to run the API on its own subdomain, set API_SUBDOMAIN to your
# desired subdomain name. We recommend "api". Then make sure to delete "api"
# from "API_PATH". That way, you'll have a URL like http://api.yourdomain.org
# instead of http://api.yourdomain.org/api.
#
# Note that an API subdomain won't work on Heroku unless you're using a custom
# domain name. Heroku doesn't support sub-subdomains when using their default
# setup, which gives you a URL such as http://ohana-api-demo.herokuapp.com.
# In development, you can test it by adding the subdomain to 'lvh.me:8080'.
# For example: http://api.lvh.me:8080.
##################################################
#
# API_PATH - REQUIRED IF API_SUBDOMAIN IS NOT SET
#
##################################################
# The API_PATH setting is related to the API_SUBDOMAIN setting. If you're not
# using a separate subdomain for the API, then define the path for the API,
# which is set to "api" by default. If you do decide to use an API_SUBDOMAIN,
# make sure to set API_PATH to blank.
##################
#
# ADMIN_SUBDOMAIN
#
##################
# If you'd like to run the admin interface on its own subdomain, set
# ADMIN_SUBDOMAIN to your desired subdomain name. We recommend "admin".
# Then make sure to delete "admin" from "ADMIN_PATH". That way, you'll have a
# URL like http://admin.example.org instead of http://admin.example.org/admin.
#
# Note that an ADMIN subdomain won't work on Heroku unless you're using a custom
# domain name. Heroku doesn't support sub-subdomains when using their default
# setup, which gives you a URL such as http://ohana-api-demo.herokuapp.com.
# In development, you can test it by adding the subdomain to 'lvh.me:8080'.
# For example: http://admin.lvh.me:8080.
######################################################
#
# ADMIN_PATH - REQUIRED IF ADMIN_SUBDOMAIN IS NOT SET
#
######################################################
# The ADMIN_PATH setting is related to the ADMIN_SUBDOMAIN setting. If you're
# not using a separate subdomain for the admin interface, then define its path,
# which is set to "admin" by default. If you do decide to use an ADMIN_SUBDOMAIN,
# make sure to set ADMIN_PATH to blank.
################
#
# DEV_SUBDOMAIN
#
################
# If you'd like to run the developer portal on its own subdomain,
# set DEV_SUBDOMAIN to your desired subdomain name, such as "developer".
#
# Note that the DEV_SUBDOMAIN won't work on Heroku unless you're using a custom
# domain name. Heroku doesn't support sub-subdomains when using their default
# setup, which gives you a URL such as http://ohana-api-demo.herokuapp.com.
# In development, you can test it by adding the subdomain to 'lvh.me:8080'.
# For example: http://developer.lvh.me:8080.
##############################
#
# DEFAULT_PER_PAGE - REQUIRED
#
##############################
# This setting controls how many results you want to the API to return
# per page by default. Note that clients can set this dynamically via
# the "per_page" parameter, but if "per_page" is not specified, then the
# setting below will dictate how many results are returned.
##########################
#
# MAX_PER_PAGE - REQUIRED
#
##########################
# This setting controls the maximum amount of results you want to the API to
# return per page. If a client sets the "per_page" parameter to a value higher
# than MAX_PER_PAGE, the API will limit results per page to MAX_PER_PAGE.
#############
#
# EXPIRES_IN
#
#############
# This setting defines how long, in minutes, API responses will be cached in
# Rack::Cache. During that time interval, any API requests for that same
# query (after the initial request) will be served by Rack::Cache instead
# of the app, thereby reducing the load on the API and serving responses
# quickly.
# Read more about HTTP Caching:
# http://railscasts.com/episodes/321-http-caching?view=asciicast
# https://devcenter.heroku.com/articles/http-caching-ruby-rails
######################################
#
# TLD_LENGTH - REQUIRED IN PRODUCTION
#
######################################
# When using the default Heroku domain setup (http://app-name.herokuapp.com),
# TLD_LENGTH should be set to "2". Once you're ready to deploy with a custom
# domain name (like "smc-connect.org"), you will need to set TLD_LENGTH to the
# number of dots in your top-level domain name, which will most likely be "1",
# but if you are using ".co.uk" for example, then you should set it to "2".
########################################
#
# ENABLE_HTTPS - REQUIRED IN PRODUCTION
#
########################################
# When using the default Heroku domain setup (http://app-name.herokuapp.com),
# you can take advantage of SSL for free. However, to use SSL with a custom
# domain name, you'll need to do some work first, as explained in the Wiki:
# https://github.com/codeforamerica/ohana-api/wiki/How-to-deploy-the-Ohana-API-to-your-Heroku-account#using-a-custom-domain-name-and-ssl-configuration
##########################################################################
#
# ADMIN_APP_TOKEN - REQUIRED TO ALLOW AN EXTERNAL APP TO WRITE TO THE API
#
##########################################################################
# This app comes with a built-in admin interface, but if you want to allow
# a trusted third-party application to write to the API, follow these steps:
# 1. Ask the developer to sign up for an account on your developer portal.
# By default, this will be the home page of your deployed website. For example:
# http://ohana-api-demo.herokuapp.com
# 2. Have them register an application on the portal and send you the API token
# that gets automatically generated.
# 3. Set ADMIN_APP_TOKEN to the API token that they sent you.
# 4. Tell the developer to send the same token in their app via the
# `X-Api-Token` HTTP header.
########################################
#
# DOMAIN_NAME - REQUIRED IN PRODUCTION
#
########################################
# This is the domain name of your website. For example, if you deployed the app
# to Heroku and did not set up a custom domain name, your DOMAIN_NAME will be
# app-name.herokuapp.com, where `app-name` is the name of your own Heroku app.
# If you have a custom domain name and you are using paths instead of subdomains
# (example.com/admin vs admin.example.com), and if your browser includes `www`
# in your website name when you visit it, make sure to include the `www` in
# DOMAIN_NAME, such as www.example.com. When setting up the DNS for your custom
# domain, make sure to redirect the naked subdomain to www, or vice versa.
# Otherwise, some parts of the app will not work properly.
# If you have a custom domain name and you are using subdomains, such as
# admin.example.com, make sure to set DOMAIN_NAME to the naked domain, such
# as example.com. Otherwise, if you set DOMAIN_NAME to www.example.com,
# you won't be able to visit admin.example.com.
########################################
#
# ASSET_HOST - REQUIRED IN PRODUCTION
#
########################################
# This is the host that serves your assets. If you deployed the app
# to Heroku and did not set up a separate server for assets (such as Cloudfront),
# your ASSET_HOST should be your Heroku domain, such as app-name.herokuapp.com.
# If you have a custom domain, set ASSET_HOST to the same value as DOMAIN_NAME.
# For more advanced users, if you will be using a CDN, you will need to replace
# AssetHosts#call with your own implementation.
# See: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html
# for examples.
###########################################################
#
# GOOGLE_GEOCODING_API_KEY - REQUIRED IN DEV AND PRODUCTION
#
###########################################################
# If you use the Google lookup service in the Geocoder config, you will need an
# API key. See https://cloud.google.com/maps-platform/user-guide/account-changes
# for details.
###########################
#
# SETTINGS FOR DEVELOPMENT
#
###########################
development:
API_SUBDOMAIN:
API_PATH: api
ADMIN_SUBDOMAIN:
ADMIN_PATH: admin
ASSET_HOST: lvh.me
DEV_SUBDOMAIN:
DEFAULT_PER_PAGE: '30'
DOMAIN_NAME: lvh.me
GOOGLE_GEOCODING_API_KEY:
MAX_PER_PAGE: '50'
###############################################################################
#
# SETTINGS FOR PRODUCTION.
#
# Run `figaro heroku:set -e production -a your_app_name` to set them on Heroku.
#
###############################################################################
production:
API_SUBDOMAIN:
API_PATH: api
ADMIN_SUBDOMAIN:
ADMIN_PATH: admin
ASSET_HOST:
DEV_SUBDOMAIN:
DEFAULT_PER_PAGE: '30'
DOMAIN_NAME:
GOOGLE_GEOCODING_API_KEY:
MAX_PER_PAGE: '50'
EXPIRES_IN: '1'
TLD_LENGTH: '2'
ENABLE_HTTPS: 'yes'
###########################################
#
# SETTINGS FOR TESTS. PLEASE DO NOT MODIFY.
#
###########################################
test:
API_SUBDOMAIN:
API_PATH: api
ADMIN_SUBDOMAIN:
ADMIN_PATH: admin
ASSET_HOST: example.com
DEV_SUBDOMAIN:
DEFAULT_PER_PAGE: '30'
DOMAIN_NAME: example.com
MAX_PER_PAGE: '50'
ADMIN_APP_TOKEN: testing123