@drumee/setup-infra 1.0.8 → 1.0.10

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/index.js CHANGED
@@ -227,9 +227,16 @@ function makeData(opt) {
227
227
  if (/.+\+$/.test(value)) {
228
228
  value = value.replace(/\+$/, data[key]);
229
229
  }
230
- data[key] = value.trim() || fallback;
230
+ if(value){
231
+ data[key] = value.trim() || fallback;
232
+ }
231
233
  }
232
234
  }
235
+
236
+ if(data.public_ip4){
237
+ data.reverse_ip4 = data.public_ip4.split('.').reverse().join('.');
238
+ }
239
+
233
240
  return data;
234
241
  }
235
242
  /**
@@ -401,6 +408,12 @@ function writeInfraConf(data) {
401
408
  `${mariadb}/50-server.cnf`,
402
409
  ];
403
410
 
411
+ if(data.reverse_ip4){
412
+ targets.push({
413
+ tpl: `var/lib/bind/reverse.tpl`,
414
+ out: `var/lib/bind/${data.public_ip4}`
415
+ })
416
+ }
404
417
  data.dkim_key = getDkim(dkim);
405
418
  data.mail_user = MAIL_USER || 'postfix';
406
419
  data.mail_password = uniqueId();
@@ -534,7 +547,6 @@ function configure() {
534
547
  const isPrivate = await privateIp();
535
548
  let os = require("os");
536
549
  let interfaces = os.networkInterfaces();
537
- let public_address;
538
550
  for (let name in interfaces) {
539
551
  for (let dev of interfaces[name]) {
540
552
  if (dev.family == 'IPv4') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drumee/setup-infra",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Drumee Infrastructure Setup Utilities",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,3 +11,11 @@ zone "<%= domain %>" {
11
11
  allow-update { key "update"; };
12
12
  allow-transfer { <%= public_ip4 %>; };
13
13
  };
14
+
15
+ <% if (typeof(reverse_ip4) !== "undefined" && reverse_ip4 != "" ) { %>
16
+ zone "<%= reverse_ip4 %>" {
17
+ type master;
18
+ file "/var/lib/bind/<%= public_ip4 %>";
19
+ allow-query { any; };
20
+ };
21
+ <% } %>
@@ -30,7 +30,7 @@ export DRUMEE_SERVER_NODE=<%= runtime_dir %>/dist/main/node_modules
30
30
  export DRUMEE_STATIC_DIR=<%= static_dir %>
31
31
  export DRUMEE_SYSTEM_GROUP=<%= system_group %>
32
32
  export DRUMEE_SYSTEM_USER=<%= system_user %>
33
- export DRUMEE_TMP_DIR=<%= runtime_dir %>/tmp
33
+ export DRUMEE_TMP_DIR=<%= data_dir %>/tmp
34
34
  export DRUMEE_UI_HOME=<%= runtime_dir %>/ui
35
35
  export DRUMEE_STORAGE_BACKUP=<%= storage_backup %>
36
36
  export DRUMEE_DB_BACKUP=<%= db_backup %>
@@ -0,0 +1,17 @@
1
+ $TTL 3D
2
+ $ORIGIN <%= reverse_ip4 %>.
3
+ ;
4
+ @ IN SOA ns1.<%= domain %>. master.<%= domain %>. (
5
+ <%= serial %> ; serial, today date + today serial
6
+ 1H ; refresh, seconds
7
+ 2H ; retry, seconds
8
+ 4W ; expire, seconds
9
+ 1D ) ; minimum, seconds
10
+ ;
11
+ ;
12
+ @ IN NS ns1.<%= domain %>.
13
+ @ IN NS ns2.<%= domain %>.
14
+
15
+ 2 IN PTR ns1.<%= domain %>.
16
+ 3 IN PTR ns2.<%= domain %>.
17
+ 3 IN PTR smtp.<%= domain %>.