-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
324 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,4 @@ | ||
# App artifacts | ||
/_build | ||
/db | ||
/deps | ||
/*.ez | ||
captain-fact-api_release.tar | ||
|
||
# Generated on crash by the VM | ||
erl_crash.dump | ||
|
||
# Uploads | ||
/resources | ||
|
||
# Release build | ||
/captain_fact.tar.gz | ||
|
||
# Secrets | ||
_build | ||
deps | ||
priv/secrets/* | ||
|
||
# File used for temp commit message | ||
COMMIT.md | ||
resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# App artifacts | ||
/_build | ||
/db | ||
/deps | ||
/*.ez | ||
captain-fact-api_release.tar | ||
|
||
# Generated on crash by the VM | ||
erl_crash.dump | ||
|
||
# Uploads | ||
/resources | ||
|
||
# Release build | ||
/captain_fact.tar.gz |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This file is responsible for configuring your application | ||
# and its dependencies with the aid of the Mix.Config module. | ||
# | ||
# This configuration file is loaded before any dependency and | ||
# is restricted to this project. | ||
use Mix.Config | ||
|
||
|
||
# General application configuration | ||
config :captain_fact, | ||
env: Mix.env, | ||
ecto_repos: [CaptainFact.Repo], | ||
source_url_regex: ~r/^https?:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/, | ||
cors_origins: [], | ||
erlang_cookie: :default_config_cookie # Set secrets/erlang_node if running in distributed mode | ||
|
||
# Configures the endpoint | ||
config :captain_fact, CaptainFactWeb.Endpoint, | ||
url: [host: "localhost"], | ||
render_errors: [view: CaptainFactWeb.ErrorView, accepts: ~w(json), default_format: "json"], | ||
pubsub: [name: CaptainFact.PubSub, adapter: Phoenix.PubSub.PG2], | ||
server: true | ||
|
||
# Database: use postgres | ||
config :captain_fact, CaptainFact.Repo, | ||
adapter: Ecto.Adapters.Postgres, | ||
pool_size: 20 | ||
|
||
# Configure scheduler | ||
config :captain_fact, CaptainFact.Scheduler, | ||
jobs: [ | ||
# Actions analysers | ||
{{:extended, "*/5 * * * * *"}, {CaptainFact.Actions.Analyzers.Votes, :update, []}}, # Every 5 seconds | ||
{ "*/1 * * * *", {CaptainFact.Actions.Analyzers.Reputation, :update, []}}, # Every minute | ||
{ "@daily", {CaptainFact.Actions.Analyzers.Reputation, :reset_daily_limits, []}}, # Every day | ||
{ "*/1 * * * *", {CaptainFact.Actions.Analyzers.Flags, :update, []}}, # Every minute | ||
{ "*/3 * * * *", {CaptainFact.Actions.Analyzers.Achievements, :update, []}}, # Every 3 minutes | ||
# Various updaters | ||
{ "*/20 * * * *", {CaptainFact.Moderation.Updater, :update, []}}, # Every 20 minutes | ||
] | ||
|
||
# Configure mailer | ||
config :captain_fact, CaptainFact.Mailer, adapter: Bamboo.MailgunAdapter | ||
|
||
# Configures Elixir's Logger | ||
config :logger, :console, | ||
format: "$time $metadata[$level] $message\n", | ||
metadata: [:request_id] | ||
|
||
# Configure ueberauth | ||
config :ueberauth, Ueberauth, | ||
base_path: "/auth", | ||
providers: [ | ||
identity: {Ueberauth.Strategy.Identity, [callback_methods: ["POST"]]}, | ||
facebook: {Ueberauth.Strategy.Facebook, [ | ||
callback_methods: ["POST"], | ||
profile_fields: "name,email,picture" | ||
]} | ||
] | ||
|
||
# Configure Guardian (authentication) | ||
config :guardian, Guardian, | ||
issuer: "CaptainFact", | ||
ttl: {30, :days}, | ||
serializer: CaptainFact.Accounts.GuardianSerializer, | ||
permissions: %{default: [:read, :write]} | ||
|
||
config :weave, | ||
environment_prefix: "CF_", | ||
loaders: [Weave.Loaders.Environment] | ||
|
||
# Import environment specific config | ||
import_config "#{Mix.env}.exs" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
defmodule CaptainFact.Mixfile do | ||
use Mix.Project | ||
|
||
def project do | ||
[ | ||
app: :captain_fact, | ||
version: "0.7.7", | ||
elixir: "~> 1.5", | ||
elixirc_paths: elixirc_paths(Mix.env), | ||
compilers: [:phoenix, :gettext] ++ Mix.compilers, | ||
build_embedded: Mix.env == :prod, | ||
start_permanent: Mix.env == :prod, | ||
aliases: aliases(), | ||
deps: deps(), | ||
test_coverage: [tool: ExCoveralls], | ||
preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test] | ||
] | ||
end | ||
|
||
# Configuration for the OTP application. | ||
# | ||
# Type `mix help compile.app` for more information. | ||
def application do | ||
[ | ||
mod: {CaptainFact, []}, | ||
extra_applications: [:logger] | ||
] | ||
end | ||
|
||
# Specifies which paths to compile per environment. | ||
defp elixirc_paths(:test), do: ["lib", "test/support"] | ||
defp elixirc_paths(:dev), do: ["lib", "test/support/factory.ex", "test/support/channel_case.ex"] | ||
defp elixirc_paths(_), do: ["lib"] | ||
|
||
# Specifies your project dependencies. | ||
# | ||
# Type `mix help deps` for examples and options. | ||
defp deps do | ||
[ | ||
{:phoenix, "~> 1.3.0", override: true}, | ||
{:phoenix_pubsub, "~> 1.0"}, | ||
{:phoenix_ecto, "~> 3.2"}, | ||
{:phoenix_html, "~> 2.6"}, | ||
{:phoenix_live_reload, "~> 1.0", only: :dev}, | ||
{:postgrex, ">= 0.0.0"}, | ||
{:gettext, "~> 0.13.1"}, | ||
{:cowboy, "~> 1.0"}, | ||
{:corsica, "~> 0.5"}, | ||
{:comeonin, "~> 3.0"}, | ||
{:ueberauth, "0.4.0"}, | ||
{:ueberauth_identity, "~> 0.2"}, | ||
{:ueberauth_facebook, "~> 0.6"}, | ||
{:guardian, "~> 0.10"}, | ||
{:ecto_enum, "~> 1.0"}, | ||
{:arc, "~> 0.8.0"}, | ||
{:arc_ecto, "~> 0.7.0"}, | ||
{:floki, "~> 0.17.0"}, | ||
{:hashids, "~> 2.0"}, | ||
{:html_entities, "~> 0.3"}, | ||
{:httpoison, "~> 0.11.2"}, | ||
{:poison, "~> 2.2.0"}, | ||
{:csv, "~> 1.4.4"}, | ||
{:quantum, "~> 2.1.0"}, | ||
{:not_qwerty123, "~> 2.2"}, | ||
{:bamboo, "~> 1.0.0-rc.1"}, | ||
{:ex_aws, "~> 1.1"}, | ||
{:hackney, "~> 1.6"}, | ||
{:sweet_xml, "~> 0.6"}, | ||
{:weave, "~> 3.0"}, | ||
{:slugger, "~> 0.2"}, | ||
{:ex_machina, "~> 2.0"}, # When opensourced, this should only be included in dev and test | ||
{:faker, "~> 0.7"}, # When opensourced, this should only be included in dev and test | ||
{:bypass, "~> 0.8", only: :test}, | ||
{:excoveralls, "~> 0.7", only: :test}, | ||
{:distillery, "~> 1.5", runtime: false}, | ||
{:credo, "~> 0.8", only: [:dev, :test], runtime: false} | ||
] | ||
end | ||
|
||
defp aliases do | ||
[ | ||
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], | ||
"ecto.reset": ["ecto.drop", "ecto.setup"], | ||
"test": ["ecto.create --quiet", "ecto.migrate", "test"] | ||
] | ||
end | ||
end |
Oops, something went wrong.