@sysnee/pgs 0.1.7-rc.6 → 0.1.7-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/manager.js +21 -3
- package/package.json +1 -1
package/manager.js
CHANGED
|
@@ -102,7 +102,7 @@ function generateTraefikDynamicConfig(tenantsManifests = {}) {
|
|
|
102
102
|
|
|
103
103
|
const router = {
|
|
104
104
|
entryPoints: ['postgres'],
|
|
105
|
-
rule: `HostSNI(\`${tenantId}.pgs.
|
|
105
|
+
rule: `HostSNI(\`${tenantId}.pgs.br-sp-1.sysnee.com\`)`,
|
|
106
106
|
service: svcName,
|
|
107
107
|
tls: {}
|
|
108
108
|
};
|
|
@@ -232,11 +232,29 @@ function ensureNetwork(doc) {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
function initialSetup() {
|
|
235
|
+
installDocker()
|
|
235
236
|
createInitialFiles()
|
|
236
237
|
ensureDockerPrivilegies()
|
|
237
238
|
console.log('All ready!')
|
|
238
239
|
}
|
|
239
240
|
|
|
241
|
+
function installDocker() {
|
|
242
|
+
|
|
243
|
+
if (execSync('docker --version', { stdio: 'ignore' }).toString().trim() !== '') {
|
|
244
|
+
console.log('Docker already installed')
|
|
245
|
+
return
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
console.log('Installing Docker...')
|
|
249
|
+
execSync('curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh', { stdio: 'inherit' })
|
|
250
|
+
execSync('rm get-docker.sh')
|
|
251
|
+
console.log('Docker installed successfully')
|
|
252
|
+
|
|
253
|
+
console.log('Installing Docker Compose plugin...')
|
|
254
|
+
execSync('sudo apt-get install -y docker-compose-plugin', { stdio: 'inherit' })
|
|
255
|
+
console.log('Docker Compose plugin installed successfully')
|
|
256
|
+
}
|
|
257
|
+
|
|
240
258
|
function ensureDockerPrivilegies() {
|
|
241
259
|
execSync('sudo usermod -aG docker $USER && newgrp docker')
|
|
242
260
|
writeFileSync(SETUP_STATUS_PATH, 'container:ok')
|
|
@@ -344,7 +362,7 @@ function createTenant(tenantId, options = {}) {
|
|
|
344
362
|
|
|
345
363
|
console.log(`✓ Created tenant: ${tenantId}`);
|
|
346
364
|
console.log(` Service: ${serviceName}`);
|
|
347
|
-
console.log(` Host: ${tenantId}.pgs.
|
|
365
|
+
console.log(` Host: ${tenantId}.pgs.br-sp-1.sysnee.com`);
|
|
348
366
|
console.log(` Port: 5432`);
|
|
349
367
|
console.log(` Database: ${tenantId}`);
|
|
350
368
|
console.log(` Password: ${password}`);
|
|
@@ -385,7 +403,7 @@ function listTenants() {
|
|
|
385
403
|
console.log('─'.repeat(90));
|
|
386
404
|
tenants.forEach(t => {
|
|
387
405
|
const accessStr = t.access ? '✓ enabled' : '✗ disabled';
|
|
388
|
-
const host = `${t.tenantId}.pgs.
|
|
406
|
+
const host = `${t.tenantId}.pgs.br-sp-1.sysnee.com`;
|
|
389
407
|
console.log(` ${t.tenantId.padEnd(25)} ${host.padEnd(45)} ${accessStr}`);
|
|
390
408
|
});
|
|
391
409
|
console.log('─'.repeat(90));
|