Browse Source

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

Eugen Rochko 4 months ago
parent
commit
291d868773
3 changed files with 4 additions and 4 deletions
  1. 2
    2
      config/puma.rb
  2. 1
    1
      docker-compose.yml
  3. 1
    1
      streaming/index.js

+ 2
- 2
config/puma.rb View File

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

+ 1
- 1
docker-compose.yml View File

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

+ 1
- 1
streaming/index.js View File

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

Loading…
Cancel
Save