dyndnsd 3.11.0 → 3.12.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +31 -0
- data/lib/dyndnsd/version.rb +1 -1
- data/lib/dyndnsd.rb +16 -3
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1291b6722535928edf7d305db50ffe5045b211b2a03425218f97fd6d6648ec4b
|
|
4
|
+
data.tar.gz: 6f9f5611f347d5f3e4dee4a0c9dd8d6fe85c6b21a36919bf39a68f872ae51e25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c42f9a7bc3aece580177ffe50cfdcda3f7a7bc3f4ee978c3986f1abfd4cf6756f01f1c8606a852d76eb217da805c6633fa4a3df7ee76d7b95417cdb3dd8dd702
|
|
7
|
+
data.tar.gz: 1735e786ae2e77b1be0a2eb1bcb45d667836f71d9adf0268433c067296831af66674525db8c0fc961a398731d51fa7a0c3d9ff7967dd2ba326788d64e393700b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -307,6 +307,37 @@ users:
|
|
|
307
307
|
```
|
|
308
308
|
|
|
309
309
|
|
|
310
|
+
### Matching with a regular expression
|
|
311
|
+
|
|
312
|
+
Instead of relying on `hosts`, you can use `regex` to employ a regular expression, which is very useful for avoiding having to repeatedly edit the configuration file to register a new host name.
|
|
313
|
+
|
|
314
|
+
```yaml
|
|
315
|
+
host: "0.0.0.0"
|
|
316
|
+
port: 5354
|
|
317
|
+
username: "dyndnsd"
|
|
318
|
+
group: "dyndnsd"
|
|
319
|
+
db: "/dyndnsd/db.json"
|
|
320
|
+
debug: false
|
|
321
|
+
domain: "dyn.dc-air.home.arpa"
|
|
322
|
+
updater:
|
|
323
|
+
name: "command_with_bind_zone"
|
|
324
|
+
params:
|
|
325
|
+
zone_file: "/nsd/zones/static/dyn.dc-air.home.arpa.zone"
|
|
326
|
+
command: "doas service nsd reload"
|
|
327
|
+
ttl: "5m"
|
|
328
|
+
dns: "ns.dc-air.home.arpa."
|
|
329
|
+
email_addr: "admin.example.org"
|
|
330
|
+
users:
|
|
331
|
+
myuser:
|
|
332
|
+
password: "superhypermegas3kurepassword1234"
|
|
333
|
+
regex: '^[a-z][0-9]\.dyn\.dc\-air\.home\.arpa$'
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
However, when using `regex`, `hosts` is simply ignored if defined, so you must choose one or the other. Recommendation: use `regex` for scripts or programs and `hosts` for regular users.
|
|
337
|
+
|
|
338
|
+
**Note**: Please note that when dyndnsd evaluates the regular expression, the `Regexp::EXTENDED` and `Regexp::IGNORECASE` options are used.
|
|
339
|
+
|
|
340
|
+
|
|
310
341
|
## License
|
|
311
342
|
|
|
312
343
|
dyndnsd.rb is licensed under the Apache License, Version 2.0. See LICENSE for more information.
|
data/lib/dyndnsd/version.rb
CHANGED
data/lib/dyndnsd.rb
CHANGED
|
@@ -218,9 +218,22 @@ module Dyndnsd
|
|
|
218
218
|
# we can trust this information since user was authorized by middleware
|
|
219
219
|
user = env['REMOTE_USER']
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
if @users[user].key?('regex')
|
|
222
|
+
pattern = @users[user].fetch('regex')
|
|
223
|
+
begin
|
|
224
|
+
regex = Regexp.new(pattern, Regexp::IGNORECASE | Regexp::EXTENDED)
|
|
225
|
+
rescue RegexpError => e
|
|
226
|
+
Dyndnsd.logger.warn "Invalid regex pattern '#{pattern}': #{e.message}"
|
|
227
|
+
return [422, {'X-DynDNS-Response' => 'host_forbidden'}, []]
|
|
228
|
+
end
|
|
229
|
+
# check for hostnames that match the regex
|
|
230
|
+
matches = hostnames.any? { |str| regex.match?(str) }
|
|
231
|
+
return [422, {'X-DynDNS-Response' => 'host_forbidden'}, []] if !matches
|
|
232
|
+
else
|
|
233
|
+
# check for hostnames that the user does not own
|
|
234
|
+
forbidden_hostnames = hostnames - @users[user].fetch('hosts', [])
|
|
235
|
+
return [422, {'X-DynDNS-Response' => 'host_forbidden'}, []] if forbidden_hostnames.any?
|
|
236
|
+
end
|
|
224
237
|
|
|
225
238
|
if params['offline'] == 'YES'
|
|
226
239
|
myips = []
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dyndnsd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Nicolai
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async
|
|
@@ -274,14 +274,14 @@ dependencies:
|
|
|
274
274
|
requirements:
|
|
275
275
|
- - "~>"
|
|
276
276
|
- !ruby/object:Gem::Version
|
|
277
|
-
version: 3.
|
|
277
|
+
version: 3.8.0
|
|
278
278
|
type: :development
|
|
279
279
|
prerelease: false
|
|
280
280
|
version_requirements: !ruby/object:Gem::Requirement
|
|
281
281
|
requirements:
|
|
282
282
|
- - "~>"
|
|
283
283
|
- !ruby/object:Gem::Version
|
|
284
|
-
version: 3.
|
|
284
|
+
version: 3.8.0
|
|
285
285
|
- !ruby/object:Gem::Dependency
|
|
286
286
|
name: solargraph
|
|
287
287
|
requirement: !ruby/object:Gem::Requirement
|