From 559c889f1b3c0708c4f8991f5b1f26804b38ae24 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 11 Oct 2018 17:37:39 +0200 Subject: [PATCH] Rename project to Mobilizon Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 4 +- LICENSE | 2 +- README.md | 4 +- config/config.exs | 18 +++---- config/dev.exs | 16 +++--- config/prod.exs | 12 ++--- config/test.exs | 10 ++-- docker-compose.yml | 10 ++-- js/.env.dist | 4 +- js/package-lock.json | 2 +- js/package.json | 2 +- js/public/index.html | 4 +- js/public/manifest.json | 4 +- js/src/components/Home.vue | 2 +- js/src/components/NavBar.vue | 2 +- js/src/i18n/en.js | 4 +- js/src/i18n/fr.js | 4 +- lib/eventos.ex | 6 +-- lib/eventos/mailer.ex | 6 --- lib/eventos_web.ex | 24 ++++----- .../controllers/inboxes_controller.ex | 6 --- .../templates/email/email.html.eex | 10 ---- .../templates/email/email.text.eex | 3 -- lib/eventos_web/views/email_view.ex | 3 -- lib/eventos_web/views/page_view.ex | 6 --- lib/eventos_web/views/user_session_view.ex | 10 ---- lib/mix/tasks/create_bot.ex | 8 +-- lib/{eventos => mobilizon}/activity.ex | 2 +- lib/{eventos => mobilizon}/actors/actor.ex | 36 ++++++------- lib/{eventos => mobilizon}/actors/actors.ex | 30 +++++------ lib/{eventos => mobilizon}/actors/bot.ex | 4 +- lib/{eventos => mobilizon}/actors/follower.ex | 6 +-- lib/{eventos => mobilizon}/actors/member.ex | 6 +-- .../actors/service/activation.ex | 6 +-- .../actors/service/reset_password.ex | 6 +-- lib/{eventos => mobilizon}/actors/user.ex | 4 +- .../addresses/address.ex | 8 +-- .../addresses/addresses.ex | 6 +-- lib/{eventos => mobilizon}/application.ex | 18 +++---- lib/{eventos => mobilizon}/email/user.ex | 16 +++--- lib/{eventos => mobilizon}/events/category.ex | 4 +- lib/{eventos => mobilizon}/events/comment.ex | 10 ++-- lib/{eventos => mobilizon}/events/event.ex | 10 ++-- lib/{eventos => mobilizon}/events/events.ex | 24 ++++----- .../events/participant.ex | 6 +-- lib/{eventos => mobilizon}/events/session.ex | 4 +- lib/{eventos => mobilizon}/events/tag.ex | 14 ++--- lib/{eventos => mobilizon}/events/track.ex | 4 +- .../export/icalendar.ex | 4 +- lib/mobilizon/mailer.ex | 6 +++ lib/{eventos => mobilizon}/postgrex_types.ex | 2 +- lib/{eventos => mobilizon}/repo.ex | 6 +-- lib/{eventos => mobilizon}/slug.ex | 2 +- .../auth_error_handler.ex | 2 +- .../auth_pipeline.ex | 8 +-- .../channels/user_socket.ex | 6 +-- .../controllers/activity_pub_controller.ex | 12 ++--- .../controllers/actor_controller.ex | 12 ++--- .../controllers/address_controller.ex | 10 ++-- .../controllers/bot_controller.ex | 10 ++-- .../controllers/category_controller.ex | 10 ++-- .../controllers/comment_controller.ex | 10 ++-- .../controllers/event_controller.ex | 14 ++--- .../controllers/event_request_controller.ex | 10 ++-- .../controllers/fallback_controller.ex | 10 ++-- .../controllers/follower_controller.ex | 10 ++-- .../controllers/group_controller.ex | 18 +++---- .../controllers/inboxes_controller.ex | 6 +++ .../controllers/nodeinfo_controller.ex | 14 ++--- .../controllers/outboxes_controller.ex | 4 +- .../controllers/page_controller.ex | 4 +- .../controllers/participant_controller.ex | 6 +-- .../controllers/search_controller.ex | 10 ++-- .../controllers/session_controller.ex | 10 ++-- .../controllers/tag_controller.ex | 10 ++-- .../controllers/track_controller.ex | 10 ++-- .../controllers/user_controller.ex | 20 +++---- .../controllers/user_session_controller.ex | 10 ++-- .../controllers/web_finger_controller.ex | 6 +-- .../endpoint.ex | 14 ++--- lib/{eventos_web => mobilizon_web}/gettext.ex | 6 +-- .../guardian.ex | 8 +-- .../http_signature.ex | 4 +- lib/{eventos_web => mobilizon_web}/router.ex | 20 +++---- .../templates/email/email.html.eex | 10 ++++ .../templates/email/email.text.eex | 3 ++ .../templates/email/password_reset.html.eex | 2 +- .../templates/email/password_reset.text.eex | 2 +- .../email/registration_confirmation.html.eex | 2 +- .../email/registration_confirmation.text.eex | 2 +- .../views/activity_pub/actor_view.ex | 24 ++++----- .../views/activity_pub/object_view.ex | 8 +-- .../views/actor_view.ex | 8 +-- .../views/address_view.ex | 6 +-- .../views/bot_view.ex | 6 +-- .../views/category_view.ex | 6 +-- .../views/changeset_view.ex | 6 +-- .../views/comment_view.ex | 6 +-- lib/mobilizon_web/views/email_view.ex | 3 ++ .../views/error_helpers.ex | 6 +-- .../views/error_view.ex | 4 +- .../views/event_view.ex | 6 +-- .../views/follower_view.ex | 6 +-- .../views/group_view.ex | 6 +-- .../views/member_view.ex | 6 +-- lib/mobilizon_web/views/page_view.ex | 6 +++ .../views/participant_view.ex | 6 +-- .../views/search_view.ex | 6 +-- .../views/session_view.ex | 6 +-- .../views/tag_view.ex | 6 +-- .../views/track_view.ex | 6 +-- lib/mobilizon_web/views/user_session_view.ex | 10 ++++ .../views/user_view.ex | 8 +-- lib/service/activity_pub/activity_pub.ex | 22 ++++---- lib/service/activity_pub/transmogrifier.ex | 10 ++-- lib/service/activity_pub/utils.ex | 24 ++++----- lib/service/federator.ex | 10 ++-- .../http_signatures/http_signatures.ex | 6 +-- lib/service/streamer.ex | 4 +- lib/service/web_finger/web_finger.ex | 14 ++--- lib/service/xml_builder.ex | 2 +- mix.exs | 14 ++--- .../migrations/20180109150000_prerequites.exs | 2 +- .../20180109165738_create_accounts.exs | 2 +- .../20180109170315_create_users.exs | 2 +- .../20180110091747_create_categories.exs | 2 +- .../20180110092400_create_addresses.exs | 2 +- .../20180110092500_create_groups.exs | 2 +- .../20180110092600_create_events.exs | 2 +- .../migrations/20180110093905_create_tags.exs | 2 +- .../20180110093906_create_events_tags.exs | 2 +- .../20180110094301_create_participants.exs | 2 +- .../20180110094502_create_event_requests.exs | 2 +- .../20180110095317_create_members.exs | 2 +- .../20180110095515_create_group_requests.exs | 2 +- .../migrations/20180110165029_guardiandb.exs | 2 +- .../20180112100000_create_tracks.exs | 2 +- .../20180112105354_create_sessions.exs | 2 +- .../migrations/20180430071244_remove_uri.exs | 2 +- ...20180515091106_add_url_field_to_events.exs | 2 +- .../20180515100237_create_comments.exs | 2 +- ...timestamps_to_date_time_with_time_zone.exs | 2 +- ...local_attribute_to_events_and_comments.exs | 2 +- ...80517100700_move_from_account_to_actor.exs | 6 +-- .../20180522133844_add_bots_table.exs | 2 +- ...0125159_add_avatar_and_banner_to_actor.exs | 2 +- ...0152323_make_actor_public_key_nullable.exs | 2 +- .../20180530170808_add_uuid_id_to_events.exs | 2 +- ...31162301_add_approved_status_to_member.exs | 2 +- .../20180607095732_add_uuid_to_comments.exs | 2 +- ...4094653_make_shared_inbox_url_nullable.exs | 2 +- ...on_public_private_key_into_keys_column.exs | 2 +- ...ibuted_to_field_to_events_and_comments.exs | 2 +- ...28091920_add-user-confirm-email-fields.exs | 2 +- ...8130746_add-user-password-reset-fields.exs | 2 +- ...28142835_revert_alter_event_timestamps.exs | 2 +- .../20180702150922_add_address_type.exs | 2 +- .../20180702154630_remove_slug_for_event.exs | 2 +- ...8_alter_events_set_description_as_text.exs | 2 +- ...54152_allow_multiple_accounts_for_user.exs | 2 +- ...80802133951_make_follower_table_unique.exs | 2 +- ...180816093446_add_primary_key_to_member.exs | 2 +- priv/repo/seeds.exs | 4 +- test/eventos/actors/actors_test.exs | 30 +++++------ test/eventos/addresses/addresses_test.exs | 8 +-- test/eventos/events/events_test.exs | 26 +++++----- .../service/activitypub/activitypub_test.exs | 18 +++---- .../service/web_finger/web_finger_test.exs | 12 ++--- .../activity_pub_controller_test.exs | 16 +++--- .../controllers/actor_controller_test.exs | 8 +-- .../controllers/address_controller_test.exs | 10 ++-- .../controllers/bot_controller_test.exs | 10 ++-- .../controllers/category_controller_test.exs | 10 ++-- .../controllers/comment_controller_test.exs | 14 ++--- .../controllers/event_controller_test.exs | 12 ++--- .../controllers/follower_controller_test.exs | 10 ++-- .../controllers/nodeinfo_controller_test.exs | 10 ++-- .../controllers/page_controller_test.exs | 4 +- .../controllers/session_controller_test.exs | 10 ++-- .../controllers/tag_controller_test.exs | 10 ++-- .../controllers/track_controller_test.exs | 10 ++-- .../controllers/user_controller_test.exs | 52 +++++++++---------- test/eventos_web/views/error_view_test.exs | 10 ++-- test/eventos_web/views/layout_view_test.exs | 4 +- test/eventos_web/views/page_view_test.exs | 4 +- test/fixtures/mastodon-post-activity.json | 2 +- test/support/channel_case.ex | 8 +-- test/support/conn_case.ex | 14 ++--- test/support/data_case.ex | 10 ++-- test/support/factory.ex | 34 ++++++------ test/test_helper.exs | 2 +- 191 files changed, 739 insertions(+), 739 deletions(-) delete mode 100644 lib/eventos/mailer.ex delete mode 100644 lib/eventos_web/controllers/inboxes_controller.ex delete mode 100644 lib/eventos_web/templates/email/email.html.eex delete mode 100644 lib/eventos_web/templates/email/email.text.eex delete mode 100644 lib/eventos_web/views/email_view.ex delete mode 100644 lib/eventos_web/views/page_view.ex delete mode 100644 lib/eventos_web/views/user_session_view.ex rename lib/{eventos => mobilizon}/activity.ex (80%) rename lib/{eventos => mobilizon}/actors/actor.ex (83%) rename lib/{eventos => mobilizon}/actors/actors.ex (95%) rename lib/{eventos => mobilizon}/actors/bot.ex (84%) rename lib/{eventos => mobilizon}/actors/follower.ex (85%) rename lib/{eventos => mobilizon}/actors/member.ex (86%) rename lib/{eventos => mobilizon}/actors/service/activation.ex (85%) rename lib/{eventos => mobilizon}/actors/service/reset_password.ex (93%) rename lib/{eventos => mobilizon}/actors/user.ex (97%) rename lib/{eventos => mobilizon}/addresses/address.ex (84%) rename lib/{eventos => mobilizon}/addresses/addresses.ex (96%) rename lib/{eventos => mobilizon}/application.ex (61%) rename lib/{eventos => mobilizon}/email/user.ex (74%) rename lib/{eventos => mobilizon}/events/category.ex (86%) rename lib/{eventos => mobilizon}/events/comment.ex (84%) rename lib/{eventos => mobilizon}/events/event.ex (90%) rename lib/{eventos => mobilizon}/events/events.ex (97%) rename lib/{eventos => mobilizon}/events/participant.ex (84%) rename lib/{eventos => mobilizon}/events/session.ex (92%) rename lib/{eventos => mobilizon}/events/tag.ex (79%) rename lib/{eventos => mobilizon}/events/track.ex (86%) rename lib/{eventos => mobilizon}/export/icalendar.ex (85%) create mode 100644 lib/mobilizon/mailer.ex rename lib/{eventos => mobilizon}/postgrex_types.ex (79%) rename lib/{eventos => mobilizon}/repo.ex (73%) rename lib/{eventos => mobilizon}/slug.ex (93%) rename lib/{eventos_web => mobilizon_web}/auth_error_handler.ex (83%) rename lib/{eventos_web => mobilizon_web}/auth_pipeline.ex (62%) rename lib/{eventos_web => mobilizon_web}/channels/user_socket.ex (86%) rename lib/{eventos_web => mobilizon_web}/controllers/activity_pub_controller.ex (93%) rename lib/{eventos_web => mobilizon_web}/controllers/actor_controller.ex (90%) rename lib/{eventos_web => mobilizon_web}/controllers/address_controller.ex (90%) rename lib/{eventos_web => mobilizon_web}/controllers/bot_controller.ex (86%) rename lib/{eventos_web => mobilizon_web}/controllers/category_controller.ex (85%) rename lib/{eventos_web => mobilizon_web}/controllers/comment_controller.ex (85%) rename lib/{eventos_web => mobilizon_web}/controllers/event_controller.ex (90%) rename lib/{eventos_web => mobilizon_web}/controllers/event_request_controller.ex (88%) rename lib/{eventos_web => mobilizon_web}/controllers/fallback_controller.ex (63%) rename lib/{eventos_web => mobilizon_web}/controllers/follower_controller.ex (84%) rename lib/{eventos_web => mobilizon_web}/controllers/group_controller.ex (69%) create mode 100644 lib/mobilizon_web/controllers/inboxes_controller.ex rename lib/{eventos_web => mobilizon_web}/controllers/nodeinfo_controller.ex (81%) rename lib/{eventos_web => mobilizon_web}/controllers/outboxes_controller.ex (67%) rename lib/{eventos_web => mobilizon_web}/controllers/page_controller.ex (75%) rename lib/{eventos_web => mobilizon_web}/controllers/participant_controller.ex (80%) rename lib/{eventos_web => mobilizon_web}/controllers/search_controller.ex (67%) rename lib/{eventos_web => mobilizon_web}/controllers/session_controller.ex (88%) rename lib/{eventos_web => mobilizon_web}/controllers/tag_controller.ex (84%) rename lib/{eventos_web => mobilizon_web}/controllers/track_controller.ex (84%) rename lib/{eventos_web => mobilizon_web}/controllers/user_controller.ex (88%) rename lib/{eventos_web => mobilizon_web}/controllers/user_session_controller.ex (85%) rename lib/{eventos_web => mobilizon_web}/controllers/web_finger_controller.ex (77%) rename lib/{eventos_web => mobilizon_web}/endpoint.ex (87%) rename lib/{eventos_web => mobilizon_web}/gettext.ex (85%) rename lib/{eventos_web => mobilizon_web}/guardian.ex (92%) rename lib/{eventos_web => mobilizon_web}/http_signature.ex (92%) rename lib/{eventos_web => mobilizon_web}/router.ex (93%) create mode 100644 lib/mobilizon_web/templates/email/email.html.eex create mode 100644 lib/mobilizon_web/templates/email/email.text.eex rename lib/{eventos_web => mobilizon_web}/templates/email/password_reset.html.eex (71%) rename lib/{eventos_web => mobilizon_web}/templates/email/password_reset.text.eex (81%) rename lib/{eventos_web => mobilizon_web}/templates/email/registration_confirmation.html.eex (66%) rename lib/{eventos_web => mobilizon_web}/templates/email/registration_confirmation.text.eex (79%) rename lib/{eventos_web => mobilizon_web}/views/activity_pub/actor_view.ex (89%) rename lib/{eventos_web => mobilizon_web}/views/activity_pub/object_view.ex (88%) rename lib/{eventos_web => mobilizon_web}/views/actor_view.ex (91%) rename lib/{eventos_web => mobilizon_web}/views/address_view.ex (90%) rename lib/{eventos_web => mobilizon_web}/views/bot_view.ex (77%) rename lib/{eventos_web => mobilizon_web}/views/category_view.ex (83%) rename lib/{eventos_web => mobilizon_web}/views/changeset_view.ex (78%) rename lib/{eventos_web => mobilizon_web}/views/comment_view.ex (79%) create mode 100644 lib/mobilizon_web/views/email_view.ex rename lib/{eventos_web => mobilizon_web}/views/error_helpers.ex (85%) rename lib/{eventos_web => mobilizon_web}/views/error_view.ex (90%) rename lib/{eventos_web => mobilizon_web}/views/event_view.ex (93%) rename lib/{eventos_web => mobilizon_web}/views/follower_view.ex (79%) rename lib/{eventos_web => mobilizon_web}/views/group_view.ex (90%) rename lib/{eventos_web => mobilizon_web}/views/member_view.ex (82%) create mode 100644 lib/mobilizon_web/views/page_view.ex rename lib/{eventos_web => mobilizon_web}/views/participant_view.ex (81%) rename lib/{eventos_web => mobilizon_web}/views/search_view.ex (68%) rename lib/{eventos_web => mobilizon_web}/views/session_view.ex (87%) rename lib/{eventos_web => mobilizon_web}/views/tag_view.ex (78%) rename lib/{eventos_web => mobilizon_web}/views/track_view.ex (81%) create mode 100644 lib/mobilizon_web/views/user_session_view.ex rename lib/{eventos_web => mobilizon_web}/views/user_view.ex (90%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d43b06180..3c60b54a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,11 +6,11 @@ services: variables: MIX_ENV: "test" - POSTGRES_DB: eventos_test + POSTGRES_DB: mobilizon_test POSTGRES_USER: postgres POSTGRES_PASSWORD: "" POSTGRES_HOST: postgres - GEOLITE_CITIES_PATH: "/builds/tcit/eventos/priv/data/GeoLite2-City.mmdb" + GEOLITE_CITIES_PATH: "/builds/tcit/mobilizon/priv/data/GeoLite2-City.mmdb" cache: key: "$CI_JOB_NAME" diff --git a/LICENSE b/LICENSE index acce1be9e..58db0a43d 100644 --- a/LICENSE +++ b/LICENSE @@ -629,7 +629,7 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - eventos + Mobilizon Copyright (C) 2018 Thomas Citharel This program is free software: you can redistribute it and/or modify diff --git a/README.md b/README.md index 677be118e..53bbcf829 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Eventos +# Mobilizon ## Development @@ -22,7 +22,7 @@ to start a database container, an API container and the front-end dev container * Fetch dependencies with `mix deps.get`. * Create your database with `mix ecto.create`. * Create the postgis extension on the database with a postgres user that has - superuser capabilities: `psql eventos_dev` + superuser capabilities: `psql mobilizon_dev` ``` create extension if not exists postgis; ``` diff --git a/config/config.exs b/config/config.exs index b093949cb..272085e17 100644 --- a/config/config.exs +++ b/config/config.exs @@ -6,10 +6,10 @@ use Mix.Config # General application configuration -config :eventos, - ecto_repos: [Eventos.Repo] +config :mobilizon, + ecto_repos: [Mobilizon.Repo] -config :eventos, :instance, +config :mobilizon, :instance, name: "Localhost", version: "1.0.0-dev", registrations_open: true @@ -20,11 +20,11 @@ config :mime, :types, %{ } # Configures the endpoint -config :eventos, EventosWeb.Endpoint, +config :mobilizon, MobilizonWeb.Endpoint, url: [host: "localhost"], secret_key_base: "1yOazsoE0Wqu4kXk3uC5gu3jDbShOimTCzyFL3OjCdBmOXMyHX87Qmf3+Tu9s0iM", - render_errors: [view: EventosWeb.ErrorView, accepts: ~w(html json)], - pubsub: [name: Eventos.PubSub, adapter: Phoenix.PubSub.PG2], + render_errors: [view: MobilizonWeb.ErrorView, accepts: ~w(html json)], + pubsub: [name: Mobilizon.PubSub, adapter: Phoenix.PubSub.PG2], instance: "localhost", email_from: "noreply@localhost", email_to: "noreply@localhost" @@ -38,12 +38,12 @@ config :logger, :console, # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" -config :eventos, EventosWeb.Guardian, - issuer: "eventos", +config :mobilizon, MobilizonWeb.Guardian, + issuer: "mobilizon", secret_key: "ty0WM7YBE3ojvxoUQxo8AERrNpfbXnIJ82ovkPdqbUFw31T5LcK8wGjaOiReVQjo" config :guardian, Guardian.DB, - repo: Eventos.Repo, + repo: Mobilizon.Repo, # default schema_name: "guardian_tokens", # store all token types if not set diff --git a/config/dev.exs b/config/dev.exs index 1eef56e7b..86443e4c0 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -6,7 +6,7 @@ use Mix.Config # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with brunch.io to recompile .js and .css sources. -config :eventos, EventosWeb.Endpoint, +config :mobilizon, MobilizonWeb.Endpoint, http: [port: System.get_env("PORT") || 4001], debug_errors: true, code_reloader: true, @@ -30,13 +30,13 @@ config :eventos, EventosWeb.Endpoint, # different ports. # Watch static and templates for browser reloading. -config :eventos, EventosWeb.Endpoint, +config :mobilizon, MobilizonWeb.Endpoint, live_reload: [ patterns: [ ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, ~r{priv/gettext/.*(po)$}, - ~r{lib/eventos_web/views/.*(ex)$}, - ~r{lib/eventos_web/templates/.*(eex)$} + ~r{lib/mobilizon_web/views/.*(ex)$}, + ~r{lib/mobilizon_web/templates/.*(eex)$} ] ] @@ -47,14 +47,14 @@ config :logger, :console, format: "[$level] $message\n", level: :debug # in production as building large stacktraces may be expensive. config :phoenix, :stacktrace_depth, 20 -config :eventos, Eventos.Mailer, adapter: Bamboo.LocalAdapter +config :mobilizon, Mobilizon.Mailer, adapter: Bamboo.LocalAdapter # Configure your database -config :eventos, Eventos.Repo, +config :mobilizon, Mobilizon.Repo, adapter: Ecto.Adapters.Postgres, - types: Eventos.PostgresTypes, + types: Mobilizon.PostgresTypes, username: System.get_env("POSTGRES_USER") || "elixir", password: System.get_env("POSTGRES_PASSWORD") || "elixir", - database: System.get_env("POSTGRES_DATABASE") || "eventos_dev", + database: System.get_env("POSTGRES_DATABASE") || "mobilizon_dev", hostname: System.get_env("POSTGRES_HOST") || "localhost", pool_size: 10 diff --git a/config/prod.exs b/config/prod.exs index 4b8df652a..476ce44af 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -3,7 +3,7 @@ use Mix.Config # For production, we often load configuration from external # sources, such as your system environment. For this reason, # you won't find the :http configuration below, but set inside -# EventosWeb.Endpoint.init/2 when load_from_system_env is +# MobilizonWeb.Endpoint.init/2 when load_from_system_env is # true. Any dynamic configuration should be done there. # # Don't forget to configure the url host to something meaningful, @@ -13,12 +13,12 @@ use Mix.Config # containing the digested version of static files. This # manifest is generated by the mix phx.digest task # which you typically run after static files are built. -config :eventos, EventosWeb.Endpoint, +config :mobilizon, MobilizonWeb.Endpoint, load_from_system_env: true, url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/cache_manifest.json" -config :eventos, Eventos.Mailer, +config :mobilizon, Mobilizon.Mailer, adapter: Bamboo.SMTPAdapter, server: "localhost", hostname: "localhost", @@ -45,7 +45,7 @@ config :logger, level: :info # To get SSL working, you will need to add the `https` key # to the previous section and set your `:url` port to 443: # -# config :eventos, EventosWeb.Endpoint, +# config :mobilizon, MobilizonWeb.Endpoint, # ... # url: [host: "example.com", port: 443], # https: [:inet6, @@ -60,7 +60,7 @@ config :logger, level: :info # We also recommend setting `force_ssl`, ensuring no data is # ever sent via http, always redirecting to https: # -# config :eventos, EventosWeb.Endpoint, +# config :mobilizon, MobilizonWeb.Endpoint, # force_ssl: [hsts: true] # # Check `Plug.SSL` for all available options in `force_ssl`. @@ -75,7 +75,7 @@ config :logger, level: :info # Alternatively, you can configure exactly which server to # start per endpoint: # -# config :eventos, EventosWeb.Endpoint, server: true +# config :mobilizon, MobilizonWeb.Endpoint, server: true # # Finally import the config/prod.secret.exs diff --git a/config/test.exs b/config/test.exs index 9d67a4ee8..6c9c1f8d5 100644 --- a/config/test.exs +++ b/config/test.exs @@ -2,7 +2,7 @@ use Mix.Config # We don't run a server during test. If one is required, # you can enable the server option below. -config :eventos, EventosWeb.Endpoint, +config :mobilizon, MobilizonWeb.Endpoint, http: [port: 4001], server: false @@ -13,13 +13,13 @@ config :logger, level: :info # Configure your database -config :eventos, Eventos.Repo, +config :mobilizon, Mobilizon.Repo, adapter: Ecto.Adapters.Postgres, username: System.get_env("POSTGRES_USER") || "elixir", password: System.get_env("POSTGRES_PASSWORD") || "elixir", - database: "eventos_test", + database: "mobilizon_test", hostname: System.get_env("POSTGRES_HOST") || "localhost", pool: Ecto.Adapters.SQL.Sandbox, - types: Eventos.PostgresTypes + types: Mobilizon.PostgresTypes -config :eventos, Eventos.Mailer, adapter: Bamboo.TestAdapter +config :mobilizon, Mobilizon.Mailer, adapter: Bamboo.TestAdapter diff --git a/docker-compose.yml b/docker-compose.yml index 33b7f301c..df37c4d7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,15 +3,15 @@ version: '3' services: postgres: - container_name: eventos_db + container_name: mobilizon_db restart: unless-stopped image: mdillon/postgis:10 environment: POSTGRES_PASSWORD: postgres - POSTGRES_DB: eventos_dev + POSTGRES_DB: mobilizon_dev front: - container_name: eventos_front + container_name: mobilizon_front restart: unless-stopped build: ./js volumes: @@ -21,7 +21,7 @@ services: entrypoint: entrypoint api: - container_name: eventos_api + container_name: mobilizon_api restart: unless-stopped build: . volumes: @@ -33,7 +33,7 @@ services: environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres - POSTGRES_DATABASE: eventos_dev + POSTGRES_DATABASE: mobilizon_dev POSTGRES_HOST: postgres PORT: 4000 entrypoint: entrypoint diff --git a/js/.env.dist b/js/.env.dist index 7a1024727..fc4c3f76f 100644 --- a/js/.env.dist +++ b/js/.env.dist @@ -1,3 +1,3 @@ -API_HOST=eventos.tld -API_ORIGIN=https://eventos.tld +API_HOST=mobilizon.tld +API_ORIGIN=https://mobilizon.tld API_PATH=/api/v1 diff --git a/js/package-lock.json b/js/package-lock.json index 23ab27648..e0b3195b8 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -1,5 +1,5 @@ { - "name": "eventos", + "name": "mobilizon", "version": "0.1.0", "lockfileVersion": 1, "requires": true, diff --git a/js/package.json b/js/package.json index bece09721..1072b6ca5 100644 --- a/js/package.json +++ b/js/package.json @@ -1,5 +1,5 @@ { - "name": "eventos", + "name": "mobilizon", "version": "0.1.0", "private": true, "scripts": { diff --git a/js/public/index.html b/js/public/index.html index d71e5fbbd..27e6f83c0 100644 --- a/js/public/index.html +++ b/js/public/index.html @@ -5,11 +5,11 @@ - eventos + mobilizon
diff --git a/js/public/manifest.json b/js/public/manifest.json index 6635eec2d..2d05e866b 100644 --- a/js/public/manifest.json +++ b/js/public/manifest.json @@ -1,6 +1,6 @@ { - "name": "eventos", - "short_name": "eventos", + "name": "mobilizon", + "short_name": "mobilizon", "icons": [ { "src": "/img/icons/android-chrome-192x192.png", diff --git a/js/src/components/Home.vue b/js/src/components/Home.vue index d044b909b..f405fde02 100644 --- a/js/src/components/Home.vue +++ b/js/src/components/Home.vue @@ -11,7 +11,7 @@

Find events you like

-

Share it with Eventos

+

Share it with Mobilizon

{{ $t("home.register") }}
diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 41376228b..018710306 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -8,7 +8,7 @@ > - Eventos + Mobilizon - - "> - - - <%= render @view_module, @view_template, assigns %> - -

<%= gettext "An email sent by Eventos on %{instance}.", instance: @instance %>

- - diff --git a/lib/eventos_web/templates/email/email.text.eex b/lib/eventos_web/templates/email/email.text.eex deleted file mode 100644 index 804356ecf..000000000 --- a/lib/eventos_web/templates/email/email.text.eex +++ /dev/null @@ -1,3 +0,0 @@ -<%= render @view_module, @view_template, assigns %> - -<%= gettext "An email sent by Eventos on %{instance}.", instance: @instance %> diff --git a/lib/eventos_web/views/email_view.ex b/lib/eventos_web/views/email_view.ex deleted file mode 100644 index d4eba334b..000000000 --- a/lib/eventos_web/views/email_view.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Eventos.EmailView do - use EventosWeb, :view -end diff --git a/lib/eventos_web/views/page_view.ex b/lib/eventos_web/views/page_view.ex deleted file mode 100644 index 53b269f16..000000000 --- a/lib/eventos_web/views/page_view.ex +++ /dev/null @@ -1,6 +0,0 @@ -defmodule EventosWeb.PageView do - @moduledoc """ - View for our webapp - """ - use EventosWeb, :view -end diff --git a/lib/eventos_web/views/user_session_view.ex b/lib/eventos_web/views/user_session_view.ex deleted file mode 100644 index 12298808d..000000000 --- a/lib/eventos_web/views/user_session_view.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule EventosWeb.UserSessionView do - @moduledoc """ - View for user Sessions - """ - use EventosWeb, :view - - def render("token.json", %{token: token, user: user}) do - %{token: token, user: render_one(user, EventosWeb.UserView, "user_simple.json")} - end -end diff --git a/lib/mix/tasks/create_bot.ex b/lib/mix/tasks/create_bot.ex index a56c0ed08..ca61ed0c4 100644 --- a/lib/mix/tasks/create_bot.ex +++ b/lib/mix/tasks/create_bot.ex @@ -4,10 +4,10 @@ defmodule Mix.Tasks.CreateBot do """ use Mix.Task - alias Eventos.Actors - alias Eventos.Actors.Bot - alias Eventos.Repo - alias Eventos.Actors.User + alias Mobilizon.Actors + alias Mobilizon.Actors.Bot + alias Mobilizon.Repo + alias Mobilizon.Actors.User import Logger @shortdoc "Register user" diff --git a/lib/eventos/activity.ex b/lib/mobilizon/activity.ex similarity index 80% rename from lib/eventos/activity.ex rename to lib/mobilizon/activity.ex index 585fdbce8..354291e12 100644 --- a/lib/eventos/activity.ex +++ b/lib/mobilizon/activity.ex @@ -1,4 +1,4 @@ -defmodule Eventos.Activity do +defmodule Mobilizon.Activity do @moduledoc """ Represents an activity """ diff --git a/lib/eventos/actors/actor.ex b/lib/mobilizon/actors/actor.ex similarity index 83% rename from lib/eventos/actors/actor.ex rename to lib/mobilizon/actors/actor.ex index 750a42935..72dafecb8 100644 --- a/lib/eventos/actors/actor.ex +++ b/lib/mobilizon/actors/actor.ex @@ -1,6 +1,6 @@ import EctoEnum -defenum(Eventos.Actors.ActorTypeEnum, :actor_type, [ +defenum(Mobilizon.Actors.ActorTypeEnum, :actor_type, [ :Person, :Application, :Group, @@ -8,19 +8,19 @@ defenum(Eventos.Actors.ActorTypeEnum, :actor_type, [ :Service ]) -defmodule Eventos.Actors.Actor do +defmodule Mobilizon.Actors.Actor do @moduledoc """ Represents an actor (local and remote actors) """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Actors - alias Eventos.Actors.{Actor, User, Follower, Member} - alias Eventos.Events.Event - alias Eventos.Service.ActivityPub + alias Mobilizon.Actors + alias Mobilizon.Actors.{Actor, User, Follower, Member} + alias Mobilizon.Events.Event + alias Mobilizon.Service.ActivityPub import Ecto.Query - alias Eventos.Repo + alias Mobilizon.Repo import Logger @@ -33,7 +33,7 @@ defmodule Eventos.Actors.Actor do field(:following_url, :string) field(:followers_url, :string) field(:shared_inbox_url, :string) - field(:type, Eventos.Actors.ActorTypeEnum, default: :Person) + field(:type, Mobilizon.Actors.ActorTypeEnum, default: :Person) field(:name, :string) field(:domain, :string) field(:summary, :string) @@ -73,7 +73,7 @@ defmodule Eventos.Actors.Actor do :banner_url, :user_id ]) - |> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["preferred_username"]}") + |> put_change(:url, "#{MobilizonWeb.Endpoint.url()}/@#{attrs["preferred_username"]}") |> validate_required([:preferred_username, :keys, :suspended, :url]) |> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index) end @@ -94,10 +94,10 @@ defmodule Eventos.Actors.Actor do :user_id ]) |> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index) - |> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}") - |> put_change(:inbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/inbox") - |> put_change(:outbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/outbox") - |> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox") + |> put_change(:url, "#{MobilizonWeb.Endpoint.url()}/@#{attrs.preferred_username}") + |> put_change(:inbox_url, "#{MobilizonWeb.Endpoint.url()}/@#{attrs.preferred_username}/inbox") + |> put_change(:outbox_url, "#{MobilizonWeb.Endpoint.url()}/@#{attrs.preferred_username}/outbox") + |> put_change(:shared_inbox_url, "#{MobilizonWeb.Endpoint.url()}/inbox") |> validate_required([:preferred_username, :keys, :suspended, :url, :type]) end @@ -160,14 +160,14 @@ defmodule Eventos.Actors.Actor do ]) |> put_change( :outbox_url, - "#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/outbox" + "#{MobilizonWeb.Endpoint.url()}/@#{params["preferred_username"]}/outbox" ) |> put_change( :inbox_url, - "#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/inbox" + "#{MobilizonWeb.Endpoint.url()}/@#{params["preferred_username"]}/inbox" ) - |> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox") - |> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}") + |> put_change(:shared_inbox_url, "#{MobilizonWeb.Endpoint.url()}/inbox") + |> put_change(:url, "#{MobilizonWeb.Endpoint.url()}/@#{params["preferred_username"]}") |> put_change(:domain, nil) |> put_change(:type, :Group) |> validate_required([:url, :outbox_url, :inbox_url, :type, :name, :preferred_username]) @@ -180,7 +180,7 @@ defmodule Eventos.Actors.Actor do def get_public_key_for_url(url) do with {:ok, %Actor{} = actor} <- Actors.get_or_fetch_by_url(url) do actor.keys - |> Eventos.Service.ActivityPub.Utils.pem_to_public_key() + |> Mobilizon.Service.ActivityPub.Utils.pem_to_public_key() else _ -> :error end diff --git a/lib/eventos/actors/actors.ex b/lib/mobilizon/actors/actors.ex similarity index 95% rename from lib/eventos/actors/actors.ex rename to lib/mobilizon/actors/actors.ex index 3e1e579c9..4c2d6ca94 100644 --- a/lib/eventos/actors/actors.ex +++ b/lib/mobilizon/actors/actors.ex @@ -1,15 +1,15 @@ -defmodule Eventos.Actors do +defmodule Mobilizon.Actors do @moduledoc """ The Actors context. """ import Ecto.Query, warn: false - alias Eventos.Repo + alias Mobilizon.Repo - alias Eventos.Actors.Actor - alias Eventos.Actors + alias Mobilizon.Actors.Actor + alias Mobilizon.Actors - alias Eventos.Service.ActivityPub + alias Mobilizon.Service.ActivityPub @doc """ Returns the list of actors. @@ -147,7 +147,7 @@ defmodule Eventos.Actors do |> Repo.insert() end - alias Eventos.Actors.User + alias Mobilizon.Actors.User @doc """ Returns the list of users. @@ -361,7 +361,7 @@ defmodule Eventos.Actors do case Comeonin.Argon2.checkpw(password, user.password_hash) do true -> # Yes, create and return the token - EventosWeb.Guardian.encode_and_sign(user) + MobilizonWeb.Guardian.encode_and_sign(user) _ -> # No, return an error @@ -391,7 +391,7 @@ defmodule Eventos.Actors do end actor = - Eventos.Actors.Actor.registration_changeset(%Eventos.Actors.Actor{}, %{ + Mobilizon.Actors.Actor.registration_changeset(%Mobilizon.Actors.Actor{}, %{ preferred_username: username, domain: nil, keys: pem, @@ -399,7 +399,7 @@ defmodule Eventos.Actors do }) user = - Eventos.Actors.User.registration_changeset(%Eventos.Actors.User{}, %{ + Mobilizon.Actors.User.registration_changeset(%Mobilizon.Actors.User{}, %{ email: email, password: password }) @@ -407,7 +407,7 @@ defmodule Eventos.Actors do actor_with_user = Ecto.Changeset.put_assoc(actor, :user, user) try do - Eventos.Repo.insert!(actor_with_user) + Mobilizon.Repo.insert!(actor_with_user) find_by_email(email) rescue e in Ecto.InvalidChangesetError -> @@ -421,7 +421,7 @@ defmodule Eventos.Actors do pem = [entry] |> :public_key.pem_encode() |> String.trim_trailing() actor = - Eventos.Actors.Actor.registration_changeset(%Eventos.Actors.Actor{}, %{ + Mobilizon.Actors.Actor.registration_changeset(%Mobilizon.Actors.Actor{}, %{ preferred_username: name, domain: nil, keys: pem, @@ -430,7 +430,7 @@ defmodule Eventos.Actors do }) try do - Eventos.Repo.insert!(actor) + Mobilizon.Repo.insert!(actor) rescue e in Ecto.InvalidChangesetError -> {:error, e.changeset} @@ -520,7 +520,7 @@ defmodule Eventos.Actors do User.changeset(user, %{}) end - alias Eventos.Actors.Member + alias Mobilizon.Actors.Member @doc """ Gets a single member. @@ -626,7 +626,7 @@ defmodule Eventos.Actors do ) end - alias Eventos.Actors.Bot + alias Mobilizon.Actors.Bot @doc """ Returns the list of bots. @@ -727,7 +727,7 @@ defmodule Eventos.Actors do Bot.changeset(bot, %{}) end - alias Eventos.Actors.Follower + alias Mobilizon.Actors.Follower @doc """ Gets a single follower. diff --git a/lib/eventos/actors/bot.ex b/lib/mobilizon/actors/bot.ex similarity index 84% rename from lib/eventos/actors/bot.ex rename to lib/mobilizon/actors/bot.ex index a3307e48b..6a75f5836 100644 --- a/lib/eventos/actors/bot.ex +++ b/lib/mobilizon/actors/bot.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Actors.Bot do +defmodule Mobilizon.Actors.Bot do @moduledoc """ Represents a local bot """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Actors.{Actor, User, Bot} + alias Mobilizon.Actors.{Actor, User, Bot} schema "bots" do field(:source, :string) diff --git a/lib/eventos/actors/follower.ex b/lib/mobilizon/actors/follower.ex similarity index 85% rename from lib/eventos/actors/follower.ex rename to lib/mobilizon/actors/follower.ex index ac69e546e..a25fec3a5 100644 --- a/lib/eventos/actors/follower.ex +++ b/lib/mobilizon/actors/follower.ex @@ -1,11 +1,11 @@ -defmodule Eventos.Actors.Follower do +defmodule Mobilizon.Actors.Follower do @moduledoc """ Represents the following of an actor to another actor """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Actors.Follower - alias Eventos.Actors.Actor + alias Mobilizon.Actors.Follower + alias Mobilizon.Actors.Actor schema "followers" do field(:approved, :boolean, default: false) diff --git a/lib/eventos/actors/member.ex b/lib/mobilizon/actors/member.ex similarity index 86% rename from lib/eventos/actors/member.ex rename to lib/mobilizon/actors/member.ex index 9b51991c0..8770df02c 100644 --- a/lib/eventos/actors/member.ex +++ b/lib/mobilizon/actors/member.ex @@ -1,11 +1,11 @@ -defmodule Eventos.Actors.Member do +defmodule Mobilizon.Actors.Member do @moduledoc """ Represents the membership of an actor to a group """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Actors.Member - alias Eventos.Actors.Actor + alias Mobilizon.Actors.Member + alias Mobilizon.Actors.Actor schema "members" do field(:approved, :boolean, default: true) diff --git a/lib/eventos/actors/service/activation.ex b/lib/mobilizon/actors/service/activation.ex similarity index 85% rename from lib/eventos/actors/service/activation.ex rename to lib/mobilizon/actors/service/activation.ex index d51c80a93..6487184d8 100644 --- a/lib/eventos/actors/service/activation.ex +++ b/lib/mobilizon/actors/service/activation.ex @@ -1,8 +1,8 @@ -defmodule Eventos.Actors.Service.Activation do +defmodule Mobilizon.Actors.Service.Activation do @moduledoc false - alias Eventos.{Mailer, Repo, Actors.User, Actors} - alias Eventos.Email.User, as: UserEmail + alias Mobilizon.{Mailer, Repo, Actors.User, Actors} + alias Mobilizon.Email.User, as: UserEmail require Logger diff --git a/lib/eventos/actors/service/reset_password.ex b/lib/mobilizon/actors/service/reset_password.ex similarity index 93% rename from lib/eventos/actors/service/reset_password.ex rename to lib/mobilizon/actors/service/reset_password.ex index 8adad04d5..8521c6cce 100644 --- a/lib/eventos/actors/service/reset_password.ex +++ b/lib/mobilizon/actors/service/reset_password.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Actors.Service.ResetPassword do +defmodule Mobilizon.Actors.Service.ResetPassword do @moduledoc false require Logger - alias Eventos.{Mailer, Repo, Actors.User} - alias Eventos.Email.User, as: UserEmail + alias Mobilizon.{Mailer, Repo, Actors.User} + alias Mobilizon.Email.User, as: UserEmail @doc """ Check that the provided token is correct and update provided password diff --git a/lib/eventos/actors/user.ex b/lib/mobilizon/actors/user.ex similarity index 97% rename from lib/eventos/actors/user.ex rename to lib/mobilizon/actors/user.ex index 815c98755..b0fc5c6e9 100644 --- a/lib/eventos/actors/user.ex +++ b/lib/mobilizon/actors/user.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Actors.User do +defmodule Mobilizon.Actors.User do @moduledoc """ Represents a local user """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Actors.{Actor, User} + alias Mobilizon.Actors.{Actor, User} schema "users" do field(:email, :string) diff --git a/lib/eventos/addresses/address.ex b/lib/mobilizon/addresses/address.ex similarity index 84% rename from lib/eventos/addresses/address.ex rename to lib/mobilizon/addresses/address.ex index 472e8775e..4ac927306 100644 --- a/lib/eventos/addresses/address.ex +++ b/lib/mobilizon/addresses/address.ex @@ -1,11 +1,11 @@ -defmodule Eventos.Addresses.Address do +defmodule Mobilizon.Addresses.Address do @moduledoc "An address for an event or a group" use Ecto.Schema import Ecto.Changeset - alias Eventos.Addresses.Address - alias Eventos.Events.Event - alias Eventos.Groups.Group + alias Mobilizon.Addresses.Address + alias Mobilizon.Events.Event + alias Mobilizon.Groups.Group schema "addresses" do field(:addressCountry, :string) diff --git a/lib/eventos/addresses/addresses.ex b/lib/mobilizon/addresses/addresses.ex similarity index 96% rename from lib/eventos/addresses/addresses.ex rename to lib/mobilizon/addresses/addresses.ex index f56b9625b..62f93592b 100644 --- a/lib/eventos/addresses/addresses.ex +++ b/lib/mobilizon/addresses/addresses.ex @@ -1,12 +1,12 @@ -defmodule Eventos.Addresses do +defmodule Mobilizon.Addresses do @moduledoc """ The Addresses context. """ import Ecto.Query, warn: false - alias Eventos.Repo + alias Mobilizon.Repo - alias Eventos.Addresses.Address + alias Mobilizon.Addresses.Address import Logger diff --git a/lib/eventos/application.ex b/lib/mobilizon/application.ex similarity index 61% rename from lib/eventos/application.ex rename to lib/mobilizon/application.ex index 0fb3bf10e..68ad7fe40 100644 --- a/lib/eventos/application.ex +++ b/lib/mobilizon/application.ex @@ -1,6 +1,6 @@ -defmodule Eventos.Application do +defmodule Mobilizon.Application do @moduledoc """ - The Eventos application + The Mobilizon application """ use Application @@ -12,25 +12,25 @@ defmodule Eventos.Application do # Define workers and child supervisors to be supervised children = [ # Start the Ecto repository - supervisor(Eventos.Repo, []), + supervisor(Mobilizon.Repo, []), # Start the endpoint when the application starts - supervisor(EventosWeb.Endpoint, []), - # Start your own worker by calling: Eventos.Worker.start_link(arg1, arg2, arg3) - # worker(Eventos.Worker, [arg1, arg2, arg3]), + supervisor(MobilizonWeb.Endpoint, []), + # Start your own worker by calling: Mobilizon.Worker.start_link(arg1, arg2, arg3) + # worker(Mobilizon.Worker, [arg1, arg2, arg3]), worker(Guardian.DB.Token.SweeperServer, []), - worker(Eventos.Service.Federator, []) + worker(Mobilizon.Service.Federator, []) ] # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options - opts = [strategy: :one_for_one, name: Eventos.Supervisor] + opts = [strategy: :one_for_one, name: Mobilizon.Supervisor] Supervisor.start_link(children, opts) end # Tell Phoenix to update the endpoint configuration # whenever the application is updated. def config_change(changed, _new, removed) do - EventosWeb.Endpoint.config_change(changed, removed) + MobilizonWeb.Endpoint.config_change(changed, removed) :ok end end diff --git a/lib/eventos/email/user.ex b/lib/mobilizon/email/user.ex similarity index 74% rename from lib/eventos/email/user.ex rename to lib/mobilizon/email/user.ex index 9de7a9ecc..d4882e294 100644 --- a/lib/eventos/email/user.ex +++ b/lib/mobilizon/email/user.ex @@ -1,13 +1,13 @@ -defmodule Eventos.Email.User do +defmodule Mobilizon.Email.User do @moduledoc """ Handles emails sent to users """ - alias Eventos.Actors.User + alias Mobilizon.Actors.User import Bamboo.Email import Bamboo.Phoenix - use Bamboo.Phoenix, view: Eventos.EmailView - import EventosWeb.Gettext + use Bamboo.Phoenix, view: Mobilizon.EmailView + import MobilizonWeb.Gettext def confirmation_email(%User{} = user, locale \\ "en") do Gettext.put_locale(locale) @@ -45,13 +45,13 @@ defmodule Eventos.Email.User do defp base_email do # Here you can set a default from, default headers, etc. new_email() - |> from(Application.get_env(:eventos, EventosWeb.Endpoint)[:email_from]) - |> put_html_layout({Eventos.EmailView, "email.html"}) - |> put_text_layout({Eventos.EmailView, "email.text"}) + |> from(Application.get_env(:mobilizon, MobilizonWeb.Endpoint)[:email_from]) + |> put_html_layout({Mobilizon.EmailView, "email.html"}) + |> put_text_layout({Mobilizon.EmailView, "email.text"}) end @spec get_config(atom()) :: any() defp get_config(key) do - _config = Application.get_env(:eventos, EventosWeb.Endpoint) |> Keyword.get(key) + _config = Application.get_env(:mobilizon, MobilizonWeb.Endpoint) |> Keyword.get(key) end end diff --git a/lib/eventos/events/category.ex b/lib/mobilizon/events/category.ex similarity index 86% rename from lib/eventos/events/category.ex rename to lib/mobilizon/events/category.ex index 334eafd9b..c69218665 100644 --- a/lib/eventos/events/category.ex +++ b/lib/mobilizon/events/category.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Events.Category do +defmodule Mobilizon.Events.Category do @moduledoc """ Represents a category for events """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.Category + alias Mobilizon.Events.Category schema "categories" do field(:description, :string) diff --git a/lib/eventos/events/comment.ex b/lib/mobilizon/events/comment.ex similarity index 84% rename from lib/eventos/events/comment.ex rename to lib/mobilizon/events/comment.ex index 025604712..cbc9a6f57 100644 --- a/lib/eventos/events/comment.ex +++ b/lib/mobilizon/events/comment.ex @@ -1,4 +1,4 @@ -defmodule Eventos.Events.Comment do +defmodule Mobilizon.Events.Comment do @moduledoc """ An actor comment (for instance on an event or on a group) """ @@ -6,9 +6,9 @@ defmodule Eventos.Events.Comment do use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.Event - alias Eventos.Actors.Actor - alias Eventos.Actors.Comment + alias Mobilizon.Events.Event + alias Mobilizon.Actors.Actor + alias Mobilizon.Actors.Comment schema "comments" do field(:text, :string) @@ -32,7 +32,7 @@ defmodule Eventos.Events.Comment do url = if Map.has_key?(attrs, "url"), do: attrs["url"], - else: "#{EventosWeb.Endpoint.url()}/comments/#{uuid}" + else: "#{MobilizonWeb.Endpoint.url()}/comments/#{uuid}" comment |> cast(attrs, [:url, :text, :actor_id, :event_id, :in_reply_to_comment_id, :attributed_to_id]) diff --git a/lib/eventos/events/event.ex b/lib/mobilizon/events/event.ex similarity index 90% rename from lib/eventos/events/event.ex rename to lib/mobilizon/events/event.ex index dfbfc1569..804dcffaf 100644 --- a/lib/eventos/events/event.ex +++ b/lib/mobilizon/events/event.ex @@ -1,15 +1,15 @@ import EctoEnum defenum(AddressTypeEnum, :address_type, [:physical, :url, :phone, :other]) -defmodule Eventos.Events.Event do +defmodule Mobilizon.Events.Event do @moduledoc """ Represents an event """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.{Event, Participant, Tag, Category, Session, Track} - alias Eventos.Actors.Actor - alias Eventos.Addresses.Address + alias Mobilizon.Events.{Event, Participant, Tag, Category, Session, Track} + alias Mobilizon.Actors.Actor + alias Mobilizon.Addresses.Address schema "events" do field(:url, :string) @@ -58,7 +58,7 @@ defmodule Eventos.Events.Event do url = if Map.has_key?(attrs, "url"), do: attrs["url"], - else: "#{EventosWeb.Endpoint.url()}/@#{actor_url}/#{uuid}" + else: "#{MobilizonWeb.Endpoint.url()}/@#{actor_url}/#{uuid}" event |> Ecto.Changeset.cast(attrs, [ diff --git a/lib/eventos/events/events.ex b/lib/mobilizon/events/events.ex similarity index 97% rename from lib/eventos/events/events.ex rename to lib/mobilizon/events/events.ex index 339dddf1a..bd110dbfa 100644 --- a/lib/eventos/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -1,15 +1,15 @@ -defmodule Eventos.Events do +defmodule Mobilizon.Events do @moduledoc """ The Events context. """ import Ecto.Query, warn: false - alias Eventos.Repo + alias Mobilizon.Repo - alias Eventos.Events.Event - alias Eventos.Events.Comment - alias Eventos.Actors.Actor - alias Eventos.Addresses.Address + alias Mobilizon.Events.Event + alias Mobilizon.Events.Comment + alias Mobilizon.Actors.Actor + alias Mobilizon.Addresses.Address @doc """ Returns the list of events. @@ -263,7 +263,7 @@ defmodule Eventos.Events do Event.changeset(event, %{}) end - alias Eventos.Events.Category + alias Mobilizon.Events.Category @doc """ Returns the list of categories. @@ -364,7 +364,7 @@ defmodule Eventos.Events do Category.changeset(category, %{}) end - alias Eventos.Events.Tag + alias Mobilizon.Events.Tag @doc """ Returns the list of tags. @@ -460,7 +460,7 @@ defmodule Eventos.Events do Tag.changeset(tag, %{}) end - alias Eventos.Events.Participant + alias Mobilizon.Events.Participant @doc """ Returns the list of participants. @@ -562,7 +562,7 @@ defmodule Eventos.Events do Repo.all(from(p in Participant, where: p.actor_id == ^actor.id and p.approved == false)) end - alias Eventos.Events.Session + alias Mobilizon.Events.Session @doc """ Returns the list of sessions. @@ -679,7 +679,7 @@ defmodule Eventos.Events do Session.changeset(session, %{}) end - alias Eventos.Events.Track + alias Mobilizon.Events.Track @doc """ Returns the list of tracks. @@ -775,7 +775,7 @@ defmodule Eventos.Events do Track.changeset(track, %{}) end - alias Eventos.Events.Comment + alias Mobilizon.Events.Comment @doc """ Returns the list of comments. diff --git a/lib/eventos/events/participant.ex b/lib/mobilizon/events/participant.ex similarity index 84% rename from lib/eventos/events/participant.ex rename to lib/mobilizon/events/participant.ex index 116c604c9..9b7506f00 100644 --- a/lib/eventos/events/participant.ex +++ b/lib/mobilizon/events/participant.ex @@ -1,11 +1,11 @@ -defmodule Eventos.Events.Participant do +defmodule Mobilizon.Events.Participant do @moduledoc """ Represents a participant, an actor participating to an event """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.{Participant, Event} - alias Eventos.Actors.Actor + alias Mobilizon.Events.{Participant, Event} + alias Mobilizon.Actors.Actor @primary_key false schema "participants" do diff --git a/lib/eventos/events/session.ex b/lib/mobilizon/events/session.ex similarity index 92% rename from lib/eventos/events/session.ex rename to lib/mobilizon/events/session.ex index 34901e466..178670f2a 100644 --- a/lib/eventos/events/session.ex +++ b/lib/mobilizon/events/session.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Events.Session do +defmodule Mobilizon.Events.Session do @moduledoc """ Represents a session for an event (such as a talk at a conference) """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.{Session, Event, Track} + alias Mobilizon.Events.{Session, Event, Track} schema "sessions" do field(:audios_urls, :string) diff --git a/lib/eventos/events/tag.ex b/lib/mobilizon/events/tag.ex similarity index 79% rename from lib/eventos/events/tag.ex rename to lib/mobilizon/events/tag.ex index 08137b212..d0453bb51 100644 --- a/lib/eventos/events/tag.ex +++ b/lib/mobilizon/events/tag.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Events.Tag.TitleSlug do +defmodule Mobilizon.Events.Tag.TitleSlug do @moduledoc """ Generates slugs for tags """ - alias Eventos.Events.Tag + alias Mobilizon.Events.Tag import Ecto.Query - alias Eventos.Repo + alias Mobilizon.Repo use EctoAutoslugField.Slug, from: :title, to: :slug def build_slug(sources, changeset) do @@ -25,20 +25,20 @@ defmodule Eventos.Events.Tag.TitleSlug do _story -> slug - |> Eventos.Slug.increment_slug() + |> Mobilizon.Slug.increment_slug() |> build_unique_slug(changeset) end end end -defmodule Eventos.Events.Tag do +defmodule Mobilizon.Events.Tag do @moduledoc """ Represents a tag for events """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.Tag - alias Eventos.Events.Tag.TitleSlug + alias Mobilizon.Events.Tag + alias Mobilizon.Events.Tag.TitleSlug schema "tags" do field(:title, :string) diff --git a/lib/eventos/events/track.ex b/lib/mobilizon/events/track.ex similarity index 86% rename from lib/eventos/events/track.ex rename to lib/mobilizon/events/track.ex index 62efd945c..a3dab3709 100644 --- a/lib/eventos/events/track.ex +++ b/lib/mobilizon/events/track.ex @@ -1,10 +1,10 @@ -defmodule Eventos.Events.Track do +defmodule Mobilizon.Events.Track do @moduledoc """ Represents a track for an event (such as a theme) having multiple sessions """ use Ecto.Schema import Ecto.Changeset - alias Eventos.Events.{Track, Event, Session} + alias Mobilizon.Events.{Track, Event, Session} schema "tracks" do field(:color, :string) diff --git a/lib/eventos/export/icalendar.ex b/lib/mobilizon/export/icalendar.ex similarity index 85% rename from lib/eventos/export/icalendar.ex rename to lib/mobilizon/export/icalendar.ex index 08cd25776..31a1c33f5 100644 --- a/lib/eventos/export/icalendar.ex +++ b/lib/mobilizon/export/icalendar.ex @@ -1,9 +1,9 @@ -defmodule Eventos.Export.ICalendar do +defmodule Mobilizon.Export.ICalendar do @moduledoc """ Export an event to iCalendar format """ - alias Eventos.Events.Event + alias Mobilizon.Events.Event @spec export_event(%Event{}) :: String def export_event(%Event{} = event) do diff --git a/lib/mobilizon/mailer.ex b/lib/mobilizon/mailer.ex new file mode 100644 index 000000000..0884ceb77 --- /dev/null +++ b/lib/mobilizon/mailer.ex @@ -0,0 +1,6 @@ +defmodule Mobilizon.Mailer do + @moduledoc """ + Mailer + """ + use Bamboo.Mailer, otp_app: :mobilizon +end diff --git a/lib/eventos/postgrex_types.ex b/lib/mobilizon/postgrex_types.ex similarity index 79% rename from lib/eventos/postgrex_types.ex rename to lib/mobilizon/postgrex_types.ex index a068a00d3..0ff906637 100644 --- a/lib/eventos/postgrex_types.ex +++ b/lib/mobilizon/postgrex_types.ex @@ -1,5 +1,5 @@ Postgrex.Types.define( - Eventos.PostgresTypes, + Mobilizon.PostgresTypes, [Geo.PostGIS.Extension] ++ Ecto.Adapters.Postgres.extensions(), json: Poison ) diff --git a/lib/eventos/repo.ex b/lib/mobilizon/repo.ex similarity index 73% rename from lib/eventos/repo.ex rename to lib/mobilizon/repo.ex index 13b5255e3..1ce8c576b 100644 --- a/lib/eventos/repo.ex +++ b/lib/mobilizon/repo.ex @@ -1,8 +1,8 @@ -defmodule Eventos.Repo do +defmodule Mobilizon.Repo do @moduledoc """ - Eventos Repo + Mobilizon Repo """ - use Ecto.Repo, otp_app: :eventos + use Ecto.Repo, otp_app: :mobilizon @doc """ Dynamically loads the repository url from the diff --git a/lib/eventos/slug.ex b/lib/mobilizon/slug.ex similarity index 93% rename from lib/eventos/slug.ex rename to lib/mobilizon/slug.ex index e69ed9633..857590634 100644 --- a/lib/eventos/slug.ex +++ b/lib/mobilizon/slug.ex @@ -1,4 +1,4 @@ -defmodule Eventos.Slug do +defmodule Mobilizon.Slug do @moduledoc """ Common functions for slug generation """ diff --git a/lib/eventos_web/auth_error_handler.ex b/lib/mobilizon_web/auth_error_handler.ex similarity index 83% rename from lib/eventos_web/auth_error_handler.ex rename to lib/mobilizon_web/auth_error_handler.ex index f819b8e47..fea3e6500 100644 --- a/lib/eventos_web/auth_error_handler.ex +++ b/lib/mobilizon_web/auth_error_handler.ex @@ -1,4 +1,4 @@ -defmodule EventosWeb.AuthErrorHandler do +defmodule MobilizonWeb.AuthErrorHandler do @moduledoc """ In case we have an auth error """ diff --git a/lib/eventos_web/auth_pipeline.ex b/lib/mobilizon_web/auth_pipeline.ex similarity index 62% rename from lib/eventos_web/auth_pipeline.ex rename to lib/mobilizon_web/auth_pipeline.ex index c441c9ad4..5ddcce967 100644 --- a/lib/eventos_web/auth_pipeline.ex +++ b/lib/mobilizon_web/auth_pipeline.ex @@ -1,12 +1,12 @@ -defmodule EventosWeb.AuthPipeline do +defmodule MobilizonWeb.AuthPipeline do @moduledoc """ Handles the app sessions """ use Guardian.Plug.Pipeline, - otp_app: :eventos, - module: EventosWeb.Guardian, - error_handler: EventosWeb.AuthErrorHandler + otp_app: :mobilizon, + module: MobilizonWeb.Guardian, + error_handler: MobilizonWeb.AuthErrorHandler plug(Guardian.Plug.VerifyHeader, claims: %{"typ" => "access"}) plug(Guardian.Plug.EnsureAuthenticated) diff --git a/lib/eventos_web/channels/user_socket.ex b/lib/mobilizon_web/channels/user_socket.ex similarity index 86% rename from lib/eventos_web/channels/user_socket.ex rename to lib/mobilizon_web/channels/user_socket.ex index dd0c3a156..dd222e6a4 100644 --- a/lib/eventos_web/channels/user_socket.ex +++ b/lib/mobilizon_web/channels/user_socket.ex @@ -1,11 +1,11 @@ -defmodule EventosWeb.UserSocket do +defmodule MobilizonWeb.UserSocket do @moduledoc """ Channel for User """ use Phoenix.Socket # Channels - # channel "room:*", EventosWeb.RoomChannel + # channel "room:*", MobilizonWeb.RoomChannel # Transports transport(:websocket, Phoenix.Transports.WebSocket) @@ -33,7 +33,7 @@ defmodule EventosWeb.UserSocket do # Would allow you to broadcast a "disconnect" event and terminate # all active sockets and channels for a given user: # - # EventosWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) + # MobilizonWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{}) # # Returning `nil` makes this socket anonymous. def id(_socket), do: nil diff --git a/lib/eventos_web/controllers/activity_pub_controller.ex b/lib/mobilizon_web/controllers/activity_pub_controller.ex similarity index 93% rename from lib/eventos_web/controllers/activity_pub_controller.ex rename to lib/mobilizon_web/controllers/activity_pub_controller.ex index 7646cb749..40963cc0f 100644 --- a/lib/eventos_web/controllers/activity_pub_controller.ex +++ b/lib/mobilizon_web/controllers/activity_pub_controller.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.ActivityPubController do - use EventosWeb, :controller - alias Eventos.{Actors, Actors.Actor, Events, Events.Event} - alias EventosWeb.ActivityPub.{ObjectView, ActorView} - alias Eventos.Service.ActivityPub - alias Eventos.Service.Federator +defmodule MobilizonWeb.ActivityPubController do + use MobilizonWeb, :controller + alias Mobilizon.{Actors, Actors.Actor, Events, Events.Event} + alias MobilizonWeb.ActivityPub.{ObjectView, ActorView} + alias Mobilizon.Service.ActivityPub + alias Mobilizon.Service.Federator require Logger diff --git a/lib/eventos_web/controllers/actor_controller.ex b/lib/mobilizon_web/controllers/actor_controller.ex similarity index 90% rename from lib/eventos_web/controllers/actor_controller.ex rename to lib/mobilizon_web/controllers/actor_controller.ex index c3ea9fbee..a933905d2 100644 --- a/lib/eventos_web/controllers/actor_controller.ex +++ b/lib/mobilizon_web/controllers/actor_controller.ex @@ -1,14 +1,14 @@ -defmodule EventosWeb.ActorController do +defmodule MobilizonWeb.ActorController do @moduledoc """ Controller for Actors """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Actors - alias Eventos.Actors.{Actor, User} - alias Eventos.Service.ActivityPub + alias Mobilizon.Actors + alias Mobilizon.Actors.{Actor, User} + alias Mobilizon.Service.ActivityPub - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do actors = Actors.list_actors() diff --git a/lib/eventos_web/controllers/address_controller.ex b/lib/mobilizon_web/controllers/address_controller.ex similarity index 90% rename from lib/eventos_web/controllers/address_controller.ex rename to lib/mobilizon_web/controllers/address_controller.ex index f33d999f4..006e2acdb 100644 --- a/lib/eventos_web/controllers/address_controller.ex +++ b/lib/mobilizon_web/controllers/address_controller.ex @@ -1,14 +1,14 @@ -defmodule EventosWeb.AddressController do +defmodule MobilizonWeb.AddressController do @moduledoc """ A controller for addresses """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Addresses - alias Eventos.Addresses.Address + alias Mobilizon.Addresses + alias Mobilizon.Addresses.Address - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do addresses = Addresses.list_addresses() diff --git a/lib/eventos_web/controllers/bot_controller.ex b/lib/mobilizon_web/controllers/bot_controller.ex similarity index 86% rename from lib/eventos_web/controllers/bot_controller.ex rename to lib/mobilizon_web/controllers/bot_controller.ex index c41d19b80..b817422d0 100644 --- a/lib/eventos_web/controllers/bot_controller.ex +++ b/lib/mobilizon_web/controllers/bot_controller.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.BotController do - use EventosWeb, :controller +defmodule MobilizonWeb.BotController do + use MobilizonWeb, :controller - alias Eventos.Actors - alias Eventos.Actors.{Bot, Actor} + alias Mobilizon.Actors + alias Mobilizon.Actors.{Bot, Actor} - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do bots = Actors.list_bots() diff --git a/lib/eventos_web/controllers/category_controller.ex b/lib/mobilizon_web/controllers/category_controller.ex similarity index 85% rename from lib/eventos_web/controllers/category_controller.ex rename to lib/mobilizon_web/controllers/category_controller.ex index b1d750862..2fd05587a 100644 --- a/lib/eventos_web/controllers/category_controller.ex +++ b/lib/mobilizon_web/controllers/category_controller.ex @@ -1,13 +1,13 @@ -defmodule EventosWeb.CategoryController do +defmodule MobilizonWeb.CategoryController do @moduledoc """ Controller for Categories """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Category + alias Mobilizon.Events + alias Mobilizon.Events.Category - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do categories = Events.list_categories() diff --git a/lib/eventos_web/controllers/comment_controller.ex b/lib/mobilizon_web/controllers/comment_controller.ex similarity index 85% rename from lib/eventos_web/controllers/comment_controller.ex rename to lib/mobilizon_web/controllers/comment_controller.ex index 6d4e2f91b..11f4bbc12 100644 --- a/lib/eventos_web/controllers/comment_controller.ex +++ b/lib/mobilizon_web/controllers/comment_controller.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.CommentController do - use EventosWeb, :controller +defmodule MobilizonWeb.CommentController do + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Comment + alias Mobilizon.Events + alias Mobilizon.Events.Comment - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do comments = Events.list_comments() diff --git a/lib/eventos_web/controllers/event_controller.ex b/lib/mobilizon_web/controllers/event_controller.ex similarity index 90% rename from lib/eventos_web/controllers/event_controller.ex rename to lib/mobilizon_web/controllers/event_controller.ex index d88b96e71..5dd7f808d 100644 --- a/lib/eventos_web/controllers/event_controller.ex +++ b/lib/mobilizon_web/controllers/event_controller.ex @@ -1,16 +1,16 @@ -defmodule EventosWeb.EventController do +defmodule MobilizonWeb.EventController do @moduledoc """ Controller for Events """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Event - alias Eventos.Export.ICalendar + alias Mobilizon.Events + alias Mobilizon.Events.Event + alias Mobilizon.Export.ICalendar require Logger - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do ip = "88.161.154.97" @@ -70,7 +70,7 @@ defmodule EventosWeb.EventController do Map.has_key?(event, "physical_address") -> address = event["physical_address"] - geom = EventosWeb.AddressController.process_geom(address["geom"]) + geom = MobilizonWeb.AddressController.process_geom(address["geom"]) address = case geom do diff --git a/lib/eventos_web/controllers/event_request_controller.ex b/lib/mobilizon_web/controllers/event_request_controller.ex similarity index 88% rename from lib/eventos_web/controllers/event_request_controller.ex rename to lib/mobilizon_web/controllers/event_request_controller.ex index a2f3b9d8d..a0486c169 100644 --- a/lib/eventos_web/controllers/event_request_controller.ex +++ b/lib/mobilizon_web/controllers/event_request_controller.ex @@ -1,13 +1,13 @@ -# defmodule EventosWeb.EventRequestController do +# defmodule MobilizonWeb.EventRequestController do # @moduledoc """ # Controller for Event requests # """ -# use EventosWeb, :controller +# use MobilizonWeb, :controller # -# alias Eventos.Events -# alias Eventos.Events.{Event, Request} +# alias Mobilizon.Events +# alias Mobilizon.Events.{Event, Request} # -# action_fallback EventosWeb.FallbackController +# action_fallback MobilizonWeb.FallbackController # # def index_for_user(conn, _params) do # actor = Guardian.Plug.current_resource(conn).actor diff --git a/lib/eventos_web/controllers/fallback_controller.ex b/lib/mobilizon_web/controllers/fallback_controller.ex similarity index 63% rename from lib/eventos_web/controllers/fallback_controller.ex rename to lib/mobilizon_web/controllers/fallback_controller.ex index 863db7029..c36a23fc9 100644 --- a/lib/eventos_web/controllers/fallback_controller.ex +++ b/lib/mobilizon_web/controllers/fallback_controller.ex @@ -1,26 +1,26 @@ -defmodule EventosWeb.FallbackController do +defmodule MobilizonWeb.FallbackController do @moduledoc """ Translates controller action results into valid `Plug.Conn` responses. See `Phoenix.Controller.action_fallback/1` for more details. """ - use EventosWeb, :controller + use MobilizonWeb, :controller def call(conn, {:error, %Ecto.Changeset{} = changeset}) do conn |> put_status(:unprocessable_entity) - |> render(EventosWeb.ChangesetView, "error.json", changeset: changeset) + |> render(MobilizonWeb.ChangesetView, "error.json", changeset: changeset) end def call(conn, {:error, nil}) do conn |> put_status(:unprocessable_entity) - |> render(EventosWeb.ErrorView, "invalid_request.json") + |> render(MobilizonWeb.ErrorView, "invalid_request.json") end def call(conn, {:error, :not_found}) do conn |> put_status(:not_found) - |> render(EventosWeb.ErrorView, :"404") + |> render(MobilizonWeb.ErrorView, :"404") end end diff --git a/lib/eventos_web/controllers/follower_controller.ex b/lib/mobilizon_web/controllers/follower_controller.ex similarity index 84% rename from lib/eventos_web/controllers/follower_controller.ex rename to lib/mobilizon_web/controllers/follower_controller.ex index ae5c9612b..01c625a63 100644 --- a/lib/eventos_web/controllers/follower_controller.ex +++ b/lib/mobilizon_web/controllers/follower_controller.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.FollowerController do - use EventosWeb, :controller +defmodule MobilizonWeb.FollowerController do + use MobilizonWeb, :controller - alias Eventos.Actors - alias Eventos.Actors.Follower + alias Mobilizon.Actors + alias Mobilizon.Actors.Follower - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do followers = Actors.list_followers() diff --git a/lib/eventos_web/controllers/group_controller.ex b/lib/mobilizon_web/controllers/group_controller.ex similarity index 69% rename from lib/eventos_web/controllers/group_controller.ex rename to lib/mobilizon_web/controllers/group_controller.ex index 5808b9ec4..2318cf60c 100644 --- a/lib/eventos_web/controllers/group_controller.ex +++ b/lib/mobilizon_web/controllers/group_controller.ex @@ -1,17 +1,17 @@ -defmodule EventosWeb.GroupController do +defmodule MobilizonWeb.GroupController do @moduledoc """ Controller for Groups """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Actors - alias Eventos.Actors.{Actor, Member} + alias Mobilizon.Actors + alias Mobilizon.Actors.{Actor, Member} - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do groups = Actors.list_groups() - render(conn, EventosWeb.ActorView, "index.json", actors: groups) + render(conn, MobilizonWeb.ActorView, "index.json", actors: groups) end def create(conn, %{"group" => group_params}) do @@ -25,7 +25,7 @@ defmodule EventosWeb.GroupController do conn |> put_status(:created) |> put_resp_header("location", actor_path(conn, :show, group)) - |> render(EventosWeb.ActorView, "actor_basic.json", actor: group) + |> render(MobilizonWeb.ActorView, "actor_basic.json", actor: group) end end @@ -36,12 +36,12 @@ defmodule EventosWeb.GroupController do Actors.create_member(%{"parent_id" => group.id, "actor_id" => actor.id}) do conn |> put_status(:created) - |> render(EventosWeb.MemberView, "member.json", member: member) + |> render(MobilizonWeb.MemberView, "member.json", member: member) else nil -> conn |> put_status(:not_found) - |> render(EventosWeb.ErrorView, "not_found.json", details: "group or actor doesn't exist") + |> render(MobilizonWeb.ErrorView, "not_found.json", details: "group or actor doesn't exist") err -> require Logger diff --git a/lib/mobilizon_web/controllers/inboxes_controller.ex b/lib/mobilizon_web/controllers/inboxes_controller.ex new file mode 100644 index 000000000..9c3ca2d97 --- /dev/null +++ b/lib/mobilizon_web/controllers/inboxes_controller.ex @@ -0,0 +1,6 @@ +defmodule MobilizonWeb.InboxesController do + use MobilizonWeb, :controller + + def create(conn) do + end +end diff --git a/lib/eventos_web/controllers/nodeinfo_controller.ex b/lib/mobilizon_web/controllers/nodeinfo_controller.ex similarity index 81% rename from lib/eventos_web/controllers/nodeinfo_controller.ex rename to lib/mobilizon_web/controllers/nodeinfo_controller.ex index b2d8eabae..885d15b6a 100644 --- a/lib/eventos_web/controllers/nodeinfo_controller.ex +++ b/lib/mobilizon_web/controllers/nodeinfo_controller.ex @@ -1,17 +1,17 @@ -defmodule EventosWeb.NodeinfoController do - use EventosWeb, :controller +defmodule MobilizonWeb.NodeinfoController do + use MobilizonWeb, :controller - alias EventosWeb - alias Eventos.{Actors, Events} + alias MobilizonWeb + alias Mobilizon.{Actors, Events} - @instance Application.get_env(:eventos, :instance) + @instance Application.get_env(:mobilizon, :instance) def schemas(conn, _params) do response = %{ links: [ %{ rel: "http://nodeinfo.diaspora.software/ns/schema/2.0", - href: EventosWeb.Router.Helpers.nodeinfo_url(EventosWeb.Endpoint, :nodeinfo, "2.0") + href: MobilizonWeb.Router.Helpers.nodeinfo_url(MobilizonWeb.Endpoint, :nodeinfo, "2.0") } ] } @@ -28,7 +28,7 @@ defmodule EventosWeb.NodeinfoController do response = %{ version: "2.0", software: %{ - name: "eventos", + name: "mobilizon", version: Keyword.get(@instance, :version) }, protocols: ["activitypub"], diff --git a/lib/eventos_web/controllers/outboxes_controller.ex b/lib/mobilizon_web/controllers/outboxes_controller.ex similarity index 67% rename from lib/eventos_web/controllers/outboxes_controller.ex rename to lib/mobilizon_web/controllers/outboxes_controller.ex index bdd997ef3..806338aaf 100644 --- a/lib/eventos_web/controllers/outboxes_controller.ex +++ b/lib/mobilizon_web/controllers/outboxes_controller.ex @@ -1,5 +1,5 @@ -defmodule EventosWeb.OutboxesController do - use EventosWeb, :controller +defmodule MobilizonWeb.OutboxesController do + use MobilizonWeb, :controller def show(conn) do actor = Guardian.Plug.current_resource(conn).actor diff --git a/lib/eventos_web/controllers/page_controller.ex b/lib/mobilizon_web/controllers/page_controller.ex similarity index 75% rename from lib/eventos_web/controllers/page_controller.ex rename to lib/mobilizon_web/controllers/page_controller.ex index 6cec99f82..3d27f512d 100644 --- a/lib/eventos_web/controllers/page_controller.ex +++ b/lib/mobilizon_web/controllers/page_controller.ex @@ -1,8 +1,8 @@ -defmodule EventosWeb.PageController do +defmodule MobilizonWeb.PageController do @moduledoc """ Controller to load our webapp """ - use EventosWeb, :controller + use MobilizonWeb, :controller plug(:put_layout, false) diff --git a/lib/eventos_web/controllers/participant_controller.ex b/lib/mobilizon_web/controllers/participant_controller.ex similarity index 80% rename from lib/eventos_web/controllers/participant_controller.ex rename to lib/mobilizon_web/controllers/participant_controller.ex index 1507c597e..0bb64a3f3 100644 --- a/lib/eventos_web/controllers/participant_controller.ex +++ b/lib/mobilizon_web/controllers/participant_controller.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.ParticipantController do +defmodule MobilizonWeb.ParticipantController do @moduledoc """ Controller for participants to an event """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events + alias Mobilizon.Events def join(conn, %{"uuid" => uuid}) do with event <- Events.get_event_by_uuid(uuid), diff --git a/lib/eventos_web/controllers/search_controller.ex b/lib/mobilizon_web/controllers/search_controller.ex similarity index 67% rename from lib/eventos_web/controllers/search_controller.ex rename to lib/mobilizon_web/controllers/search_controller.ex index 7b3d5bb4f..7667a4a2f 100644 --- a/lib/eventos_web/controllers/search_controller.ex +++ b/lib/mobilizon_web/controllers/search_controller.ex @@ -1,13 +1,13 @@ -defmodule EventosWeb.SearchController do +defmodule MobilizonWeb.SearchController do @moduledoc """ Controller for Search """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Actors + alias Mobilizon.Events + alias Mobilizon.Actors - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def search(conn, %{"name" => name}) do events = Events.find_events_by_name(name) diff --git a/lib/eventos_web/controllers/session_controller.ex b/lib/mobilizon_web/controllers/session_controller.ex similarity index 88% rename from lib/eventos_web/controllers/session_controller.ex rename to lib/mobilizon_web/controllers/session_controller.ex index 1a7c603ec..c70ba3fa8 100644 --- a/lib/eventos_web/controllers/session_controller.ex +++ b/lib/mobilizon_web/controllers/session_controller.ex @@ -1,13 +1,13 @@ -defmodule EventosWeb.SessionController do +defmodule MobilizonWeb.SessionController do @moduledoc """ Controller for (event) Sessions """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Session + alias Mobilizon.Events + alias Mobilizon.Events.Session - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do sessions = Events.list_sessions() diff --git a/lib/eventos_web/controllers/tag_controller.ex b/lib/mobilizon_web/controllers/tag_controller.ex similarity index 84% rename from lib/eventos_web/controllers/tag_controller.ex rename to lib/mobilizon_web/controllers/tag_controller.ex index 9a169f0c7..c1a5fbe8d 100644 --- a/lib/eventos_web/controllers/tag_controller.ex +++ b/lib/mobilizon_web/controllers/tag_controller.ex @@ -1,13 +1,13 @@ -defmodule EventosWeb.TagController do +defmodule MobilizonWeb.TagController do @moduledoc """ Controller for Tags """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Tag + alias Mobilizon.Events + alias Mobilizon.Events.Tag - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do tags = Events.list_tags() diff --git a/lib/eventos_web/controllers/track_controller.ex b/lib/mobilizon_web/controllers/track_controller.ex similarity index 84% rename from lib/eventos_web/controllers/track_controller.ex rename to lib/mobilizon_web/controllers/track_controller.ex index 437811c9d..bf4b6fdfc 100644 --- a/lib/eventos_web/controllers/track_controller.ex +++ b/lib/mobilizon_web/controllers/track_controller.ex @@ -1,13 +1,13 @@ -defmodule EventosWeb.TrackController do +defmodule MobilizonWeb.TrackController do @moduledoc """ Controller for Tracks """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Events - alias Eventos.Events.Track + alias Mobilizon.Events + alias Mobilizon.Events.Track - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do tracks = Events.list_tracks() diff --git a/lib/eventos_web/controllers/user_controller.ex b/lib/mobilizon_web/controllers/user_controller.ex similarity index 88% rename from lib/eventos_web/controllers/user_controller.ex rename to lib/mobilizon_web/controllers/user_controller.ex index 7bb50d1bc..3a6848254 100644 --- a/lib/eventos_web/controllers/user_controller.ex +++ b/lib/mobilizon_web/controllers/user_controller.ex @@ -1,15 +1,15 @@ -defmodule EventosWeb.UserController do +defmodule MobilizonWeb.UserController do @moduledoc """ Controller for Users """ - use EventosWeb, :controller + use MobilizonWeb, :controller - alias Eventos.Actors - alias Eventos.Actors.User - alias Eventos.Repo - alias Eventos.Actors.Service.{Activation, ResetPassword} + alias Mobilizon.Actors + alias Mobilizon.Actors.User + alias Mobilizon.Repo + alias Mobilizon.Actors.Service.{Activation, ResetPassword} - action_fallback(EventosWeb.FallbackController) + action_fallback(MobilizonWeb.FallbackController) def index(conn, _params) do users = Actors.list_users_with_actors() @@ -29,7 +29,7 @@ defmodule EventosWeb.UserController do def validate(conn, %{"token" => token}) do with {:ok, %User{} = user} <- Activation.check_confirmation_token(token) do - {:ok, token, _claims} = EventosWeb.Guardian.encode_and_sign(user) + {:ok, token, _claims} = MobilizonWeb.Guardian.encode_and_sign(user) conn |> put_resp_header("location", user_path(conn, :show_current_actor)) @@ -88,7 +88,7 @@ defmodule EventosWeb.UserController do def reset_password(conn, %{"password" => password, "token" => token}) do with {:ok, %User{} = user} <- ResetPassword.check_reset_password_token(password, token) do - {:ok, token, _claims} = EventosWeb.Guardian.encode_and_sign(user) + {:ok, token, _claims} = MobilizonWeb.Guardian.encode_and_sign(user) render(conn, "show_with_token.json", %{user: user, token: token}) else {:error, :invalid_token} -> @@ -99,7 +99,7 @@ defmodule EventosWeb.UserController do {:error, %Ecto.Changeset{} = changeset} -> conn |> put_status(:unprocessable_entity) - |> render(EventosWeb.ChangesetView, "error.json", changeset: changeset) + |> render(MobilizonWeb.ChangesetView, "error.json", changeset: changeset) end end diff --git a/lib/eventos_web/controllers/user_session_controller.ex b/lib/mobilizon_web/controllers/user_session_controller.ex similarity index 85% rename from lib/eventos_web/controllers/user_session_controller.ex rename to lib/mobilizon_web/controllers/user_session_controller.ex index c3d5f0076..4b4df85a6 100644 --- a/lib/eventos_web/controllers/user_session_controller.ex +++ b/lib/mobilizon_web/controllers/user_session_controller.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.UserSessionController do +defmodule MobilizonWeb.UserSessionController do @moduledoc """ Controller for user sessions """ - use EventosWeb, :controller - alias Eventos.Actors.User - alias Eventos.Actors + use MobilizonWeb, :controller + alias Mobilizon.Actors.User + alias Mobilizon.Actors def sign_in(conn, %{"email" => email, "password" => password}) do with {:ok, %User{} = user} <- Actors.find_by_email(email), @@ -35,7 +35,7 @@ defmodule EventosWeb.UserSessionController do def sign_out(conn, _params) do conn - |> EventosWeb.Guardian.Plug.sign_out() + |> MobilizonWeb.Guardian.Plug.sign_out() |> send_resp(204, "") end end diff --git a/lib/eventos_web/controllers/web_finger_controller.ex b/lib/mobilizon_web/controllers/web_finger_controller.ex similarity index 77% rename from lib/eventos_web/controllers/web_finger_controller.ex rename to lib/mobilizon_web/controllers/web_finger_controller.ex index 5a63403a5..50b7846a9 100644 --- a/lib/eventos_web/controllers/web_finger_controller.ex +++ b/lib/mobilizon_web/controllers/web_finger_controller.ex @@ -1,7 +1,7 @@ -defmodule EventosWeb.WebFingerController do - use EventosWeb, :controller +defmodule MobilizonWeb.WebFingerController do + use MobilizonWeb, :controller - alias Eventos.Service.WebFinger + alias Mobilizon.Service.WebFinger def host_meta(conn, _params) do xml = WebFinger.host_meta() diff --git a/lib/eventos_web/endpoint.ex b/lib/mobilizon_web/endpoint.ex similarity index 87% rename from lib/eventos_web/endpoint.ex rename to lib/mobilizon_web/endpoint.ex index e45f916d7..fa16cba5a 100644 --- a/lib/eventos_web/endpoint.ex +++ b/lib/mobilizon_web/endpoint.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.Endpoint do +defmodule MobilizonWeb.Endpoint do @moduledoc """ - Endpoint for Eventos app + Endpoint for Mobilizon app """ - use Phoenix.Endpoint, otp_app: :eventos + use Phoenix.Endpoint, otp_app: :mobilizon - socket("/socket", EventosWeb.UserSocket) + socket("/socket", MobilizonWeb.UserSocket) # Serve at "/" the static files from "priv/static" directory. # @@ -13,7 +13,7 @@ defmodule EventosWeb.Endpoint do plug( Plug.Static, at: "/", - from: :eventos, + from: :mobilizon, gzip: false, only: ~w(css fonts images js favicon.ico robots.txt index.html) ) @@ -46,11 +46,11 @@ defmodule EventosWeb.Endpoint do plug( Plug.Session, store: :cookie, - key: "_eventos_key", + key: "_mobilizon_key", signing_salt: "F9CCTF22" ) - plug(EventosWeb.Router) + plug(MobilizonWeb.Router) @doc """ Callback invoked for dynamically configuring the endpoint. diff --git a/lib/eventos_web/gettext.ex b/lib/mobilizon_web/gettext.ex similarity index 85% rename from lib/eventos_web/gettext.ex rename to lib/mobilizon_web/gettext.ex index 59995765f..25a7544e4 100644 --- a/lib/eventos_web/gettext.ex +++ b/lib/mobilizon_web/gettext.ex @@ -1,11 +1,11 @@ -defmodule EventosWeb.Gettext do +defmodule MobilizonWeb.Gettext do @moduledoc """ A module providing Internationalization with a gettext-based API. By using [Gettext](https://hexdocs.pm/gettext), your module gains a set of macros for translations, for example: - import EventosWeb.Gettext + import MobilizonWeb.Gettext # Simple translation gettext "Here is the string to translate" @@ -20,5 +20,5 @@ defmodule EventosWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :eventos + use Gettext, otp_app: :mobilizon end diff --git a/lib/eventos_web/guardian.ex b/lib/mobilizon_web/guardian.ex similarity index 92% rename from lib/eventos_web/guardian.ex rename to lib/mobilizon_web/guardian.ex index 333ac243d..944618218 100644 --- a/lib/eventos_web/guardian.ex +++ b/lib/mobilizon_web/guardian.ex @@ -1,16 +1,16 @@ -defmodule EventosWeb.Guardian do +defmodule MobilizonWeb.Guardian do @moduledoc """ Handles the JWT tokens encoding and decoding """ use Guardian, - otp_app: :eventos, + otp_app: :mobilizon, permissions: %{ superuser: [:moderate, :super], user: [:base] } - alias Eventos.Actors - alias Eventos.Actors.User + alias Mobilizon.Actors + alias Mobilizon.Actors.User def subject_for_token(%User{} = user, _claims) do {:ok, "User:" <> to_string(user.id)} diff --git a/lib/eventos_web/http_signature.ex b/lib/mobilizon_web/http_signature.ex similarity index 92% rename from lib/eventos_web/http_signature.ex rename to lib/mobilizon_web/http_signature.ex index 554db61c0..5858cdfec 100644 --- a/lib/eventos_web/http_signature.ex +++ b/lib/mobilizon_web/http_signature.ex @@ -1,11 +1,11 @@ -defmodule EventosWeb.HTTPSignaturePlug do +defmodule MobilizonWeb.HTTPSignaturePlug do @moduledoc """ # HTTPSignaturePlug Plug to check HTTP Signatures on every incoming request """ - alias Eventos.Service.HTTPSignatures + alias Mobilizon.Service.HTTPSignatures import Plug.Conn require Logger diff --git a/lib/eventos_web/router.ex b/lib/mobilizon_web/router.ex similarity index 93% rename from lib/eventos_web/router.ex rename to lib/mobilizon_web/router.ex index f8ad343ee..cb7c235ae 100644 --- a/lib/eventos_web/router.ex +++ b/lib/mobilizon_web/router.ex @@ -1,8 +1,8 @@ -defmodule EventosWeb.Router do +defmodule MobilizonWeb.Router do @moduledoc """ - Router for eventos app + Router for mobilizon app """ - use EventosWeb, :router + use MobilizonWeb, :router pipeline :api do plug(:accepts, ["json"]) @@ -14,12 +14,12 @@ defmodule EventosWeb.Router do pipeline :activity_pub do plug(:accepts, ["activity-json", "text/html"]) - plug(EventosWeb.HTTPSignaturePlug) + plug(MobilizonWeb.HTTPSignaturePlug) end pipeline :api_auth do plug(:accepts, ["json"]) - plug(EventosWeb.AuthPipeline) + plug(MobilizonWeb.AuthPipeline) end pipeline :browser do @@ -34,7 +34,7 @@ defmodule EventosWeb.Router do plug(:accepts, ["html", "application/json"]) end - scope "/api", EventosWeb do + scope "/api", MobilizonWeb do pipe_through(:api) scope "/v1" do @@ -81,7 +81,7 @@ defmodule EventosWeb.Router do end # Authentificated API - scope "/api", EventosWeb do + scope "/api", MobilizonWeb do pipe_through(:api_auth) scope "/v1" do @@ -112,7 +112,7 @@ defmodule EventosWeb.Router do end end - scope "/.well-known", EventosWeb do + scope "/.well-known", MobilizonWeb do pipe_through(:well_known) get("/host-meta", WebFingerController, :host_meta) @@ -120,7 +120,7 @@ defmodule EventosWeb.Router do get("/nodeinfo", NodeinfoController, :schemas) end - scope "/", EventosWeb do + scope "/", MobilizonWeb do pipe_through(:activity_pub) get("/@:name", ActivityPubController, :actor) @@ -138,7 +138,7 @@ defmodule EventosWeb.Router do forward("/sent_emails", Bamboo.SentEmailViewerPlug) end - scope "/", EventosWeb do + scope "/", MobilizonWeb do pipe_through(:browser) get("/*path", PageController, :index) diff --git a/lib/mobilizon_web/templates/email/email.html.eex b/lib/mobilizon_web/templates/email/email.html.eex new file mode 100644 index 000000000..241559de3 --- /dev/null +++ b/lib/mobilizon_web/templates/email/email.html.eex @@ -0,0 +1,10 @@ + + + "> + + + <%= render @view_module, @view_template, assigns %> + +

<%= gettext "An email sent by Mobilizon on %{instance}.", instance: @instance %>

+ + diff --git a/lib/mobilizon_web/templates/email/email.text.eex b/lib/mobilizon_web/templates/email/email.text.eex new file mode 100644 index 000000000..1b8e403fb --- /dev/null +++ b/lib/mobilizon_web/templates/email/email.text.eex @@ -0,0 +1,3 @@ +<%= render @view_module, @view_template, assigns %> + +<%= gettext "An email sent by Mobilizon on %{instance}.", instance: @instance %> diff --git a/lib/eventos_web/templates/email/password_reset.html.eex b/lib/mobilizon_web/templates/email/password_reset.html.eex similarity index 71% rename from lib/eventos_web/templates/email/password_reset.html.eex rename to lib/mobilizon_web/templates/email/password_reset.html.eex index 412fc0a98..18cd887fa 100644 --- a/lib/eventos_web/templates/email/password_reset.html.eex +++ b/lib/mobilizon_web/templates/email/password_reset.html.eex @@ -2,4 +2,4 @@

<%= gettext "You requested a new password for your account on %{host}.", host: @instance %>

<%= gettext "If you didn't request this, please ignore this email. Your password won't change until you access the link below and create a new one." %>

-

<%= link "Change password", to: EventosWeb.Endpoint.url() <> "/password-reset/#{@token}", target: "_blank" %>

+

<%= link "Change password", to: MobilizonWeb.Endpoint.url() <> "/password-reset/#{@token}", target: "_blank" %>

diff --git a/lib/eventos_web/templates/email/password_reset.text.eex b/lib/mobilizon_web/templates/email/password_reset.text.eex similarity index 81% rename from lib/eventos_web/templates/email/password_reset.text.eex rename to lib/mobilizon_web/templates/email/password_reset.text.eex index 882956acf..2cb528141 100644 --- a/lib/eventos_web/templates/email/password_reset.text.eex +++ b/lib/mobilizon_web/templates/email/password_reset.text.eex @@ -6,6 +6,6 @@ <%= gettext "If you didn't request this, please ignore this email. Your password won't change until you access the link below and create a new one." %> -<%= EventosWeb.Endpoint.url() <> "/password-reset/#{@token}" %> +<%= MobilizonWeb.Endpoint.url() <> "/password-reset/#{@token}" %> diff --git a/lib/eventos_web/templates/email/registration_confirmation.html.eex b/lib/mobilizon_web/templates/email/registration_confirmation.html.eex similarity index 66% rename from lib/eventos_web/templates/email/registration_confirmation.html.eex rename to lib/mobilizon_web/templates/email/registration_confirmation.html.eex index 410cf8205..25d187eec 100644 --- a/lib/eventos_web/templates/email/registration_confirmation.html.eex +++ b/lib/mobilizon_web/templates/email/registration_confirmation.html.eex @@ -1,4 +1,4 @@

<%= gettext "Confirm the email address" %>

<%= gettext "You created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this email.", host: @instance %>

-

<%= link "Confirm your email address", to: EventosWeb.Endpoint.url() <> "/validate/#{@token}", target: "_blank" %>

+

<%= link "Confirm your email address", to: MobilizonWeb.Endpoint.url() <> "/validate/#{@token}", target: "_blank" %>

diff --git a/lib/eventos_web/templates/email/registration_confirmation.text.eex b/lib/mobilizon_web/templates/email/registration_confirmation.text.eex similarity index 79% rename from lib/eventos_web/templates/email/registration_confirmation.text.eex rename to lib/mobilizon_web/templates/email/registration_confirmation.text.eex index 3f6f0e052..aec29b2cc 100644 --- a/lib/eventos_web/templates/email/registration_confirmation.text.eex +++ b/lib/mobilizon_web/templates/email/registration_confirmation.text.eex @@ -4,6 +4,6 @@ <%= gettext "You created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this email.", host: @instance %> -<%= EventosWeb.Endpoint.url() <> "/validate/#{@token}" %> +<%= MobilizonWeb.Endpoint.url() <> "/validate/#{@token}" %> diff --git a/lib/eventos_web/views/activity_pub/actor_view.ex b/lib/mobilizon_web/views/activity_pub/actor_view.ex similarity index 89% rename from lib/eventos_web/views/activity_pub/actor_view.ex rename to lib/mobilizon_web/views/activity_pub/actor_view.ex index 3742be4f1..8fdfb536f 100644 --- a/lib/eventos_web/views/activity_pub/actor_view.ex +++ b/lib/mobilizon_web/views/activity_pub/actor_view.ex @@ -1,19 +1,19 @@ -defmodule EventosWeb.ActivityPub.ActorView do - use EventosWeb, :view +defmodule MobilizonWeb.ActivityPub.ActorView do + use MobilizonWeb, :view - alias EventosWeb.ActivityPub.ActorView - alias EventosWeb.ActivityPub.ObjectView - alias EventosWeb.WebFinger - alias Eventos.Actors.Actor - alias Eventos.Repo - alias Eventos.Service.ActivityPub - alias Eventos.Service.ActivityPub.Transmogrifier - alias Eventos.Service.ActivityPub.Utils - alias Eventos.Activity + alias MobilizonWeb.ActivityPub.ActorView + alias MobilizonWeb.ActivityPub.ObjectView + alias MobilizonWeb.WebFinger + alias Mobilizon.Actors.Actor + alias Mobilizon.Repo + alias Mobilizon.Service.ActivityPub + alias Mobilizon.Service.ActivityPub.Transmogrifier + alias Mobilizon.Service.ActivityPub.Utils + alias Mobilizon.Activity import Ecto.Query def render("actor.json", %{actor: actor}) do - public_key = Eventos.Service.ActivityPub.Utils.pem_to_public_key_pem(actor.keys) + public_key = Mobilizon.Service.ActivityPub.Utils.pem_to_public_key_pem(actor.keys) %{ "id" => actor.url, diff --git a/lib/eventos_web/views/activity_pub/object_view.ex b/lib/mobilizon_web/views/activity_pub/object_view.ex similarity index 88% rename from lib/eventos_web/views/activity_pub/object_view.ex rename to lib/mobilizon_web/views/activity_pub/object_view.ex index 90e2ed560..f43d4463b 100644 --- a/lib/eventos_web/views/activity_pub/object_view.ex +++ b/lib/mobilizon_web/views/activity_pub/object_view.ex @@ -1,7 +1,7 @@ -defmodule EventosWeb.ActivityPub.ObjectView do - use EventosWeb, :view - alias EventosWeb.ActivityPub.ObjectView - alias Eventos.Service.ActivityPub.Transmogrifier +defmodule MobilizonWeb.ActivityPub.ObjectView do + use MobilizonWeb, :view + alias MobilizonWeb.ActivityPub.ObjectView + alias Mobilizon.Service.ActivityPub.Transmogrifier @base %{ "@context" => [ diff --git a/lib/eventos_web/views/actor_view.ex b/lib/mobilizon_web/views/actor_view.ex similarity index 91% rename from lib/eventos_web/views/actor_view.ex rename to lib/mobilizon_web/views/actor_view.ex index 742b9db96..1c7749891 100644 --- a/lib/eventos_web/views/actor_view.ex +++ b/lib/mobilizon_web/views/actor_view.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.ActorView do +defmodule MobilizonWeb.ActorView do @moduledoc """ View for Actors """ - use EventosWeb, :view - alias EventosWeb.{ActorView, EventView, MemberView} - alias Eventos.Actors + use MobilizonWeb, :view + alias MobilizonWeb.{ActorView, EventView, MemberView} + alias Mobilizon.Actors def render("index.json", %{actors: actors}) do %{data: render_many(actors, ActorView, "actor_basic.json")} diff --git a/lib/eventos_web/views/address_view.ex b/lib/mobilizon_web/views/address_view.ex similarity index 90% rename from lib/eventos_web/views/address_view.ex rename to lib/mobilizon_web/views/address_view.ex index 604818a03..acef9e450 100644 --- a/lib/eventos_web/views/address_view.ex +++ b/lib/mobilizon_web/views/address_view.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.AddressView do +defmodule MobilizonWeb.AddressView do @moduledoc """ View for addresses """ - use EventosWeb, :view - alias EventosWeb.AddressView + use MobilizonWeb, :view + alias MobilizonWeb.AddressView def render("index.json", %{addresses: addresses}) do %{data: render_many(addresses, AddressView, "address.json")} diff --git a/lib/eventos_web/views/bot_view.ex b/lib/mobilizon_web/views/bot_view.ex similarity index 77% rename from lib/eventos_web/views/bot_view.ex rename to lib/mobilizon_web/views/bot_view.ex index 72cd072b0..eebd6948e 100644 --- a/lib/eventos_web/views/bot_view.ex +++ b/lib/mobilizon_web/views/bot_view.ex @@ -1,6 +1,6 @@ -defmodule EventosWeb.BotView do - use EventosWeb, :view - alias EventosWeb.BotView +defmodule MobilizonWeb.BotView do + use MobilizonWeb, :view + alias MobilizonWeb.BotView def render("index.json", %{bots: bots}) do %{data: render_many(bots, BotView, "bot.json")} diff --git a/lib/eventos_web/views/category_view.ex b/lib/mobilizon_web/views/category_view.ex similarity index 83% rename from lib/eventos_web/views/category_view.ex rename to lib/mobilizon_web/views/category_view.ex index ec28935d3..3e5a70bba 100644 --- a/lib/eventos_web/views/category_view.ex +++ b/lib/mobilizon_web/views/category_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.CategoryView do +defmodule MobilizonWeb.CategoryView do @moduledoc """ View for Categories """ - use EventosWeb, :view - alias EventosWeb.CategoryView + use MobilizonWeb, :view + alias MobilizonWeb.CategoryView def render("index.json", %{categories: categories}) do %{data: render_many(categories, CategoryView, "category.json")} diff --git a/lib/eventos_web/views/changeset_view.ex b/lib/mobilizon_web/views/changeset_view.ex similarity index 78% rename from lib/eventos_web/views/changeset_view.ex rename to lib/mobilizon_web/views/changeset_view.ex index 3399463ff..eebe95532 100644 --- a/lib/eventos_web/views/changeset_view.ex +++ b/lib/mobilizon_web/views/changeset_view.ex @@ -1,14 +1,14 @@ -defmodule EventosWeb.ChangesetView do +defmodule MobilizonWeb.ChangesetView do @moduledoc """ View for changesets in case of errors """ - use EventosWeb, :view + use MobilizonWeb, :view @doc """ Traverses and translates changeset errors. See `Ecto.Changeset.traverse_errors/2` and - `EventosWeb.ErrorHelpers.translate_error/1` for more details. + `MobilizonWeb.ErrorHelpers.translate_error/1` for more details. """ def translate_errors(changeset) do Ecto.Changeset.traverse_errors(changeset, &translate_error/1) diff --git a/lib/eventos_web/views/comment_view.ex b/lib/mobilizon_web/views/comment_view.ex similarity index 79% rename from lib/eventos_web/views/comment_view.ex rename to lib/mobilizon_web/views/comment_view.ex index e273e5096..d06222ec0 100644 --- a/lib/eventos_web/views/comment_view.ex +++ b/lib/mobilizon_web/views/comment_view.ex @@ -1,6 +1,6 @@ -defmodule EventosWeb.CommentView do - use EventosWeb, :view - alias EventosWeb.CommentView +defmodule MobilizonWeb.CommentView do + use MobilizonWeb, :view + alias MobilizonWeb.CommentView def render("index.json", %{comments: comments}) do %{data: render_many(comments, CommentView, "comment.json")} diff --git a/lib/mobilizon_web/views/email_view.ex b/lib/mobilizon_web/views/email_view.ex new file mode 100644 index 000000000..7c2ecb679 --- /dev/null +++ b/lib/mobilizon_web/views/email_view.ex @@ -0,0 +1,3 @@ +defmodule Mobilizon.EmailView do + use MobilizonWeb, :view +end diff --git a/lib/eventos_web/views/error_helpers.ex b/lib/mobilizon_web/views/error_helpers.ex similarity index 85% rename from lib/eventos_web/views/error_helpers.ex rename to lib/mobilizon_web/views/error_helpers.ex index 375bc6c16..2ae367b2d 100644 --- a/lib/eventos_web/views/error_helpers.ex +++ b/lib/mobilizon_web/views/error_helpers.ex @@ -1,4 +1,4 @@ -defmodule EventosWeb.ErrorHelpers do +defmodule MobilizonWeb.ErrorHelpers do @moduledoc """ Conveniences for translating and building error messages. """ @@ -32,9 +32,9 @@ defmodule EventosWeb.ErrorHelpers do # dgettext "errors", "is invalid" # if count = opts[:count] do - Gettext.dngettext(EventosWeb.Gettext, "errors", msg, msg, count, opts) + Gettext.dngettext(MobilizonWeb.Gettext, "errors", msg, msg, count, opts) else - Gettext.dgettext(EventosWeb.Gettext, "errors", msg, opts) + Gettext.dgettext(MobilizonWeb.Gettext, "errors", msg, opts) end end end diff --git a/lib/eventos_web/views/error_view.ex b/lib/mobilizon_web/views/error_view.ex similarity index 90% rename from lib/eventos_web/views/error_view.ex rename to lib/mobilizon_web/views/error_view.ex index 13c6563c0..42714317e 100644 --- a/lib/eventos_web/views/error_view.ex +++ b/lib/mobilizon_web/views/error_view.ex @@ -1,8 +1,8 @@ -defmodule EventosWeb.ErrorView do +defmodule MobilizonWeb.ErrorView do @moduledoc """ View for errors """ - use EventosWeb, :view + use MobilizonWeb, :view def render("404.html", _assigns) do "Page not found" diff --git a/lib/eventos_web/views/event_view.ex b/lib/mobilizon_web/views/event_view.ex similarity index 93% rename from lib/eventos_web/views/event_view.ex rename to lib/mobilizon_web/views/event_view.ex index 35e766a72..c01050a9c 100644 --- a/lib/eventos_web/views/event_view.ex +++ b/lib/mobilizon_web/views/event_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.EventView do +defmodule MobilizonWeb.EventView do @moduledoc """ View for Events """ - use EventosWeb, :view - alias EventosWeb.{EventView, ActorView, GroupView, AddressView} + use MobilizonWeb, :view + alias MobilizonWeb.{EventView, ActorView, GroupView, AddressView} def render("index.json", %{events: events, coord: coord, city: city, country: country}) do %{ diff --git a/lib/eventos_web/views/follower_view.ex b/lib/mobilizon_web/views/follower_view.ex similarity index 79% rename from lib/eventos_web/views/follower_view.ex rename to lib/mobilizon_web/views/follower_view.ex index fe3f396c2..6779d9776 100644 --- a/lib/eventos_web/views/follower_view.ex +++ b/lib/mobilizon_web/views/follower_view.ex @@ -1,6 +1,6 @@ -defmodule EventosWeb.FollowerView do - use EventosWeb, :view - alias EventosWeb.FollowerView +defmodule MobilizonWeb.FollowerView do + use MobilizonWeb, :view + alias MobilizonWeb.FollowerView def render("index.json", %{followers: followers}) do %{data: render_many(followers, FollowerView, "follower.json")} diff --git a/lib/eventos_web/views/group_view.ex b/lib/mobilizon_web/views/group_view.ex similarity index 90% rename from lib/eventos_web/views/group_view.ex rename to lib/mobilizon_web/views/group_view.ex index f2f159f4c..7b22d0fd3 100644 --- a/lib/eventos_web/views/group_view.ex +++ b/lib/mobilizon_web/views/group_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.GroupView do +defmodule MobilizonWeb.GroupView do @moduledoc """ View for Groups """ - use EventosWeb, :view - alias EventosWeb.{GroupView, ActorView} + use MobilizonWeb, :view + alias MobilizonWeb.{GroupView, ActorView} def render("index.json", %{groups: groups}) do %{data: render_many(groups, GroupView, "group_simple.json")} diff --git a/lib/eventos_web/views/member_view.ex b/lib/mobilizon_web/views/member_view.ex similarity index 82% rename from lib/eventos_web/views/member_view.ex rename to lib/mobilizon_web/views/member_view.ex index 92447787f..a36375c61 100644 --- a/lib/eventos_web/views/member_view.ex +++ b/lib/mobilizon_web/views/member_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.MemberView do +defmodule MobilizonWeb.MemberView do @moduledoc """ View for Members """ - use EventosWeb, :view - alias EventosWeb.{MemberView, ActorView} + use MobilizonWeb, :view + alias MobilizonWeb.{MemberView, ActorView} def render("index.json", %{members: members}) do %{data: render_many(members, MemberView, "member.json")} diff --git a/lib/mobilizon_web/views/page_view.ex b/lib/mobilizon_web/views/page_view.ex new file mode 100644 index 000000000..ea88b06af --- /dev/null +++ b/lib/mobilizon_web/views/page_view.ex @@ -0,0 +1,6 @@ +defmodule MobilizonWeb.PageView do + @moduledoc """ + View for our webapp + """ + use MobilizonWeb, :view +end diff --git a/lib/eventos_web/views/participant_view.ex b/lib/mobilizon_web/views/participant_view.ex similarity index 81% rename from lib/eventos_web/views/participant_view.ex rename to lib/mobilizon_web/views/participant_view.ex index ce489138c..69921be4f 100644 --- a/lib/eventos_web/views/participant_view.ex +++ b/lib/mobilizon_web/views/participant_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.ParticipantView do +defmodule MobilizonWeb.ParticipantView do @moduledoc """ View for Participants """ - use EventosWeb, :view - alias EventosWeb.ParticipantView + use MobilizonWeb, :view + alias MobilizonWeb.ParticipantView def render("index.json", %{participants: participants}) do %{data: render_many(participants, ParticipantView, "participant.json")} diff --git a/lib/eventos_web/views/search_view.ex b/lib/mobilizon_web/views/search_view.ex similarity index 68% rename from lib/eventos_web/views/search_view.ex rename to lib/mobilizon_web/views/search_view.ex index 212086560..6085c240e 100644 --- a/lib/eventos_web/views/search_view.ex +++ b/lib/mobilizon_web/views/search_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.SearchView do +defmodule MobilizonWeb.SearchView do @moduledoc """ View for Events """ - use EventosWeb, :view - alias EventosWeb.{EventView, ActorView, GroupView, AddressView} + use MobilizonWeb, :view + alias MobilizonWeb.{EventView, ActorView, GroupView, AddressView} def render("search.json", %{events: events, actors: actors}) do %{ diff --git a/lib/eventos_web/views/session_view.ex b/lib/mobilizon_web/views/session_view.ex similarity index 87% rename from lib/eventos_web/views/session_view.ex rename to lib/mobilizon_web/views/session_view.ex index 812f15fb1..ac3808525 100644 --- a/lib/eventos_web/views/session_view.ex +++ b/lib/mobilizon_web/views/session_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.SessionView do +defmodule MobilizonWeb.SessionView do @moduledoc """ View for event Sessions """ - use EventosWeb, :view - alias EventosWeb.SessionView + use MobilizonWeb, :view + alias MobilizonWeb.SessionView def render("index.json", %{sessions: sessions}) do %{data: render_many(sessions, SessionView, "session.json")} diff --git a/lib/eventos_web/views/tag_view.ex b/lib/mobilizon_web/views/tag_view.ex similarity index 78% rename from lib/eventos_web/views/tag_view.ex rename to lib/mobilizon_web/views/tag_view.ex index 94b9b3d2a..17f218a63 100644 --- a/lib/eventos_web/views/tag_view.ex +++ b/lib/mobilizon_web/views/tag_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.TagView do +defmodule MobilizonWeb.TagView do @moduledoc """ View for Tags """ - use EventosWeb, :view - alias EventosWeb.TagView + use MobilizonWeb, :view + alias MobilizonWeb.TagView def render("index.json", %{tags: tags}) do %{data: render_many(tags, TagView, "tag.json")} diff --git a/lib/eventos_web/views/track_view.ex b/lib/mobilizon_web/views/track_view.ex similarity index 81% rename from lib/eventos_web/views/track_view.ex rename to lib/mobilizon_web/views/track_view.ex index 55654922d..941db2605 100644 --- a/lib/eventos_web/views/track_view.ex +++ b/lib/mobilizon_web/views/track_view.ex @@ -1,9 +1,9 @@ -defmodule EventosWeb.TrackView do +defmodule MobilizonWeb.TrackView do @moduledoc """ View for Tracks """ - use EventosWeb, :view - alias EventosWeb.TrackView + use MobilizonWeb, :view + alias MobilizonWeb.TrackView def render("index.json", %{tracks: tracks}) do %{data: render_many(tracks, TrackView, "track.json")} diff --git a/lib/mobilizon_web/views/user_session_view.ex b/lib/mobilizon_web/views/user_session_view.ex new file mode 100644 index 000000000..f2c98e30d --- /dev/null +++ b/lib/mobilizon_web/views/user_session_view.ex @@ -0,0 +1,10 @@ +defmodule MobilizonWeb.UserSessionView do + @moduledoc """ + View for user Sessions + """ + use MobilizonWeb, :view + + def render("token.json", %{token: token, user: user}) do + %{token: token, user: render_one(user, MobilizonWeb.UserView, "user_simple.json")} + end +end diff --git a/lib/eventos_web/views/user_view.ex b/lib/mobilizon_web/views/user_view.ex similarity index 90% rename from lib/eventos_web/views/user_view.ex rename to lib/mobilizon_web/views/user_view.ex index 13f25991d..828a3255f 100644 --- a/lib/eventos_web/views/user_view.ex +++ b/lib/mobilizon_web/views/user_view.ex @@ -1,10 +1,10 @@ -defmodule EventosWeb.UserView do +defmodule MobilizonWeb.UserView do @moduledoc """ View for Users """ - use EventosWeb, :view - alias EventosWeb.UserView - alias EventosWeb.ActorView + use MobilizonWeb, :view + alias MobilizonWeb.UserView + alias MobilizonWeb.ActorView def render("index.json", %{users: users}) do %{data: render_many(users, UserView, "user_simple.json")} diff --git a/lib/service/activity_pub/activity_pub.ex b/lib/service/activity_pub/activity_pub.ex index b40d4a97f..40919803b 100644 --- a/lib/service/activity_pub/activity_pub.ex +++ b/lib/service/activity_pub/activity_pub.ex @@ -1,23 +1,23 @@ -defmodule Eventos.Service.ActivityPub do +defmodule Mobilizon.Service.ActivityPub do @moduledoc """ # ActivityPub Every ActivityPub method """ - alias Eventos.Events - alias Eventos.Events.{Event, Category, Comment} - alias Eventos.Service.ActivityPub.Transmogrifier - alias Eventos.Service.WebFinger - alias Eventos.Activity + alias Mobilizon.Events + alias Mobilizon.Events.{Event, Category, Comment} + alias Mobilizon.Service.ActivityPub.Transmogrifier + alias Mobilizon.Service.WebFinger + alias Mobilizon.Activity - alias Eventos.Actors - alias Eventos.Actors.Actor + alias Mobilizon.Actors + alias Mobilizon.Actors.Actor - alias Eventos.Service.Federator + alias Mobilizon.Service.Federator import Logger - import Eventos.Service.ActivityPub.Utils + import Mobilizon.Service.ActivityPub.Utils def get_recipients(data) do (data["to"] || []) ++ (data["cc"] || []) @@ -261,7 +261,7 @@ defmodule Eventos.Service.ActivityPub do host = URI.parse(inbox).host signature = - Eventos.Service.HTTPSignatures.sign(actor, %{host: host, "content-length": byte_size(json)}) + Mobilizon.Service.HTTPSignatures.sign(actor, %{host: host, "content-length": byte_size(json)}) Logger.debug("signature") Logger.debug(inspect(signature)) diff --git a/lib/service/activity_pub/transmogrifier.ex b/lib/service/activity_pub/transmogrifier.ex index 65f6607bb..b0646b3b9 100644 --- a/lib/service/activity_pub/transmogrifier.ex +++ b/lib/service/activity_pub/transmogrifier.ex @@ -1,11 +1,11 @@ -defmodule Eventos.Service.ActivityPub.Transmogrifier do +defmodule Mobilizon.Service.ActivityPub.Transmogrifier do @moduledoc """ A module to handle coding from internal to wire ActivityPub and back. """ - alias Eventos.Actors.Actor - alias Eventos.Actors - alias Eventos.Events.{Event, Comment} - alias Eventos.Service.ActivityPub + alias Mobilizon.Actors.Actor + alias Mobilizon.Actors + alias Mobilizon.Events.{Event, Comment} + alias Mobilizon.Service.ActivityPub import Ecto.Query diff --git a/lib/service/activity_pub/utils.ex b/lib/service/activity_pub/utils.ex index 9a59abc4f..0c0782254 100644 --- a/lib/service/activity_pub/utils.ex +++ b/lib/service/activity_pub/utils.ex @@ -1,19 +1,19 @@ -defmodule Eventos.Service.ActivityPub.Utils do +defmodule Mobilizon.Service.ActivityPub.Utils do @moduledoc """ # Utils Various utils """ - alias Eventos.Repo - alias Eventos.Actors - alias Eventos.Actors.Actor - alias Eventos.Events.Event - alias Eventos.Events - alias Eventos.Activity - alias EventosWeb - alias EventosWeb.Router.Helpers - alias EventosWeb.Endpoint + alias Mobilizon.Repo + alias Mobilizon.Actors + alias Mobilizon.Actors.Actor + alias Mobilizon.Events.Event + alias Mobilizon.Events + alias Mobilizon.Activity + alias MobilizonWeb + alias MobilizonWeb.Router.Helpers + alias MobilizonWeb.Endpoint alias Ecto.{Changeset, UUID} import Ecto.Query @@ -49,7 +49,7 @@ defmodule Eventos.Service.ActivityPub.Utils do # end def generate_id(type) do - "#{EventosWeb.Endpoint.url()}/#{type}/#{UUID.generate()}" + "#{MobilizonWeb.Endpoint.url()}/#{type}/#{UUID.generate()}" end # def create_context(context) do @@ -78,7 +78,7 @@ defmodule Eventos.Service.ActivityPub.Utils do _ -> 5 end - Eventos.Service.Federator.enqueue(:publish, activity, priority) + Mobilizon.Service.Federator.enqueue(:publish, activity, priority) :ok end diff --git a/lib/service/federator.ex b/lib/service/federator.ex index e8b1b7843..f2c4259fd 100644 --- a/lib/service/federator.ex +++ b/lib/service/federator.ex @@ -1,13 +1,13 @@ -defmodule Eventos.Service.Federator do +defmodule Mobilizon.Service.Federator do @moduledoc """ Handle federated activities """ use GenServer - alias Eventos.Actors - alias Eventos.Activity - alias Eventos.Service.ActivityPub - alias Eventos.Service.ActivityPub.Transmogrifier + alias Mobilizon.Actors + alias Mobilizon.Activity + alias Mobilizon.Service.ActivityPub + alias Mobilizon.Service.ActivityPub.Transmogrifier require Logger @max_jobs 20 diff --git a/lib/service/http_signatures/http_signatures.ex b/lib/service/http_signatures/http_signatures.ex index 20ff31e81..669a47965 100644 --- a/lib/service/http_signatures/http_signatures.ex +++ b/lib/service/http_signatures/http_signatures.ex @@ -1,13 +1,13 @@ # https://tools.ietf.org/html/draft-cavage-http-signatures-08 -defmodule Eventos.Service.HTTPSignatures do +defmodule Mobilizon.Service.HTTPSignatures do @moduledoc """ # HTTP Signatures Generates and checks HTTP Signatures """ - alias Eventos.Actors.Actor - alias Eventos.Service.ActivityPub + alias Mobilizon.Actors.Actor + alias Mobilizon.Service.ActivityPub import Logger def split_signature(sig) do diff --git a/lib/service/streamer.ex b/lib/service/streamer.ex index 43c63df98..b2b9f9cd6 100644 --- a/lib/service/streamer.ex +++ b/lib/service/streamer.ex @@ -1,4 +1,4 @@ -defmodule Eventos.Service.Streamer do +defmodule Mobilizon.Service.Streamer do @moduledoc """ # Streamer @@ -7,7 +7,7 @@ defmodule Eventos.Service.Streamer do use GenServer require Logger - alias Eventos.Accounts.Actor + alias Mobilizon.Accounts.Actor def init(args) do {:ok, args} diff --git a/lib/service/web_finger/web_finger.ex b/lib/service/web_finger/web_finger.ex index 273f80999..74a0e18b9 100644 --- a/lib/service/web_finger/web_finger.ex +++ b/lib/service/web_finger/web_finger.ex @@ -1,18 +1,18 @@ -defmodule Eventos.Service.WebFinger do +defmodule Mobilizon.Service.WebFinger do @moduledoc """ # WebFinger Performs the WebFinger requests and responses (json only) """ - alias Eventos.Actors - alias Eventos.Service.XmlBuilder - alias Eventos.Repo + alias Mobilizon.Actors + alias Mobilizon.Service.XmlBuilder + alias Mobilizon.Repo require Jason require Logger def host_meta do - base_url = EventosWeb.Endpoint.url() + base_url = MobilizonWeb.Endpoint.url() { :XRD, @@ -30,7 +30,7 @@ defmodule Eventos.Service.WebFinger do end def webfinger(resource, "JSON") do - host = EventosWeb.Endpoint.host() + host = MobilizonWeb.Endpoint.host() regex = ~r/(acct:)?(?\w+)@#{host}/ with %{"name" => name} <- Regex.named_captures(regex, resource) do @@ -49,7 +49,7 @@ defmodule Eventos.Service.WebFinger do def represent_user(user, "JSON") do %{ - "subject" => "acct:#{user.preferred_username}@#{EventosWeb.Endpoint.host() <> ":4001"}", + "subject" => "acct:#{user.preferred_username}@#{MobilizonWeb.Endpoint.host() <> ":4001"}", "aliases" => [user.url], "links" => [ %{"rel" => "self", "type" => "application/activity+json", "href" => user.url} diff --git a/lib/service/xml_builder.ex b/lib/service/xml_builder.ex index bb172a5ef..9a89d66a3 100644 --- a/lib/service/xml_builder.ex +++ b/lib/service/xml_builder.ex @@ -1,4 +1,4 @@ -defmodule Eventos.Service.XmlBuilder do +defmodule Mobilizon.Service.XmlBuilder do @moduledoc """ XML Builder. diff --git a/mix.exs b/mix.exs index 635450fb7..d2dccfd8b 100644 --- a/mix.exs +++ b/mix.exs @@ -1,9 +1,9 @@ -defmodule Eventos.Mixfile do +defmodule Mobilizon.Mixfile do use Mix.Project def project do [ - app: :eventos, + app: :mobilizon, version: "0.0.1", elixir: "~> 1.4", elixirc_paths: elixirc_paths(Mix.env()), @@ -18,10 +18,10 @@ defmodule Eventos.Mixfile do "coveralls.post": :test, "coveralls.html": :test ], - name: "Eventos", - source_url: "https://framagit.org/tcit/eventos", - homepage_url: "https://framagit.org/tcit/eventos", - docs: [main: "Eventos"] + name: "Mobilizon", + source_url: "https://framagit.org/tcit/mobilizon", + homepage_url: "https://framagit.org/tcit/mobilizon", + docs: [main: "Mobilizon"] ] end @@ -30,7 +30,7 @@ defmodule Eventos.Mixfile do # Type `mix help compile.app` for more information. def application do [ - mod: {Eventos.Application, []}, + mod: {Mobilizon.Application, []}, extra_applications: [:logger, :runtime_tools, :guardian, :bamboo, :geolix] ] end diff --git a/priv/repo/migrations/20180109150000_prerequites.exs b/priv/repo/migrations/20180109150000_prerequites.exs index b27db8acb..0cc58b153 100644 --- a/priv/repo/migrations/20180109150000_prerequites.exs +++ b/priv/repo/migrations/20180109150000_prerequites.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.Prerequites do +defmodule Mobilizon.Repo.Migrations.Prerequites do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180109165738_create_accounts.exs b/priv/repo/migrations/20180109165738_create_accounts.exs index 08846d455..c781f03ec 100644 --- a/priv/repo/migrations/20180109165738_create_accounts.exs +++ b/priv/repo/migrations/20180109165738_create_accounts.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateAccounts do +defmodule Mobilizon.Repo.Migrations.CreateAccounts do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180109170315_create_users.exs b/priv/repo/migrations/20180109170315_create_users.exs index 19a522647..b49965b09 100644 --- a/priv/repo/migrations/20180109170315_create_users.exs +++ b/priv/repo/migrations/20180109170315_create_users.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateUsers do +defmodule Mobilizon.Repo.Migrations.CreateUsers do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110091747_create_categories.exs b/priv/repo/migrations/20180110091747_create_categories.exs index a21b62f10..33a6c6cbb 100644 --- a/priv/repo/migrations/20180110091747_create_categories.exs +++ b/priv/repo/migrations/20180110091747_create_categories.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateCategories do +defmodule Mobilizon.Repo.Migrations.CreateCategories do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110092400_create_addresses.exs b/priv/repo/migrations/20180110092400_create_addresses.exs index bda6b92b5..ad7e96d79 100644 --- a/priv/repo/migrations/20180110092400_create_addresses.exs +++ b/priv/repo/migrations/20180110092400_create_addresses.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateAddresses do +defmodule Mobilizon.Repo.Migrations.CreateAddresses do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110092500_create_groups.exs b/priv/repo/migrations/20180110092500_create_groups.exs index 50066c94e..b03798d0c 100644 --- a/priv/repo/migrations/20180110092500_create_groups.exs +++ b/priv/repo/migrations/20180110092500_create_groups.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateGroups do +defmodule Mobilizon.Repo.Migrations.CreateGroups do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110092600_create_events.exs b/priv/repo/migrations/20180110092600_create_events.exs index 3082687e8..0a7fb2a3e 100644 --- a/priv/repo/migrations/20180110092600_create_events.exs +++ b/priv/repo/migrations/20180110092600_create_events.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateEvents do +defmodule Mobilizon.Repo.Migrations.CreateEvents do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110093905_create_tags.exs b/priv/repo/migrations/20180110093905_create_tags.exs index 8cc23589f..fafd3c49c 100644 --- a/priv/repo/migrations/20180110093905_create_tags.exs +++ b/priv/repo/migrations/20180110093905_create_tags.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateTags do +defmodule Mobilizon.Repo.Migrations.CreateTags do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110093906_create_events_tags.exs b/priv/repo/migrations/20180110093906_create_events_tags.exs index ee49c21a2..451d3cd55 100644 --- a/priv/repo/migrations/20180110093906_create_events_tags.exs +++ b/priv/repo/migrations/20180110093906_create_events_tags.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateEventsTags do +defmodule Mobilizon.Repo.Migrations.CreateEventsTags do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110094301_create_participants.exs b/priv/repo/migrations/20180110094301_create_participants.exs index d746dc5e1..2b6c724f3 100644 --- a/priv/repo/migrations/20180110094301_create_participants.exs +++ b/priv/repo/migrations/20180110094301_create_participants.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateParticipants do +defmodule Mobilizon.Repo.Migrations.CreateParticipants do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110094502_create_event_requests.exs b/priv/repo/migrations/20180110094502_create_event_requests.exs index 39273a3e3..209787826 100644 --- a/priv/repo/migrations/20180110094502_create_event_requests.exs +++ b/priv/repo/migrations/20180110094502_create_event_requests.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateEventRequests do +defmodule Mobilizon.Repo.Migrations.CreateEventRequests do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110095317_create_members.exs b/priv/repo/migrations/20180110095317_create_members.exs index afa4c1cae..c079d98c7 100644 --- a/priv/repo/migrations/20180110095317_create_members.exs +++ b/priv/repo/migrations/20180110095317_create_members.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateMembers do +defmodule Mobilizon.Repo.Migrations.CreateMembers do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110095515_create_group_requests.exs b/priv/repo/migrations/20180110095515_create_group_requests.exs index bfab1c789..a6f97c070 100644 --- a/priv/repo/migrations/20180110095515_create_group_requests.exs +++ b/priv/repo/migrations/20180110095515_create_group_requests.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateGroupRequests do +defmodule Mobilizon.Repo.Migrations.CreateGroupRequests do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180110165029_guardiandb.exs b/priv/repo/migrations/20180110165029_guardiandb.exs index 22d41efb3..bae2291f1 100644 --- a/priv/repo/migrations/20180110165029_guardiandb.exs +++ b/priv/repo/migrations/20180110165029_guardiandb.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.Guardian.DB do +defmodule Mobilizon.Repo.Migrations.Guardian.DB do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180112100000_create_tracks.exs b/priv/repo/migrations/20180112100000_create_tracks.exs index bd3b967d4..a83f6b4b6 100644 --- a/priv/repo/migrations/20180112100000_create_tracks.exs +++ b/priv/repo/migrations/20180112100000_create_tracks.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateTracks do +defmodule Mobilizon.Repo.Migrations.CreateTracks do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180112105354_create_sessions.exs b/priv/repo/migrations/20180112105354_create_sessions.exs index 2662ff206..f63c90494 100644 --- a/priv/repo/migrations/20180112105354_create_sessions.exs +++ b/priv/repo/migrations/20180112105354_create_sessions.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateSessions do +defmodule Mobilizon.Repo.Migrations.CreateSessions do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180430071244_remove_uri.exs b/priv/repo/migrations/20180430071244_remove_uri.exs index 32c8a9a3d..3c29c71bb 100644 --- a/priv/repo/migrations/20180430071244_remove_uri.exs +++ b/priv/repo/migrations/20180430071244_remove_uri.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.RemoveUri do +defmodule Mobilizon.Repo.Migrations.RemoveUri do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180515091106_add_url_field_to_events.exs b/priv/repo/migrations/20180515091106_add_url_field_to_events.exs index f7a3f16bc..b2596448b 100644 --- a/priv/repo/migrations/20180515091106_add_url_field_to_events.exs +++ b/priv/repo/migrations/20180515091106_add_url_field_to_events.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddUrlFieldToEvents do +defmodule Mobilizon.Repo.Migrations.AddUrlFieldToEvents do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180515100237_create_comments.exs b/priv/repo/migrations/20180515100237_create_comments.exs index c33ca55a4..d93d0069d 100644 --- a/priv/repo/migrations/20180515100237_create_comments.exs +++ b/priv/repo/migrations/20180515100237_create_comments.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.CreateComments do +defmodule Mobilizon.Repo.Migrations.CreateComments do use Ecto.Migration def change do diff --git a/priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs b/priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs index 2f178b147..ac8f5101b 100644 --- a/priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs +++ b/priv/repo/migrations/20180515142835_alter_event_timestamps_to_date_time_with_time_zone.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone do +defmodule Mobilizon.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs b/priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs index 3555b2c54..eea70dfe1 100644 --- a/priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs +++ b/priv/repo/migrations/20180515145438_add_local_attribute_to_events_and_comments.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddLocalAttributeToEventsAndComments do +defmodule Mobilizon.Repo.Migrations.AddLocalAttributeToEventsAndComments do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180517100700_move_from_account_to_actor.exs b/priv/repo/migrations/20180517100700_move_from_account_to_actor.exs index 81b4822af..bcbc6ab69 100644 --- a/priv/repo/migrations/20180517100700_move_from_account_to_actor.exs +++ b/priv/repo/migrations/20180517100700_move_from_account_to_actor.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.MoveFromAccountToActor do +defmodule Mobilizon.Repo.Migrations.MoveFromAccountToActor do use Ecto.Migration def up do @@ -19,7 +19,7 @@ defmodule Eventos.Repo.Migrations.MoveFromAccountToActor do drop table("groups") rename table("accounts"), to: table("actors") - Eventos.Actors.ActorTypeEnum.create_type + Mobilizon.Actors.ActorTypeEnum.create_type rename table("actors"), :username, to: :name rename table("actors"), :description, to: :summary rename table("actors"), :display_name, to: :preferred_username @@ -85,7 +85,7 @@ defmodule Eventos.Repo.Migrations.MoveFromAccountToActor do modify :username, :string, null: false modify :display_name, :string, null: true end - Eventos.Actors.ActorTypeEnum.drop_type() + Mobilizon.Actors.ActorTypeEnum.drop_type() rename table("events"), :organizer_actor_id, to: :organizer_account_id diff --git a/priv/repo/migrations/20180522133844_add_bots_table.exs b/priv/repo/migrations/20180522133844_add_bots_table.exs index 234f01a54..629754a7c 100644 --- a/priv/repo/migrations/20180522133844_add_bots_table.exs +++ b/priv/repo/migrations/20180522133844_add_bots_table.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddBotsTable do +defmodule Mobilizon.Repo.Migrations.AddBotsTable do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs b/priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs index 27ce9b36a..e808c1785 100644 --- a/priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs +++ b/priv/repo/migrations/20180530125159_add_avatar_and_banner_to_actor.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddAvatarAndBannerToActor do +defmodule Mobilizon.Repo.Migrations.AddAvatarAndBannerToActor do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs b/priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs index 645715b08..82ad33be2 100644 --- a/priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs +++ b/priv/repo/migrations/20180530152323_make_actor_public_key_nullable.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.MakeActorPublicKeyNullable do +defmodule Mobilizon.Repo.Migrations.MakeActorPublicKeyNullable do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs b/priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs index 5d83adb94..16e1ee084 100644 --- a/priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs +++ b/priv/repo/migrations/20180530170808_add_uuid_id_to_events.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddUUIDIdToEvents do +defmodule Mobilizon.Repo.Migrations.AddUUIDIdToEvents do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180531162301_add_approved_status_to_member.exs b/priv/repo/migrations/20180531162301_add_approved_status_to_member.exs index 3200484d2..241e20599 100644 --- a/priv/repo/migrations/20180531162301_add_approved_status_to_member.exs +++ b/priv/repo/migrations/20180531162301_add_approved_status_to_member.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddApprovedStatusToMember do +defmodule Mobilizon.Repo.Migrations.AddApprovedStatusToMember do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180607095732_add_uuid_to_comments.exs b/priv/repo/migrations/20180607095732_add_uuid_to_comments.exs index c0f0785cb..7722f0c2c 100644 --- a/priv/repo/migrations/20180607095732_add_uuid_to_comments.exs +++ b/priv/repo/migrations/20180607095732_add_uuid_to_comments.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddUUIDToComments do +defmodule Mobilizon.Repo.Migrations.AddUUIDToComments do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs b/priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs index 3b2135361..44ee0bb5a 100644 --- a/priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs +++ b/priv/repo/migrations/20180614094653_make_shared_inbox_url_nullable.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.MakeSharedInboxUrlNullable do +defmodule Mobilizon.Repo.Migrations.MakeSharedInboxUrlNullable do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs b/priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs index d9722db4d..0d6d33663 100644 --- a/priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs +++ b/priv/repo/migrations/20180614104618_fusion_public_private_key_into_keys_column.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.FusionPublicPrivateKeyIntoKeysColumn do +defmodule Mobilizon.Repo.Migrations.FusionPublicPrivateKeyIntoKeysColumn do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs b/priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs index 66b5d9579..c8a9d2015 100644 --- a/priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs +++ b/priv/repo/migrations/20180614131328_add_attributed_to_field_to_events_and_comments.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddAttributedToFieldToEventsAndComments do +defmodule Mobilizon.Repo.Migrations.AddAttributedToFieldToEventsAndComments do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs b/priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs index 2a2c3a76d..e30a8b061 100644 --- a/priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs +++ b/priv/repo/migrations/20180628091920_add-user-confirm-email-fields.exs @@ -1,4 +1,4 @@ -defmodule :"Elixir.Eventos.Repo.Migrations.Add-user-confirm-email-fields" do +defmodule :"Elixir.Mobilizon.Repo.Migrations.Add-user-confirm-email-fields" do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs b/priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs index 65ab97de1..772835221 100644 --- a/priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs +++ b/priv/repo/migrations/20180628130746_add-user-password-reset-fields.exs @@ -1,4 +1,4 @@ -defmodule :"Elixir.Eventos.Repo.Migrations.Add-user-password-reset-fields" do +defmodule :"Elixir.Mobilizon.Repo.Migrations.Add-user-password-reset-fields" do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs b/priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs index afbb3a9ea..6fbf5958f 100644 --- a/priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs +++ b/priv/repo/migrations/20180628142835_revert_alter_event_timestamps.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone do +defmodule Mobilizon.Repo.Migrations.AlterEventTimestampsToDateTimeWithTimeZone do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180702150922_add_address_type.exs b/priv/repo/migrations/20180702150922_add_address_type.exs index fbd329ab0..d89f75097 100644 --- a/priv/repo/migrations/20180702150922_add_address_type.exs +++ b/priv/repo/migrations/20180702150922_add_address_type.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddAddressType do +defmodule Mobilizon.Repo.Migrations.AddAddressType do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180702154630_remove_slug_for_event.exs b/priv/repo/migrations/20180702154630_remove_slug_for_event.exs index 11ddc6024..1cc8a018b 100644 --- a/priv/repo/migrations/20180702154630_remove_slug_for_event.exs +++ b/priv/repo/migrations/20180702154630_remove_slug_for_event.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.RemoveSlugForEvent do +defmodule Mobilizon.Repo.Migrations.RemoveSlugForEvent do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs b/priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs index fb9deaaf7..a3d6dc197 100644 --- a/priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs +++ b/priv/repo/migrations/20180706082208_alter_events_set_description_as_text.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AlterEventsSetDescriptionAsText do +defmodule Mobilizon.Repo.Migrations.AlterEventsSetDescriptionAsText do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs b/priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs index 26ba57b37..0ab8b7415 100644 --- a/priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs +++ b/priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AllowMultipleAccountsForUser do +defmodule Mobilizon.Repo.Migrations.AllowMultipleAccountsForUser do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180802133951_make_follower_table_unique.exs b/priv/repo/migrations/20180802133951_make_follower_table_unique.exs index 348bc5831..9b9ffc238 100644 --- a/priv/repo/migrations/20180802133951_make_follower_table_unique.exs +++ b/priv/repo/migrations/20180802133951_make_follower_table_unique.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.MakeFollowerTableUnique do +defmodule Mobilizon.Repo.Migrations.MakeFollowerTableUnique do use Ecto.Migration def up do diff --git a/priv/repo/migrations/20180816093446_add_primary_key_to_member.exs b/priv/repo/migrations/20180816093446_add_primary_key_to_member.exs index 57a5b6853..eac91b20f 100644 --- a/priv/repo/migrations/20180816093446_add_primary_key_to_member.exs +++ b/priv/repo/migrations/20180816093446_add_primary_key_to_member.exs @@ -1,4 +1,4 @@ -defmodule Eventos.Repo.Migrations.AddPrimaryKeyToMember do +defmodule Mobilizon.Repo.Migrations.AddPrimaryKeyToMember do use Ecto.Migration def up do diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 752310971..4a0412f95 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -5,12 +5,12 @@ # Inside the script, you can read and write to any of your # repositories directly: # -# Eventos.Repo.insert!(%Eventos.SomeSchema{}) +# Mobilizon.Repo.insert!(%Mobilizon.SomeSchema{}) # # We recommend using the bang functions (`insert!`, `update!` # and so on) as they will fail if something goes wrong. -import Eventos.Factory +import Mobilizon.Factory # Insert an user user = insert(:user) diff --git a/test/eventos/actors/actors_test.exs b/test/eventos/actors/actors_test.exs index a3522fd5d..eec7ee2f6 100644 --- a/test/eventos/actors/actors_test.exs +++ b/test/eventos/actors/actors_test.exs @@ -1,11 +1,11 @@ -defmodule Eventos.ActorsTest do - use Eventos.DataCase - import Eventos.Factory +defmodule Mobilizon.ActorsTest do + use Mobilizon.DataCase + import Mobilizon.Factory - alias Eventos.Actors + alias Mobilizon.Actors describe "actors" do - alias Eventos.Actors.Actor + alias Mobilizon.Actors.Actor @valid_attrs %{ summary: "some description", @@ -178,7 +178,7 @@ defmodule Eventos.ActorsTest do test "test get_public_key_for_url/1 with local actor", %{actor: actor} do assert Actor.get_public_key_for_url(actor.url) == - actor.keys |> Eventos.Service.ActivityPub.Utils.pem_to_public_key() + actor.keys |> Mobilizon.Service.ActivityPub.Utils.pem_to_public_key() end @remote_actor_key {:RSAPublicKey, @@ -231,7 +231,7 @@ defmodule Eventos.ActorsTest do end describe "users" do - alias Eventos.Actors.{User, Actor} + alias Mobilizon.Actors.{User, Actor} @actor_valid_attrs %{ description: "some description", @@ -311,8 +311,8 @@ defmodule Eventos.ActorsTest do end describe "groups" do - alias Eventos.Actors - alias Eventos.Actors.Actor + alias Mobilizon.Actors + alias Mobilizon.Actors.Actor @valid_attrs %{ summary: "some description", @@ -340,10 +340,10 @@ defmodule Eventos.ActorsTest do end end - alias Eventos.Actors + alias Mobilizon.Actors describe "bots" do - alias Eventos.Actors.Bot + alias Mobilizon.Actors.Bot @valid_attrs %{source: "some source", type: "some type"} @update_attrs %{source: "some updated source", type: "some updated type"} @@ -406,8 +406,8 @@ defmodule Eventos.ActorsTest do end describe "followers" do - alias Eventos.Actors.Follower - alias Eventos.Actors.Actor + alias Mobilizon.Actors.Follower + alias Mobilizon.Actors.Actor @valid_attrs %{approved: true, score: 42} @update_attrs %{approved: false, score: 43} @@ -498,8 +498,8 @@ defmodule Eventos.ActorsTest do end describe "members" do - alias Eventos.Actors.Member - alias Eventos.Actors.Actor + alias Mobilizon.Actors.Member + alias Mobilizon.Actors.Actor @valid_attrs %{approved: true, role: 0} @update_attrs %{approved: false, role: 1} diff --git a/test/eventos/addresses/addresses_test.exs b/test/eventos/addresses/addresses_test.exs index cf37b3e67..6ffa2943a 100644 --- a/test/eventos/addresses/addresses_test.exs +++ b/test/eventos/addresses/addresses_test.exs @@ -1,10 +1,10 @@ -defmodule Eventos.AddressesTest do - use Eventos.DataCase +defmodule Mobilizon.AddressesTest do + use Mobilizon.DataCase - alias Eventos.Addresses + alias Mobilizon.Addresses describe "addresses" do - alias Eventos.Addresses.Address + alias Mobilizon.Addresses.Address @valid_attrs %{ addressCountry: "some addressCountry", diff --git a/test/eventos/events/events_test.exs b/test/eventos/events/events_test.exs index cacde8327..9c5cd651a 100644 --- a/test/eventos/events/events_test.exs +++ b/test/eventos/events/events_test.exs @@ -1,10 +1,10 @@ -defmodule Eventos.EventsTest do - use Eventos.DataCase +defmodule Mobilizon.EventsTest do + use Mobilizon.DataCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Actors + alias Mobilizon.Events + alias Mobilizon.Actors @event_valid_attrs %{ begins_on: "2010-04-17 14:00:00.000000Z", @@ -30,7 +30,7 @@ defmodule Eventos.EventsTest do end describe "events" do - alias Eventos.Events.Event + alias Mobilizon.Events.Event setup do actor = insert(:actor) @@ -161,7 +161,7 @@ defmodule Eventos.EventsTest do end describe "categories" do - alias Eventos.Events.Category + alias Mobilizon.Events.Category setup do category = insert(:category) @@ -223,7 +223,7 @@ defmodule Eventos.EventsTest do end describe "tags" do - alias Eventos.Events.Tag + alias Mobilizon.Events.Tag @valid_attrs %{title: "some title"} @update_attrs %{title: "some updated title"} @@ -283,8 +283,8 @@ defmodule Eventos.EventsTest do end describe "participants" do - alias Eventos.Events.{Participant, Event} - alias Eventos.Actors.Actor + alias Mobilizon.Events.{Participant, Event} + alias Mobilizon.Actors.Actor @valid_attrs %{role: 42} @update_attrs %{role: 43} @@ -346,7 +346,7 @@ defmodule Eventos.EventsTest do end describe "sessions" do - alias Eventos.Events.Session + alias Mobilizon.Events.Session @valid_attrs %{ audios_urls: "some audios_urls", @@ -452,7 +452,7 @@ defmodule Eventos.EventsTest do end describe "tracks" do - alias Eventos.Events.Track + alias Mobilizon.Events.Track @valid_attrs %{color: "some color", description: "some description", name: "some name"} @update_attrs %{ @@ -525,7 +525,7 @@ defmodule Eventos.EventsTest do end describe "comments" do - alias Eventos.Events.Comment + alias Mobilizon.Events.Comment @valid_attrs %{text: "some text"} @update_attrs %{text: "some updated text"} diff --git a/test/eventos/service/activitypub/activitypub_test.exs b/test/eventos/service/activitypub/activitypub_test.exs index 3cf40fbef..cbe8cbe37 100644 --- a/test/eventos/service/activitypub/activitypub_test.exs +++ b/test/eventos/service/activitypub/activitypub_test.exs @@ -1,13 +1,13 @@ -defmodule Eventos.Service.Activitypub.ActivitypubTest do - use Eventos.DataCase +defmodule Mobilizon.Service.Activitypub.ActivitypubTest do + use Mobilizon.DataCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Actors.Actor - alias Eventos.Actors - alias Eventos.Service.ActivityPub - alias Eventos.Activity + alias Mobilizon.Events + alias Mobilizon.Actors.Actor + alias Mobilizon.Actors + alias Mobilizon.Service.ActivityPub + alias Mobilizon.Activity describe "fetching actor from it's url" do test "returns an actor from nickname" do @@ -80,7 +80,7 @@ defmodule Eventos.Service.Activitypub.ActivitypubTest do describe "update" do test "it creates an update activity with the new actor data" do actor = insert(:actor) - actor_data = EventosWeb.ActivityPub.ActorView.render("actor.json", %{actor: actor}) + actor_data = MobilizonWeb.ActivityPub.ActorView.render("actor.json", %{actor: actor}) {:ok, update} = ActivityPub.update(%{ diff --git a/test/eventos/service/web_finger/web_finger_test.exs b/test/eventos/service/web_finger/web_finger_test.exs index f8154ee66..954db8a4e 100644 --- a/test/eventos/service/web_finger/web_finger_test.exs +++ b/test/eventos/service/web_finger/web_finger_test.exs @@ -1,13 +1,13 @@ -defmodule Eventos.Service.WebFingerTest do - use Eventos.DataCase - alias Eventos.Service.WebFinger - import Eventos.Factory +defmodule Mobilizon.Service.WebFingerTest do + use Mobilizon.DataCase + alias Mobilizon.Service.WebFinger + import Mobilizon.Factory describe "host meta" do test "returns a link to the xml lrdd" do host_info = WebFinger.host_meta() - assert String.contains?(host_info, EventosWeb.Endpoint.url()) + assert String.contains?(host_info, MobilizonWeb.Endpoint.url()) end end @@ -16,7 +16,7 @@ defmodule Eventos.Service.WebFingerTest do actor = insert(:actor) {:ok, result} = - WebFinger.webfinger("#{actor.preferred_username}@#{EventosWeb.Endpoint.host()}", "JSON") + WebFinger.webfinger("#{actor.preferred_username}@#{MobilizonWeb.Endpoint.host()}", "JSON") assert is_map(result) end diff --git a/test/eventos_web/controllers/activity_pub_controller_test.exs b/test/eventos_web/controllers/activity_pub_controller_test.exs index 73d850cec..5b03f1981 100644 --- a/test/eventos_web/controllers/activity_pub_controller_test.exs +++ b/test/eventos_web/controllers/activity_pub_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.ActivityPubControllerTest do - use EventosWeb.ConnCase - import Eventos.Factory - alias EventosWeb.ActivityPub.{ActorView, ObjectView} - alias Eventos.{Repo, Actors, Actors.Actor} - alias Eventos.Service.ActivityPub - alias Eventos.Activity +defmodule MobilizonWeb.ActivityPubControllerTest do + use MobilizonWeb.ConnCase + import Mobilizon.Factory + alias MobilizonWeb.ActivityPub.{ActorView, ObjectView} + alias Mobilizon.{Repo, Actors, Actors.Actor} + alias Mobilizon.Service.ActivityPub + alias Mobilizon.Activity import Logger describe "/@:preferred_username" do @@ -135,7 +135,7 @@ defmodule EventosWeb.ActivityPubControllerTest do # test "it returns the following in a collection", %{conn: conn} do # actor = insert(:actor) # actor2 = insert(:actor) - # Eventos.Service.ActivityPub.follow(actor, actor2) + # Mobilizon.Service.ActivityPub.follow(actor, actor2) # result = # conn diff --git a/test/eventos_web/controllers/actor_controller_test.exs b/test/eventos_web/controllers/actor_controller_test.exs index 3b04bd815..4cfa21f8d 100644 --- a/test/eventos_web/controllers/actor_controller_test.exs +++ b/test/eventos_web/controllers/actor_controller_test.exs @@ -1,9 +1,9 @@ -defmodule EventosWeb.ActorControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.ActorControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Actors + alias Mobilizon.Actors setup %{conn: conn} do user = insert(:user) diff --git a/test/eventos_web/controllers/address_controller_test.exs b/test/eventos_web/controllers/address_controller_test.exs index d0e4c2dde..01d66e009 100644 --- a/test/eventos_web/controllers/address_controller_test.exs +++ b/test/eventos_web/controllers/address_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.AddressControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.AddressControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Addresses - alias Eventos.Addresses.Address + alias Mobilizon.Addresses + alias Mobilizon.Addresses.Address @create_attrs %{ addressCountry: "some addressCountry", diff --git a/test/eventos_web/controllers/bot_controller_test.exs b/test/eventos_web/controllers/bot_controller_test.exs index c6dc88845..a136a80a7 100644 --- a/test/eventos_web/controllers/bot_controller_test.exs +++ b/test/eventos_web/controllers/bot_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.BotControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.BotControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Actors - alias Eventos.Actors.Bot + alias Mobilizon.Actors + alias Mobilizon.Actors.Bot @create_attrs %{source: "some source", type: "some type", name: "some name"} @update_attrs %{ diff --git a/test/eventos_web/controllers/category_controller_test.exs b/test/eventos_web/controllers/category_controller_test.exs index b823685db..868782b5f 100644 --- a/test/eventos_web/controllers/category_controller_test.exs +++ b/test/eventos_web/controllers/category_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.CategoryControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.CategoryControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Events.Category + alias Mobilizon.Events + alias Mobilizon.Events.Category @create_attrs %{description: "some description", picture: "some picture", title: "some title"} @update_attrs %{ diff --git a/test/eventos_web/controllers/comment_controller_test.exs b/test/eventos_web/controllers/comment_controller_test.exs index c0509c08b..af107d08d 100644 --- a/test/eventos_web/controllers/comment_controller_test.exs +++ b/test/eventos_web/controllers/comment_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.CommentControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.CommentControllerTest do + use MobilizonWeb.ConnCase - alias Eventos.Events - alias Eventos.Events.Comment + alias Mobilizon.Events + alias Mobilizon.Events.Comment - import Eventos.Factory + import Mobilizon.Factory @create_attrs %{text: "some text"} @update_attrs %{text: "some updated text"} @@ -29,7 +29,7 @@ defmodule EventosWeb.CommentControllerTest do "id" => id, "text" => "some text", "uuid" => uuid, - "url" => "#{EventosWeb.Endpoint.url()}/comments/#{uuid}" + "url" => "#{MobilizonWeb.Endpoint.url()}/comments/#{uuid}" } end @@ -60,7 +60,7 @@ defmodule EventosWeb.CommentControllerTest do "id" => id, "text" => "some updated text", "uuid" => uuid, - "url" => "#{EventosWeb.Endpoint.url()}/comments/#{uuid}" + "url" => "#{MobilizonWeb.Endpoint.url()}/comments/#{uuid}" } end diff --git a/test/eventos_web/controllers/event_controller_test.exs b/test/eventos_web/controllers/event_controller_test.exs index a4fbc3620..db1c688eb 100644 --- a/test/eventos_web/controllers/event_controller_test.exs +++ b/test/eventos_web/controllers/event_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.EventControllerTest do - use EventosWeb.ConnCase - import Eventos.Factory +defmodule MobilizonWeb.EventControllerTest do + use MobilizonWeb.ConnCase + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Events.Event - alias Eventos.Export.ICalendar + alias Mobilizon.Events + alias Mobilizon.Events.Event + alias Mobilizon.Export.ICalendar @create_attrs %{ begins_on: "2010-04-17 14:00:00.000000Z", diff --git a/test/eventos_web/controllers/follower_controller_test.exs b/test/eventos_web/controllers/follower_controller_test.exs index f09238483..aa994879f 100644 --- a/test/eventos_web/controllers/follower_controller_test.exs +++ b/test/eventos_web/controllers/follower_controller_test.exs @@ -1,9 +1,9 @@ -defmodule EventosWeb.FollowerControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.FollowerControllerTest do + use MobilizonWeb.ConnCase - alias Eventos.Actors - alias Eventos.Actors.Follower - import Eventos.Factory + alias Mobilizon.Actors + alias Mobilizon.Actors.Follower + import Mobilizon.Factory @create_attrs %{approved: true, score: 42} @update_attrs %{approved: false, score: 43} diff --git a/test/eventos_web/controllers/nodeinfo_controller_test.exs b/test/eventos_web/controllers/nodeinfo_controller_test.exs index d0db93ca5..003c82649 100644 --- a/test/eventos_web/controllers/nodeinfo_controller_test.exs +++ b/test/eventos_web/controllers/nodeinfo_controller_test.exs @@ -1,7 +1,7 @@ -defmodule EventosWeb.NodeinfoControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.NodeinfoControllerTest do + use MobilizonWeb.ConnCase - @instance Application.get_env(:eventos, :instance) + @instance Application.get_env(:mobilizon, :instance) test "Get node info schemas", %{conn: conn} do conn = get(conn, nodeinfo_path(conn, :schemas)) @@ -10,7 +10,7 @@ defmodule EventosWeb.NodeinfoControllerTest do "links" => [ %{ "href" => - EventosWeb.Router.Helpers.nodeinfo_url(EventosWeb.Endpoint, :nodeinfo, "2.0"), + MobilizonWeb.Router.Helpers.nodeinfo_url(MobilizonWeb.Endpoint, :nodeinfo, "2.0"), "rel" => "http://nodeinfo.diaspora.software/ns/schema/2.0" } ] @@ -27,7 +27,7 @@ defmodule EventosWeb.NodeinfoControllerTest do "openRegistrations" => Keyword.get(@instance, :registrations_open), "protocols" => ["activitypub"], "services" => %{"inbound" => [], "outbound" => []}, - "software" => %{"name" => "eventos", "version" => Keyword.get(@instance, :version)}, + "software" => %{"name" => "mobilizon", "version" => Keyword.get(@instance, :version)}, "version" => "2.0" } end diff --git a/test/eventos_web/controllers/page_controller_test.exs b/test/eventos_web/controllers/page_controller_test.exs index 9662307b1..f90af3b1e 100644 --- a/test/eventos_web/controllers/page_controller_test.exs +++ b/test/eventos_web/controllers/page_controller_test.exs @@ -1,5 +1,5 @@ -defmodule EventosWeb.PageControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.PageControllerTest do + use MobilizonWeb.ConnCase test "GET /", %{conn: conn} do conn = get(conn, "/") diff --git a/test/eventos_web/controllers/session_controller_test.exs b/test/eventos_web/controllers/session_controller_test.exs index 743393d91..2baeb36de 100644 --- a/test/eventos_web/controllers/session_controller_test.exs +++ b/test/eventos_web/controllers/session_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.SessionControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.SessionControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Events.Session + alias Mobilizon.Events + alias Mobilizon.Events.Session @create_attrs %{ audios_urls: "some audios_urls", diff --git a/test/eventos_web/controllers/tag_controller_test.exs b/test/eventos_web/controllers/tag_controller_test.exs index 8bae81c72..b6b187cc9 100644 --- a/test/eventos_web/controllers/tag_controller_test.exs +++ b/test/eventos_web/controllers/tag_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.TagControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.TagControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Events.Tag + alias Mobilizon.Events + alias Mobilizon.Events.Tag @create_attrs %{title: "some title"} @update_attrs %{title: "some updated title"} diff --git a/test/eventos_web/controllers/track_controller_test.exs b/test/eventos_web/controllers/track_controller_test.exs index d79426547..2065b2395 100644 --- a/test/eventos_web/controllers/track_controller_test.exs +++ b/test/eventos_web/controllers/track_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.TrackControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.TrackControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Events - alias Eventos.Events.Track + alias Mobilizon.Events + alias Mobilizon.Events.Track @create_attrs %{color: "some color", description: "some description", name: "some name"} @update_attrs %{ diff --git a/test/eventos_web/controllers/user_controller_test.exs b/test/eventos_web/controllers/user_controller_test.exs index 25ce98fda..383cc8e80 100644 --- a/test/eventos_web/controllers/user_controller_test.exs +++ b/test/eventos_web/controllers/user_controller_test.exs @@ -1,10 +1,10 @@ -defmodule EventosWeb.UserControllerTest do - use EventosWeb.ConnCase +defmodule MobilizonWeb.UserControllerTest do + use MobilizonWeb.ConnCase - import Eventos.Factory + import Mobilizon.Factory - alias Eventos.Actors - alias Eventos.Actors.User + alias Mobilizon.Actors + alias Mobilizon.Actors.User use Bamboo.Test @create_attrs %{email: "foo@bar.tld", password: "some password_hash", username: "some username"} @@ -34,8 +34,8 @@ defmodule EventosWeb.UserControllerTest do test "renders user when data is valid", %{conn: conn} do conn = post(conn, user_path(conn, :register), @create_attrs) assert %{"email" => "foo@bar.tld"} = json_response(conn, 201) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(@create_attrs.email) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(@create_attrs.email) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) end test "renders errors when data is invalid", %{conn: conn} do @@ -59,8 +59,8 @@ defmodule EventosWeb.UserControllerTest do test "validate user when token is valid", %{conn: conn} do conn = post(conn, user_path(conn, :create), @create_attrs) assert %{"email" => "foo@bar.tld"} = json_response(conn, 201) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(@create_attrs.email) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(@create_attrs.email) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) conn = get(conn, user_path(conn, :validate, user.confirmation_token)) assert %{"user" => _, "token" => _} = json_response(conn, 200) @@ -69,8 +69,8 @@ defmodule EventosWeb.UserControllerTest do test "validate user when token is invalid", %{conn: conn} do conn = post(conn, user_path(conn, :create), @create_attrs) assert %{"email" => "foo@bar.tld"} = json_response(conn, 201) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(@create_attrs.email) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(@create_attrs.email) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) conn = get(conn, user_path(conn, :validate, "toto")) assert %{"error" => _} = json_response(conn, 404) @@ -81,8 +81,8 @@ defmodule EventosWeb.UserControllerTest do test "ask to resend token to user when too soon", %{conn: conn} do conn = post(conn, user_path(conn, :create), @create_attrs) assert %{"email" => "foo@bar.tld"} = json_response(conn, 201) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(@create_attrs.email) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(@create_attrs.email) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) conn = post(conn, user_path(conn, :resend_confirmation), %{"email" => @create_attrs.email}) assert %{"error" => _} = json_response(conn, 404) @@ -92,17 +92,17 @@ defmodule EventosWeb.UserControllerTest do conn = post(conn, user_path(conn, :create), @create_attrs) assert %{"email" => "foo@bar.tld"} = json_response(conn, 201) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(@create_attrs.email) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(@create_attrs.email) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) # Hammer time ! {:ok, %User{} = user} = - Eventos.Actors.update_user(user, %{ + Mobilizon.Actors.update_user(user, %{ confirmation_sent_at: Timex.shift(user.confirmation_sent_at, hours: -3) }) conn = post(conn, user_path(conn, :resend_confirmation), %{"email" => @create_attrs.email}) - assert_delivered_email(Eventos.Email.User.confirmation_email(user)) + assert_delivered_email(Mobilizon.Email.User.confirmation_email(user)) assert %{"email" => "foo@bar.tld"} = json_response(conn, 200) end end @@ -113,8 +113,8 @@ defmodule EventosWeb.UserControllerTest do # Send reset email conn = post(conn, user_path(conn, :send_reset_password), %{"email" => user_email}) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(user.email) - assert_delivered_email(Eventos.Email.User.reset_password_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(user.email) + assert_delivered_email(Mobilizon.Email.User.reset_password_email(user)) assert %{"email" => user_email} = json_response(conn, 200) # Call reset route @@ -133,8 +133,8 @@ defmodule EventosWeb.UserControllerTest do # Send reset email conn = post(conn, user_path(conn, :send_reset_password), %{"email" => user.email}) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(user.email) - assert_delivered_email(Eventos.Email.User.reset_password_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(user.email) + assert_delivered_email(Mobilizon.Email.User.reset_password_email(user)) assert %{"email" => user_email} = json_response(conn, 200) # Send reset email again @@ -149,20 +149,20 @@ defmodule EventosWeb.UserControllerTest do # Send reset email conn = post(conn, user_path(conn, :send_reset_password), %{"email" => user.email}) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(user.email) - assert_delivered_email(Eventos.Email.User.reset_password_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(user.email) + assert_delivered_email(Mobilizon.Email.User.reset_password_email(user)) assert %{"email" => user_email} = json_response(conn, 200) # Hammer time ! {:ok, %User{} = user} = - Eventos.Actors.update_user(user, %{ + Mobilizon.Actors.update_user(user, %{ reset_password_sent_at: Timex.shift(user.reset_password_sent_at, hours: -3) }) # Send reset email again conn = post(conn, user_path(conn, :send_reset_password), %{"email" => user.email}) - assert {:ok, %User{} = user} = Eventos.Actors.get_user_by_email(user.email) - assert_delivered_email(Eventos.Email.User.reset_password_email(user)) + assert {:ok, %User{} = user} = Mobilizon.Actors.get_user_by_email(user.email) + assert_delivered_email(Mobilizon.Email.User.reset_password_email(user)) assert %{"email" => user_email} = json_response(conn, 200) end diff --git a/test/eventos_web/views/error_view_test.exs b/test/eventos_web/views/error_view_test.exs index 78a4fe7b1..933a95c1d 100644 --- a/test/eventos_web/views/error_view_test.exs +++ b/test/eventos_web/views/error_view_test.exs @@ -1,18 +1,18 @@ -defmodule EventosWeb.ErrorViewTest do - use EventosWeb.ConnCase, async: true +defmodule MobilizonWeb.ErrorViewTest do + use MobilizonWeb.ConnCase, async: true # Bring render/3 and render_to_string/3 for testing custom views import Phoenix.View test "renders 404.html" do - assert render_to_string(EventosWeb.ErrorView, "404.html", []) == "Page not found" + assert render_to_string(MobilizonWeb.ErrorView, "404.html", []) == "Page not found" end test "render 500.html" do - assert render_to_string(EventosWeb.ErrorView, "500.html", []) == "Internal server error" + assert render_to_string(MobilizonWeb.ErrorView, "500.html", []) == "Internal server error" end test "render any other" do - assert render_to_string(EventosWeb.ErrorView, "505.html", []) == "Internal server error" + assert render_to_string(MobilizonWeb.ErrorView, "505.html", []) == "Internal server error" end end diff --git a/test/eventos_web/views/layout_view_test.exs b/test/eventos_web/views/layout_view_test.exs index 1ba92e058..c8c8d6366 100644 --- a/test/eventos_web/views/layout_view_test.exs +++ b/test/eventos_web/views/layout_view_test.exs @@ -1,3 +1,3 @@ -defmodule EventosWeb.LayoutViewTest do - use EventosWeb.ConnCase, async: true +defmodule MobilizonWeb.LayoutViewTest do + use MobilizonWeb.ConnCase, async: true end diff --git a/test/eventos_web/views/page_view_test.exs b/test/eventos_web/views/page_view_test.exs index 8efcc412a..5280b55de 100644 --- a/test/eventos_web/views/page_view_test.exs +++ b/test/eventos_web/views/page_view_test.exs @@ -1,3 +1,3 @@ -defmodule EventosWeb.PageViewTest do - use EventosWeb.ConnCase, async: true +defmodule MobilizonWeb.PageViewTest do + use MobilizonWeb.ConnCase, async: true end diff --git a/test/fixtures/mastodon-post-activity.json b/test/fixtures/mastodon-post-activity.json index 1bee5938b..9adac0d55 100644 --- a/test/fixtures/mastodon-post-activity.json +++ b/test/fixtures/mastodon-post-activity.json @@ -18,7 +18,7 @@ "actor": "http://framapiaf.org/users/admin", "cc": [ "http://framapiaf.org/users/admin/followers", - "http://eventos.com/@tcit" + "http://mobilizon.com/@tcit" ], "id": "http://framapiaf.org/users/admin/statuses/99512778738411822/activity", "nickname": "lain", diff --git a/test/support/channel_case.ex b/test/support/channel_case.ex index 0508a0e7a..cc77f22f4 100644 --- a/test/support/channel_case.ex +++ b/test/support/channel_case.ex @@ -1,4 +1,4 @@ -defmodule EventosWeb.ChannelCase do +defmodule MobilizonWeb.ChannelCase do @moduledoc """ This module defines the test case to be used by channel tests. @@ -21,15 +21,15 @@ defmodule EventosWeb.ChannelCase do use Phoenix.ChannelTest # The default endpoint for testing - @endpoint EventosWeb.Endpoint + @endpoint MobilizonWeb.Endpoint end end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(Eventos.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(Mobilizon.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(Eventos.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(Mobilizon.Repo, {:shared, self()}) end :ok diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 8faa5c440..686bcb921 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -1,4 +1,4 @@ -defmodule EventosWeb.ConnCase do +defmodule MobilizonWeb.ConnCase do @moduledoc """ This module defines the test case to be used by tests that require setting up a connection. @@ -19,13 +19,13 @@ defmodule EventosWeb.ConnCase do quote do # Import conveniences for testing with connections use Phoenix.ConnTest - import EventosWeb.Router.Helpers + import MobilizonWeb.Router.Helpers # The default endpoint for testing - @endpoint EventosWeb.Endpoint + @endpoint MobilizonWeb.Endpoint - def auth_conn(%Plug.Conn{} = conn, %Eventos.Actors.User{} = user) do - {:ok, token, _claims} = EventosWeb.Guardian.encode_and_sign(user) + def auth_conn(%Plug.Conn{} = conn, %Mobilizon.Actors.User{} = user) do + {:ok, token, _claims} = MobilizonWeb.Guardian.encode_and_sign(user) conn |> Plug.Conn.put_req_header("authorization", "Bearer #{token}") @@ -35,10 +35,10 @@ defmodule EventosWeb.ConnCase do end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(Eventos.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(Mobilizon.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(Eventos.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(Mobilizon.Repo, {:shared, self()}) end {:ok, conn: Phoenix.ConnTest.build_conn()} diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 127cf5f83..df02d2d4a 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -1,4 +1,4 @@ -defmodule Eventos.DataCase do +defmodule Mobilizon.DataCase do @moduledoc """ This module defines the setup for tests requiring access to the application's data layer. @@ -16,20 +16,20 @@ defmodule Eventos.DataCase do using do quote do - alias Eventos.Repo + alias Mobilizon.Repo import Ecto import Ecto.Changeset import Ecto.Query - import Eventos.DataCase + import Mobilizon.DataCase end end setup tags do - :ok = Ecto.Adapters.SQL.Sandbox.checkout(Eventos.Repo) + :ok = Ecto.Adapters.SQL.Sandbox.checkout(Mobilizon.Repo) unless tags[:async] do - Ecto.Adapters.SQL.Sandbox.mode(Eventos.Repo, {:shared, self()}) + Ecto.Adapters.SQL.Sandbox.mode(Mobilizon.Repo, {:shared, self()}) end :ok diff --git a/test/support/factory.ex b/test/support/factory.ex index 5246f83bd..1deff9fe2 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -1,12 +1,12 @@ -defmodule Eventos.Factory do +defmodule Mobilizon.Factory do @moduledoc """ Factory for fixtures with ExMachina """ # with Ecto - use ExMachina.Ecto, repo: Eventos.Repo + use ExMachina.Ecto, repo: Mobilizon.Repo def user_factory do - %Eventos.Actors.User{ + %Mobilizon.Actors.User{ password_hash: "Jane Smith", email: sequence(:email, &"email-#{&1}@example.com"), role: 0 @@ -20,12 +20,12 @@ defmodule Eventos.Factory do preferred_username = sequence("thomas") - %Eventos.Actors.Actor{ + %Mobilizon.Actors.Actor{ preferred_username: preferred_username, domain: nil, keys: pem, type: :Person, - url: EventosWeb.Endpoint.url() <> "/@#{preferred_username}", + url: MobilizonWeb.Endpoint.url() <> "/@#{preferred_username}", user: nil } end @@ -40,21 +40,21 @@ defmodule Eventos.Factory do end def follower_factory do - %Eventos.Actors.Follower{ + %Mobilizon.Actors.Follower{ target_actor: build(:actor), actor: build(:actor) } end def category_factory do - %Eventos.Events.Category{ + %Mobilizon.Events.Category{ title: sequence("MyCategory"), description: "My category desc" } end def address_factory do - %Eventos.Addresses.Address{ + %Mobilizon.Addresses.Address{ description: sequence("MyAddress"), geom: %Geo.Point{coordinates: {30, -90}, srid: 4326}, floor: "Myfloor", @@ -69,19 +69,19 @@ defmodule Eventos.Factory do def comment_factory do uuid = Ecto.UUID.generate() - %Eventos.Events.Comment{ + %Mobilizon.Events.Comment{ text: "My Comment", actor: build(:actor), event: build(:event), uuid: uuid, - url: "#{EventosWeb.Endpoint.url()}/comments/#{uuid}" + url: "#{MobilizonWeb.Endpoint.url()}/comments/#{uuid}" } end def event_factory do actor = build(:actor) - %Eventos.Events.Event{ + %Mobilizon.Events.Event{ title: sequence("MyEvent"), description: "My desc", begins_on: nil, @@ -90,19 +90,19 @@ defmodule Eventos.Factory do category: build(:category), physical_address: build(:address), public: true, - url: "#{EventosWeb.Endpoint.url()}/@#{actor.url}/#{Ecto.UUID.generate()}" + url: "#{MobilizonWeb.Endpoint.url()}/@#{actor.url}/#{Ecto.UUID.generate()}" } end def participant_factory do - %Eventos.Events.Participant{ + %Mobilizon.Events.Participant{ event: build(:event), actor: build(:actor) } end def session_factory do - %Eventos.Events.Session{ + %Mobilizon.Events.Session{ title: sequence("MySession"), event: build(:event), track: build(:track) @@ -110,14 +110,14 @@ defmodule Eventos.Factory do end def track_factory do - %Eventos.Events.Track{ + %Mobilizon.Events.Track{ name: sequence("MyTrack"), event: build(:event) } end def bot_factory do - %Eventos.Actors.Bot{ + %Mobilizon.Actors.Bot{ source: "https://mysource.tld/feed.ics", type: "ics", user: build(:user), @@ -126,7 +126,7 @@ defmodule Eventos.Factory do end def member_factory do - %Eventos.Actors.Member{ + %Mobilizon.Actors.Member{ parent: build(:actor), actor: build(:actor) } diff --git a/test/test_helper.exs b/test/test_helper.exs index e37ba04e2..43b41df65 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -3,4 +3,4 @@ ExUnit.configure(formatters: [ExUnit.CLIFormatter, ExUnitNotifier]) ExUnit.start() -Ecto.Adapters.SQL.Sandbox.mode(Eventos.Repo, :manual) +Ecto.Adapters.SQL.Sandbox.mode(Mobilizon.Repo, :manual)