Merge pull request #8517 from openfoodfoundation/chore-remove-deprecated-application.yml

Remove references to deprecated application.yml config file.
This commit is contained in:
Filipe
2021-12-02 10:54:08 +00:00
committed by GitHub
10 changed files with 10 additions and 92 deletions

View File

@@ -59,9 +59,6 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up application.yml
run: cp config/application.yml.example config/application.yml
- name: Set up database
run: |
bundle exec rake db:create
@@ -109,9 +106,6 @@ jobs:
- name: Install JS dependencies
run: yarn install --frozen-lockfile
- name: Set up application.yml
run: cp config/application.yml.example config/application.yml
- name: Set up database
run: |
bundle exec rake db:create

1
.gitignore vendored
View File

@@ -42,7 +42,6 @@ config/initializers/feature_toggle.rb
NERD_tree*
coverage
libpeerconnection.log
/config/application.yml
/config/newrelic.yml
node_modules
vendor/bundle/

View File

@@ -85,7 +85,7 @@ The tests of all custom engines can be run with:
Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop.
Note: The time zone on your machine should match the one defined in `config/application.yml`.
Note: The time zone on your machine should match the one defined in the `.env[.*]` file.
Once [npm dependencies are installed][karma], AngularJS tests can be run with:

View File

@@ -1,68 +0,0 @@
# Add application configuration variables here, as shown below.
#
# Change this, it has serious security implications.
# Minimum 30 but usually 128 characters. To obtain run 'rake secret', or faster, 'openssl rand -hex 128'
SECRET_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Time zone must match the operating system time zone in order to pass all tests.
# This string is the key for the MAPPING hash constant in ActiveSupport::TimeZone.
# Documentation including the hash: https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
TIMEZONE: Melbourne
# Default country for dropdowns etc. See for codes: http://en.wikipedia.org/wiki/ISO_3166-1
DEFAULT_COUNTRY_CODE: AU
# Locale for translation.
LOCALE: en
# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES: en,es
# Spree zone.
CHECKOUT_ZONE: Australia
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.
CURRENCY: AUD
# The whenever gem can set the `MAILTO` variable for our cron jobs.
# You can define an email address to notify if any job outputs something.
# But you need a working mail server setup so that the message is delivered.
# See: config/schedule.rb
#SCHEDULE_NOTIFICATIONS: admin@example.com
# Mail settings
MAIL_HOST: 'example.com'
MAIL_DOMAIN: 'example.com'
MAIL_PORT: '25'
SMTP_USERNAME: 'ofn'
SMTP_PASSWORD: 'f00d'
# Optional mail settings
# MAIL_SECURE_CONNECTION: 'TLS' # 'None' (default), 'SSL' or 'TLS'
# MAILS_FROM: hello@example.com
# MAIL_BCC: manager@example.com
# Javascript error reporting via Bugsnag.
#BUGSNAG_JS_KEY: ""
# SingleSignOn login for Discourse
#
# DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance.
#DISCOURSE_SSO_SECRET: ""
#
# DISCOURSE_URL must be the URL of your Discourse instance.
#DISCOURSE_URL: "https://noticeboard.openfoodnetwork.org.au"
# see: https://developers.google.com/maps/documentation/javascript/get-api-key
# GOOGLE_MAPS_API_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Stripe Connect details for instance account
# Find these under 'API keys' and 'Connect' in your Stripe account dashboard -> Account Settings
# Under 'Connect', the Redirect URI should be set to https://YOUR_SERVER_URL/stripe/callbacks (e.g. https://openfoodnetwork.org.uk/stripe/callbacks)
# Under 'Webhooks', you should set up a Connect endpoint pointing to https://YOUR_SERVER_URL/stripe/webhooks e.g. (https://openfoodnetwork.org.uk/stripe/webhooks)
# STRIPE_INSTANCE_SECRET_KEY: "sk_test_xxxxxx" # This can be a test key or a live key
# STRIPE_INSTANCE_PUBLISHABLE_KEY: "pk_test_xxxx" # This can be a test key or a live key
# STRIPE_CLIENT_ID: "ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET: "whsec_xxxx"
# Feature toggles
#
# Adding user emails separated by commas will enable them the use of certain features. See
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS: ofn@example.com,superadmin@example.com

View File

@@ -60,7 +60,7 @@ Openfoodnetwork::Application.configure do
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
#
# To override this, set the appropriate locale in application.yml
# To override this, set the appropriate locale in .env[.*] file.
config.time_zone = ENV.fetch("TIMEZONE", "UTC")
config.i18n.fallbacks = [:en]

View File

@@ -1,5 +1,5 @@
# Google requires an API key with a billing account to use their API.
# The key is stored in config/application.yml.
# The key is stored in .env[.*] files.
Geocoder.configure(
timeout: ENV.fetch('GEOCODER_TIMEOUT', 6).to_i,

View File

@@ -1,11 +1,12 @@
# Force manual loading of rails application to get all env variables from dotenv-rails when running whenever cmd
require File.expand_path('../environment', __FILE__)
require 'whenever'
require 'yaml'
# Learn more: http://github.com/javan/whenever
app_config = YAML.load_file(File.join(__dir__, 'application.yml'))
env "MAILTO", app_config["SCHEDULE_NOTIFICATIONS"] if app_config["SCHEDULE_NOTIFICATIONS"]
env "MAILTO", ENV["SCHEDULE_NOTIFICATIONS"] if ENV["SCHEDULE_NOTIFICATIONS"]
# If we use -e with a file containing specs, rspec interprets it and filters out our examples
job_type :run_file, "cd :path; :environment_variable=:environment bundle exec script/rails runner :task :output"
@@ -15,9 +16,9 @@ every 1.month, at: '4:30am' do
end
every 1.day, at: '2:45am' do
rake 'db2fog:clean' if app_config['S3_BACKUPS_BUCKET']
rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET']
end
every 4.hours do
rake 'db2fog:backup' if app_config['S3_BACKUPS_BUCKET']
rake 'db2fog:backup' if ENV['S3_BACKUPS_BUCKET']
end

View File

@@ -24,7 +24,6 @@ services:
- .:/usr/src/app
- gems:/bundles
- ./config/database.yml:/usr/src/app/config/database.yml
- ./config/application.yml.example:/usr/src/app/config/application.yml
depends_on:
- db
- redis
@@ -59,7 +58,6 @@ services:
- .:/usr/src/app
- gems:/bundles
- ./config/database.yml:/usr/src/app/config/database.yml
- ./config/application.yml.example:/usr/src/app/config/application.yml
depends_on:
- db
- redis

View File

@@ -3,7 +3,7 @@
module OpenFoodNetwork
# Provides access to the language settings.
# Currently, language settings are read from the environment.
# See: config/application.yml
# See: .env[.*] files.
class I18nConfig
# Users don't need to select the already selected locale.
def self.locale_options

View File

@@ -34,12 +34,6 @@ fi
bundle check || bundle install
yarn install
# Set up configurable environment variables
if [ ! -f config/application.yml ]; then
cp config/application.yml.example config/application.yml
printf "${YELLOW}Copied config/application.yml Make sure to fill it with the appropriate configuration values.\n\n${NO_COLOR}"
fi
# Set up the database for both development and test
# Confirming the default user and password
printf '\n\n' | bundle exec rake db:setup db:test:prepare