@sysnee/pgs 0.1.4-rc1 → 0.1.4-rc2

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.
Files changed (2) hide show
  1. package/manager.js +8 -3
  2. package/package.json +1 -1
package/manager.js CHANGED
@@ -6,6 +6,11 @@ import yaml from 'js-yaml';
6
6
  import os from 'os';
7
7
  import { Command } from 'commander';
8
8
  import { execSync } from 'child_process';
9
+ import { fileURLToPath } from 'url';
10
+ import { dirname } from 'path';
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = dirname(__filename);
9
14
 
10
15
  const CONFIG_DIR = path.join(os.homedir(), '.sysnee-config');
11
16
 
@@ -70,10 +75,10 @@ function generateHAProxyConfig() {
70
75
  console.debug(`tenants.lenght: ${tenants.length}`)
71
76
 
72
77
  // Get initial HAProxy config
73
- const templateFilePath = path.join(path.dirname(''), 'haproxy.cfg')
78
+ const templateFilePath = path.join(__dirname, 'haproxy.cfg')
74
79
  console.debug(`haproxy template file path: ${templateFilePath}`)
75
80
  let config = readFileSync(templateFilePath, 'utf8');
76
- console.debug(`haproxy template file loaded: ${config}`)
81
+ console.debug(`haproxy template file loaded`)
77
82
 
78
83
  // Add all tenant backends to SSL pool for SSL negotiation
79
84
  // PostgreSQL will respond 'N' (no SSL) during negotiation, then client retries without SSL
@@ -392,7 +397,7 @@ const program = new Command();
392
397
  program
393
398
  .name('postgres-manager')
394
399
  .description('Manage PostgreSQL tenant instances')
395
- .version('0.1.4-rc1');
400
+ .version(JSON.parse(readFileSync('package.json', 'utf8')).version);
396
401
 
397
402
  program
398
403
  .command('setup')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sysnee/pgs",
3
- "version": "0.1.4-rc1",
3
+ "version": "0.1.4-rc2",
4
4
  "description": "Dynamic PostgreSQL service instance manager",
5
5
  "type": "module",
6
6
  "bin": {