From e7ec8f04894978a37f2bc8eb5d48e50854239580 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 26 Sep 2021 09:10:54 +0200 Subject: [PATCH 1/2] Deprecated SHORT_DOMAIN_* env vars with replacements --- config/autoload/url-shortener.global.php | 6 ++++-- docker/README.md | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/autoload/url-shortener.global.php b/config/autoload/url-shortener.global.php index 35f95ec6..5193ee1b 100644 --- a/config/autoload/url-shortener.global.php +++ b/config/autoload/url-shortener.global.php @@ -13,13 +13,15 @@ return (static function (): array { $webhooks = env('VISITS_WEBHOOKS'); $shortCodesLength = (int) env('DEFAULT_SHORT_CODES_LENGTH', DEFAULT_SHORT_CODES_LENGTH); $shortCodesLength = $shortCodesLength < MIN_SHORT_CODES_LENGTH ? MIN_SHORT_CODES_LENGTH : $shortCodesLength; + $useHttps = env('USE_HTTPS'); // Deprecated. For v3, set this to true by default, instead of null return [ 'url_shortener' => [ 'domain' => [ - 'schema' => env('SHORT_DOMAIN_SCHEMA', 'http'), - 'hostname' => env('SHORT_DOMAIN_HOST', ''), + // Deprecated SHORT_DOMAIN_* env vars + 'schema' => $useHttps !== null ? (bool) $useHttps : env('SHORT_DOMAIN_SCHEMA', 'http'), + 'hostname' => env('DEFAULT_DOMAIN', env('SHORT_DOMAIN_HOST', '')), ], 'validate_url' => (bool) env('VALIDATE_URLS', false), // Deprecated 'visits_webhooks' => $webhooks === null ? [] : explode(',', $webhooks), diff --git a/docker/README.md b/docker/README.md index 5269ebb6..9f97642c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -11,8 +11,8 @@ It exposes a shlink instance served with [swoole](https://www.swoole.co.uk/), wh The most basic way to run Shlink's docker image is by providing these mandatory env vars. -* `SHORT_DOMAIN_HOST`: The custom short domain used for this shlink instance. For example **doma.in**. -* `SHORT_DOMAIN_SCHEMA`: Either **http** or **https**. +* `DEFAULT_DOMAIN`: The default short domain used for this shlink instance. For example **doma.in**. +* `USE_HTTPS`: Either **true** or **false**. * `GEOLITE_LICENSE_KEY`: Your GeoLite2 license key. [Learn more](https://shlink.io/documentation/geolite-license-key/) about this. To run shlink on top of a local docker service, and using an internal SQLite database, do the following: @@ -21,8 +21,8 @@ To run shlink on top of a local docker service, and using an internal SQLite dat docker run \ --name shlink \ -p 8080:8080 \ - -e SHORT_DOMAIN_HOST=doma.in \ - -e SHORT_DOMAIN_SCHEMA=https \ + -e DEFAULT_DOMAIN=doma.in \ + -e USE_HTTPS=true \ -e GEOLITE_LICENSE_KEY=kjh23ljkbndskj345 \ shlinkio/shlink:stable ``` From c6226547f7fe7ec69b2d6d038bad286deed83e56 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 26 Sep 2021 09:12:26 +0200 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d816951..c3a12e21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#1157](https://github.com/shlinkio/shlink/issues/1157) All routes now support CORS, not only rest ones. ### Deprecated -* *Nothing* +* [#1164](https://github.com/shlinkio/shlink/issues/1164) Deprecated `SHORT_DOMAIN_HOST` and `SHORT_DOMAIN_SCHEMA` env vars. Use `DEFAULT_DOMAIN` and `USE_HTTPS=true|false` instead. ### Removed * *Nothing*