Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails-api-with-engine-template
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
rails-api-with-engine-template
Commits
85e3f0cc
Commit
85e3f0cc
authored
Mar 04, 2022
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改env和redis的相关配置
parent
4d35f130
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
.env
src/.env
+5
-5
ohm.rb
src/config/ohm.rb
+2
-0
template.rb
template.rb
+7
-6
No files found.
src/.env
View file @
85e3f0cc
...
...
@@ -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://o
cs-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://o
bs.cn-east-2.myhuaweicloud
.com
S3_PUBLIC = true
src/config/ohm.rb
View file @
85e3f0cc
...
...
@@ -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
)
template.rb
View file @
85e3f0cc
...
...
@@ -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/r
ails
-rails-swagger'
gem
'rspec-rails-swagger'
,
tallty:
'open-source/r
spec
-rails-swagger'
gem
'simplecov'
,
require:
false
gem
'annotate'
gem
"pry-rails"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment