This commit is contained in:
2024-06-02 13:31:19 +02:00
parent 9d547bcdf2
commit 443081e086
67 changed files with 623 additions and 4282 deletions

View File

@ -8,7 +8,8 @@
import Config
config :something_erlang,
ecto_repos: [SomethingErlang.Repo]
ecto_repos: [SomethingErlang.Repo],
generators: [timestamp_type: :utc_datetime]
# Configures the endpoint
config :something_erlang, SomethingErlangWeb.Endpoint,
@ -19,7 +20,7 @@ config :something_erlang, SomethingErlangWeb.Endpoint,
layout: false
],
pubsub_server: SomethingErlang.PubSub,
live_view: [signing_salt: "00UFDP60"]
live_view: [signing_salt: "FIHDRhv0"]
# Configures the mailer
#
@ -32,8 +33,8 @@ config :something_erlang, SomethingErlang.Mailer, adapter: Swoosh.Adapters.Local
# Configure esbuild (the version is required)
config :esbuild,
version: "0.14.41",
default: [
version: "0.17.11",
something_erlang: [
args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
@ -42,8 +43,8 @@ config :esbuild,
# Configure tailwind (the version is required)
config :tailwind,
version: "3.2.4",
default: [
version: "3.4.0",
something_erlang: [
args: ~w(
--config=tailwind.config.js
--input=css/app.css

View File

@ -14,8 +14,8 @@ config :something_erlang, SomethingErlang.Repo,
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with esbuild to bundle .js and .css sources.
# watchers to your application. For example, we can use it
# to bundle .js and .css sources.
config :something_erlang, SomethingErlangWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
@ -23,10 +23,10 @@ config :something_erlang, SomethingErlangWeb.Endpoint,
check_origin: false,
code_reloader: true,
debug_errors: true,
secret_key_base: "uUSGthtWxUO9OOLlTaRq78iLoKgqFxonmAsZ5wmuLnnsKc1l3MVJkPDUNGu06+4Q",
secret_key_base: "s9ehTIW4uAHpl9HKL8cbxFTaH0o5qWqEiWsz3+xY/05YP5kw1uZppf459GFBTAKW",
watchers: [
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
esbuild: {Esbuild, :install_and_run, [:something_erlang, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_run, [:something_erlang, ~w(--watch)]}
]
# ## SSL Support
@ -56,7 +56,7 @@ config :something_erlang, SomethingErlangWeb.Endpoint,
config :something_erlang, SomethingErlangWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/something_erlang_web/(controllers|live|components)/.*(ex|heex)$"
]
@ -75,5 +75,11 @@ config :phoenix, :stacktrace_depth, 20
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime
config :phoenix_live_view,
# Include HEEx debug annotations as HTML comments in rendered markup
debug_heex_annotations: true,
# Enable helpful, but potentially expensive runtime checks
enable_expensive_runtime_checks: true
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false

View File

@ -1,19 +1,19 @@
import Config
# For production, don't forget to configure the url host
# to something meaningful, Phoenix uses this information
# when generating URLs.
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix phx.digest` task,
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :something_erlang, SomethingErlangWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
config :something_erlang, SomethingErlangWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json"
# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: SomethingErlang.Finch
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
# Do not print debug messages in production
config :logger, level: :info

View File

@ -28,7 +28,7 @@ if config_env() == :prod do
For example: ecto://USER:PASS@HOST/DATABASE
"""
maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
config :something_erlang, SomethingErlang.Repo,
# ssl: true,
@ -51,12 +51,14 @@ if config_env() == :prod do
host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")
config :something_erlang, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
config :something_erlang, SomethingErlangWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
http: [
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
# See the documentation on https://hexdocs.pm/bandit/Bandit.html#t:options/0
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: port
@ -87,8 +89,8 @@ if config_env() == :prod do
# "priv/ssl/server.key". For all supported SSL configuration
# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
#
# We also recommend setting `force_ssl` in your endpoint, ensuring
# no data is ever sent via http, always redirecting to https:
# We also recommend setting `force_ssl` in your config/prod.exs,
# ensuring no data is ever sent via http, always redirecting to https:
#
# config :something_erlang, SomethingErlangWeb.Endpoint,
# force_ssl: [hsts: true]

View File

@ -1,8 +1,5 @@
import Config
# Only in tests, remove the complexity from the password hashing algorithm
config :bcrypt_elixir, :log_rounds, 1
# Configure your database
#
# The MIX_TEST_PARTITION environment variable can be used
@ -14,13 +11,13 @@ config :something_erlang, SomethingErlang.Repo,
hostname: "localhost",
database: "something_erlang_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10
pool_size: System.schedulers_online() * 2
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :something_erlang, SomethingErlangWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "hnSErwuszrqB3jBjmZVIAgb8D7m4nZPqti/6WDaL1pJi6l3/kQZY0Z4H4JAPadgF",
secret_key_base: "oeiuquQvGK/axIhwOn3+pqT6qnLh54bCQLlD10REdl/vYW9syU41aHafc9BEXP0f",
server: false
# In test we don't send emails.
@ -34,3 +31,7 @@ config :logger, level: :warning
# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime
config :phoenix_live_view,
# Enable helpful, but potentially expensive runtime checks
enable_expensive_runtime_checks: true