Browse Source

Rename project to Mobilizon

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
osm-theme
Thomas Citharel 2 years ago
parent
commit
559c889f1b
191 changed files with 740 additions and 740 deletions
  1. +2
    -2
      .gitlab-ci.yml
  2. +1
    -1
      LICENSE
  3. +2
    -2
      README.md
  4. +9
    -9
      config/config.exs
  5. +8
    -8
      config/dev.exs
  6. +6
    -6
      config/prod.exs
  7. +5
    -5
      config/test.exs
  8. +5
    -5
      docker-compose.yml
  9. +2
    -2
      js/.env.dist
  10. +1
    -1
      js/package-lock.json
  11. +1
    -1
      js/package.json
  12. +2
    -2
      js/public/index.html
  13. +2
    -2
      js/public/manifest.json
  14. +1
    -1
      js/src/components/Home.vue
  15. +1
    -1
      js/src/components/NavBar.vue
  16. +2
    -2
      js/src/i18n/en.js
  17. +2
    -2
      js/src/i18n/fr.js
  18. +3
    -3
      lib/eventos.ex
  19. +0
    -6
      lib/eventos/mailer.ex
  20. +12
    -12
      lib/eventos_web.ex
  21. +0
    -6
      lib/eventos_web/controllers/inboxes_controller.ex
  22. +0
    -10
      lib/eventos_web/templates/email/email.html.eex
  23. +0
    -3
      lib/eventos_web/templates/email/email.text.eex
  24. +0
    -3
      lib/eventos_web/views/email_view.ex
  25. +0
    -6
      lib/eventos_web/views/page_view.ex
  26. +0
    -10
      lib/eventos_web/views/user_session_view.ex
  27. +4
    -4
      lib/mix/tasks/create_bot.ex
  28. +1
    -1
      lib/mobilizon/activity.ex
  29. +18
    -18
      lib/mobilizon/actors/actor.ex
  30. +15
    -15
      lib/mobilizon/actors/actors.ex
  31. +2
    -2
      lib/mobilizon/actors/bot.ex
  32. +3
    -3
      lib/mobilizon/actors/follower.ex
  33. +3
    -3
      lib/mobilizon/actors/member.ex
  34. +3
    -3
      lib/mobilizon/actors/service/activation.ex
  35. +3
    -3
      lib/mobilizon/actors/service/reset_password.ex
  36. +2
    -2
      lib/mobilizon/actors/user.ex
  37. +4
    -4
      lib/mobilizon/addresses/address.ex
  38. +3
    -3
      lib/mobilizon/addresses/addresses.ex
  39. +9
    -9
      lib/mobilizon/application.ex
  40. +8
    -8
      lib/mobilizon/email/user.ex
  41. +2
    -2
      lib/mobilizon/events/category.ex
  42. +5
    -5
      lib/mobilizon/events/comment.ex
  43. +5
    -5
      lib/mobilizon/events/event.ex
  44. +12
    -12
      lib/mobilizon/events/events.ex
  45. +3
    -3
      lib/mobilizon/events/participant.ex
  46. +2
    -2
      lib/mobilizon/events/session.ex
  47. +7
    -7
      lib/mobilizon/events/tag.ex
  48. +2
    -2
      lib/mobilizon/events/track.ex
  49. +2
    -2
      lib/mobilizon/export/icalendar.ex
  50. +6
    -0
      lib/mobilizon/mailer.ex
  51. +1
    -1
      lib/mobilizon/postgrex_types.ex
  52. +3
    -3
      lib/mobilizon/repo.ex
  53. +1
    -1
      lib/mobilizon/slug.ex
  54. +1
    -1
      lib/mobilizon_web/auth_error_handler.ex
  55. +4
    -4
      lib/mobilizon_web/auth_pipeline.ex
  56. +3
    -3
      lib/mobilizon_web/channels/user_socket.ex
  57. +6
    -6
      lib/mobilizon_web/controllers/activity_pub_controller.ex
  58. +6
    -6
      lib/mobilizon_web/controllers/actor_controller.ex
  59. +5
    -5
      lib/mobilizon_web/controllers/address_controller.ex
  60. +5
    -5
      lib/mobilizon_web/controllers/bot_controller.ex
  61. +5
    -5
      lib/mobilizon_web/controllers/category_controller.ex
  62. +5
    -5
      lib/mobilizon_web/controllers/comment_controller.ex
  63. +7
    -7
      lib/mobilizon_web/controllers/event_controller.ex
  64. +5
    -5
      lib/mobilizon_web/controllers/event_request_controller.ex
  65. +5
    -5
      lib/mobilizon_web/controllers/fallback_controller.ex
  66. +5
    -5
      lib/mobilizon_web/controllers/follower_controller.ex
  67. +9
    -9
      lib/mobilizon_web/controllers/group_controller.ex
  68. +6
    -0
      lib/mobilizon_web/controllers/inboxes_controller.ex
  69. +7
    -7
      lib/mobilizon_web/controllers/nodeinfo_controller.ex
  70. +2
    -2
      lib/mobilizon_web/controllers/outboxes_controller.ex
  71. +2
    -2
      lib/mobilizon_web/controllers/page_controller.ex
  72. +3
    -3
      lib/mobilizon_web/controllers/participant_controller.ex
  73. +5
    -5
      lib/mobilizon_web/controllers/search_controller.ex
  74. +5
    -5
      lib/mobilizon_web/controllers/session_controller.ex
  75. +5
    -5
      lib/mobilizon_web/controllers/tag_controller.ex
  76. +5
    -5
      lib/mobilizon_web/controllers/track_controller.ex
  77. +10
    -10
      lib/mobilizon_web/controllers/user_controller.ex
  78. +5
    -5
      lib/mobilizon_web/controllers/user_session_controller.ex
  79. +3
    -3
      lib/mobilizon_web/controllers/web_finger_controller.ex
  80. +7
    -7
      lib/mobilizon_web/endpoint.ex
  81. +3
    -3
      lib/mobilizon_web/gettext.ex
  82. +4
    -4
      lib/mobilizon_web/guardian.ex
  83. +2
    -2
      lib/mobilizon_web/http_signature.ex
  84. +10
    -10
      lib/mobilizon_web/router.ex
  85. +10
    -0
      lib/mobilizon_web/templates/email/email.html.eex
  86. +3
    -0
      lib/mobilizon_web/templates/email/email.text.eex
  87. +1
    -1
      lib/mobilizon_web/templates/email/password_reset.html.eex
  88. +1
    -1
      lib/mobilizon_web/templates/email/password_reset.text.eex
  89. +1
    -1
      lib/mobilizon_web/templates/email/registration_confirmation.html.eex
  90. +1
    -1
      lib/mobilizon_web/templates/email/registration_confirmation.text.eex
  91. +13
    -13
      lib/mobilizon_web/views/activity_pub/actor_view.ex
  92. +4
    -4
      lib/mobilizon_web/views/activity_pub/object_view.ex
  93. +4
    -4
      lib/mobilizon_web/views/actor_view.ex
  94. +3
    -3
      lib/mobilizon_web/views/address_view.ex
  95. +3
    -3
      lib/mobilizon_web/views/bot_view.ex
  96. +3
    -3
      lib/mobilizon_web/views/category_view.ex
  97. +3
    -3
      lib/mobilizon_web/views/changeset_view.ex
  98. +3
    -3
      lib/mobilizon_web/views/comment_view.ex
  99. +3
    -0
      lib/mobilizon_web/views/email_view.ex
  100. +3
    -3
      lib/mobilizon_web/views/error_helpers.ex

+ 2
- 2
.gitlab-ci.yml View File

@ -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"


+ 1
- 1
LICENSE View File

@ -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


+ 2
- 2
README.md View File

@ -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; ```


+ 9
- 9
config/config.exs View File

@ -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


+ 8
- 8
config/dev.exs View File

@ -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

+ 6
- 6
config/prod.exs View File

@ -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


+ 5
- 5
config/test.exs View File

@ -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

+ 5
- 5
docker-compose.yml View File

@ -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

+ 2
- 2
js/.env.dist View File

@ -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

+ 1
- 1
js/package-lock.json View File

@ -1,5 +1,5 @@
{
"name": "eventos",
"name": "mobilizon",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,


+ 1
- 1
js/package.json View File

@ -1,5 +1,5 @@
{
"name": "eventos",
"name": "mobilizon",
"version": "0.1.0",
"private": true,
"scripts": {


+ 2
- 2
js/public/index.html View File

@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>eventos</title>
<title>mobilizon</title>
</head>
<body>
<noscript>
<strong>We're sorry but eventos doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but mobilizon doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->


+ 2
- 2
js/public/manifest.json View File

@ -1,6 +1,6 @@
{
"name": "eventos",
"short_name": "eventos",
"name": "mobilizon",
"short_name": "mobilizon",
"icons": [
{
"src": "/img/icons/android-chrome-192x192.png",


+ 1
- 1
js/src/components/Home.vue View File

@ -11,7 +11,7 @@
<v-layout align-center>
<v-flex text-xs-center>
<h1 class="display-3">Find events you like</h1>
<h2>Share it with Eventos</h2>
<h2>Share it with Mobilizon</h2>
<v-btn :to="{ name: 'Register' }">{{ $t("home.register") }}</v-btn>
</v-flex>
</v-layout>


+ 1
- 1
js/src/components/NavBar.vue View File

@ -8,7 +8,7 @@
>
<v-toolbar-title style="width: 300px" class="ml-0 pl-3 white--text">
<v-toolbar-side-icon @click.stop="toggleDrawer()"></v-toolbar-side-icon>
<router-link :to="{ name: 'Home' }" class="hidden-sm-and-down white--text">Eventos
<router-link :to="{ name: 'Home' }" class="hidden-sm-and-down white--text">Mobilizon
</router-link>
</v-toolbar-title>
<v-autocomplete


+ 2
- 2
js/src/i18n/en.js View File

@ -1,7 +1,7 @@
export default {
home: {
welcome: 'Welcome on Eventos, {username}',
welcome_off: 'Welcome on Eventos',
welcome: 'Welcome on Mobilizon, {username}',
welcome_off: 'Welcome on Mobilizon',
events: 'Events',
groups: 'Groups',
login: 'Login',


+ 2
- 2
js/src/i18n/fr.js View File

@ -1,7 +1,7 @@
export default {
home: {
welcome: 'Bienvenue sur Eventos, {username}!',
welcome_off: 'Bienvenue sur Eventos',
welcome: 'Bienvenue sur Mobilizon, {username}!',
welcome_off: 'Bienvenue sur Mobilizon',
events: 'Événements',
groups: 'Groupes',
login: 'Se connecter',


+ 3
- 3
lib/eventos.ex View File

@ -1,9 +1,9 @@
defmodule Eventos do
defmodule Mobilizon do
@moduledoc """
Eventos is a decentralized and federated Meetup-like using [ActivityPub](http://activitypub.rocks/).
Mobilizon is a decentralized and federated Meetup-like using [ActivityPub](http://activitypub.rocks/).
It consists of an API server build with [Elixir](http://elixir-lang.github.io/) and the [Phoenix Framework](https://hexdocs.pm/phoenix).
Eventos relies on `Guardian` for auth and `Geo`/Postgis for geographical informations.
Mobilizon relies on `Guardian` for auth and `Geo`/Postgis for geographical informations.
"""
end

+ 0
- 6
lib/eventos/mailer.ex View File

@ -1,6 +0,0 @@
defmodule Eventos.Mailer do
@moduledoc """
Mailer
"""
use Bamboo.Mailer, otp_app: :eventos
end

+ 12
- 12
lib/eventos_web.ex View File

@ -1,12 +1,12 @@
defmodule EventosWeb do
defmodule MobilizonWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, views, channels and so on.
This can be used in your application as:
use EventosWeb, :controller
use EventosWeb, :view
use MobilizonWeb, :controller
use MobilizonWeb, :view
The definitions below will be executed for every view,
controller, etc, so keep them short and clean, focused
@ -19,18 +19,18 @@ defmodule EventosWeb do
def controller do
quote do
use Phoenix.Controller, namespace: EventosWeb
use Phoenix.Controller, namespace: MobilizonWeb
import Plug.Conn
import EventosWeb.Router.Helpers
import EventosWeb.Gettext
import MobilizonWeb.Router.Helpers
import MobilizonWeb.Gettext
end
end
def view do
quote do
use Phoenix.View,
root: "lib/eventos_web/templates",
namespace: EventosWeb
root: "lib/mobilizon_web/templates",
namespace: MobilizonWeb
# Import convenience functions from controllers
import Phoenix.Controller, only: [get_flash: 2, view_module: 1]
@ -38,9 +38,9 @@ defmodule EventosWeb do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
import EventosWeb.Router.Helpers
import EventosWeb.ErrorHelpers
import EventosWeb.Gettext
import MobilizonWeb.Router.Helpers
import MobilizonWeb.ErrorHelpers
import MobilizonWeb.Gettext
end
end
@ -55,7 +55,7 @@ defmodule EventosWeb do
def channel do
quote do
use Phoenix.Channel
import EventosWeb.Gettext
import MobilizonWeb.Gettext
end
end


+ 0
- 6
lib/eventos_web/controllers/inboxes_controller.ex View File

@ -1,6 +0,0 @@
defmodule EventosWeb.InboxesController do
use EventosWeb, :controller
def create(conn) do
end
end

+ 0
- 10
lib/eventos_web/templates/email/email.html.eex View File

@ -1,10 +0,0 @@
<html>
<head>
<link rel="stylesheet" href="<%= static_url(EventosWeb.Endpoint, "/css/email.css") %>">
</head>
<body>
<%= render @view_module, @view_template, assigns %>
<p><%= gettext "An email sent by Eventos on %{instance}.", instance: @instance %></p>
</body>
</html>

+ 0
- 3
lib/eventos_web/templates/email/email.text.eex View File

@ -1,3 +0,0 @@
<%= render @view_module, @view_template, assigns %>
<%= gettext "An email sent by Eventos on %{instance}.", instance: @instance %>

+ 0
- 3
lib/eventos_web/views/email_view.ex View File

@ -1,3 +0,0 @@
defmodule Eventos.EmailView do
use EventosWeb, :view
end

+ 0
- 6
lib/eventos_web/views/page_view.ex View File

@ -1,6 +0,0 @@
defmodule EventosWeb.PageView do
@moduledoc """
View for our webapp
"""
use EventosWeb, :view
end

+ 0
- 10
lib/eventos_web/views/user_session_view.ex View File

@ -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

+ 4
- 4
lib/mix/tasks/create_bot.ex View File

@ -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"


lib/eventos/activity.ex → lib/mobilizon/activity.ex View File

@ -1,4 +1,4 @@
defmodule Eventos.Activity do
defmodule Mobilizon.Activity do
@moduledoc """
Represents an activity
"""

lib/eventos/actors/actor.ex → lib/mobilizon/actors/actor.ex View File

@ -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

lib/eventos/actors/actors.ex → lib/mobilizon/actors/actors.ex View File

@ -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.

lib/eventos/actors/bot.ex → lib/mobilizon/actors/bot.ex View File

@ -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)

lib/eventos/actors/follower.ex → lib/mobilizon/actors/follower.ex View File

@ -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)

lib/eventos/actors/member.ex → lib/mobilizon/actors/member.ex View File

@ -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)

lib/eventos/actors/service/activation.ex → lib/mobilizon/actors/service/activation.ex View File

@ -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

lib/eventos/actors/service/reset_password.ex → lib/mobilizon/actors/service/reset_password.ex View File

@ -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

lib/eventos/actors/user.ex → lib/mobilizon/actors/user.ex View File

@ -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)

lib/eventos/addresses/address.ex → lib/mobilizon/addresses/address.ex View File

@ -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)

lib/eventos/addresses/addresses.ex → lib/mobilizon/addresses/addresses.ex View File

@ -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

lib/eventos/application.ex → lib/mobilizon/application.ex View File

@ -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

lib/eventos/email/user.ex → lib/mobilizon/email/user.ex View File

@ -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

lib/eventos/events/category.ex → lib/mobilizon/events/category.ex View File

@ -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)

lib/eventos/events/comment.ex → lib/mobilizon/events/comment.ex View File

@ -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])

lib/eventos/events/event.ex → lib/mobilizon/events/event.ex View File

@ -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, [

lib/eventos/events/events.ex → lib/mobilizon/events/events.ex View File

@ -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.

lib/eventos/events/participant.ex → lib/mobilizon/events/participant.ex View File

@ -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

lib/eventos/events/session.ex → lib/mobilizon/events/session.ex View File

@ -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)

lib/eventos/events/tag.ex → lib/mobilizon/events/tag.ex View File

@ -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)

lib/eventos/events/track.ex → lib/mobilizon/events/track.ex View File

@ -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)

lib/eventos/export/icalendar.ex → lib/mobilizon/export/icalendar.ex View File

@ -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

+ 6
- 0
lib/mobilizon/mailer.ex View File

@ -0,0 +1,6 @@
defmodule Mobilizon.Mailer do
@moduledoc """
Mailer
"""
use Bamboo.Mailer, otp_app: :mobilizon
end

lib/eventos/postgrex_types.ex → lib/mobilizon/postgrex_types.ex View File

@ -1,5 +1,5 @@
Postgrex.Types.define(
Eventos.PostgresTypes,
Mobilizon.PostgresTypes,
[Geo.PostGIS.Extension] ++ Ecto.Adapters.Postgres.extensions(),
json: Poison
)

lib/eventos/repo.ex → lib/mobilizon/repo.ex View File

@ -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

lib/eventos/slug.ex → lib/mobilizon/slug.ex View File

@ -1,4 +1,4 @@
defmodule Eventos.Slug do
defmodule Mobilizon.Slug do
@moduledoc """
Common functions for slug generation
"""

lib/eventos_web/auth_error_handler.ex → lib/mobilizon_web/auth_error_handler.ex View File

@ -1,4 +1,4 @@
defmodule EventosWeb.AuthErrorHandler do
defmodule MobilizonWeb.AuthErrorHandler do
@moduledoc """
In case we have an auth error
"""

lib/eventos_web/auth_pipeline.ex → lib/mobilizon_web/auth_pipeline.ex View File

@ -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)

lib/eventos_web/channels/user_socket.ex → lib/mobilizon_web/channels/user_socket.ex View File

@ -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

lib/eventos_web/controllers/activity_pub_controller.ex → lib/mobilizon_web/controllers/activity_pub_controller.ex View File

@ -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

lib/eventos_web/controllers/actor_controller.ex → lib/mobilizon_web/controllers/actor_controller.ex View File

@ -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()

lib/eventos_web/controllers/address_controller.ex → lib/mobilizon_web/controllers/address_controller.ex View File

@ -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()

lib/eventos_web/controllers/bot_controller.ex → lib/mobilizon_web/controllers/bot_controller.ex View File

@ -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()

lib/eventos_web/controllers/category_controller.ex → lib/mobilizon_web/controllers/category_controller.ex View File

@ -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()

lib/eventos_web/controllers/comment_controller.ex → lib/mobilizon_web/controllers/comment_controller.ex View File

@ -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()

lib/eventos_web/controllers/event_controller.ex → lib/mobilizon_web/controllers/event_controller.ex View File

@ -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