@drumee/setup-infra 1.0.8 → 1.0.9

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
@@ -230,6 +230,11 @@ function makeData(opt) {
230
230
  data[key] = value.trim() || fallback;
231
231
  }
232
232
  }
233
+
234
+ if(data.public_ip4){
235
+ data.reverse_ip4 = data.public_ip4.split('.').reverse().join('.');
236
+ }
237
+
233
238
  return data;
234
239
  }
235
240
  /**
@@ -401,6 +406,12 @@ function writeInfraConf(data) {
401
406
  `${mariadb}/50-server.cnf`,
402
407
  ];
403
408
 
409
+ if(data.reverse_ip4){
410
+ targets.push({
411
+ tpl: `var/lib/bind/reverse.tpl`,
412
+ out: `var/lib/bind/${data.public_ip4}`
413
+ })
414
+ }
404
415
  data.dkim_key = getDkim(dkim);
405
416
  data.mail_user = MAIL_USER || 'postfix';
406
417
  data.mail_password = uniqueId();
@@ -534,7 +545,6 @@ function configure() {
534
545
  const isPrivate = await privateIp();
535
546
  let os = require("os");
536
547
  let interfaces = os.networkInterfaces();
537
- let public_address;
538
548
  for (let name in interfaces) {
539
549
  for (let dev of interfaces[name]) {
540
550
  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.9",
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 %>.