On 2021/12/16 11:27, Aaron Bieber wrote:
> Hi,
> 
> Here is an update to headscale, I have been running it for some time
> without issue.
> 
> It introduces a config change (json to yaml) - so the old config
> breaks. I am not sure how to handle that. Quirk? FAQ? Cry?!

I would normally only add an faq/current.html entry if something will
break badly in some way that is especially hard to figure out, or
requires work *before* the update. Alternatively there's the @ask-update
mechanism, but people trying to do automated updates will be annoyed if
you use it too much.

For much software it would not be unusual for an update to need some
work and that would usually be documented upstream, I don't think we
need to repeat that.

For this particular case I think I would note it in the commit log
and *maybe* pkg/README if it's hard to find info in upstream docs.

> Pointers very welcome!
> 
> Cheers,
> Aaron
> 

> diff 39ab195a6316df60baffce3d067cc4a1aa66fa75 /usr/ports
> blob - 50af97fefa8ff8671cfab7d1d6d44bd143028b5c
> file + net/headscale/Makefile
> --- net/headscale/Makefile
> +++ net/headscale/Makefile
> @@ -3,7 +3,7 @@
>  COMMENT =    open source implementation of the Tailscale control server
>  
>  MODGO_MODNAME =      github.com/juanfont/headscale
> -MODGO_VERSION =      v0.10.1
> +MODGO_VERSION =      v0.11.0
>  
>  DISTNAME =   headscale-${MODGO_VERSION}
>  
> @@ -25,11 +25,9 @@ SUBST_VARS +=      VARBASE
>  
>  post-install:
>       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/headscale
> -     ${INSTALL_DATA} ${WRKSRC}/derp.yaml ${PREFIX}/share/examples/headscale/
> -     ${SUBST_DATA} ${WRKSRC}/config.json.postgres.example \
> -             ${PREFIX}/share/examples/headscale/config.json.postgres.example
> -     ${SUBST_DATA} ${WRKSRC}/config.json.sqlite.example \
> -             ${PREFIX}/share/examples/headscale/config.json.sqlite.example
> +     ${INSTALL_DATA} ${WRKSRC}/derp-example.yaml 
> ${PREFIX}/share/examples/headscale/
> +     ${SUBST_DATA} ${WRKSRC}/config-example.yaml \
> +             ${PREFIX}/share/examples/headscale/config-example.yaml
>  
>  .include "modules.inc"
>  
> blob - 085149e515fd2071d94ae26508308e738526bb71
> file + net/headscale/distinfo
> --- net/headscale/distinfo
> +++ net/headscale/distinfo
> @@ -1922,7 +1922,7 @@ SHA256 (go_modules/sourcegraph.com/sourcegraph/appdash
>  SHA256 
> (go_modules/sourcegraph.com/sourcegraph/appdash/@v/v0.0.0-20190731080439-ebfcffb1b5c0.zip)
>  = vSSS2dsFNiwv7NCz0PYALImm2Q1nj7k7QVgpiriDc28=
>  SHA256 (go_modules/tailscale.com/@v/v1.14.2.mod) = 
> UWgNAy9mgZLMvYK/m87pI+SJ0ivwiaY/Qd/ATTwWU9M=
>  SHA256 (go_modules/tailscale.com/@v/v1.14.2.zip) = 
> t4De5natDLqPWkxyTO+Bl8rCmWLv6G7T0fn54tJec9w=
> -SHA256 (headscale-v0.10.1.zip) = gnXmfjuxnl81b5YALQBEVGTyOfEntEVyf3bSZjzBtxg=
> +SHA256 (headscale-v0.11.0.zip) = cfj/jmdbt8sjlEFjjZ7v/Bris5xnZ0SuGpULZ52fVLk=
>  SIZE 
> (go_modules/4d63.com/gochecknoglobals/@v/v0.0.0-20201008074935-acfc0b28355a.mod)
>  = 105
>  SIZE 
> (go_modules/4d63.com/gochecknoglobals/@v/v0.0.0-20201008074935-acfc0b28355a.zip)
>  = 14082
>  SIZE (go_modules/bazil.org/fuse/@v/v0.0.0-20160811212531-371fbbdaa898.mod) = 
> 22
> @@ -3847,4 +3847,4 @@ SIZE (go_modules/sourcegraph.com/sourcegraph/appdash/@
>  SIZE 
> (go_modules/sourcegraph.com/sourcegraph/appdash/@v/v0.0.0-20190731080439-ebfcffb1b5c0.zip)
>  = 158069
>  SIZE (go_modules/tailscale.com/@v/v1.14.2.mod) = 2294
>  SIZE (go_modules/tailscale.com/@v/v1.14.2.zip) = 1087553
> -SIZE (headscale-v0.10.1.zip) = 145631
> +SIZE (headscale-v0.11.0.zip) = 152406
> blob - fe0e443a3bd339ca9733c22796318d568fccd4cc
> file + net/headscale/modules.inc
> --- net/headscale/modules.inc
> +++ net/headscale/modules.inc
> @@ -1,4 +1,4 @@
> -# $OpenBSD: modules.inc,v 1.2 2021/10/12 13:14:01 abieber Exp $
> +# $OpenBSD$
>  
>  MODGO_MODULES =      \
>       4d63.com/gochecknoglobals                                        
> v0.0.0-20201008074935-acfc0b28355a \
> blob - /dev/null
> file + net/headscale/patches/patch-config-example_yaml
> --- /dev/null
> +++ net/headscale/patches/patch-config-example_yaml
> @@ -0,0 +1,45 @@
> +$OpenBSD$
> +
> +Index: config-example.yaml
> +--- config-example.yaml.orig
> ++++ config-example.yaml
> +@@ -4,10 +4,10 @@
> + server_url: http://127.0.0.1:8080
> + 
> + # Address to listen to / bind to on the server
> +-listen_addr: 0.0.0.0:8080
> ++listen_addr: 127.0.0.1:8080
> + 
> + # Path to WireGuard private key file
> +-private_key_path: private.key
> ++private_key_path: ${SYSCONFDIR}/headscale/private.key
> + 
> + derp:
> +   # List of externally available DERP maps encoded in JSON
> +@@ -16,7 +16,7 @@ derp:
> + 
> +   # Locally available DERP map files encoded in YAML
> +   paths:
> +-    - derp-example.yaml
> ++    - ${SYSCONFDIR}/headscale/derp.yaml
> + 
> +   # If enabled, a worker will be set up to periodically
> +   # refresh the given sources and update the derpmap
> +@@ -32,7 +32,7 @@ ephemeral_node_inactivity_timeout: 30m
> + 
> + # SQLite config
> + db_type: sqlite3
> +-db_path: db.sqlite
> ++db_path: ${VARBASE}/headscale/db.sqlite
> + 
> + # # Postgres config
> + # db_type: postgres
> +@@ -47,7 +47,7 @@ acme_email: ""
> + 
> + tls_letsencrypt_hostname: ""
> + tls_letsencrypt_listen: ":http"
> +-tls_letsencrypt_cache_dir: ".cache"
> ++tls_letsencrypt_cache_dir: "${VARBASE}/headscale/.cache"
> + tls_letsencrypt_challenge_type: HTTP-01
> + 
> + tls_cert_path: ""
> blob - 7c0f745821d5dbe190061109a2249d32c829983e
> file + /dev/null
> --- net/headscale/patches/patch-config_json_postgres_example
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -$OpenBSD: patch-config_json_postgres_example,v 1.2 2021/10/12 13:14:01 
> abieber Exp $
> -
> -Index: config.json.postgres.example
> ---- config.json.postgres.example.orig
> -+++ config.json.postgres.example
> -@@ -1,8 +1,8 @@
> - {
> -     "server_url": "http://127.0.0.1:8080";,
> --    "listen_addr": "0.0.0.0:8080",
> --    "private_key_path": "private.key",
> --    "derp_map_path": "derp.yaml",
> -+    "listen_addr": "127.0.0.1:8080",
> -+    "private_key_path": "${SYSCONFDIR}/headscale/private.key",
> -+    "derp_map_path": "${SYSCONFDIR}/headscale/derp.yaml",
> -     "ephemeral_node_inactivity_timeout": "30m",
> -     "db_type": "postgres",
> -     "db_host": "localhost",
> -@@ -14,7 +14,7 @@
> -     "acme_email": "",
> -     "tls_letsencrypt_hostname": "",
> -     "tls_letsencrypt_listen": ":http",
> --    "tls_letsencrypt_cache_dir": ".cache",
> -+    "tls_letsencrypt_cache_dir": "${VARBASE}/headscale/.cache",
> -     "tls_letsencrypt_challenge_type": "HTTP-01",
> -     "tls_cert_path": "",
> -     "tls_key_path": "",
> blob - 29d1d89eb2712b483363972a4beffb9c3f7ba897
> file + /dev/null
> --- net/headscale/patches/patch-config_json_sqlite_example
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -$OpenBSD: patch-config_json_sqlite_example,v 1.2 2021/10/12 13:14:01 abieber 
> Exp $
> -
> -Index: config.json.sqlite.example
> ---- config.json.sqlite.example.orig
> -+++ config.json.sqlite.example
> -@@ -1,16 +1,16 @@
> - {
> -     "server_url": "http://127.0.0.1:8080";,
> --    "listen_addr": "0.0.0.0:8080",
> --    "private_key_path": "private.key",
> --    "derp_map_path": "derp.yaml",
> -+    "listen_addr": "127.0.0.1:8080",
> -+    "private_key_path": "${SYSCONFDIR}/headscale/private.key",
> -+    "derp_map_path": "${SYSCONFDIR}/headscale/derp.yaml",
> -     "ephemeral_node_inactivity_timeout": "30m",
> -     "db_type": "sqlite3",
> --    "db_path": "db.sqlite",
> -+    "db_path": "${VARBASE}/headscale/db.sqlite",
> -     "acme_url": "https://acme-v02.api.letsencrypt.org/directory";,
> -     "acme_email": "",
> -     "tls_letsencrypt_hostname": "",
> -     "tls_letsencrypt_listen": ":http",
> --    "tls_letsencrypt_cache_dir": ".cache",
> -+    "tls_letsencrypt_cache_dir": "${VARBASE}/headscale/.cache",
> -     "tls_letsencrypt_challenge_type": "HTTP-01",
> -     "tls_cert_path": "",
> -     "tls_key_path": "",
> blob - d8c46cebe9055c74d9af169d7d1a9c78d33f4b31
> file + net/headscale/pkg/PLIST
> --- net/headscale/pkg/PLIST
> +++ net/headscale/pkg/PLIST
> @@ -13,14 +13,10 @@
>  @bin bin/headscale
>  share/doc/pkg-readmes/${PKGSTEM}
>  share/examples/headscale/
> -share/examples/headscale/config.json.postgres.example
> -share/examples/headscale/config.json.sqlite.example
> +share/examples/headscale/config-example.yaml
>  @mode 640
>  @group _headscale
> -@sample ${SYSCONFDIR}/headscale/config.json
> -@mode
> -@group
> -share/examples/headscale/derp.yaml
> +@sample ${SYSCONFDIR}/headscale/config.yaml
> +share/examples/headscale/derp-example.yaml
>  @mode 644
> -@group _headscale
>  @sample ${SYSCONFDIR}/headscale/derp.yaml

Reply via email to