@sysnee/pgs 0.1.6 → 0.1.7-rc.1
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 +11 -5
- package/package.json +1 -1
package/manager.js
CHANGED
|
@@ -118,9 +118,9 @@ function updateHAProxyDependsOn() {
|
|
|
118
118
|
container_name: 'postgres_proxy',
|
|
119
119
|
ports: ['5432:5432'],
|
|
120
120
|
volumes: [
|
|
121
|
-
|
|
121
|
+
`${HAPROXY_CFG_PATH}:/usr/local/etc/haproxy/haproxy.cfg:ro`,
|
|
122
122
|
'./haproxy-lua:/etc/haproxy/lua:ro',
|
|
123
|
-
|
|
123
|
+
`${TENANT_ACCESS_FILE_PATH}:/etc/haproxy/tenant-access.json:ro`
|
|
124
124
|
],
|
|
125
125
|
networks: ['postgres_network'],
|
|
126
126
|
restart: 'unless-stopped'
|
|
@@ -217,14 +217,20 @@ function createInitialFiles() {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
// docker-compose.yml
|
|
220
|
-
if (!
|
|
220
|
+
if (!existsSync(COMPOSE_FILE_PATH)) {
|
|
221
221
|
const dockerComposeInitialContent = readFileSync(path.join(__dirname, 'docker-compose.yml'), 'utf8')
|
|
222
222
|
writeFileSync(COMPOSE_FILE_PATH, dockerComposeInitialContent)
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
// tenant-access.json
|
|
226
|
-
if (!
|
|
227
|
-
|
|
226
|
+
if (!existsSync(TENANT_ACCESS_FILE_PATH)) {
|
|
227
|
+
writeFileSync(TENANT_ACCESS_FILE_PATH, '{}');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// haproxy.cfg
|
|
231
|
+
if (!existsSync(HAPROXY_CFG_PATH)) {
|
|
232
|
+
const haproxyTemplate = readFileSync(path.join(__dirname, 'haproxy.cfg'), 'utf8');
|
|
233
|
+
writeFileSync(HAPROXY_CFG_PATH, haproxyTemplate);
|
|
228
234
|
}
|
|
229
235
|
}
|
|
230
236
|
|