switch to sqlite, generate new project as 'quip'
This commit is contained in:
@@ -7,20 +7,20 @@
|
||||
# General application configuration
|
||||
import Config
|
||||
|
||||
config :phoenix_test,
|
||||
ecto_repos: [PhoenixTest.Repo],
|
||||
config :quip,
|
||||
ecto_repos: [Quip.Repo],
|
||||
generators: [timestamp_type: :utc_datetime]
|
||||
|
||||
# Configures the endpoint
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
config :quip, QuipWeb.Endpoint,
|
||||
url: [host: "localhost"],
|
||||
adapter: Bandit.PhoenixAdapter,
|
||||
render_errors: [
|
||||
formats: [html: PhoenixTestWeb.ErrorHTML, json: PhoenixTestWeb.ErrorJSON],
|
||||
formats: [html: QuipWeb.ErrorHTML, json: QuipWeb.ErrorJSON],
|
||||
layout: false
|
||||
],
|
||||
pubsub_server: PhoenixTest.PubSub,
|
||||
live_view: [signing_salt: "bXtM8iJy"]
|
||||
pubsub_server: Quip.PubSub,
|
||||
live_view: [signing_salt: "J4MlrElx"]
|
||||
|
||||
# Configures the mailer
|
||||
#
|
||||
@@ -29,12 +29,12 @@ config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
#
|
||||
# For production it's recommended to configure a different adapter
|
||||
# at the `config/runtime.exs`.
|
||||
config :phoenix_test, PhoenixTest.Mailer, adapter: Swoosh.Adapters.Local
|
||||
config :quip, Quip.Mailer, adapter: Swoosh.Adapters.Local
|
||||
|
||||
# Configure esbuild (the version is required)
|
||||
config :esbuild,
|
||||
version: "0.17.11",
|
||||
phoenix_test: [
|
||||
quip: [
|
||||
args:
|
||||
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
|
||||
cd: Path.expand("../assets", __DIR__),
|
||||
@@ -44,7 +44,7 @@ config :esbuild,
|
||||
# Configure tailwind (the version is required)
|
||||
config :tailwind,
|
||||
version: "3.4.3",
|
||||
phoenix_test: [
|
||||
quip: [
|
||||
args: ~w(
|
||||
--config=tailwind.config.js
|
||||
--input=css/app.css
|
||||
|
@@ -1,14 +1,11 @@
|
||||
import Config
|
||||
|
||||
# Configure your database
|
||||
config :phoenix_test, PhoenixTest.Repo,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "localhost",
|
||||
database: "phoenix_test_dev",
|
||||
config :quip, Quip.Repo,
|
||||
database: Path.expand("../quip_dev.db", __DIR__),
|
||||
pool_size: 5,
|
||||
stacktrace: true,
|
||||
show_sensitive_data_on_connection_error: true,
|
||||
pool_size: 10
|
||||
show_sensitive_data_on_connection_error: true
|
||||
|
||||
# For development, we disable any cache and enable
|
||||
# debugging and code reloading.
|
||||
@@ -16,17 +13,17 @@ config :phoenix_test, PhoenixTest.Repo,
|
||||
# The watchers configuration can be used to run external
|
||||
# watchers to your application. For example, we can use it
|
||||
# to bundle .js and .css sources.
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
config :quip, QuipWeb.Endpoint,
|
||||
# Binding to loopback ipv4 address prevents access from other machines.
|
||||
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
|
||||
http: [ip: {127, 0, 0, 1}, port: 4000],
|
||||
check_origin: false,
|
||||
code_reloader: true,
|
||||
debug_errors: true,
|
||||
secret_key_base: "5AWJTTMb3iv5xM9DExujLeC74qMduXvRv7keyiKc7/kvPOAKCOHInuX0C2hdWHmq",
|
||||
secret_key_base: "l4+6blY1rcppRaUjqSzQBM2ZZBfVwIobcktDvsq1eYMd+sMjaRhY0uSdI2qDTUlL",
|
||||
watchers: [
|
||||
esbuild: {Esbuild, :install_and_run, [:phoenix_test, ~w(--sourcemap=inline --watch)]},
|
||||
tailwind: {Tailwind, :install_and_run, [:phoenix_test, ~w(--watch)]}
|
||||
esbuild: {Esbuild, :install_and_run, [:quip, ~w(--sourcemap=inline --watch)]},
|
||||
tailwind: {Tailwind, :install_and_run, [:quip, ~w(--watch)]}
|
||||
]
|
||||
|
||||
# ## SSL Support
|
||||
@@ -53,17 +50,17 @@ config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
# different ports.
|
||||
|
||||
# Watch static and templates for browser reloading.
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
config :quip, QuipWeb.Endpoint,
|
||||
live_reload: [
|
||||
patterns: [
|
||||
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
|
||||
~r"priv/gettext/.*(po)$",
|
||||
~r"lib/phoenix_test_web/(controllers|live|components)/.*(ex|heex)$"
|
||||
~r"lib/quip_web/(controllers|live|components)/.*(ex|heex)$"
|
||||
]
|
||||
]
|
||||
|
||||
# Enable dev routes for dashboard and mailbox
|
||||
config :phoenix_test, dev_routes: true
|
||||
config :quip, dev_routes: true
|
||||
|
||||
# Do not include metadata nor timestamps in development logs
|
||||
config :logger, :console, format: "[$level] $message\n"
|
||||
|
@@ -5,11 +5,10 @@ import Config
|
||||
# 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 :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
cache_static_manifest: "priv/static/cache_manifest.json"
|
||||
config :quip, QuipWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
|
||||
|
||||
# Configures Swoosh API Client
|
||||
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: PhoenixTest.Finch
|
||||
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Quip.Finch
|
||||
|
||||
# Disable Swoosh Local Memory Storage
|
||||
config :swoosh, local: false
|
||||
|
@@ -12,29 +12,25 @@ import Config
|
||||
# If you use `mix release`, you need to explicitly enable the server
|
||||
# by passing the PHX_SERVER=true when you start it:
|
||||
#
|
||||
# PHX_SERVER=true bin/phoenix_test start
|
||||
# PHX_SERVER=true bin/quip start
|
||||
#
|
||||
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
|
||||
# script that automatically sets the env var above.
|
||||
if System.get_env("PHX_SERVER") do
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint, server: true
|
||||
config :quip, QuipWeb.Endpoint, server: true
|
||||
end
|
||||
|
||||
if config_env() == :prod do
|
||||
database_url =
|
||||
System.get_env("DATABASE_URL") ||
|
||||
database_path =
|
||||
System.get_env("DATABASE_PATH") ||
|
||||
raise """
|
||||
environment variable DATABASE_URL is missing.
|
||||
For example: ecto://USER:PASS@HOST/DATABASE
|
||||
environment variable DATABASE_PATH is missing.
|
||||
For example: /etc/quip/quip.db
|
||||
"""
|
||||
|
||||
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
|
||||
|
||||
config :phoenix_test, PhoenixTest.Repo,
|
||||
# ssl: true,
|
||||
url: database_url,
|
||||
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
|
||||
socket_options: maybe_ipv6
|
||||
config :quip, Quip.Repo,
|
||||
database: database_path,
|
||||
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "5")
|
||||
|
||||
# The secret key base is used to sign/encrypt cookies and other secrets.
|
||||
# A default value is used in config/dev.exs and config/test.exs but you
|
||||
@@ -51,9 +47,9 @@ if config_env() == :prod do
|
||||
host = System.get_env("PHX_HOST") || "example.com"
|
||||
port = String.to_integer(System.get_env("PORT") || "4000")
|
||||
|
||||
config :phoenix_test, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
||||
config :quip, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
||||
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
config :quip, QuipWeb.Endpoint,
|
||||
url: [host: host, port: 443, scheme: "https"],
|
||||
http: [
|
||||
# Enable IPv6 and bind on all interfaces.
|
||||
@@ -70,7 +66,7 @@ if config_env() == :prod do
|
||||
# To get SSL working, you will need to add the `https` key
|
||||
# to your endpoint configuration:
|
||||
#
|
||||
# config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
# config :quip, QuipWeb.Endpoint,
|
||||
# https: [
|
||||
# ...,
|
||||
# port: 443,
|
||||
@@ -92,7 +88,7 @@ if config_env() == :prod do
|
||||
# We also recommend setting `force_ssl` in your config/prod.exs,
|
||||
# ensuring no data is ever sent via http, always redirecting to https:
|
||||
#
|
||||
# config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
# config :quip, QuipWeb.Endpoint,
|
||||
# force_ssl: [hsts: true]
|
||||
#
|
||||
# Check `Plug.SSL` for all available options in `force_ssl`.
|
||||
@@ -103,7 +99,7 @@ if config_env() == :prod do
|
||||
# Also, you may need to configure the Swoosh API client of your choice if you
|
||||
# are not using SMTP. Here is an example of the configuration:
|
||||
#
|
||||
# config :phoenix_test, PhoenixTest.Mailer,
|
||||
# config :quip, Quip.Mailer,
|
||||
# adapter: Swoosh.Adapters.Mailgun,
|
||||
# api_key: System.get_env("MAILGUN_API_KEY"),
|
||||
# domain: System.get_env("MAILGUN_DOMAIN")
|
||||
|
@@ -5,23 +5,20 @@ import Config
|
||||
# The MIX_TEST_PARTITION environment variable can be used
|
||||
# to provide built-in test partitioning in CI environment.
|
||||
# Run `mix help test` for more information.
|
||||
config :phoenix_test, PhoenixTest.Repo,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "localhost",
|
||||
database: "phoenix_test_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
pool_size: System.schedulers_online() * 2
|
||||
config :quip, Quip.Repo,
|
||||
database: Path.expand("../quip_test.db", __DIR__),
|
||||
pool_size: 5,
|
||||
pool: Ecto.Adapters.SQL.Sandbox
|
||||
|
||||
# We don't run a server during test. If one is required,
|
||||
# you can enable the server option below.
|
||||
config :phoenix_test, PhoenixTestWeb.Endpoint,
|
||||
config :quip, QuipWeb.Endpoint,
|
||||
http: [ip: {127, 0, 0, 1}, port: 4002],
|
||||
secret_key_base: "A7xacZJjAytqd85J4lTTrhOD2hD3rZE+DjLf4HVaxrOJB7M3ZvVx8v4erjVvJIER",
|
||||
secret_key_base: "60BPpQ3VaiaNWaJ9XBOpjteaYhP64maXILhzQMGiHqo6LOen7RfQrtBJ09ltCxLY",
|
||||
server: false
|
||||
|
||||
# In test we don't send emails
|
||||
config :phoenix_test, PhoenixTest.Mailer, adapter: Swoosh.Adapters.Test
|
||||
config :quip, Quip.Mailer, adapter: Swoosh.Adapters.Test
|
||||
|
||||
# Disable swoosh api client as it is only required for production adapters
|
||||
config :swoosh, :api_client, false
|
||||
|
Reference in New Issue
Block a user