Browse Source

为ws单独指定域名(解决CDN不支持ws的问题),放宽api频率

pull/4/head
欧醚 4 years ago
parent
commit
0efe1c54e9
4 changed files with 1857 additions and 2082 deletions
  1. +1
    -1
      config/initializers/1_hosts.rb
  2. +2
    -2
      config/initializers/rack_attack.rb
  3. +3
    -3
      package.json
  4. +1851
    -2076
      yarn.lock

+ 1
- 1
config/initializers/1_hosts.rb View File

@ -21,7 +21,7 @@ Rails.application.configure do
config.x.streaming_api_base_url = ENV.fetch('STREAMING_API_BASE_URL') do
if Rails.env.production?
"ws#{https ? 's' : ''}://#{web_host}"
"ws#{https ? 's' : ''}://ws-#{web_host}"
else
"ws://#{ENV['REMOTE_DEV'] == 'true' ? host.split(':').first : 'localhost'}:4000"
end

+ 2
- 2
config/initializers/rack_attack.rb View File

@ -53,11 +53,11 @@ class Rack::Attack
req.remote_ip == '127.0.0.1' || req.remote_ip == '::1'
end
throttle('throttle_authenticated_api', limit: 300, period: 5.minutes) do |req|
throttle('throttle_authenticated_api', limit: 1000, period: 5.minutes) do |req|
req.authenticated_user_id if req.api_request?
end
throttle('throttle_unauthenticated_api', limit: 300, period: 5.minutes) do |req|
throttle('throttle_unauthenticated_api', limit: 1000, period: 5.minutes) do |req|
req.remote_ip if req.api_request? && req.unauthenticated?
end

+ 3
- 3
package.json View File

@ -128,6 +128,7 @@
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hotkeys": "^1.1.4",
"react-html-parser": "^2.0.2",
"react-immutable-proptypes": "^2.1.0",
"react-immutable-pure-component": "^1.1.1",
"react-intl": "^2.9.0",
@ -144,6 +145,7 @@
"react-swipeable-views": "^0.13.3",
"react-textarea-autosize": "^7.1.0",
"react-toggle": "^4.0.1",
"react-tree-graph": "^4.0.1",
"redis": "^2.7.1",
"redux": "^4.0.4",
"redux-immutable": "^4.0.0",
@ -167,9 +169,7 @@
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.7",
"webpack-merge": "^4.2.1",
"websocket.js": "^0.1.12",
"react-tree-graph":"^4.0.1",
"react-html-parser":"^2.0.2"
"websocket.js": "^0.1.12"
},
"devDependencies": {
"babel-eslint": "^10.0.3",

+ 1851
- 2076
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save