Merge masterIP and masterPort into masterURL

Merge the masterIP and masterPort configuration entries into a single
masterURL entry.  Fixes the problem with connecting to an HTTPS version
of the master server and also makes it easier to host the master server
behind a reverse proxy.

This breaks all known code interfacing Clusterio.
This commit is contained in:
Hornwitser committed 2019-09-09 12:44:09 +02:00
1 parent da99b39402
commit 98900e72dc
15 files changed
+68 -43

No files matched your search

+3 -3
View File
@@ -50,7 +50,7 @@ class ResearchSync {
}
initial_request_own_data(callback) {
const url = `${this.config.masterIP}:${this.config.masterPort}/api/getSlaveMeta`
const url = `${this.config.masterURL}/api/getSlaveMeta`
const data = {
instanceID: this.config.unique,
password: this.config.clientPassword,
@@ -102,7 +102,7 @@ class ResearchSync {
}
request_cluster_data() {
const slaves_data_url = `${this.config.masterIP}:${this.config.masterPort}/api/slaves`
const slaves_data_url = `${this.config.masterURL}/api/slaves`
needle.get(slaves_data_url, {compressed:true}, this.sync_researches.bind(this))
}
@@ -134,7 +134,7 @@ class ResearchSync {
this.print_own_contribution()
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/editSlaveMeta', {
needle.post(this.config.masterURL + '/api/editSlaveMeta', {
instanceID: this.config.unique,
password: this.config.clientPassword,
meta: {research: this.research}
+1 -2
View File
@@ -12,8 +12,7 @@ describe("researchSync/index.js", function() {
const config = {
instanceName: "test",
masterIP: "localhost",
masterPort: 8080,
masterURL: "http://localhost:8080",
unique: 99,
clientPassword: "password",
masterAuthToken: "masterToken",