diff --git a/CHANGELOG.md b/CHANGELOG.md index d8581c3c87..b4659f5abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fix not logging OpenAPI queries when `log-query=main-query` is enabled by @steve-chavez in #4226 - Fix not logging explain query when `log-query=main-query` is enabled by @steve-chavez in #4319 - Fix not logging transaction variables and db-pre-request function when `log-query=main-query` is enabled by @steve-chavez in #3934 +- Fix loading utf-8 config files with `ASCII` locale set in #4386 ### Added diff --git a/cabal.project.freeze b/cabal.project.freeze index 33b7f7aa7d..969ea8cd03 100644 --- a/cabal.project.freeze +++ b/cabal.project.freeze @@ -1 +1 @@ -index-state: hackage.haskell.org 2025-07-08T15:50:10Z +index-state: hackage.haskell.org 2025-10-13T04:53:27Z diff --git a/nix/overlays/haskell-packages.nix b/nix/overlays/haskell-packages.nix index 1e0feefd56..577e5162b3 100644 --- a/nix/overlays/haskell-packages.nix +++ b/nix/overlays/haskell-packages.nix @@ -50,6 +50,16 @@ let # jailbreak, because hspec limit for tests fuzzyset = prev.fuzzyset_0_2_4; + # TODO: Remove once available in nixpkgs haskellPackages + configurator-pg = + prev.callHackageDirect + { + pkg = "configurator-pg"; + ver = "0.2.11"; + sha256 = "sha256-mtGtNawDJgz2ZIEVca+IYXVu4oNw9xsfJiYWAqAbbgc="; + } + { }; + # Downgrade hasql and related packages while we are still on GHC 9.4 for the static build. hasql = lib.dontCheck (lib.doJailbreak prev.hasql_1_6_4_4); hasql-dynamic-statements = lib.dontCheck prev.hasql-dynamic-statements_0_3_1_5; diff --git a/postgrest.cabal b/postgrest.cabal index a42e05b4ea..ce3094a22a 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -106,7 +106,7 @@ library , case-insensitive >= 1.2 && < 1.3 , cassava >= 0.4.5 && < 0.6 , clock >= 0.8.3 && < 0.9.0 - , configurator-pg >= 0.2 && < 0.3 + , configurator-pg >= 0.2.11 && < 0.3 , containers >= 0.5.7 && < 0.7 , cookie >= 0.4.2 && < 0.6 , directory >= 1.2.6 && < 1.4 diff --git a/stack.yaml b/stack.yaml index 20de8d453e..0dabf21a65 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,6 +9,7 @@ nix: pure: false extra-deps: + - configurator-pg-0.2.11 - fuzzyset-0.2.4 - hasql-pool-1.0.1 - jose-jwt-0.10.0 diff --git a/stack.yaml.lock b/stack.yaml.lock index 32956204fc..17d4666356 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -4,6 +4,13 @@ # https://docs.haskellstack.org/en/stable/topics/lock_files packages: +- completed: + hackage: configurator-pg-0.2.11@sha256:de0c56386591e85159436b0af04a8f15a4f4e156354e99709676c2c2ee959505,2850 + pantry-tree: + sha256: 7b4daa4ea970335414f26b313a168cd12182b7b34ea8af2616c83d38699c4301 + size: 2527 + original: + hackage: configurator-pg-0.2.11 - completed: hackage: fuzzyset-0.2.4@sha256:f1b6de8bf33277bf6255207541d65028f1f1ea93af5541b654c86b5674995485,1618 pantry-tree: diff --git a/test/io/configs/expected/utf-8.config b/test/io/configs/expected/utf-8.config new file mode 100644 index 0000000000..dc8226011d --- /dev/null +++ b/test/io/configs/expected/utf-8.config @@ -0,0 +1,40 @@ +db-aggregates-enabled = false +db-anon-role = "" +db-channel = "pgrst" +db-channel-enabled = true +db-extra-search-path = "public" +db-hoisted-tx-settings = "statement_timeout,plan_filter.statement_cost_limit,default_transaction_isolation" +db-max-rows = "" +db-plan-enabled = false +db-pool = 10 +db-pool-acquisition-timeout = 10 +db-pool-max-lifetime = 1800 +db-pool-max-idletime = 30 +db-pool-automatic-recovery = true +db-pre-request = "" +db-prepared-statements = true +db-root-spec = "" +db-schemas = "public" +db-config = true +db-pre-config = "" +db-tx-end = "commit" +db-uri = "postgresql://" +jwt-aud = "" +jwt-role-claim-key = ".\"role\"" +jwt-secret = "" +jwt-secret-is-base64 = false +jwt-cache-max-entries = 1000 +log-level = "crit" +log-query = false +openapi-mode = "follow-privileges" +openapi-security-active = false +openapi-server-proxy-uri = "" +server-cors-allowed-origins = "" +server-host = "!4" +server-port = 3000 +server-trace-header = "" +server-timing-enabled = false +server-unix-socket = "" +server-unix-socket-mode = "660" +admin-server-host = "!4" +admin-server-port = "" diff --git a/test/io/configs/utf-8.config b/test/io/configs/utf-8.config new file mode 100644 index 0000000000..9b205b3c9f --- /dev/null +++ b/test/io/configs/utf-8.config @@ -0,0 +1,2 @@ +# Commènt utf-8 chàrs +log-level = "crit"