Skip to content

Commit

Permalink
Merge branch 'release/0.12.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Jan 25, 2024
2 parents ba10b55 + 99537b6 commit a95009f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lib/uplink/clients/caddy/config/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ defmodule Uplink.Clients.Caddy.Config.Builder do
%{wrapper: "tls"}
],
routes:
Enum.flat_map(installs, &build_route/1)
installs
|> Enum.flat_map(&build_route/1)
|> Enum.uniq_by(fn route ->
path =
Enum.map(route.match, fn m -> m.path end)
Expand All @@ -96,6 +97,11 @@ defmodule Uplink.Clients.Caddy.Config.Builder do
|> Enum.join(":")

"#{route.group}_#{host}_#{path}"
end)
|> Enum.sort_by(fn route ->
paths = Enum.flat_map(route.match, fn m -> m.path end)

if Enum.any?(paths, &(&1 == "*")), do: 1, else: 0
end),
logs: %{
default_logger_name: "default"
Expand Down Expand Up @@ -268,11 +274,6 @@ defmodule Uplink.Clients.Caddy.Config.Builder do
sub_routes_and_proxies = Enum.concat(sub_routes, proxy_routes)

[main_route | sub_routes_and_proxies]
|> Enum.sort_by(fn route ->
paths = Enum.flat_map(route.match, fn m -> m.path end)

if Enum.any?(paths, &(&1 == "*")), do: 1, else: 0
end)
end

defp find_valid_instances(instances, install_id) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Uplink.MixProject do
def project do
[
app: :uplink,
version: "0.12.4",
version: "0.12.5",
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit a95009f

Please sign in to comment.