Skip to content

Commit

Permalink
Merge pull request #24 from Recruitee/bump-dependencies
Browse files Browse the repository at this point in the history
Bump language version and dependencies
  • Loading branch information
rdk08 authored Oct 25, 2023
2 parents d6c8d89 + 03486b1 commit cf3db2e
Show file tree
Hide file tree
Showing 37 changed files with 540 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
elixir 1.12.2-otp-24
erlang 24.0.3
elixir 1.14.4-otp-25
erlang 25.2.2
nodejs 16.3.0
python 3.9.4
119 changes: 63 additions & 56 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -284,66 +284,73 @@ config :plausible, PlausibleWeb.Firewall,
|> String.split(",")
|> Enum.map(&String.trim/1)

if config_env() == :prod && !disable_cron do
base_cron = [
# Daily at midnight
{"0 0 * * *", Plausible.Workers.RotateSalts},
#  hourly
{"0 * * * *", Plausible.Workers.ScheduleEmailReports},
# hourly
{"0 * * * *", Plausible.Workers.SendSiteSetupEmails},
# Daily at midday
{"0 12 * * *", Plausible.Workers.SendCheckStatsEmails},
# Every 15 minutes
{"*/15 * * * *", Plausible.Workers.SpikeNotifier},
# Every day at midnight
{"0 0 * * *", Plausible.Workers.CleanEmailVerificationCodes},
# Every day at 1am
{"0 1 * * *", Plausible.Workers.CleanInvitations}
]
cond do
config_env() == :prod && !disable_cron ->
base_cron = [
# Daily at midnight
{"0 0 * * *", Plausible.Workers.RotateSalts},
#  hourly
{"0 * * * *", Plausible.Workers.ScheduleEmailReports},
# hourly
{"0 * * * *", Plausible.Workers.SendSiteSetupEmails},
# Daily at midday
{"0 12 * * *", Plausible.Workers.SendCheckStatsEmails},
# Every 15 minutes
{"*/15 * * * *", Plausible.Workers.SpikeNotifier},
# Every day at midnight
{"0 0 * * *", Plausible.Workers.CleanEmailVerificationCodes},
# Every day at 1am
{"0 1 * * *", Plausible.Workers.CleanInvitations}
]

extra_cron = [
# Daily at midday
{"0 12 * * *", Plausible.Workers.SendTrialNotifications},
# Daily at 14
{"0 14 * * *", Plausible.Workers.CheckUsage},
# Daily at 15
{"0 15 * * *", Plausible.Workers.NotifyAnnualRenewal},
# Every midnight
{"0 0 * * *", Plausible.Workers.LockSites}
]
extra_cron = [
# Daily at midday
{"0 12 * * *", Plausible.Workers.SendTrialNotifications},
# Daily at 14
{"0 14 * * *", Plausible.Workers.CheckUsage},
# Daily at 15
{"0 15 * * *", Plausible.Workers.NotifyAnnualRenewal},
# Every midnight
{"0 0 * * *", Plausible.Workers.LockSites}
]

base_queues = [
rotate_salts: 1,
schedule_email_reports: 1,
send_email_reports: 1,
spike_notifications: 1,
check_stats_emails: 1,
site_setup_emails: 1,
clean_email_verification_codes: 1,
clean_invitations: 1,
google_analytics_imports: 1
]
base_queues = [
rotate_salts: 1,
schedule_email_reports: 1,
send_email_reports: 1,
spike_notifications: 1,
check_stats_emails: 1,
site_setup_emails: 1,
clean_email_verification_codes: 1,
clean_invitations: 1,
google_analytics_imports: 1
]

extra_queues = [
provision_ssl_certificates: 1,
trial_notification_emails: 1,
check_usage: 1,
notify_annual_renewal: 1,
lock_sites: 1
]
extra_queues = [
provision_ssl_certificates: 1,
trial_notification_emails: 1,
check_usage: 1,
notify_annual_renewal: 1,
lock_sites: 1
]

# Keep 30 days history
config :plausible, Oban,
repo: Plausible.Repo,
plugins: [{Oban.Plugins.Pruner, max_age: 2_592_000}],
queues: if(is_selfhost, do: base_queues, else: base_queues ++ extra_queues),
crontab: if(is_selfhost, do: base_cron, else: base_cron ++ extra_cron)
else
config :plausible, Oban,
repo: Plausible.Repo,
queues: [google_analytics_imports: 1],
plugins: false
# Keep 30 days history
config :plausible, Oban,
repo: Plausible.Repo,
plugins: [{Oban.Plugins.Pruner, max_age: 2_592_000}],
queues: if(is_selfhost, do: base_queues, else: base_queues ++ extra_queues),
crontab: if(is_selfhost, do: base_cron, else: base_cron ++ extra_cron)

config_env() == :test ->
config :plausible, Oban,
repo: Plausible.Repo,
testing: :inline

true ->
config :plausible, Oban,
repo: Plausible.Repo,
queues: [google_analytics_imports: 1],
plugins: []
end

config :plausible, :hcaptcha,
Expand Down
20 changes: 11 additions & 9 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Plausible.MixProject do
[
app: :plausible,
version: System.get_env("APP_VERSION", "0.0.1"),
elixir: "~> 1.11",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -55,21 +55,23 @@ defmodule Plausible.MixProject do
{:bcrypt_elixir, "~> 2.0"},
{:combination, "~> 0.0.3"},
{:cors_plug, "~> 2.0"},
{:ecto_sql, "~> 3.0"},
{:ecto_sql, "~> 3.7.0"},
{:elixir_uuid, "~> 1.2", only: :test},
{:jason, "~> 1.3", override: true},
{:phoenix, "~> 1.5.0"},
{:phoenix, "~> 1.6.16"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 2.12"},
{:phoenix_html, "~> 3.3", override: true},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_pubsub, "~> 2.0"},
{:plug_cowboy, "~> 2.3"},
{:plug, "~> 1.14", override: true},
{:plug_cowboy, "~> 2.6"},
{:postgrex, ">= 0.0.0"},
{:ref_inspector, "~> 1.3"},
{:timex, "~> 3.6"},
{:timex, "~> 3.7"},
{:gettext, "~> 0.20.0", override: true},
{:ua_inspector, "~> 2.2"},
{:bamboo, "~> 2.2"},
{:hackney, "~> 1.8"},
{:hackney, "~> 1.18"},
{:bamboo_phoenix, "~> 1.0.0"},
{:bamboo_postmark, git: "https://github.com/pablo-co/bamboo_postmark.git", tag: "master"},
{:bamboo_smtp, "~> 4.1"},
Expand All @@ -83,14 +85,14 @@ defmodule Plausible.MixProject do
{:oauther, "~> 1.3"},
{:nanoid, "~> 2.0.2"},
{:siphash, "~> 3.2"},
{:oban, "~> 2.0"},
{:oban, "~> 2.12.0"},
{:geolix, "~> 1.0"},
{:clickhouse_ecto, git: "https://github.com/Recruitee/clickhouse_ecto.git", ref: "ed45cd0"},
{:location, git: "https://github.com/plausible/location.git"},
{:geolix_adapter_mmdb2, "~> 0.5.0"},
{:cachex, "~> 3.4"},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:kaffy, "~> 0.9.0"},
{:envy, "~> 1.1.1"},
{:phoenix_pagination, "~> 0.7.0"},
Expand Down
Loading

0 comments on commit cf3db2e

Please sign in to comment.