From 06a762959f03d8316bc6054838ac6331537b98f5 Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Tue, 29 Apr 2025 15:19:46 -0400 Subject: [PATCH] feat: enable Open Graph tag passthrough by default (#348) * feat: enable Open Graph tag passthrough by default Signed-off-by: Jason Cameron * docs(changelog): move opengraph passthrough on by default to unreleased Signed-off-by: Xe Iaso --------- Signed-off-by: Jason Cameron Signed-off-by: Xe Iaso Co-authored-by: Xe Iaso --- cmd/anubis/main.go | 2 +- docs/docs/CHANGELOG.md | 2 ++ docs/docs/admin/configuration/open-graph.mdx | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 76f99fe..5ae7eff 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -57,7 +57,7 @@ var ( healthcheck = flag.Bool("healthcheck", false, "run a health check against Anubis") useRemoteAddress = flag.Bool("use-remote-address", false, "read the client's IP address from the network request, useful for debugging and running Anubis on bare metal") debugBenchmarkJS = flag.Bool("debug-benchmark-js", false, "respond to every request with a challenge for benchmarking hashrate") - ogPassthrough = flag.Bool("og-passthrough", false, "enable Open Graph tag passthrough") + ogPassthrough = flag.Bool("og-passthrough", true, "enable Open Graph tag passthrough") ogTimeToLive = flag.Duration("og-expiry-time", 24*time.Hour, "Open Graph tag cache expiration time") ogCacheConsiderHost = flag.Bool("og-cache-consider-host", false, "enable or disable the use of the host in the Open Graph tag cache") extractResources = flag.String("extract-resources", "", "if set, extract the static resources to the specified folder") diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index d09a7dd..d4d84e5 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Updated the `OG_PASSTHROUGH` to be true by default, thereby allowing OpenGraph tags to be passed through by default - Added the ability to [customize Anubis' HTTP status codes](./admin/configuration/custom-status-codes.mdx) ([#355](https://github.com/TecharoHQ/anubis/issues/355)) ## v1.17.0: Asahi sas Brutus @@ -45,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reduce Anubis' paranoia with user cookies ([#365](https://github.com/TecharoHQ/anubis/pull/365)) - Added support for Opengraph passthrough while using unix sockets - The opengraph subsystem now passes the HTTP `HOST` header through to the origin +- Updated the `OG_PASSTHROUGH` to be true by default, thereby allowing OpenGraph tags to be passed through by default ## v1.16.0 diff --git a/docs/docs/admin/configuration/open-graph.mdx b/docs/docs/admin/configuration/open-graph.mdx index 98cdd74..2fcd7ae 100644 --- a/docs/docs/admin/configuration/open-graph.mdx +++ b/docs/docs/admin/configuration/open-graph.mdx @@ -9,11 +9,11 @@ This page provides detailed information on how to configure [OpenGraph tag](http ## Configuration Options -| Name | Description | Type | Default | Example | -|--------------------------|-----------------------------------------------------------|----------|---------|---------------------------------| -| `OG_PASSTHROUGH` | Enables or disables the Open Graph tag passthrough system | Boolean | `false` | `OG_PASSTHROUGH=true` | -| `OG_EXPIRY_TIME` | Configurable cache expiration time for Open Graph tags | Duration | `24h` | `OG_EXPIRY_TIME=1h` | -| `OG_CACHE_CONSIDER_HOST` | Enables or disables the use of the host in the cache key | Boolean | `false` | `OG_CACHE_CONSIDER_HOST=true` | +| Name | Description | Type | Default | Example | +| ------------------------ | --------------------------------------------------------- | -------- | ------- | ----------------------------- | +| `OG_PASSTHROUGH` | Enables or disables the Open Graph tag passthrough system | Boolean | `true` | `OG_PASSTHROUGH=true` | +| `OG_EXPIRY_TIME` | Configurable cache expiration time for Open Graph tags | Duration | `24h` | `OG_EXPIRY_TIME=1h` | +| `OG_CACHE_CONSIDER_HOST` | Enables or disables the use of the host in the cache key | Boolean | `false` | `OG_CACHE_CONSIDER_HOST=true` | ## Usage