Skip to content
Open
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
1 change: 1 addition & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
import_deps: [:phoenix],
inputs: [
"apps/*/{lib,config,test}/**/*.{ex,exs}",
"apps/*/mix.exs",
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- uses: actions/setup-elixir@v1.1.0
with:
otp-version: 21.x
elixir-version: 1.6.x
otp-version: 22.x
elixir-version: 1.10.1
- name: Install dependencies
run: mix deps.get
- name: Check format
run: mix format --check-formatted

Expand All @@ -39,8 +47,8 @@ jobs:
${{ runner.os }}-mix-
- uses: actions/setup-elixir@v1.1.0
with:
otp-version: 21.x
elixir-version: 1.6.x
otp-version: 22.x
elixir-version: 1.10.1
- name: Install dependencies
run: mix deps.get
- name: Prepare DB
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
key: ${{ runner.os }}-mix-build
- uses: actions/setup-elixir@v1.1.0
with:
otp-version: 21.x
elixir-version: 1.6.x
otp-version: 22.x
elixir-version: 1.10.1
- name: Install API's dependencies
run: mix deps.get
- name: Compile dependencies
Expand Down
2 changes: 1 addition & 1 deletion apps/cf/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule CF.Mixfile do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.3.0", override: true},
{:phoenix, "~> 1.4.0"},
{:phoenix_html, "~> 2.6"},
{:gettext, "~> 0.13.1"},
{:google_api_you_tube, "~> 0.1.0"},
Expand Down
2 changes: 1 addition & 1 deletion apps/cf/test/authenticator/authenticator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule CF.AuthenticatorTest do

user = insert_user_with_custom_password(password)

check all password <- binary(), max_runs: 3 do
check all(password <- binary(), max_runs: 3) do
assert is_nil(Authenticator.get_user_for_email_or_name_password(user.email, password))
end
end
Expand Down
4 changes: 2 additions & 2 deletions apps/cf_atom_feed/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ defmodule CF.AtomFeed.Mixfile do
[
# --- Runtime
{:atomex, "~> 0.2"},
{:cowboy, "~> 1.0"},
{:plug, "~> 1.0"},
{:plug_cowboy, "~> 1.0"},
{:plug, "~> 1.7"},
{:kaur, "~> 1.1"},

# ---- In Umbrella
Expand Down
6 changes: 3 additions & 3 deletions apps/cf_graphql/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ defmodule CF.Graphql.Mixfile do

defp deps do
[
{:phoenix, "~> 1.3.0"},
{:plug, "~> 1.0"},
{:phoenix, "~> 1.4.0"},
{:phoenix_pubsub, "~> 1.0"},
{:cowboy, "~> 1.0"},
{:plug_cowboy, "~> 1.0"},
{:plug, "~> 1.7"},
{:corsica, "~> 1.0"},
{:absinthe_ecto, "~> 0.1.3"},
{:absinthe_plug, "~> 1.4.1"},
Expand Down
1 change: 1 addition & 0 deletions apps/cf_jobs/lib/report_manager.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
defmodule CF.Jobs.ReportManager do
import Ecto.Query

# TODO Implement this as a behaviour

alias DB.Repo
Expand Down
4 changes: 0 additions & 4 deletions apps/cf_rest_api/lib/channels/user_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ defmodule CF.RestApi.UserSocket do
channel("statements:video:*", CF.RestApi.StatementsChannel)
channel("comments:video:*", CF.RestApi.CommentsChannel)

## Transports
transport(:websocket, Phoenix.Transports.WebSocket)
transport(:longpoll, Phoenix.Transports.LongPoll)

# Connect with token
def connect(%{"token" => token}, socket) do
case authenticate(socket, GuardianImpl, token) do
Expand Down
2 changes: 1 addition & 1 deletion apps/cf_rest_api/lib/endpoint.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule CF.RestApi.Endpoint do
use Phoenix.Endpoint, otp_app: :cf_rest_api

socket("/socket", CF.RestApi.UserSocket)
socket("/socket", CF.RestApi.UserSocket, websocket: true, longpoll: true)

if Application.get_env(:arc, :storage) == Arc.Storage.Local,
do: plug(Plug.Static, at: "/resources", from: "./resources", gzip: false)
Expand Down
5 changes: 3 additions & 2 deletions apps/cf_rest_api/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ defmodule CF.RestApi.Mixfile do
defp deps do
[
{:corsica, "~> 1.0"},
{:cowboy, "~> 1.0"},
{:plug_cowboy, "~> 1.0"},
{:plug, "~> 1.7"},
{:gettext, "~> 0.13.1"},
{:kaur, "~> 1.1"},
{:phoenix, "~> 1.3.0", override: true},
{:phoenix, "~> 1.4.0"},
{:phoenix_html, "~> 2.6"},
{:phoenix_pubsub, "~> 1.0"},
{:poison, "~> 3.1"},
Expand Down
5 changes: 3 additions & 2 deletions apps/cf_reverse_proxy/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ defmodule CF.ReverseProxy.Mixfile do
{:cf_rest_api, in_umbrella: true},
{:cf_graphql, in_umbrella: true},
{:cf_atom_feed, in_umbrella: true},
{:phoenix, "~> 1.3.0"},
{:cowboy, "~> 1.0"},
{:phoenix, "~> 1.4.0"},
{:plug_cowboy, "~> 1.0"},
{:plug, "~> 1.7"},
{:corsica, "~> 1.0"}
]
end
Expand Down
1 change: 1 addition & 0 deletions apps/db/lib/db_type/user_picture.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule DB.Type.UserPicture do
use Arc.Ecto.Definition

@versions [:thumb, :mini_thumb]

# TODO @extension_whitelist ~w(.jpg .jpeg .png)

@doc """
Expand Down
4 changes: 2 additions & 2 deletions apps/db/test/db_type/video_hash_id_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ defmodule DB.Type.VideoHashIdTest do
end

property "should work with any integer" do
check all id <- id_generator(), do: assert(String.length(VideoHashId.encode(id)) >= 4)
check(all(id <- id_generator(), do: assert(String.length(VideoHashId.encode(id)) >= 4)))
end

defp id_generator do
ExUnitProperties.gen all id <- integer() do
ExUnitProperties.gen all(id <- integer()) do
abs(id)
end
end
Expand Down
9 changes: 6 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"libring": {:hex, :libring, "1.4.0", "41246ba2f3fbc76b3971f6bce83119dfec1eee17e977a48d8a9cfaaf58c2a8d6", [:mix], [], "hexpm", "1feaf05ee886815ad047cad7ede17d6910710986148ae09cf73eee2989717b81"},
"meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"},
"mime": {:hex, :mime, "1.4.0", "5066f14944b470286146047d2f73518cf5cca82f8e4815cf35d196b58cf07c47", [:mix], [], "hexpm", "75fa42c4228ea9a23f70f123c74ba7cece6a03b1fd474fe13f6a7a85c6ea4ff6"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"mix_test_watch": {:hex, :mix_test_watch, "0.9.0", "c72132a6071261893518fa08e121e911c9358713f62794a90c95db59042af375", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "817dec4a7f6edf260258002f99ac8ffaf7a8f395b27bf2d13ec24018beecec8a"},
"mochiweb": {:hex, :mochiweb, "2.18.0", "eb55f1db3e6e960fac4e6db4e2db9ec3602cc9f30b86cd1481d56545c3145d2e", [:rebar3], [], "hexpm", "b93e2b1e564bdbadfecc297277f9e6d0902da645b417d6c9210f6038ac63489a"},
Expand All @@ -66,10 +66,12 @@
"oauth2": {:hex, :oauth2, "0.9.4", "632e8e8826a45e33ac2ea5ac66dcc019ba6bb5a0d2ba77e342d33e3b7b252c6e", [:mix], [{:hackney, "~> 1.7", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "407c6b9f60aa0d01b915e2347dc6be78adca706a37f0c530808942da3b62e7af"},
"parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"},
"phoenix": {:hex, :phoenix, "1.3.4", "aaa1b55e5523083a877bcbe9886d9ee180bf2c8754905323493c2ac325903dc5", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "f9eb4926aaad604c5ee4051f462f5981828fb559691236d71f7fb07ac4a0532d"},
"phoenix": {:hex, :phoenix, "1.4.17", "1b1bd4cff7cfc87c94deaa7d60dd8c22e04368ab95499483c50640ef3bd838d8", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a8e5d7a3d76d452bb5fb86e8b7bd115f737e4f8efe202a463d4aeb4a5809611"},
"phoenix_html": {:hex, :phoenix_html, "2.11.2", "86ebd768258ba60a27f5578bec83095bdb93485d646fc4111db8844c316602d6", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "2fe8543036a9cb2103efe26c18874512dc0e005afba60dbfe90aa56e27c198a2"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm", "1f13f9f0f3e769a667a6b6828d29dec37497a082d195cc52dbef401a9b69bf38"},
"plug": {:hex, :plug, "1.5.1", "1ff35bdecfb616f1a2b1c935ab5e4c47303f866cb929d2a76f0541e553a58165", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.3", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm", "aa312d5df0f815eed879aaa77543534e21c78ca4a7e983083698fc190796fd9c"},
"plug": {:hex, :plug, "1.10.4", "41eba7d1a2d671faaf531fa867645bd5a3dce0957d8e2a3f398ccff7d2ef017f", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ad1e233fe73d2eec56616568d260777b67f53148a999dc2d048f4eb9778fe4a0"},
"plug_cowboy": {:hex, :plug_cowboy, "1.0.0", "2e2a7d3409746d335f451218b8bb0858301c3de6d668c3052716c909936eb57a", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "01d201427a8a1f4483be2465a98b45f5e82263327507fe93404a61c51eb9e9a8"},
"plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"},
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"postgrex": {:hex, :postgrex, "0.13.5", "3d931aba29363e1443da167a4b12f06dcd171103c424de15e5f3fc2ba3e6d9c5", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "a19b61193379cdee04b5b2361bf93d1eb170cd2eec0b18042617b07e1e15fbfb"},
Expand All @@ -83,6 +85,7 @@
"stream_data": {:hex, :stream_data, "0.4.2", "fa86b78c88ec4eaa482c0891350fcc23f19a79059a687760ddcf8680aac2799b", [:mix], [], "hexpm", "54d6bf6f1e5e27fbf4a7784a2bffbb993446d0efd079debca0f27bf859c0d1cf"},
"swarm": {:hex, :swarm, "3.3.1", "b4d29c49310b92b4a84bd3be6a51d9616eaeda1899b7619201d0908d8d789bd8", [:mix], [{:gen_state_machine, "~> 2.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:libring, "~> 1.0", [hex: :libring, repo: "hexpm", optional: false]}], "hexpm", "228dcaa2bbff0bf5a5e5bb4541cb0e2afcfc38afdd01f44e81912d2ad7a2e33b"},
"sweet_xml": {:hex, :sweet_xml, "0.6.5", "dd9cde443212b505d1b5f9758feb2000e66a14d3c449f04c572f3048c66e6697", [:mix], [], "hexpm", "f79c597e7c511178028811061df8782740f1c7e176eb7807fcfdf42ce3d6eff7"},
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
"tesla": {:hex, :tesla, "1.1.0", "666e90b65d5c1edd4cd9ba96a24cf5d552cc29ccf5b22ca0cc86c465f732ba40", [:mix], [{:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm", "c21bb09fbeb15f8a961f874406859a03d26de3d18a9ab7107493e2f134f1a99f"},
"timex": {:hex, :timex, "3.6.2", "845cdeb6119e2fef10751c0b247b6c59d86d78554c83f78db612e3290f819bc2", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "26030b46199d02a590be61c2394b37ea25a3664c02fafbeca0b24c972025d47a"},
"tzdata": {:hex, :tzdata, "1.0.3", "73470ad29dde46e350c60a66e6b360d3b99d2d18b74c4c349dbebbc27a09a3eb", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a6e1ee7003c4d04ecbd21dd3ec690d4c6662db5d3bbdd7262d53cdf5e7c746c1"},
Expand Down