Skip to content

Commit 0244187

Browse files
committed
Improved pdns dev config
1 parent 0dd713e commit 0244187

File tree

2 files changed

+188
-20
lines changed

2 files changed

+188
-20
lines changed

backend/internal/acme/acmesh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func getCommonArgs() []string {
130130
}
131131

132132
args = append(args, "--log", "/data/logs/acme.sh.log")
133-
// args = append(args, "--debug", "2")
133+
args = append(args, "--debug", "2")
134134

135135
return args
136136
}

docker/dev/pdns-db.sql

Lines changed: 187 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,79 @@
1+
/*
2+
3+
How this was generated:
4+
1. bring up an empty pdns stack
5+
2. use api to create a zone ...
6+
7+
curl -X POST \
8+
'http://npm.dev:8081/api/v1/servers/localhost/zones' \
9+
--header 'X-API-Key: npm' \
10+
--header 'Content-Type: application/json' \
11+
--data-raw '{
12+
"name": "example.com.",
13+
"kind": "Native",
14+
"masters": [],
15+
"nameservers": [
16+
"ns1.pdns.",
17+
"ns2.pdns."
18+
]
19+
}'
20+
21+
3. Dump sql:
22+
23+
docker exec -ti npm.pdns.db mysqldump -u pdns -p pdns
24+
25+
*/
26+
27+
----------------------------------------------------------------------
28+
29+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
30+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
31+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
32+
/*!40101 SET NAMES utf8mb4 */;
33+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
34+
/*!40103 SET TIME_ZONE='+00:00' */;
35+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
36+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
37+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
38+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
39+
40+
--
41+
-- Table structure for table `comments`
42+
--
43+
44+
DROP TABLE IF EXISTS `comments`;
45+
/*!40101 SET @saved_cs_client = @@character_set_client */;
46+
/*!40101 SET character_set_client = utf8 */;
147
CREATE TABLE `comments` (
248
`id` int(11) NOT NULL AUTO_INCREMENT,
349
`domain_id` int(11) NOT NULL,
450
`name` varchar(255) NOT NULL,
551
`type` varchar(10) NOT NULL,
652
`modified_at` int(11) NOT NULL,
7-
`account` varchar(40) DEFAULT NULL,
8-
`comment` text NOT NULL,
53+
`account` varchar(40) CHARACTER SET utf8mb3 DEFAULT NULL,
54+
`comment` text CHARACTER SET utf8mb3 NOT NULL,
955
PRIMARY KEY (`id`),
1056
KEY `comments_name_type_idx` (`name`,`type`),
1157
KEY `comments_order_idx` (`domain_id`,`modified_at`)
12-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
58+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
59+
/*!40101 SET character_set_client = @saved_cs_client */;
60+
61+
--
62+
-- Dumping data for table `comments`
63+
--
64+
65+
LOCK TABLES `comments` WRITE;
66+
/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
67+
/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
68+
UNLOCK TABLES;
1369

70+
--
71+
-- Table structure for table `cryptokeys`
72+
--
73+
74+
DROP TABLE IF EXISTS `cryptokeys`;
75+
/*!40101 SET @saved_cs_client = @@character_set_client */;
76+
/*!40101 SET character_set_client = utf8 */;
1477
CREATE TABLE `cryptokeys` (
1578
`id` int(11) NOT NULL AUTO_INCREMENT,
1679
`domain_id` int(11) NOT NULL,
@@ -20,68 +83,173 @@ CREATE TABLE `cryptokeys` (
2083
`content` text DEFAULT NULL,
2184
PRIMARY KEY (`id`),
2285
KEY `domainidindex` (`domain_id`)
23-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
86+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
87+
/*!40101 SET character_set_client = @saved_cs_client */;
88+
89+
--
90+
-- Dumping data for table `cryptokeys`
91+
--
92+
93+
LOCK TABLES `cryptokeys` WRITE;
94+
/*!40000 ALTER TABLE `cryptokeys` DISABLE KEYS */;
95+
/*!40000 ALTER TABLE `cryptokeys` ENABLE KEYS */;
96+
UNLOCK TABLES;
2497

98+
--
99+
-- Table structure for table `domainmetadata`
100+
--
101+
102+
DROP TABLE IF EXISTS `domainmetadata`;
103+
/*!40101 SET @saved_cs_client = @@character_set_client */;
104+
/*!40101 SET character_set_client = utf8 */;
25105
CREATE TABLE `domainmetadata` (
26106
`id` int(11) NOT NULL AUTO_INCREMENT,
27107
`domain_id` int(11) NOT NULL,
28108
`kind` varchar(32) DEFAULT NULL,
29109
`content` text DEFAULT NULL,
30110
PRIMARY KEY (`id`),
31111
KEY `domainmetadata_idx` (`domain_id`,`kind`)
32-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
112+
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
113+
/*!40101 SET character_set_client = @saved_cs_client */;
114+
115+
--
116+
-- Dumping data for table `domainmetadata`
117+
--
33118

34-
INSERT INTO `domainmetadata` VALUES (1,1,'SOA-EDIT-API','DEFAULT');
119+
LOCK TABLES `domainmetadata` WRITE;
120+
/*!40000 ALTER TABLE `domainmetadata` DISABLE KEYS */;
121+
INSERT INTO `domainmetadata` VALUES
122+
(1,1,'SOA-EDIT-API','DEFAULT');
123+
/*!40000 ALTER TABLE `domainmetadata` ENABLE KEYS */;
124+
UNLOCK TABLES;
35125

126+
--
127+
-- Table structure for table `domains`
128+
--
129+
130+
DROP TABLE IF EXISTS `domains`;
131+
/*!40101 SET @saved_cs_client = @@character_set_client */;
132+
/*!40101 SET character_set_client = utf8 */;
36133
CREATE TABLE `domains` (
37134
`id` int(11) NOT NULL AUTO_INCREMENT,
38135
`name` varchar(255) NOT NULL,
39136
`master` varchar(128) DEFAULT NULL,
40137
`last_check` int(11) DEFAULT NULL,
41-
`type` varchar(6) NOT NULL,
138+
`type` varchar(8) NOT NULL,
42139
`notified_serial` int(10) unsigned DEFAULT NULL,
43-
`account` varchar(40) DEFAULT NULL,
140+
`account` varchar(40) CHARACTER SET utf8mb3 DEFAULT NULL,
141+
`options` varchar(64000) DEFAULT NULL,
142+
`catalog` varchar(255) DEFAULT NULL,
44143
PRIMARY KEY (`id`),
45-
UNIQUE KEY `name_index` (`name`)
46-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
144+
UNIQUE KEY `name_index` (`name`),
145+
KEY `catalog_idx` (`catalog`)
146+
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
147+
/*!40101 SET character_set_client = @saved_cs_client */;
148+
149+
--
150+
-- Dumping data for table `domains`
151+
--
47152

48-
INSERT INTO `domains` VALUES (1,'example.com','',NULL,'NATIVE',NULL,'');
153+
LOCK TABLES `domains` WRITE;
154+
/*!40000 ALTER TABLE `domains` DISABLE KEYS */;
155+
INSERT INTO `domains` VALUES
156+
(1,'example.com','',NULL,'NATIVE',NULL,'',NULL,NULL);
157+
/*!40000 ALTER TABLE `domains` ENABLE KEYS */;
158+
UNLOCK TABLES;
49159

160+
--
161+
-- Table structure for table `records`
162+
--
163+
164+
DROP TABLE IF EXISTS `records`;
165+
/*!40101 SET @saved_cs_client = @@character_set_client */;
166+
/*!40101 SET character_set_client = utf8 */;
50167
CREATE TABLE `records` (
51168
`id` bigint(20) NOT NULL AUTO_INCREMENT,
52169
`domain_id` int(11) DEFAULT NULL,
53170
`name` varchar(255) DEFAULT NULL,
54171
`type` varchar(10) DEFAULT NULL,
55-
`content` TEXT DEFAULT NULL,
172+
`content` varchar(64000) DEFAULT NULL,
56173
`ttl` int(11) DEFAULT NULL,
57174
`prio` int(11) DEFAULT NULL,
58175
`disabled` tinyint(1) DEFAULT 0,
59-
`ordername` varchar(255) DEFAULT NULL,
176+
`ordername` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
60177
`auth` tinyint(1) DEFAULT 1,
61178
PRIMARY KEY (`id`),
62179
KEY `nametype_index` (`name`,`type`),
63180
KEY `domain_id` (`domain_id`),
64181
KEY `ordername` (`ordername`)
65-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
182+
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
183+
/*!40101 SET character_set_client = @saved_cs_client */;
184+
185+
--
186+
-- Dumping data for table `records`
187+
--
66188

189+
LOCK TABLES `records` WRITE;
190+
/*!40000 ALTER TABLE `records` DISABLE KEYS */;
67191
INSERT INTO `records` VALUES
68192
(1,1,'example.com','NS','ns1.pdns',1500,0,0,NULL,1),
69193
(2,1,'example.com','NS','ns2.pdns',1500,0,0,NULL,1),
70-
(4,1,'test.example.com','A','10.0.0.1',60,0,0,NULL,1),
71-
(5,1,'example.com','SOA','a.misconfigured.dns.server.invalid hostmaster.example.com 2022020702 10800 3600 604800 3600',1500,0,0,NULL,1);
194+
(3,1,'example.com','SOA','a.misconfigured.dns.server.invalid hostmaster.example.com 2023030501 10800 3600 604800 3600',1500,0,0,NULL,1);
195+
/*!40000 ALTER TABLE `records` ENABLE KEYS */;
196+
UNLOCK TABLES;
197+
198+
--
199+
-- Table structure for table `supermasters`
200+
--
72201

202+
DROP TABLE IF EXISTS `supermasters`;
203+
/*!40101 SET @saved_cs_client = @@character_set_client */;
204+
/*!40101 SET character_set_client = utf8 */;
73205
CREATE TABLE `supermasters` (
74206
`ip` varchar(64) NOT NULL,
75207
`nameserver` varchar(255) NOT NULL,
76-
`account` varchar(40) NOT NULL,
208+
`account` varchar(40) CHARACTER SET utf8mb3 NOT NULL,
77209
PRIMARY KEY (`ip`,`nameserver`)
78-
) DEFAULT CHARSET=latin1;
210+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
211+
/*!40101 SET character_set_client = @saved_cs_client */;
79212

213+
--
214+
-- Dumping data for table `supermasters`
215+
--
216+
217+
LOCK TABLES `supermasters` WRITE;
218+
/*!40000 ALTER TABLE `supermasters` DISABLE KEYS */;
219+
/*!40000 ALTER TABLE `supermasters` ENABLE KEYS */;
220+
UNLOCK TABLES;
221+
222+
--
223+
-- Table structure for table `tsigkeys`
224+
--
225+
226+
DROP TABLE IF EXISTS `tsigkeys`;
227+
/*!40101 SET @saved_cs_client = @@character_set_client */;
228+
/*!40101 SET character_set_client = utf8 */;
80229
CREATE TABLE `tsigkeys` (
81230
`id` int(11) NOT NULL AUTO_INCREMENT,
82231
`name` varchar(255) DEFAULT NULL,
83232
`algorithm` varchar(50) DEFAULT NULL,
84233
`secret` varchar(255) DEFAULT NULL,
85234
PRIMARY KEY (`id`),
86235
UNIQUE KEY `namealgoindex` (`name`,`algorithm`)
87-
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
236+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
237+
/*!40101 SET character_set_client = @saved_cs_client */;
238+
239+
--
240+
-- Dumping data for table `tsigkeys`
241+
--
242+
243+
LOCK TABLES `tsigkeys` WRITE;
244+
/*!40000 ALTER TABLE `tsigkeys` DISABLE KEYS */;
245+
/*!40000 ALTER TABLE `tsigkeys` ENABLE KEYS */;
246+
UNLOCK TABLES;
247+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
248+
249+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
250+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
251+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
252+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
253+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
254+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
255+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

0 commit comments

Comments
 (0)