Commit 85e3f0cc by liyijie

feat: 修改env和redis的相关配置

parent 4d35f130
......@@ -8,9 +8,9 @@ DATABASE_PASSWORD =
DATABASE_NAME = app_name_to_replace
DATABASE_PORT = 5432
S3_ACCESS_KEY_ID = n7Xqqp1Fweznus_J0o14DJjuDuuZ-UJYa5lVMnSl
S3_SECRET_ACCESS_KEY = M-M8qDXRjz4wPz0khw9-QSco6yLzaeqNaouaDFP1
S3_REGION = cn-south-1
S3_BUCKET = wechat-peacock
S3_ENDPOINT = https://ocs-cn-south1.heytapcs.com
S3_ACCESS_KEY_ID = KEY_ID
S3_SECRET_ACCESS_KEY = ACCESS_KEY
S3_REGION = cn-east-2
S3_BUCKET = soa-storage
S3_ENDPOINT = https://obs.cn-east-2.myhuaweicloud.com
S3_PUBLIC = true
......@@ -3,3 +3,5 @@ $redis = ENV['REDIS_PASSWORD'].present? ?
Redis.new(url: ENV['REDIS_URL'], password: ENV['REDIS_PASSWORD'] ) :
Redis.new(url: ENV['REDIS_URL'])
$token_redis = Redis::Namespace.new(:token, redis: $redis)
$verify_code_redis = Redis::Namespace.new(:verify_code, redis: $redis)
$limit_redis = Redis::Namespace.new(:limit, redis: $redis)
......@@ -11,17 +11,18 @@ gsub_file 'Gemfile', 'https://rubygems.org', 'https://gems.ruby-china.com'
# If you use gems that require environment variables to be set before they are loaded, then list dotenv-rails in the Gemfile before those other gems and require dotenv/rails-now.
gem 'dotenv-rails', require: 'dotenv/rails-now'
inject_into_file 'Gemfile', after: "source 'https://gems.ruby-china.com'" do <<-GEM_COMMENT
git_source(:tallty) { |repo| "git@git.tallty.com:#\{repo\}.git" }
GEM_COMMENT
end
gem 'pg'
inject_into_file 'Gemfile', before: "gem 'pg" do <<-COMMENT
# Use PostgresSql as the database for deploy
COMMENT
end
inject_into_file 'Gemfile', before: "gemspec" do <<-COMMENT
git_source(:tallty) { |repo| "git@git.tallty.com:#{repo}.git" }
COMMENT
end
gsub_file 'app/controllers/application_controller.rb', 'respond_to :html', 'respond_to :json'
# A Ruby static code analyzer, based on the community Ruby style guide. http://rubocop.readthedocs.io
......@@ -48,7 +49,7 @@ gem_group :development, :test do
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'factory_bot_rails'
gem 'rspec-rails-swagger', tallty: 'open-source/rails-rails-swagger'
gem 'rspec-rails-swagger', tallty: 'open-source/rspec-rails-swagger'
gem 'simplecov', require: false
gem 'annotate'
gem "pry-rails"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment