Skip to content

Commit f3f2f16

Browse files
committed
✨ SERVER_CHECK_ORIGIN support for self-hosted
1 parent 926e362 commit f3f2f16

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

config/runtime.exs

+10
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ if config_env() == :prod and self_hosted do
111111
_ -> false
112112
end
113113

114+
check_origin =
115+
case System.get_env("SERVER_CHECK_ORIGIN", "false") do
116+
"true" -> true
117+
"1" -> true
118+
"false" -> false
119+
"0" -> false
120+
other -> raise("Invalid SERVER_CHECK_ORIGIN: #{other}, must be true or false or 1 or 0")
121+
end
122+
114123
config :sequin, Sequin.Posthog,
115124
req_opts: [base_url: "https://us.i.posthog.com"],
116125
api_key: "phc_i9k28nZwjjJG9DzUK0gDGASxXtGNusdI1zdaz9cuA7h",
@@ -128,6 +137,7 @@ if config_env() == :prod and self_hosted do
128137
# host and port of the application
129138
# TODO: Default to 443
130139
url: [host: server_host, port: server_port, scheme: "https"],
140+
check_origin: check_origin,
131141
http: [
132142
ip: {0, 0, 0, 0, 0, 0, 0, 0},
133143
port: server_port

0 commit comments

Comments
 (0)