@sysnee/pgs 0.1.7-rc.6 → 0.1.7-rc.7
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 +15 -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,23 @@ 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
|
+
console.log('Installing Docker...')
|
|
243
|
+
execSync('curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh', { stdio: 'inherit' })
|
|
244
|
+
execSync('rm get-docker.sh')
|
|
245
|
+
console.log('Docker installed successfully')
|
|
246
|
+
|
|
247
|
+
console.log('Installing Docker Compose plugin...')
|
|
248
|
+
execSync('sudo apt-get install -y docker-compose-plugin', { stdio: 'inherit' })
|
|
249
|
+
console.log('Docker Compose plugin installed successfully')
|
|
250
|
+
}
|
|
251
|
+
|
|
240
252
|
function ensureDockerPrivilegies() {
|
|
241
253
|
execSync('sudo usermod -aG docker $USER && newgrp docker')
|
|
242
254
|
writeFileSync(SETUP_STATUS_PATH, 'container:ok')
|
|
@@ -344,7 +356,7 @@ function createTenant(tenantId, options = {}) {
|
|
|
344
356
|
|
|
345
357
|
console.log(`✓ Created tenant: ${tenantId}`);
|
|
346
358
|
console.log(` Service: ${serviceName}`);
|
|
347
|
-
console.log(` Host: ${tenantId}.pgs.
|
|
359
|
+
console.log(` Host: ${tenantId}.pgs.br-sp-1.sysnee.com`);
|
|
348
360
|
console.log(` Port: 5432`);
|
|
349
361
|
console.log(` Database: ${tenantId}`);
|
|
350
362
|
console.log(` Password: ${password}`);
|
|
@@ -385,7 +397,7 @@ function listTenants() {
|
|
|
385
397
|
console.log('─'.repeat(90));
|
|
386
398
|
tenants.forEach(t => {
|
|
387
399
|
const accessStr = t.access ? '✓ enabled' : '✗ disabled';
|
|
388
|
-
const host = `${t.tenantId}.pgs.
|
|
400
|
+
const host = `${t.tenantId}.pgs.br-sp-1.sysnee.com`;
|
|
389
401
|
console.log(` ${t.tenantId.padEnd(25)} ${host.padEnd(45)} ${accessStr}`);
|
|
390
402
|
});
|
|
391
403
|
console.log('─'.repeat(90));
|