Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FROM debian:${DEBIAN_VERSION} AS app

RUN apt update && \
apt upgrade -y && \
apt install --no-install-recommends -y bash openssl && \
apt install --no-install-recommends -y bash openssl ca-certificates && \
apt clean -y && rm -rf /var/lib/apt/lists/*

RUN mkdir /app
Expand Down
3 changes: 1 addition & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ if config_env() == :prod do
queue_id: System.fetch_env!("PREVIEW_QUEUE_ID"),
queue_concurrency: String.to_integer(System.fetch_env!("PREVIEW_QUEUE_CONCURRENCY")),
fastly_key: System.fetch_env!("PREVIEW_FASTLY_KEY"),
fastly_repo: System.fetch_env!("PREVIEW_FASTLY_REPO"),
plausible_url: "https://stats.hex.pm/js/plausible.js"
fastly_repo: System.fetch_env!("PREVIEW_FASTLY_REPO")

config :preview, :repo_bucket,
implementation: Preview.Storage.S3,
Expand Down
2 changes: 1 addition & 1 deletion lib/preview_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule PreviewWeb do

def controller do
quote do
use Phoenix.Controller, namespace: PreviewWeb
use Phoenix.Controller, formats: [:html, :json]

import Plug.Conn
import PreviewWeb.Gettext
Expand Down
1 change: 1 addition & 0 deletions lib/preview_web/controllers/sitemap_controller.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
defmodule PreviewWeb.SitemapController do
use PreviewWeb, :controller
plug :put_format, "xml"

def index(conn, _params) do
bucket = Application.get_env(:preview, :preview_bucket)
Expand Down
8 changes: 5 additions & 3 deletions lib/preview_web/templates/layout/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
>
</script>

<%= if plausible_url = Application.get_env(:preview, :plausible_url) do %>
<% host = Application.fetch_env!(:preview, :host) %>
<script async defer data-domain={host} src={plausible_url}>
<%= if host = Application.get_env(:preview, :host) do %>
<script async defer src={"https://s.#{host}/js/script.js"}>
</script>
<script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};plausible.init({endpoint:"https://s.<%= host %>/api/event"})
</script>
<% end %>
</head>
Expand Down
Loading