mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #18116 from overleaf/jpa-bulk-replace-localhost
[misc] bulk replace localhost with 127.0.0.1 GitOrigin-RevId: d238f3635302e8ff5500d611108c4d1bef216726
This commit is contained in:
@@ -4,7 +4,7 @@ const settings = {
|
||||
redis: {
|
||||
pubsub: {
|
||||
host:
|
||||
process.env.PUBSUB_REDIS_HOST || process.env.REDIS_HOST || 'localhost',
|
||||
process.env.PUBSUB_REDIS_HOST || process.env.REDIS_HOST || '127.0.0.1',
|
||||
port: process.env.PUBSUB_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
||||
password:
|
||||
process.env.PUBSUB_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
||||
@@ -19,7 +19,7 @@ const settings = {
|
||||
host:
|
||||
process.env.REAL_TIME_REDIS_HOST ||
|
||||
process.env.REDIS_HOST ||
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
port:
|
||||
process.env.REAL_TIME_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
||||
password:
|
||||
@@ -45,7 +45,7 @@ const settings = {
|
||||
host:
|
||||
process.env.DOC_UPDATER_REDIS_HOST ||
|
||||
process.env.REDIS_HOST ||
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
port:
|
||||
process.env.DOC_UPDATER_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
||||
password:
|
||||
@@ -68,7 +68,7 @@ const settings = {
|
||||
host:
|
||||
process.env.SESSIONS_REDIS_HOST ||
|
||||
process.env.REDIS_HOST ||
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
port: process.env.SESSIONS_REDIS_PORT || process.env.REDIS_PORT || '6379',
|
||||
password:
|
||||
process.env.SESSIONS_REDIS_PASSWORD || process.env.REDIS_PASSWORD || '',
|
||||
@@ -83,14 +83,14 @@ const settings = {
|
||||
internal: {
|
||||
realTime: {
|
||||
port: 3026,
|
||||
host: process.env.LISTEN_ADDRESS || 'localhost',
|
||||
host: process.env.LISTEN_ADDRESS || '127.0.0.1',
|
||||
},
|
||||
},
|
||||
|
||||
apis: {
|
||||
web: {
|
||||
url: `http://${
|
||||
process.env.WEB_API_HOST || process.env.WEB_HOST || 'localhost'
|
||||
process.env.WEB_API_HOST || process.env.WEB_HOST || '127.0.0.1'
|
||||
}:${process.env.WEB_API_PORT || process.env.WEB_PORT || 3000}`,
|
||||
user: process.env.WEB_API_USER || 'overleaf',
|
||||
pass: process.env.WEB_API_PASSWORD || 'password',
|
||||
@@ -99,7 +99,7 @@ const settings = {
|
||||
url: `http://${
|
||||
process.env.DOCUMENT_UPDATER_HOST ||
|
||||
process.env.DOCUPDATER_HOST ||
|
||||
'localhost'
|
||||
'127.0.0.1'
|
||||
}:3003`,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ const request = require('request')
|
||||
const drain = function (rate, callback) {
|
||||
request.post(
|
||||
{
|
||||
url: `http://localhost:3026/drain?rate=${rate}`,
|
||||
url: `http://127.0.0.1:3026/drain?rate=${rate}`,
|
||||
},
|
||||
(error, response, data) => callback(error, data)
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
const async = require('async')
|
||||
const { expect } = require('chai')
|
||||
const request = require('request').defaults({
|
||||
baseUrl: 'http://localhost:3026',
|
||||
baseUrl: 'http://127.0.0.1:3026',
|
||||
})
|
||||
|
||||
const RealTimeClient = require('./helpers/RealTimeClient')
|
||||
|
||||
@@ -74,7 +74,7 @@ module.exports = Client = {
|
||||
},
|
||||
|
||||
connect(projectId, callback) {
|
||||
const client = io.connect('http://localhost:3026', {
|
||||
const client = io.connect('http://127.0.0.1:3026', {
|
||||
'force new connection': true,
|
||||
query: new URLSearchParams({ projectId }).toString(),
|
||||
})
|
||||
@@ -105,7 +105,7 @@ module.exports = Client = {
|
||||
}
|
||||
return request.get(
|
||||
{
|
||||
url: 'http://localhost:3026/clients',
|
||||
url: 'http://127.0.0.1:3026/clients',
|
||||
json: true,
|
||||
},
|
||||
(error, response, data) => callback(error, data)
|
||||
@@ -118,7 +118,7 @@ module.exports = Client = {
|
||||
}
|
||||
return request.get(
|
||||
{
|
||||
url: `http://localhost:3026/clients/${clientId}`,
|
||||
url: `http://127.0.0.1:3026/clients/${clientId}`,
|
||||
json: true,
|
||||
},
|
||||
(error, response, data) => {
|
||||
@@ -134,7 +134,7 @@ module.exports = Client = {
|
||||
disconnectClient(clientId, callback) {
|
||||
request.post(
|
||||
{
|
||||
url: `http://localhost:3026/client/${clientId}/disconnect`,
|
||||
url: `http://127.0.0.1:3026/client/${clientId}/disconnect`,
|
||||
},
|
||||
(error, response, data) => callback(error, data)
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = {
|
||||
Settings.internal != null ? Settings.internal.realtime : undefined,
|
||||
x => x.port
|
||||
),
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
error => {
|
||||
if (error != null) {
|
||||
throw error
|
||||
|
||||
@@ -273,7 +273,7 @@ exports.XMLHttpRequest = function () {
|
||||
|
||||
case undefined:
|
||||
case '':
|
||||
host = 'localhost'
|
||||
host = '127.0.0.1'
|
||||
break
|
||||
|
||||
default:
|
||||
@@ -309,8 +309,8 @@ exports.XMLHttpRequest = function () {
|
||||
return
|
||||
}
|
||||
|
||||
// Default to port 80. If accessing localhost on another port be sure
|
||||
// to use http://localhost:port/path
|
||||
// Default to port 80. If accessing 127.0.0.1 on another port be sure
|
||||
// to use http://127.0.0.1:port/path
|
||||
const port = url.port || (ssl ? 443 : 80)
|
||||
// Add query string if one is used
|
||||
const uri = url.pathname + (url.search ? url.search : '')
|
||||
|
||||
Reference in New Issue
Block a user