Change default interface of web and streaming from 0.0.0.0 to 127.0.0.1 (#11302)

master
Eugen Rochko 6 years ago committed by GitHub
parent 2f813b7ea1
commit e7353c47db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      config/puma.rb
  2. 2
      docker-compose.yml
  3. 2
      streaming/index.js

@ -2,9 +2,9 @@ threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i
threads threads_count, threads_count threads threads_count, threads_count
if ENV['SOCKET'] if ENV['SOCKET']
bind 'unix://' + ENV['SOCKET'] bind "unix://#{ENV['SOCKET']}"
else else
port ENV.fetch('PORT') { 3000 } bind "tcp://127.0.0.1:#{ENV.fetch('PORT', 3000)}"
end end
environment ENV.fetch('RAILS_ENV') { 'development' } environment ENV.fetch('RAILS_ENV') { 'development' }

@ -58,7 +58,7 @@ services:
image: tootsuite/mastodon image: tootsuite/mastodon
restart: always restart: always
env_file: .env.production env_file: .env.production
command: yarn start command: BIND=0.0.0.0 node ./streaming
networks: networks:
- external_network - external_network
- internal_network - internal_network

@ -672,7 +672,7 @@ const attachServerWithConfig = (server, onSuccess) => {
} }
}); });
} else { } else {
server.listen(+process.env.PORT || 4000, process.env.BIND || '0.0.0.0', () => { server.listen(+process.env.PORT || 4000, process.env.BIND || '127.0.0.1', () => {
if (onSuccess) { if (onSuccess) {
onSuccess(`${server.address().address}:${server.address().port}`); onSuccess(`${server.address().address}:${server.address().port}`);
} }

Loading…
Cancel
Save