~cytrogen/masto-fe

be053560e98dc9b702ee347518994e0b07914fae — Eugen Rochko 6 years ago 5ccd011
Change default interface of web and streaming from 0.0.0.0 to 127.0.0.1 (#11302)

3 files changed, 4 insertions(+), 4 deletions(-)

M config/puma.rb
M docker-compose.yml
M streaming/index.js
M config/puma.rb => config/puma.rb +2 -2
@@ 2,9 2,9 @@ threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i
threads threads_count, threads_count

if ENV['SOCKET']
  bind 'unix://' + ENV['SOCKET']
  bind "unix://#{ENV['SOCKET']}"
else
  port ENV.fetch('PORT') { 3000 }
  bind "tcp://127.0.0.1:#{ENV.fetch('PORT', 3000)}"
end

environment ENV.fetch('RAILS_ENV') { 'development' }

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

M streaming/index.js => streaming/index.js +1 -1
@@ 678,7 678,7 @@ const attachServerWithConfig = (server, onSuccess) => {
      }
    });
  } 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) {
        onSuccess(`${server.address().address}:${server.address().port}`);
      }