Skip to content

Commit e18acf2

Browse files
committed
We're going to always have some differences we want to ignore
1 parent 38350b3 commit e18acf2

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

.github/workflows/headscale-config-checker.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,31 @@ jobs:
2828
- name: Check for new options
2929
id: check
3030
run: |
31-
# Extract just the key structure, ignoring values
31+
# Extract structure with better handling of commented lines
3232
extract_structure() {
33-
grep -E "^[[:space:]]*[^#].*:" "$1" | \
33+
# Use a more explicit approach
34+
grep -v "^[[:space:]]*#" "$1" | \
35+
grep -E "^[[:space:]]*[^[:space:]]*:" | \
36+
grep -v "# DIFF_IGNORE" | \
3437
sed 's/:[[:space:]]*.*$//' | \
38+
sed 's/^[[:space:]]*//' | \
3539
sort -u
3640
}
3741
42+
echo "Processing local config..."
3843
extract_structure "templates/headscale.template.yaml" > local-structure.txt
44+
45+
echo "Processing upstream config..."
3946
extract_structure "upstream-config.yaml" > upstream-structure.txt
4047
41-
# Find truly missing keys
48+
echo "Local keys found (first 10):"
49+
head -10 local-structure.txt
50+
echo ""
51+
echo "Upstream keys found (first 10):"
52+
head -10 upstream-structure.txt
53+
echo ""
54+
55+
# Find missing keys
4256
comm -23 upstream-structure.txt local-structure.txt > new-options.txt
4357
4458
if [ -s new-options.txt ]; then
@@ -62,5 +76,5 @@ jobs:
6276
owner: context.repo.owner,
6377
repo: context.repo.repo,
6478
issue_number: context.issue.number,
65-
body: `## 🆕 New Headscale Config Options\n\n\`\`\`diff\n${newOptions}\`\`\``
79+
body: `## 🆕 New Headscale Config Options\n\n\`\`\`diff\n${newOptions.split('\n').map(line => line.trim() ? `+ ${line}` : '').filter(line => line).join('\n')}\`\`\``
6680
});

templates/headscale.template.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ database:
144144
# Enable debug mode. This setting requires the log.level to be set to "debug" or "trace".
145145
debug: false
146146

147+
path: false # DIFF_IGNORE
148+
147149
# GORM configuration settings.
148150
gorm:
149151
# Enable prepared statements.
@@ -197,27 +199,27 @@ database:
197199
# TLS for a domain with Let's Encrypt.
198200
#
199201
# URL to ACME directory
200-
#acme_url: https://acme-v02.api.letsencrypt.org/directory
202+
#acme_url: https://acme-v02.api.letsencrypt.org/directory # DIFF_IGNORE
201203

202204
# Email to register with ACME provider
203-
#acme_email: ""
205+
#acme_email: "" # DIFF_IGNORE
204206

205207
# Domain name to request a TLS certificate for:
206-
#tls_letsencrypt_hostname: ""
208+
#tls_letsencrypt_hostname: "" # DIFF_IGNORE
207209

208210
# Path to store certificates and metadata needed by
209211
# letsencrypt
210212
# For production:
211-
#tls_letsencrypt_cache_dir: /var/lib/headscale/cache
213+
#tls_letsencrypt_cache_dir: /var/lib/headscale/cache # DIFF_IGNORE
212214

213215
# Type of ACME challenge to use, currently supported types:
214216
# HTTP-01 or TLS-ALPN-01
215217
# See: docs/ref/tls.md for more information
216-
#tls_letsencrypt_challenge_type: HTTP-01
218+
#tls_letsencrypt_challenge_type: HTTP-01 # DIFF_IGNORE
217219
# When HTTP-01 challenge is chosen, letsencrypt must set up a
218220
# verification endpoint, and it will be listening on:
219221
# :http = port 80
220-
#tls_letsencrypt_listen: ":http"
222+
#tls_letsencrypt_listen: ":http" # DIFF_IGNORE
221223

222224
## Use already defined certificates:
223225
tls_cert_path: ""

0 commit comments

Comments
 (0)