Compare commits

..

12 Commits

Author SHA1 Message Date
CI
9d8bf1529a chore: release version v1.0.11 2024-09-20 09:55:21 +00:00
Dmitry Popov
a514825eaf Merge branches 'main' and 'main' of github.com:wanderer-industries/wanderer 2024-09-20 13:54:54 +04:00
Dmitry Popov
8abcacb517 chore: release version v1.0.9 2024-09-20 13:54:46 +04:00
CI
a3fc55e63d chore: release version v1.0.10 2024-09-19 20:25:53 +00:00
Dmitry Popov
a4c1d5bf98 Merge branch 'main' of github.com:wanderer-industries/wanderer 2024-09-20 00:25:21 +04:00
Dmitry Popov
b16bc615fa fix(signatures): Fix update signatures error if no character tracked on map 2024-09-20 00:25:18 +04:00
CI
10ec8d6b97 chore: release version v1.0.9 2024-09-19 19:41:29 +00:00
Dmitry Popov
b04f0c9183 Merge branch 'main' of github.com:wanderer-industries/wanderer 2024-09-19 23:40:55 +04:00
Dmitry Popov
45e9ebb0d4 fix(core): Fix system add error if it's already added on map 2024-09-19 23:40:51 +04:00
CI
ac3e68a49f chore: release version v1.0.8 2024-09-19 13:21:59 +00:00
Dmitry Popov
b35ef1151a Merge branch 'main' of github.com:wanderer-industries/wanderer 2024-09-19 17:14:12 +04:00
Dmitry Popov
ebd01bebd4 fix(docker): Fix DB connection in docker-compose internal network 2024-09-19 17:14:08 +04:00
6 changed files with 123 additions and 75 deletions

View File

@@ -2,6 +2,38 @@
<!-- changelog -->
## [v1.0.11](https://github.com/wanderer-industries/wanderer/compare/v1.0.10...v1.0.11) (2024-09-20)
## [v1.0.10](https://github.com/wanderer-industries/wanderer/compare/v1.0.9...v1.0.10) (2024-09-19)
### Bug Fixes:
* signatures: Fix update signatures error if no character tracked on map
## [v1.0.9](https://github.com/wanderer-industries/wanderer/compare/v1.0.8...v1.0.9) (2024-09-19)
### Bug Fixes:
* core: Fix system add error if it's already added on map
## [v1.0.8](https://github.com/wanderer-industries/wanderer/compare/v1.0.7...v1.0.8) (2024-09-19)
### Bug Fixes:
* docker: Fix DB connection in docker-compose internal network
## [v1.0.7](https://github.com/wanderer-industries/wanderer/compare/v1.0.6...v1.0.7) (2024-09-19)

View File

@@ -1,22 +1,6 @@
import Config
import WandererApp.ConfigHelpers
# config/runtime.exs is executed for all environments, including
# during releases. It is executed after compilation and before the
# system starts, so it is typically used to load production configuration
# and secrets from environment variables or elsewhere. Do not define
# any compile-time configuration in here, as it won't be applied.
# The block below contains prod specific runtime configuration.
# ## Using releases
#
# If you use `mix release`, you need to explicitly enable the server
# by passing the PHX_SERVER=true when you start it:
#
# PHX_SERVER=true bin/wanderer_app start
#
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
# script that automatically sets the env var above.
if System.get_env("PHX_SERVER") do
config :wanderer_app, WandererAppWeb.Endpoint, server: true
end
@@ -69,6 +53,15 @@ map_subscriptions_enabled =
|> get_var_from_path_or_env("WANDERER_MAP_SUBSCRIPTIONS_ENABLED", "false")
|> String.to_existing_atom()
map_subscription_characters_limit =
config_dir
|> get_int_from_path_or_env("WANDERER_MAP_SUBSCRIPTION_CHARACTERS_LIMIT", 100)
map_subscription_hubs_limit =
config_dir
|> get_int_from_path_or_env("WANDERER_MAP_SUBSCRIPTION_HUBS_LIMIT", 10)
wallet_tracking_enabled =
config_dir
|> get_var_from_path_or_env("WANDERER_WALLET_TRACKING_ENABLED", "false")
@@ -93,7 +86,7 @@ config :wanderer_app,
wallet_tracking_enabled: wallet_tracking_enabled,
subscription_settings: %{
plans: [
%{id: "alpha", characters_limit: 100, hubs_limit: 10, base_price: 0, monthly_discount: 0},
%{id: "alpha", characters_limit: map_subscription_characters_limit, hubs_limit: map_subscription_hubs_limit, base_price: 0, monthly_discount: 0},
%{
id: "omega",
characters_limit: 300,
@@ -178,10 +171,23 @@ if config_env() == :prod do
For example: ecto://USER:PASS@HOST/DATABASE
"""
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
maybe_ipv6 =
config_dir
|> get_var_from_path_or_env("ECTO_IPV6", "false")
|> String.to_existing_atom()
|> case do
true -> [:inet6]
_ -> []
end
db_ssl_enabled =
config_dir
|> get_var_from_path_or_env("DATABASE_SSL_ENABLED", "false")
|> String.to_existing_atom()
config :wanderer_app, WandererApp.Repo,
url: database_url,
ssl: db_ssl_enabled,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
socket_options: maybe_ipv6

View File

@@ -1657,32 +1657,35 @@ defmodule WandererApp.Map.Server.Impl do
{:ok, solar_system_info} =
WandererApp.Api.MapSolarSystem.by_solar_system_id(location.solar_system_id)
{:ok, new_system} =
WandererApp.MapSystemRepo.create(%{
map_id: map_id,
solar_system_id: location.solar_system_id,
name: solar_system_info.solar_system_name,
position_x: position.x,
position_y: position.y
})
map_id: map_id,
solar_system_id: location.solar_system_id,
name: solar_system_info.solar_system_name,
position_x: position.x,
position_y: position.y
})
|> case do
{:ok, new_system} ->
@ddrt.insert(
{new_system.solar_system_id,
WandererApp.Map.PositionCalculator.get_system_bounding_rect(new_system)},
rtree_name
)
@ddrt.insert(
{new_system.solar_system_id,
WandererApp.Map.PositionCalculator.get_system_bounding_rect(new_system)},
rtree_name
)
WandererApp.Cache.put(
"map_#{map_id}:system_#{new_system.id}:last_activity",
DateTime.utc_now(),
ttl: @system_inactive_timeout
)
WandererApp.Cache.put(
"map_#{map_id}:system_#{new_system.id}:last_activity",
DateTime.utc_now(),
ttl: @system_inactive_timeout
)
broadcast!(map_id, :add_system, new_system)
WandererApp.Map.add_system(map_id, new_system)
broadcast!(map_id, :add_system, new_system)
WandererApp.Map.add_system(map_id, new_system)
_ ->
:ok
end
end
{:error, :already_exists} ->
{:error, _} ->
:ok
end
end

View File

@@ -724,47 +724,55 @@ defmodule WandererAppWeb.MapLive do
first_character_eve_id =
Map.get(socket.assigns, :user_characters, []) |> List.first()
added_signatures =
added_signatures
|> _parse_signatures(first_character_eve_id, system.id)
case not is_nil(first_character_eve_id) do
true ->
added_signatures =
added_signatures
|> _parse_signatures(first_character_eve_id, system.id)
updated_signatures =
updated_signatures
|> _parse_signatures(first_character_eve_id, system.id)
updated_signatures =
updated_signatures
|> _parse_signatures(first_character_eve_id, system.id)
updated_signatures_eve_ids =
updated_signatures
|> Enum.map(fn s -> s.eve_id end)
updated_signatures_eve_ids =
updated_signatures
|> Enum.map(fn s -> s.eve_id end)
removed_signatures_eve_ids =
removed_signatures
|> _parse_signatures(first_character_eve_id, system.id)
|> Enum.map(fn s -> s.eve_id end)
removed_signatures_eve_ids =
removed_signatures
|> _parse_signatures(first_character_eve_id, system.id)
|> Enum.map(fn s -> s.eve_id end)
WandererApp.Api.MapSystemSignature.by_system_id!(system.id)
|> Enum.filter(fn s -> s.eve_id in removed_signatures_eve_ids end)
|> Enum.each(fn s ->
s
|> Ash.destroy!()
end)
WandererApp.Api.MapSystemSignature.by_system_id!(system.id)
|> Enum.filter(fn s -> s.eve_id in removed_signatures_eve_ids end)
|> Enum.each(fn s ->
s
|> Ash.destroy!()
end)
WandererApp.Api.MapSystemSignature.by_system_id!(system.id)
|> Enum.filter(fn s -> s.eve_id in updated_signatures_eve_ids end)
|> Enum.each(fn s ->
updated = updated_signatures |> Enum.find(fn u -> u.eve_id == s.eve_id end)
WandererApp.Api.MapSystemSignature.by_system_id!(system.id)
|> Enum.filter(fn s -> s.eve_id in updated_signatures_eve_ids end)
|> Enum.each(fn s ->
updated = updated_signatures |> Enum.find(fn u -> u.eve_id == s.eve_id end)
if not is_nil(updated) do
s
|> WandererApp.Api.MapSystemSignature.update(updated)
end
end)
if not is_nil(updated) do
s
|> WandererApp.Api.MapSystemSignature.update(updated)
end
end)
added_signatures
|> Enum.map(fn s ->
s |> WandererApp.Api.MapSystemSignature.create!()
end)
added_signatures
|> Enum.map(fn s ->
s |> WandererApp.Api.MapSystemSignature.create!()
end)
{:reply, %{signatures: _get_system_signatures(system.id)}, socket}
{:reply, %{signatures: _get_system_signatures(system.id)}, socket}
_ ->
{:reply, %{signatures: []}, socket |> put_flash(
:error,
"You should enable tracking for at least one character to work with signatures."
)}
end
_ ->
{:noreply, socket}

View File

@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
use Mix.Project
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.0.7"
@version "1.0.11"
def project do
[
@@ -56,7 +56,7 @@ defmodule WandererApp.MixProject do
{:phoenix, "~> 1.7.12"},
{:phoenix_ecto, "~> 4.6"},
{:ecto_sql, "~> 3.10"},
{:postgrex, ">= 0.0.0"},
{:postgrex, "~> 0.19.1"},
{:phoenix_html, "~> 4.0"},
{:phoenix_live_reload, "~> 1.5.3", only: :dev},
{:phoenix_live_view, "~> 0.20.17"},

View File

@@ -1,6 +1,5 @@
#!/bin/sh
export ERL_AFLAGS="-proto_dist inet6_tcp"
export ECTO_IPV6="true"
export RELEASE_DISTRIBUTION="name"
export RELEASE_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}"