From da93f2aa6e46f63d44dcae10f972c8aa920941c5 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Fri, 27 May 2022 10:52:58 +0300 Subject: [PATCH] Remove dead code --- .github/workflows/docker.yml | 5 ---- config/runtime.exs | 3 --- lib/plausible/slack.ex | 25 ------------------- .../controllers/site_controller.ex | 2 -- 4 files changed, 35 deletions(-) delete mode 100644 lib/plausible/slack.ex diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c013256d1..7d556ba8b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,11 +18,6 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - - name: WAT - shell: bash - run: ls $GITHUB_WORKSPACE/priv - id: ls_github_workspace - - name: Prepeare release shell: bash run: ./rel/prepare_release.sh ${{ steps.extract_branch.outputs.branch }} diff --git a/config/runtime.exs b/config/runtime.exs index c7afed65a..e963cd21b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -103,7 +103,6 @@ paddle_auth_code = get_var_from_path_or_env(config_dir, "PADDLE_VENDOR_AUTH_CODE paddle_vendor_id = get_var_from_path_or_env(config_dir, "PADDLE_VENDOR_ID") google_cid = get_var_from_path_or_env(config_dir, "GOOGLE_CLIENT_ID") google_secret = get_var_from_path_or_env(config_dir, "GOOGLE_CLIENT_SECRET") -slack_hook_url = get_var_from_path_or_env(config_dir, "SLACK_WEBHOOK") postmark_api_key = get_var_from_path_or_env(config_dir, "POSTMARK_API_KEY") cron_enabled = @@ -236,8 +235,6 @@ config :plausible, :google, client_id: google_cid, client_secret: google_secret -config :plausible, :slack, webhook: slack_hook_url - config :plausible, Plausible.ClickhouseRepo, loggers: [Ecto.LogEntry], queue_target: 500, diff --git a/lib/plausible/slack.ex b/lib/plausible/slack.ex deleted file mode 100644 index 5c648aa3d..000000000 --- a/lib/plausible/slack.ex +++ /dev/null @@ -1,25 +0,0 @@ -defmodule Plausible.Slack do - require Logger - - def notify(text) do - Task.start(fn -> - if env() == "prod" && !self_hosted() do - HTTPoison.post!(webhook_url(), Jason.encode!(%{text: text})) - else - Logger.debug(text) - end - end) - end - - defp webhook_url() do - Keyword.fetch!(Application.get_env(:plausible, :slack), :webhook) - end - - defp env() do - Application.get_env(:plausible, :environment) - end - - defp self_hosted() do - Application.get_env(:plausible, :is_selfhost) - end -end diff --git a/lib/plausible_web/controllers/site_controller.ex b/lib/plausible_web/controllers/site_controller.ex index b3ed90dd3..188d71c7a 100644 --- a/lib/plausible_web/controllers/site_controller.ex +++ b/lib/plausible_web/controllers/site_controller.ex @@ -77,8 +77,6 @@ defmodule PlausibleWeb.SiteController do case Sites.create(user, site_params) do {:ok, %{site: site}} -> - Plausible.Slack.notify("#{user.name} created #{site.domain} [email=#{user.email}]") - if is_first_site do PlausibleWeb.Email.welcome_email(user) |> Plausible.Mailer.send_email()