mirror of
https://github.com/plausible/analytics.git
synced 2024-08-16 13:20:59 +03:00
Upgrade otp (#1313)
* update tool versions to latest * Upgrades erlang and elixir, format project Co-authored-by: happysalada <raphael@megzari.com>
This commit is contained in:
parent
3f8af9a13b
commit
c68b88c24b
@ -1,4 +1,4 @@
|
||||
elixir 1.11.3-otp-23
|
||||
erlang 23.2.1
|
||||
nodejs 15.3.0
|
||||
python 3.9.4
|
||||
elixir 1.12.2-otp-24
|
||||
erlang 24.0.3
|
||||
nodejs 16.3.0
|
||||
python 3.9.4
|
||||
|
@ -2,7 +2,7 @@
|
||||
# platform specific, it makes sense to build it in the docker
|
||||
|
||||
#### Builder
|
||||
FROM hexpm/elixir:1.11.3-erlang-23.2.1-alpine-3.12.1 as buildcontainer
|
||||
FROM hexpm/elixir:1.12.2-erlang-24.0-alpine-3.13.3 as buildcontainer
|
||||
|
||||
# preparation
|
||||
ARG APP_VER=0.0.1
|
||||
@ -49,7 +49,7 @@ COPY rel rel
|
||||
RUN mix release plausible
|
||||
|
||||
# Main Docker Image
|
||||
FROM alpine:3.12.1
|
||||
FROM alpine:3.13.3
|
||||
LABEL maintainer="tckb <tckb@tgrthi.me>"
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
BASE_URL=http://localhost:8000
|
||||
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/plausible_dev
|
||||
CLICKHOUSE_DATABASE_URL=http://127.0.0.1:8123/plausible_dev
|
||||
CLICKHOUSE_DATABASE_URL=http://127.0.0.1:8123/plausible_events_db
|
||||
SECRET_KEY_BASE=/njrhntbycvastyvtk1zycwfm981vpo/0xrvwjjvemdakc/vsvbrevlwsc6u8rcg
|
||||
ENVIRONMENT=dev
|
||||
MAILER_ADAPTER=Bamboo.LocalAdapter
|
||||
|
@ -19,9 +19,7 @@ end
|
||||
base_url = URI.parse(base_url)
|
||||
|
||||
if base_url.scheme not in ["http", "https"] do
|
||||
raise "BASE_URL must start with `http` or `https`. Currently configured as `#{
|
||||
System.get_env("BASE_URL")
|
||||
}`"
|
||||
raise "BASE_URL must start with `http` or `https`. Currently configured as `#{System.get_env("BASE_URL")}`"
|
||||
end
|
||||
|
||||
secret_key_base = get_var_from_path_or_env(config_dir, "SECRET_KEY_BASE", nil)
|
||||
|
@ -6,9 +6,7 @@ defmodule Plausible.Google.Api do
|
||||
if Application.get_env(:plausible, :environment) == "test" do
|
||||
""
|
||||
else
|
||||
"https://accounts.google.com/o/oauth2/v2/auth?client_id=#{client_id()}&redirect_uri=#{
|
||||
redirect_uri()
|
||||
}&prompt=consent&response_type=code&access_type=offline&scope=#{@scope}&state=#{site_id}"
|
||||
"https://accounts.google.com/o/oauth2/v2/auth?client_id=#{client_id()}&redirect_uri=#{redirect_uri()}&prompt=consent&response_type=code&access_type=offline&scope=#{@scope}&state=#{site_id}"
|
||||
end
|
||||
end
|
||||
|
||||
@ -16,9 +14,7 @@ defmodule Plausible.Google.Api do
|
||||
res =
|
||||
HTTPoison.post!(
|
||||
"https://www.googleapis.com/oauth2/v4/token",
|
||||
"client_id=#{client_id()}&client_secret=#{client_secret()}&code=#{code}&grant_type=authorization_code&redirect_uri=#{
|
||||
redirect_uri()
|
||||
}",
|
||||
"client_id=#{client_id()}&client_secret=#{client_secret()}&code=#{code}&grant_type=authorization_code&redirect_uri=#{redirect_uri()}",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
)
|
||||
|
||||
@ -129,9 +125,7 @@ defmodule Plausible.Google.Api do
|
||||
res =
|
||||
HTTPoison.post!(
|
||||
"https://www.googleapis.com/oauth2/v4/token",
|
||||
"client_id=#{client_id()}&client_secret=#{client_secret()}&refresh_token=#{
|
||||
auth.refresh_token
|
||||
}&grant_type=refresh_token&redirect_uri=#{redirect_uri()}",
|
||||
"client_id=#{client_id()}&client_secret=#{client_secret()}&refresh_token=#{auth.refresh_token}&grant_type=refresh_token&redirect_uri=#{redirect_uri()}",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
)
|
||||
|
||||
|
@ -114,9 +114,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController do
|
||||
|
||||
event_only_filter && invalid_metric in @session_metrics ->
|
||||
{:error,
|
||||
"Session metric `#{invalid_metric}` cannot be queried when using a filter on `#{
|
||||
event_only_filter
|
||||
}`."}
|
||||
"Session metric `#{invalid_metric}` cannot be queried when using a filter on `#{event_only_filter}`."}
|
||||
|
||||
true ->
|
||||
{:error,
|
||||
@ -212,9 +210,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController do
|
||||
:ok
|
||||
else
|
||||
{:error,
|
||||
"Error parsing `interval` parameter: invalid interval `#{interval}`. Valid intervals are #{
|
||||
@valid_intervals_str
|
||||
}"}
|
||||
"Error parsing `interval` parameter: invalid interval `#{interval}`. Valid intervals are #{@valid_intervals_str}"}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -59,9 +59,7 @@ defmodule PlausibleWeb.Site.MembershipController do
|
||||
conn
|
||||
|> put_flash(
|
||||
:success,
|
||||
"#{email} has been invited to #{site_domain} as #{
|
||||
PlausibleWeb.SiteView.with_indefinite_article(role)
|
||||
}"
|
||||
"#{email} has been invited to #{site_domain} as #{PlausibleWeb.SiteView.with_indefinite_article(role)}"
|
||||
)
|
||||
|> redirect(to: Routes.site_path(conn, :settings_people, site.domain))
|
||||
end
|
||||
|
@ -60,9 +60,7 @@ defmodule PlausibleWeb.StatsController do
|
||||
|> Enum.join()
|
||||
|
||||
filename =
|
||||
"Plausible export #{domain} #{Timex.format!(query.date_range.first, "{ISOdate} ")} to #{
|
||||
Timex.format!(query.date_range.last, "{ISOdate} ")
|
||||
}.csv"
|
||||
"Plausible export #{domain} #{Timex.format!(query.date_range.first, "{ISOdate} ")} to #{Timex.format!(query.date_range.last, "{ISOdate} ")}.csv"
|
||||
|
||||
conn
|
||||
|> put_resp_content_type("text/csv")
|
||||
|
@ -200,9 +200,7 @@ defmodule PlausibleWeb.Email do
|
||||
|> to(invitation.inviter.email)
|
||||
|> tag("invitation-accepted")
|
||||
|> subject(
|
||||
"[Plausible Analytics] #{invitation.email} accepted your invitation to #{
|
||||
invitation.site.domain
|
||||
}"
|
||||
"[Plausible Analytics] #{invitation.email} accepted your invitation to #{invitation.site.domain}"
|
||||
)
|
||||
|> render("invitation_accepted.html",
|
||||
invitation: invitation
|
||||
@ -214,9 +212,7 @@ defmodule PlausibleWeb.Email do
|
||||
|> to(invitation.inviter.email)
|
||||
|> tag("invitation-rejected")
|
||||
|> subject(
|
||||
"[Plausible Analytics] #{invitation.email} rejected your invitation to #{
|
||||
invitation.site.domain
|
||||
}"
|
||||
"[Plausible Analytics] #{invitation.email} rejected your invitation to #{invitation.site.domain}"
|
||||
)
|
||||
|> render("invitation_rejected.html",
|
||||
invitation: invitation
|
||||
@ -228,9 +224,7 @@ defmodule PlausibleWeb.Email do
|
||||
|> to(invitation.inviter.email)
|
||||
|> tag("ownership-transfer-accepted")
|
||||
|> subject(
|
||||
"[Plausible Analytics] #{invitation.email} accepted the ownership transfer of #{
|
||||
invitation.site.domain
|
||||
}"
|
||||
"[Plausible Analytics] #{invitation.email} accepted the ownership transfer of #{invitation.site.domain}"
|
||||
)
|
||||
|> render("ownership_transfer_accepted.html",
|
||||
invitation: invitation
|
||||
@ -242,9 +236,7 @@ defmodule PlausibleWeb.Email do
|
||||
|> to(invitation.inviter.email)
|
||||
|> tag("ownership-transfer-rejected")
|
||||
|> subject(
|
||||
"[Plausible Analytics] #{invitation.email} rejected the ownership transfer of #{
|
||||
invitation.site.domain
|
||||
}"
|
||||
"[Plausible Analytics] #{invitation.email} rejected the ownership transfer of #{invitation.site.domain}"
|
||||
)
|
||||
|> render("ownership_transfer_rejected.html",
|
||||
invitation: invitation
|
||||
|
@ -81,9 +81,7 @@ defmodule PlausibleWeb.Api.StatsController.SuggestionsTest do
|
||||
conn =
|
||||
get(
|
||||
conn,
|
||||
"/api/stats/#{site.domain}/suggestions/browser_version?period=month&date=2019-01-01&filters=#{
|
||||
filters
|
||||
}"
|
||||
"/api/stats/#{site.domain}/suggestions/browser_version?period=month&date=2019-01-01&filters=#{filters}"
|
||||
)
|
||||
|
||||
assert json_response(conn, 200) == ["78.0"]
|
||||
@ -101,9 +99,7 @@ defmodule PlausibleWeb.Api.StatsController.SuggestionsTest do
|
||||
conn =
|
||||
get(
|
||||
conn,
|
||||
"/api/stats/#{site.domain}/suggestions/os_version?period=month&date=2019-01-01&filters=#{
|
||||
filters
|
||||
}"
|
||||
"/api/stats/#{site.domain}/suggestions/os_version?period=month&date=2019-01-01&filters=#{filters}"
|
||||
)
|
||||
|
||||
assert json_response(conn, 200) == ["10.15"]
|
||||
@ -115,9 +111,7 @@ defmodule PlausibleWeb.Api.StatsController.SuggestionsTest do
|
||||
conn =
|
||||
get(
|
||||
conn,
|
||||
"/api/stats/#{site.domain}/suggestions/os_version?period=month&date=2019-01-01&filters=#{
|
||||
filters
|
||||
}&q=11"
|
||||
"/api/stats/#{site.domain}/suggestions/os_version?period=month&date=2019-01-01&filters=#{filters}&q=11"
|
||||
)
|
||||
|
||||
assert json_response(conn, 200) == []
|
||||
|
Loading…
Reference in New Issue
Block a user