From 7ad16abcc3957b5be61b2d317648054ad22cdd71 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 8 Jan 2020 23:33:20 +0100 Subject: [PATCH 1/3] Moving log to error level --- conf/.env | 2 +- conf/prod.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env b/conf/.env index 592e830..3c79767 100644 --- a/conf/.env +++ b/conf/.env @@ -11,7 +11,7 @@ GRAPHQL_API_FULL_PATH="" # APP MIX_ENV=prod -MOBILIZON_LOGLEVEL="info" +MOBILIZON_LOGLEVEL="error" MOBILIZON_SECRET="__SECRET__" # Database diff --git a/conf/prod.exs b/conf/prod.exs index 59a2308..cdf0632 100644 --- a/conf/prod.exs +++ b/conf/prod.exs @@ -45,7 +45,7 @@ config :mobilizon, MobilizonWeb.Email.Mailer, no_mx_lookups: false # Do not print debug messages in production -#config :logger, level: System.get_env("MOBILIZON_LOGLEVEL") |> String.to_atom() || :info +config :logger, level: System.get_env("MOBILIZON_LOGLEVEL") |> String.to_atom() || :info config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Nominatim From 811b26797b73676f651043f73f438ce047a44960 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 11 Jan 2020 18:11:00 +0100 Subject: [PATCH 2/3] fix error during compilation ** (ArgumentError) argument error :erlang.binary_to_atom(nil, :utf8) :erlang.binary_to_atom(nil, :utf8) (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6 (stdlib) erl_eval.erl:273: :erl_eval.expr/5 (stdlib) erl_eval.erl:888: :erl_eval.expr_list/6 (stdlib) erl_eval.erl:240: :erl_eval.expr/5 (stdlib) erl_eval.erl:232: :erl_eval.expr/5 (stdlib) erl_eval.erl:888: :erl_eval.expr_list/6 (stdlib) erl_eval.erl:411: :erl_eval.expr/5 --- conf/prod.exs | 2 +- scripts/install | 3 +++ scripts/upgrade | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/prod.exs b/conf/prod.exs index cdf0632..59a2308 100644 --- a/conf/prod.exs +++ b/conf/prod.exs @@ -45,7 +45,7 @@ config :mobilizon, MobilizonWeb.Email.Mailer, no_mx_lookups: false # Do not print debug messages in production -config :logger, level: System.get_env("MOBILIZON_LOGLEVEL") |> String.to_atom() || :info +#config :logger, level: System.get_env("MOBILIZON_LOGLEVEL") |> String.to_atom() || :info config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Nominatim diff --git a/scripts/install b/scripts/install index bdaa61a..da578c1 100644 --- a/scripts/install +++ b/scripts/install @@ -188,6 +188,9 @@ pushd $final_path/$app sudo -u "$app" MIX_ENV=prod mix phx.digest popd +# Modify log level +ynh_replace_string --match_string="#config :logger" --replace_string="config :logger" --target_file="$final_path/$app/config/prod.exs" + curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz --output GeoLite2-City.tar.gz -s && tar zxf GeoLite2-City.tar.gz && mkdir -p /usr/share/GeoIP && mv GeoLite2-City_*/GeoLite2-City.mmdb $final_path/$app/priv/data/GeoLite2-City.mmdb #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 14e2222..3819524 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -189,12 +189,14 @@ pushd $final_path/$app/js popd pushd $final_path/$app + ynh_replace_string --match_string="config :logger" --replace_string="#config :logger" --target_file="$final_path/$app/config/prod.exs" source .env sudo -u "$app" MIX_ENV=prod mix local.hex --force sudo -u "$app" MIX_ENV=prod mix local.rebar --force sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix phx.digest + ynh_replace_string --match_string="#config :logger" --replace_string="config :logger" --target_file="$final_path/$app/config/prod.exs" popd #================================================= From 56fa91363eac1e7fa37538608a9b51f5c5b36444 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 11 Jan 2020 20:32:10 +0100 Subject: [PATCH 3/3] Update install --- scripts/install | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index da578c1..b0ed3d8 100644 --- a/scripts/install +++ b/scripts/install @@ -180,17 +180,16 @@ pushd $final_path/$app/js popd pushd $final_path/$app + ynh_replace_string --match_string="config :logger" --replace_string="#config :logger" --target_file="$final_path/$app/config/prod.exs" source .env sudo -u "$app" MIX_ENV=prod mix local.hex --force sudo -u "$app" MIX_ENV=prod mix local.rebar --force sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix phx.digest + ynh_replace_string --match_string="#config :logger" --replace_string="config :logger" --target_file="$final_path/$app/config/prod.exs" popd -# Modify log level -ynh_replace_string --match_string="#config :logger" --replace_string="config :logger" --target_file="$final_path/$app/config/prod.exs" - curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz --output GeoLite2-City.tar.gz -s && tar zxf GeoLite2-City.tar.gz && mkdir -p /usr/share/GeoIP && mv GeoLite2-City_*/GeoLite2-City.mmdb $final_path/$app/priv/data/GeoLite2-City.mmdb #=================================================