更新部分镜像版本
This commit is contained in:
committed by
cloud-init created default user
parent
00f679a0f6
commit
f084d89eab
44
examples/xbrowsersync/conf/healthcheck.js
Normal file
44
examples/xbrowsersync/conf/healthcheck.js
Normal file
@@ -0,0 +1,44 @@
|
||||
const http = require('http');
|
||||
|
||||
const response = http.request(
|
||||
{
|
||||
host: '0.0.0.0',
|
||||
method: 'GET',
|
||||
path: '/info',
|
||||
port: 8080,
|
||||
timeout: 2000,
|
||||
},
|
||||
(res) => {
|
||||
let body = '';
|
||||
res.setEncoding('utf8');
|
||||
|
||||
res.on('data', (chunk) => {
|
||||
body += chunk;
|
||||
});
|
||||
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
const payload = JSON.parse(body);
|
||||
switch (payload.status) {
|
||||
case 1:
|
||||
case 3:
|
||||
console.log('HEALTHCHECK: online');
|
||||
process.exit(0);
|
||||
case 2:
|
||||
default:
|
||||
console.log('HEALTHCHECK: offline');
|
||||
}
|
||||
} else {
|
||||
console.log('HEALTHCHECK: offline');
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
response.on('error', function (err) {
|
||||
console.log('HEALTHCHECK: offline');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
response.end();
|
||||
3
examples/xbrowsersync/conf/mongoconfig.js
Normal file
3
examples/xbrowsersync/conf/mongoconfig.js
Normal file
@@ -0,0 +1,3 @@
|
||||
db.newsynclogs.createIndex( { "expiresAt": 1 }, { expireAfterSeconds: 0 } );
|
||||
db.newsynclogs.createIndex( { "ipAddress": 1 } );
|
||||
db.bookmarks.createIndex( { "lastAccessed": 1 }, { expireAfterSeconds: 21*86400 } );
|
||||
16
examples/xbrowsersync/conf/settings.json
Normal file
16
examples/xbrowsersync/conf/settings.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"location": "JP",
|
||||
"maxSyncs": "10000",
|
||||
"maxSyncSize": "10485760",
|
||||
"db": {
|
||||
"host": "xbrowsersync-db",
|
||||
"name": "xbrowsersync",
|
||||
"username": "xbrowsersync",
|
||||
"password": "aP7xvybVU6ZdVKWkTp7NjbcYuFdH5YR6Gi3aFrvdT4kbJ3aKwFqB4GnxYyao5DgR"
|
||||
},
|
||||
"status": {
|
||||
"allowNewSyncs": "true",
|
||||
"online": "true",
|
||||
"message": "Welcome to the HTY1024 xBrowserSync service! We run the latest version of the xBrowserSync API and take database backups daily."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user