Merge branch 'doc/nicer-docs' into 'master'

📝 Doc/nicer docs

See merge request framasoft/mobilizon!97
This commit is contained in:
Thomas Citharel 2019-03-18 12:17:43 +01:00
commit 61642dd8d3
19 changed files with 772 additions and 150 deletions

View File

@ -74,6 +74,21 @@ elixir_deps:
paths: paths:
- deps - deps
doc:
stage: back
before_script:
- mix deps.get
script:
- mix docs
- mv doc public
cache:
paths:
- deps
artifacts:
expire_in: 1 hour
paths:
- public
mix: mix:
stage: back stage: back
services: services:

View File

@ -0,0 +1,29 @@
#### Description
[Description of the issue]
#### Steps to Reproduce
1. [First Step]
2. [Second Step]
3. [and so on...]
#### Expected behaviour:
[What you expect to happen]
#### Actual behaviour:
[What actually happens]
#### Reproduces how often:
[What percentage of the time does it reproduce?]
#### Versions
[What Mobilizon instance you're using, and the versions of each relevant app or component, including your OS and browser.]
#### Additional Information
[Any additional information, configuration or data that might be necessary to reproduce the issue.]

View File

@ -6,7 +6,9 @@
First off, thank you for considering contributing to Mobilizon! First off, thank you for considering contributing to Mobilizon!
Our aim is for this project to make you feel welcome as a contributor. We hugely value the comments and contributions of community members in the various publicly-accessible areas in use, which currently are: Our aim is for this project to make you feel welcome as a contributor.
We hugely value the comments and contributions of community members in the various
publicly-accessible areas in use, which currently are:
* Home: [Home](https://joinmobilizon.org) * Home: [Home](https://joinmobilizon.org)
* Wiki: [Project Wiki](https://framagit.org/framasoft/mobilizon/wikis) (Gitlab) * Wiki: [Project Wiki](https://framagit.org/framasoft/mobilizon/wikis) (Gitlab)
@ -93,13 +95,13 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
### Submitting Feature Requests, Enhancement Suggestions or Bug Reports ### Submitting Feature Requests, Enhancement Suggestions or Bug Reports
This section guides you through submitting a :sparkles: feature request, :lipstick: enhancement suggestions, and :bug: bug reports for Mobilizon - anything from errors and crashes, to minor improvements, to completely new features. This section guides you through submitting a ✨ feature request, 💄 enhancement suggestions, and 🐛 bug reports for Mobilizon - anything from errors and crashes, to minor improvements, to completely new features.
When you post an issue, please include as many details as possible. **Fill in the issue template** (available below) to help us resolve issues faster. When you post an issue, please include as many details as possible. **Fill in the issue template** (available below) to help us resolve issues faster.
### Before making a submission ### Before making a submission
Please go through the checklist below before posting any :sparkles: :lipstick: :bug: Please go through the checklist below before posting any ✨ 💄 🐛
* **Check if you're using the latest version** of Mobilizon and all its relevant components and if you can get the desired behaviour by changing some config settings. * **Check if you're using the latest version** of Mobilizon and all its relevant components and if you can get the desired behaviour by changing some config settings.
* **Perform a cursory search** in the issue tracker to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. * **Perform a cursory search** in the issue tracker to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
@ -121,7 +123,7 @@ Open an issue providing the following information:
* **Explain why this enhancement would be useful** to most participants of Mobilizon and isn't something that can or should be implemented as a community extension. * **Explain why this enhancement would be useful** to most participants of Mobilizon and isn't something that can or should be implemented as a community extension.
* **List some other communities, platforms or apps where this enhancement exists.** * **List some other communities, platforms or apps where this enhancement exists.**
### Reporting Bugs :bug: ### Reporting Bugs 🐛
Open an issue providing the following information by filling in issue template below, explaining the problem and including additional details to help maintainers reproduce the problem: Open an issue providing the following information by filling in issue template below, explaining the problem and including additional details to help maintainers reproduce the problem:
@ -149,76 +151,42 @@ Include details about your configuration and environment:
--- ---
### Template for submitting issues
#### Description
[Description of the issue]
#### Steps to Reproduce
1. [First Step]
2. [Second Step]
3. [and so on...]
#### Expected behaviour:
[What you expect to happen]
#### Actual behaviour:
[What actually happens]
#### Reproduces how often:
[What percentage of the time does it reproduce?]
#### Versions
[What Mobilizon instance you're using, and the versions of each relevant app or component, including your OS and browser.]
#### Additional Information
[Any additional information, configuration or data that might be necessary to reproduce the issue.]
---
### Contributing ### Contributing
A common misconception about contributing to free and open source projects is that you need to contribute code. In fact, its often the other parts of a project that are most overlooked. Youll do the project a huge favour by offering to pitch in with these types of contributions! A common misconception about contributing to free and open source projects is that you need to contribute code. In fact, its often the other parts of a project that are most overlooked. Youll do the project a huge favour by offering to pitch in with these types of contributions!
Even if you like to write code, other types of contributions are a great way to get involved with a project and meet other community members. Building those relationships may open up unexpected opportunities. Even if you like to write code, other types of contributions are a great way to get involved with a project and meet other community members. Building those relationships may open up unexpected opportunities.
#### Do you like to design? :art: #### Do you like to design? 🎨
* Restructure layouts to improve the project's usability * Restructure layouts to improve the project's usability
* Conduct user research to reorganise and refine the project's navigation or menus * Conduct user research to reorganise and refine the project's navigation or menus
* Create art for icons and app screens * Create art for icons and app screens
#### Do you like to write? :pencil2: #### Do you like to write? ✏
* Write and improve the project's documentation * Write and improve the project's documentation
* Write tutorials for the project * Write tutorials for the project
* Curate a wiki page of examples showing how the project can be used * Curate a wiki page of examples showing how the project can be used
#### Do you like organising? :inbox_tray: #### Do you like organising? 📥
* Link to duplicate issues, and suggest new issue labels, to keep things organised * Link to duplicate issues, and suggest new issue labels, to keep things organised
* Go through open issues and suggest revisiting or closing old ones * Go through open issues and suggest revisiting or closing old ones
* Ask clarifying questions on recently opened issues to move the discussion forward * Ask clarifying questions on recently opened issues to move the discussion forward
#### Do you like helping people? :raising_hand: #### Do you like helping people? 🙋
* Answer questions about the project on forums and other sites * Answer questions about the project on forums and other sites
* Answer questions for people on open issues * Answer questions for people on open issues
#### Do you like helping others code? :open_hands: #### Do you like helping others code? 👐
* Review code on other peoples submissions * Review code on other peoples submissions
* Write tutorials for how a project can be used * Write tutorials for how a project can be used
* Offer to mentor another contributor * Offer to mentor another contributor
#### Do you like to code? :nut_and_bolt: #### Do you like to code? 🔩
* Find an open issue to tackle * Find an open issue to tackle
* Offer to help write a new feature * Offer to help write a new feature
@ -231,24 +199,23 @@ Even if you like to write code, other types of contributions are a great way to
Unsure where to begin contributing? You can start by looking through issues tagged with: Unsure where to begin contributing? You can start by looking through issues tagged with:
* [`first-timers-only`](https://www.firsttimersonly.com)- issues which should only require a few lines of code, and a test or two. * [`first-timers-only`](https://framagit.org/framasoft/mobilizon/issues?scope=all&utf8=✓&state=opened&label_name[]=🌱 first-timers-only) [https://www.firsttimersonly.com](https://www.firsttimersonly.com)- issues which should only require a few lines of code, and a test or two.
* `help-wanted` - issues which should be a bit more involved than `first-timers-only` issues. * [`help-wanted`](https://framagit.org/framasoft/mobilizon/issues?label_name[]=🙏 help-wanted) - issues which should be a bit more involved than `first-timers-only` issues.
#### Local development #### Local development
Mobilizon can be developed locally. For instructions on how to do this, please see [the documentation](https://framagit.org/framasoft/mobilizon/wikis/install). Mobilizon can be developed locally. For instructions on how to do this, please see [the documentation](development.html).
#### Coding & git practices #### Coding & git practices
* We use GitLab's merge requests as our code review tool * We use GitLab's merge requests as our code review tool
* We encourage any dev to comment on merge requests and we think of the merge request not as a "please approve my code" but as a space for co-developing. * We encourage any dev to comment on merge requests and we think of the merge request not as a "please approve my code" but as a space for co-developing.
* We develop features on separate branches identified by issue numbers. * We develop features on separate branches identified by issue numbers.
* We use merge to `develop` (not rebase) so that commits related to an issue can be retroactively explored.
* We don't currently use release branches or tags because we don't have release management at this phase of development. * We don't currently use release branches or tags because we don't have release management at this phase of development.
#### How to make changes #### How to make changes
* Make your changes on a seperate branch which includes an issue number e.g. `1234-some-new-feature` where 1234 is the issue number where the feature is documented. Make sure the branch is based on `develop`. * Make your changes on a separate branch which includes an issue number e.g. `1234-some-new-feature` where 1234 is the issue number where the feature is documented. Make sure the branch is based on `develop`.
* Do not commit changes to files that are irrelevant to your feature or bugfix. * Do not commit changes to files that are irrelevant to your feature or bugfix.
* Use commit messages descriptive of your changes. * Use commit messages descriptive of your changes.
* Push to the upstream of your new branch. * Push to the upstream of your new branch.
@ -262,8 +229,8 @@ Mobilizon can be developed locally. For instructions on how to do this, please s
#### Merge requests #### Merge requests
* Follow the code styleguides (TBD). * Follow [the code styleguides](styleguide.html).
* Document new code based on the documentation styleguide (TBD) * Document new code based on [the documentation styleguide](https://hexdocs.pm/elixir/writing-documentation.html)
* Each merge request should implement ONE feature or bugfix. If you want to add or fix more than one thing, submit more than one merge request. * Each merge request should implement ONE feature or bugfix. If you want to add or fix more than one thing, submit more than one merge request.
* Fill in the merge request template below * Fill in the merge request template below
* Include relevant issue number(s) in the merge request title * Include relevant issue number(s) in the merge request title
@ -284,48 +251,48 @@ Mobilizon can be developed locally. For instructions on how to do this, please s
#### Issue & Commit Categories #### Issue & Commit Categories
* :ambulance: `critical` : Critical hotfix! * 🚑 `critical` : Critical hotfix!
* :lipstick: `enhancement` : General improvements. * 💄 `enhancement` : General improvements.
* :sparkles: `feature` : New features. * `feature` : New features.
* :bug: `bug` : Confirmed bugs, or reports that are likely to be bugs. * 🐛 `bug` : Confirmed bugs, or reports that are likely to be bugs.
* :raising_hand: `question` : Questions (e.g. how can I do X?) * 🙋 `question` : Questions (e.g. how can I do X?)
* :postbox: `feedback` : General feedback. * 📮 `feedback` : General feedback.
* :art: `ui` : Visual design. * 🎨 `ui` : Visual design.
* :scroll: `copy` : Text in the apps, or translations. * 📜 `copy` : Text in the apps, or translations.
* :information_source: `documentation` : Documentation. * `documentation` : Documentation.
* :racehorse: `performance` : Performance. * 🐎 `performance` : Performance.
* :lock: `security` : Security. * 🔒 `security` : Security.
* :electric_plug: `api` : Mobilizon's APIs. * 🔌 `api` : Mobilizon's APIs.
* :alien: `external` : External libraries or API integrations. * 👽 `external` : External libraries or API integrations.
* :warning: `exception` : Uncaught exceptions. * `exception` : Uncaught exceptions.
* :fire: `crash` : Crash. * 🔥 `crash` : Crash.
* :symbols: `encoding` : Character encoding or data serialization issue. * 🔣 `encoding` : Character encoding or data serialization issue.
* :truck: `cleanup` : Removing, moving or refactoring code or files. * 🚚 `cleanup` : Removing, moving or refactoring code or files.
* :white_check_mark: `tests` : Testing * `tests` : Testing
#### Issue Status #### Issue Status
* :speech_balloon: `discussion` : Discussion to clarify this issue is ongoing. * 💬 `discussion` : Discussion to clarify this issue is ongoing.
* :soon: `todo` : This has been discussed and now needs work. * 🔜 `todo` : This has been discussed and now needs work.
* :repeat: `needs-more-info` : More information needs to be collected about these problems or feature requests (e.g. steps to reproduce). * 🔁 `needs-more-info` : More information needs to be collected about these problems or feature requests (e.g. steps to reproduce).
* :bulb: `idea` : Needs to be discussed further. Could be a feature request which might be good to first implement as a community extension. * 💡 `idea` : Needs to be discussed further. Could be a feature request which might be good to first implement as a community extension.
* :construction: `in-progress` : Someone is working on this... * 🚧 `in-progress` : Someone is working on this...
* :pray: `help-wanted` : The Mobilizon core team would appreciate help from the community in resolving these issues. * 🙏 `help-wanted` : The Mobilizon core team would appreciate help from the community in resolving these issues.
* :seedling: `first-timers-only` : Less complex issues which would be good first issues to work on for users who want to contribute. * 🌱 `first-timers-only` : Less complex issues which would be good first issues to work on for users who want to contribute.
* :1234: `needs-reproduction` : Likely bugs, but haven't been reliably reproduced. * 🔢 `needs-reproduction` : Likely bugs, but haven't been reliably reproduced.
* :red_circle: `blocked` : Blocked on other issues. * 🔴 `blocked` : Blocked on other issues.
* :two: `duplicate` : Duplicate of another issue, i.e. has been reported before. * 2 `duplicate` : Duplicate of another issue, i.e. has been reported before.
* :no_good: `wontfix` : The Mobilizon core team has decided not to fix these issues (or add these features) for now, because they're working as intended, or some other reason. * 🙅 `wontfix` : The Mobilizon core team has decided not to fix these issues (or add these features) for now, because they're working as intended, or some other reason.
* :put_litter_in_its_place: `invalid` : Issues which are not valid (e.g. spam or submitted by error). * 🚮 `invalid` : Issues which are not valid (e.g. spam or submitted by error).
#### Merge Request Status #### Merge Request Status
* :construction: `in-progress` : Still being worked on, more changes will follow. * 🚧 `in-progress` : Still being worked on, more changes will follow.
* :busstop: `needs-review` : Needs code review and approval from maintainers. * 🚏 `needs-review` : Needs code review and approval from maintainers.
* :mag: `under-review` : Being reviewed by maintainers. * 🔍 `under-review` : Being reviewed by maintainers.
* :wrench: `changes-required` : Needs to be updated based on review comments and then reviewed again. * 🔧 `changes-required` : Needs to be updated based on review comments and then reviewed again.
* :eyes: `needs-testing` : Needs manual testing. * 👀 `needs-testing` : Needs manual testing.
--- ---
@ -337,4 +304,4 @@ The following documents have greatly helped us put this together. A big thank yo
* [Open Source Guides](https://opensource.guide) * [Open Source Guides](https://opensource.guide)
* [Holochain's Development Protocols](https://github.com/holochain/holochain-proto/wiki/Development-Protocols) * [Holochain's Development Protocols](https://github.com/holochain/holochain-proto/wiki/Development-Protocols)
* [Atom's contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md) * [Atom's contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md)
* [Funkwhale's pad on how to Communicate with others](https://hackmd.io/qESHvdHZSWuhLNjeanaVQw?both) * [Funkwhale's pad on how to Communicate with others](https://hackmd.io/qESHvdHZSWuhLNjeanaVQw?both)

View File

@ -1,68 +1,61 @@
# Mobilizon <h1 align="center">
<a href="https://joinmobilizon.org">
<img src="http://lutim.cpy.re/m9Y8rXRU.png" alt="Mobilizon">
</a>
</h1>
Your federated organization and mobilization platform. Gather people with a convivial, ethical, and emancipating tool. MobiliZon is your federated organization and mobilization platform. Gather people with a convivial, ethical, and emancipating tool.
## Development <p align="center">
Clone the repo, and start the project trough Docker. You'll need both Docker and Docker-Compose. <strong>Developed with ♥ by <a href="https://framasoft.org">Framasoft</a></strong>
```bash </p>
git clone https://framagit.org/framasoft/mobilizon && cd mobilizon
make
```
### Manual
#### Server <p align="center">
<a href="https://framasoft.org">
<img width="150px" src="http://lutim.cpy.re/Prd3ci7G.png" alt="Framasoft logo"/>
</a>
</p>
* Install dependencies: ## Introduction
* Elixir (and Erlang) by following the instructions at [https://elixir-lang.github.io/install.html](https://elixir-lang.github.io/install.html)
* Fetch backend Elixir dependencies with `mix deps.get`.
* PostgreSQL
* Start services:
* Start postgres
* Setup services:
* Make sure the postgis extension is installed on your system.
* Create a postgres user with database creation capabilities, using the
following: `createuser -d -P mobilizon` and set `mobilizon` as the password.
* Create your database with `mix ecto.create`.
* Create the postgis extension on the database with a postgres user that has
superuser capabilities: `psql mobilizon_dev`
``` create extension if not exists postgis; ``` Mobilizon is a tool designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc.
* Run migrations: `mix ecto.migrate`. The MobiliZon software is under a Free licence, so anyone can host a MobiliZon server, called an instance. These instances may federate with each other, so any person with an account on *ExampleMeet* will be able to register to an event created on *SpecimenEvent*.
* Start Phoenix endpoint with `mix phx.server`.
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser ## ✨ Features
and see the website (server *and* client) in action.
#### Client ### 👤 Identities
If you plan to specifically change the client side (frontend), do the following Do you want to separate your family gatherings from your associative activities or militant mobilizations?
once the server is running: You will have the power to create multiple identities from the same account, like so many social masks.
* Install the NodeJS (we guarantee support for the latest LTS and later) ![](https://img.shields.io/badge/node-%3E%3D%2010.0+-brightgreen.svg) ---
* Change directory to `js/` and do:
* Install JavaScript package dependencies: `npm install`.
* Run the developement server in watch mode: `npm run dev`. This will open a
browser on [`localhost:8080`](http://localhost:8080) that gets
automatically reloaded on change.
### Docker ### 📅 Events and groups
You need to install the latest supported [Docker](https://docs.docker.com/install/#supported-platforms) and [Docker-Compose](https://docs.docker.com/compose/install/) before using the Docker way of installing Mobilizon.
Just run : Create your events and make sure they will appeal to everybody.
```bash Privacy settings and participants roles are supported.
make start There's no lock-in, you can interact with the event without registration.
```
to start a database container, an API container and the front-end dev container running on localhost.
## Learn more ---
* Official website: https://joinmobilizon.org/ ## Contributing
* Source: https://framagit.org/framasoft/mobilizon
* Docu wiki: https://framagit.org/framasoft/mobilizon/wikis/home We appreciate any contribution to MobiliZon. Check our [CONTRIBUTING](CONTRIBUTING.md) file for more information.
* Riot/Matrix: https://riot.im/app/#/room/#Mobilizon:matrix.org
* Mastodon: https://framapiaf.org/@mobilizon ## Links
* Forum: https://framacolibri.org/c/mobilizon/fr-francais
### Learn more
* 🌐 Official website: [https://joinmobilizon.org](https://joinmobilizon.org)
* 💻 Source: [https://framagit.org/framasoft/mobilizon](https://framagit.org/framasoft/mobilizon)
* 📝 Wiki: [https://framagit.org/framasoft/mobilizon/wikis/home](https://framagit.org/framasoft/mobilizon/wikis/home)
### Discuss
* 💬 Riot/Matrix: [https://riot.im/app/#/room/#Mobilizon:matrix.org](https://riot.im/app/#/room/#Mobilizon:matrix.org)
* 🗣️ Forum: [https://framacolibri.org/c/mobilizon](https://framacolibri.org/c/mobilizon)
### Follow
* 🐘 Mastodon: [https://framapiaf.org/@mobilizon](https://framapiaf.org/@mobilizon)
* 🐦 Twitter [https://twitter.com/@joinmobilizon](https://twitter.com/@joinmobilizon)
Note: Most federation code comes from [Pleroma](https://pleroma.social), which is `Copyright © 2017-2018 Pleroma Authors - AGPL-3.0` Note: Most federation code comes from [Pleroma](https://pleroma.social), which is `Copyright © 2017-2018 Pleroma Authors - AGPL-3.0`

View File

@ -5,7 +5,7 @@ defmodule MobilizonWeb.Resolvers.User do
alias Mobilizon.Actors.Actor alias Mobilizon.Actors.Actor
alias Mobilizon.Users.User alias Mobilizon.Users.User
alias Mobilizon.{Actors, Users} alias Mobilizon.{Actors, Users}
alias Mobilizon.Users.Service.{ResetPassword, Activation} alias Mobilizon.Service.Users.{ResetPassword, Activation}
import Mobilizon.Users.Guards import Mobilizon.Users.Guards
require Logger require Logger

View File

@ -1,10 +1,10 @@
defmodule Mobilizon.Users.Service.Activation do defmodule Mobilizon.Service.Users.Activation do
@moduledoc false @moduledoc false
alias Mobilizon.{Mailer, Users} alias Mobilizon.{Mailer, Users}
alias Mobilizon.Users.User alias Mobilizon.Users.User
alias Mobilizon.Email.User, as: UserEmail alias Mobilizon.Email.User, as: UserEmail
alias Mobilizon.Users.Service.Tools alias Mobilizon.Service.Users.Tools
require Logger require Logger

View File

@ -1,4 +1,4 @@
defmodule Mobilizon.Users.Service.ResetPassword do defmodule Mobilizon.Service.Users.ResetPassword do
@moduledoc false @moduledoc false
require Logger require Logger
@ -6,7 +6,7 @@ defmodule Mobilizon.Users.Service.ResetPassword do
alias Mobilizon.Users.User alias Mobilizon.Users.User
alias Mobilizon.{Mailer, Repo, Users} alias Mobilizon.{Mailer, Repo, Users}
alias Mobilizon.Email.User, as: UserEmail alias Mobilizon.Email.User, as: UserEmail
alias Mobilizon.Users.Service.Tools alias Mobilizon.Service.Users.Tools
@doc """ @doc """
Check that the provided token is correct and update provided password Check that the provided token is correct and update provided password

View File

@ -1,4 +1,4 @@
defmodule Mobilizon.Users.Service.Tools do defmodule Mobilizon.Service.Users.Tools do
@moduledoc """ @moduledoc """
Common functions for actors services Common functions for actors services
""" """

200
mix.exs
View File

@ -1,10 +1,12 @@
defmodule Mobilizon.Mixfile do defmodule Mobilizon.Mixfile do
use Mix.Project use Mix.Project
@version "0.0.1-dev"
def project do def project do
[ [
app: :mobilizon, app: :mobilizon,
version: "0.0.1", version: @version,
elixir: "~> 1.4", elixir: "~> 1.4",
elixirc_paths: elixirc_paths(Mix.env()), elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(), compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@ -25,7 +27,7 @@ defmodule Mobilizon.Mixfile do
name: "Mobilizon", name: "Mobilizon",
source_url: "https://framagit.org/tcit/mobilizon", source_url: "https://framagit.org/tcit/mobilizon",
homepage_url: "https://framagit.org/tcit/mobilizon", homepage_url: "https://framagit.org/tcit/mobilizon",
docs: [main: "Mobilizon"] docs: docs()
] ]
end end
@ -93,7 +95,7 @@ defmodule Mobilizon.Mixfile do
{:phoenix_live_reload, "~> 1.2", only: :dev}, {:phoenix_live_reload, "~> 1.2", only: :dev},
{:ex_machina, "~> 2.2", only: [:dev, :test]}, {:ex_machina, "~> 2.2", only: [:dev, :test]},
{:excoveralls, "~> 0.10", only: :test}, {:excoveralls, "~> 0.10", only: :test},
{:ex_doc, "~> 0.16", only: :dev, runtime: false}, {:ex_doc, "~> 0.16", only: [:dev, :test], runtime: false},
{:mix_test_watch, "~> 0.5", only: :dev, runtime: false}, {:mix_test_watch, "~> 0.5", only: :dev, runtime: false},
{:ex_unit_notifier, "~> 0.1", only: :test}, {:ex_unit_notifier, "~> 0.1", only: :test},
{:dialyxir, "~> 1.0.0-rc.4", only: [:dev], runtime: false}, {:dialyxir, "~> 1.0.0-rc.4", only: [:dev], runtime: false},
@ -117,4 +119,196 @@ defmodule Mobilizon.Mixfile do
test: ["ecto.create --quiet", "ecto.migrate", "test"] test: ["ecto.create --quiet", "ecto.migrate", "test"]
] ]
end end
defp docs() do
[
source_ref: "v#{@version}",
extra_section: "GUIDES",
main: "introduction",
api_reference: false,
groups_for_modules: groups_for_modules(),
extras: extras(),
groups_for_extras: groups_for_extras(),
nest_modules_by_prefix: [
Mobilizon,
MobilizonWeb,
Mobilizon.Service.Geospatial,
MobilizonWeb.Resolvers,
MobilizonWeb.Schema,
Mobilizon.Service
]
]
end
defp extras() do
[
"support/guides/development/development.md",
"support/guides/development/tests.md",
"support/guides/development/styleguide.md",
"support/guides/install/install.md",
"support/guides/install/dependencies.md",
"support/guides/install/docker.md",
"support/guides/introduction.md",
"CONTRIBUTING.md"
]
end
defp groups_for_modules() do
[
Models: [
Mobilizon.Actors,
Mobilizon.Actors.Actor,
Mobilizon.Actors.ActorOpennessEnum,
Mobilizon.Actors.ActorTypeEnum,
Mobilizon.Actors.MemberRoleEnum,
Mobilizon.Actors.Bot,
Mobilizon.Actors.Follower,
Mobilizon.Actors.Member,
Mobilizon.Addresses,
Mobilizon.Addresses.Address,
Mobilizon.Events,
Mobilizon.Events.Event,
Mobilizon.Events.Comment,
Mobilizon.Events.FeedToken,
Mobilizon.Events.Participant,
Mobilizon.Events.Session,
Mobilizon.Events.Tag,
Mobilizon.Events.TagRelations,
Mobilizon.Events.Track,
Mobilizon.Event.EventCategoryEnum,
Mobilizon.Events.CommentVisibilityEnum,
Mobilizon.Events.EventStatusEnum,
Mobilizon.Events.EventVisibilityEnum,
Mobilizon.Events.JoinOptionsEnum,
Mobilizon.Events.ParticipantRoleEnum,
Mobilizon.Events.Tag.TitleSlug,
Mobilizon.Events.Tag.TitleSlug.Type,
Mobilizon.Events.TagRelation,
Mobilizon.Users,
Mobilizon.Users.User,
Mobilizon.Users.UserRoleEnum,
Mobilizon.Users.Guards,
Mobilizon.Activity,
Mobilizon.Ecto,
Mobilizon.Repo
],
APIs: [
MobilizonWeb.API.Comments,
MobilizonWeb.API.Events,
MobilizonWeb.API.Groups,
MobilizonWeb.API.Search,
MobilizonWeb.API.Utils
],
Web: [
MobilizonWeb,
MobilizonWeb.PageView,
MobilizonWeb.Router,
MobilizonWeb.Router.Helpers,
MobilizonWeb.AuthErrorHandler,
MobilizonWeb.AuthPipeline,
MobilizonWeb.ChangesetView,
MobilizonWeb.Context,
MobilizonWeb.Endpoint,
MobilizonWeb.ErrorHelpers,
MobilizonWeb.ErrorView,
MobilizonWeb.FallbackController,
MobilizonWeb.FeedController,
MobilizonWeb.Gettext,
MobilizonWeb.Guardian,
MobilizonWeb.Guardian.Plug,
MobilizonWeb.JsonLD.ObjectView,
MobilizonWeb.PageController,
MobilizonWeb.UploadPlug,
MobilizonWeb.Uploaders.Avatar,
MobilizonWeb.Uploaders.Category,
MobilizonWeb.Uploaders.Category.Type
],
Geospatial: [
Mobilizon.Service.Geospatial,
Mobilizon.Service.Geospatial.Addok,
Mobilizon.Service.Geospatial.GoogleMaps,
Mobilizon.Service.Geospatial.MapQuest,
Mobilizon.Service.Geospatial.Nominatim,
Mobilizon.Service.Geospatial.Photon,
Mobilizon.Service.Geospatial.Provider
],
GraphQL: [
MobilizonWeb.Resolvers.Address,
MobilizonWeb.Resolvers.Comment,
MobilizonWeb.Resolvers.Event,
MobilizonWeb.Resolvers.FeedToken,
MobilizonWeb.Resolvers.Group,
MobilizonWeb.Resolvers.Person,
MobilizonWeb.Resolvers.Search,
MobilizonWeb.Resolvers.Tag,
MobilizonWeb.Resolvers.User,
MobilizonWeb.Schema,
MobilizonWeb.Schema.ActorInterface,
MobilizonWeb.Schema.Actors.FollowerType,
MobilizonWeb.Schema.Actors.GroupType,
MobilizonWeb.Schema.Actors.MemberType,
MobilizonWeb.Schema.Actors.PersonType,
MobilizonWeb.Schema.AddressType,
MobilizonWeb.Schema.CommentType,
MobilizonWeb.Schema.Custom.Point,
MobilizonWeb.Schema.Custom.UUID,
MobilizonWeb.Schema.EventType,
MobilizonWeb.Schema.Events.FeedTokenType,
MobilizonWeb.Schema.Events.ParticipantType,
MobilizonWeb.Schema.SortType,
MobilizonWeb.Schema.TagType,
MobilizonWeb.Schema.UserType,
MobilizonWeb.Schema.Utils
],
ActivityPub: [
MobilizonWeb.ActivityPub.ActorView,
MobilizonWeb.ActivityPub.ObjectView,
MobilizonWeb.ActivityPubController,
Mobilizon.Service.ActivityPub,
Mobilizon.Service.ActivityPub.Transmogrifier,
Mobilizon.Service.ActivityPub.Utils,
MobilizonWeb.HTTPSignaturePlug,
MobilizonWeb.WebFingerController,
MobilizonWeb.NodeInfoController,
Mobilizon.Service.HTTPSignatures,
Mobilizon.Service.WebFinger,
Mobilizon.Service.XmlBuilder,
Mobilizon.Service.Federator
],
Services: [
Mobilizon.Service.EmailChecker,
Mobilizon.Service.Export.Feed,
Mobilizon.Service.Export.ICalendar,
Mobilizon.Service.Metadata,
Mobilizon.Service.Formatter,
Mobilizon.Service.Users.Tools
],
Tools: [
Mobilizon.Application,
Mobilizon.Factory,
Mobilizon.Mailer,
Mobilizon.EmailView,
Mobilizon.Email.User
]
]
end
defp groups_for_extras() do
[
Introduction: [
"support/guides/introduction.md",
"CONTRIBUTING.md"
],
Development: [
"support/guides/development/development.md",
"support/guides/development/tests.md",
"support/guides/development/styleguide.md"
],
Production: [
"support/guides/install/install.md",
"support/guides/install/docker.md",
"support/guides/install/dependencies.md"
]
]
end
end end

View File

@ -0,0 +1,53 @@
# Development
Clone the repo, and start the project trough Docker. You'll need both Docker and Docker-Compose.
```bash
git clone https://framagit.org/framasoft/mobilizon && cd mobilizon
make
```
## Manual
### Server
* Install dependencies:
* Elixir (and Erlang) by following the instructions at [https://elixir-lang.github.io/install.html](https://elixir-lang.github.io/install.html)
* Fetch backend Elixir dependencies with `mix deps.get`.
* [PostgreSQL]() with PostGIS
* Start services:
* Start postgres
* Setup services:
* Make sure the postgis extension is installed on your system.
* Create a postgres user with database creation capabilities, using the
following: `createuser -d -P mobilizon` and set `mobilizon` as the password.
* Create your database with `mix ecto.create`.
* Create the postgis extension on the database with a postgres user that has
superuser capabilities: `psql mobilizon_dev`
``` create extension if not exists postgis; ```
* Run migrations: `mix ecto.migrate`.
* Start Phoenix endpoint with `mix phx.server`.
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser
and see the website (server *and* client) in action.
### Client
If you plan to specifically change the client side (frontend), do the following
once the server is running:
* Install the NodeJS (we guarantee support for the latest LTS and later) ![](https://img.shields.io/badge/node-%3E%3D%2010.0+-brightgreen.svg)
* Change directory to `js/` and do:
* Install JavaScript package dependencies: `npm install`.
* Run the developement server in watch mode: `npm run dev`. This will open a
browser on [`localhost:8080`](http://localhost:8080) that gets
automatically reloaded on change.
## Docker
You need to install the latest supported [Docker](https://docs.docker.com/install/#supported-platforms) and [Docker-Compose](https://docs.docker.com/compose/install/) before using the Docker way of installing Mobilizon.
Just run :
```bash
make start
```
to start a database container, an API container and the front-end dev container running on localhost.

View File

@ -0,0 +1,16 @@
# Styleguide
# Elixir
We format our code with the Elixir Formatter and check for issues with [Credo](https://github.com/rrrene/credo) (a few rules are not blocking).
Please run those two commands before pushing code :
* `mix format`
* `mix credo`
These two commands must not return an error code, since they are required to pass inside CI.
# Front
We use `tslint` with the `tslint-config-airbnb` preset.
Errors should be reported when running in dev mode `npm run dev` or when building a production bundle `npm run build`.

View File

@ -0,0 +1,36 @@
# Tests
## Backend
The backend uses `ExUnit`.
To launch all the tests:
```bash
mix test
```
If you want the coverage:
```bash
mix coveralls.html
```
It will show the coverage and will output a `cover/excoveralls.html` file.
If you want to test a single file:
```bash
mix test test/mobilizon/actors/actors_test.exs
```
If you want to test a specific test, block or line:
```bash
mix test test/mobilizon/actors/actors_test.exs:85
```
> Note: The coveralls.html also works the same
## Front-end
Waiting for [https://framagit.org/framasoft/mobilizon/merge_requests/42](https://framagit.org/framasoft/mobilizon/merge_requests/42) to be ready.

View File

@ -0,0 +1,52 @@
# Dependencies
- [Debian / Ubuntu and derivatives](#debian--ubuntu-and-derivatives)
- [Arch Linux](#arch-linux)
- [Other distributions](#other-distributions)
## Debian / Ubuntu and derivatives
1. On a fresh Debian/Ubuntu, as root user, install basic utility programs needed for the installation
```
sudo apt-get install curl sudo unzip vim
```
2. It would be wise to disable root access and to continue this tutorial with a user with sudoers group access
3. Install certbot (choose instructions for nginx and your distribution) :
[https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions)
4. Install NodeJS 10.x (current LTS):
[https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
5. Install Erlang and Elixir:
[https://elixir-lang.org/install.html#unix-and-unix-like](https://elixir-lang.org/install.html#unix-and-unix-like)
6. Install PostGIS:
[https://postgis.net/install/](https://postgis.net/install/)
6. Run:
```
sudo apt update
sudo apt install nginx postgresql postgresql-contrib openssl make git esl-erlang elixir postgis
```
Now that dependencies are installed, before running MobiliZon you should start PostgreSQL:
```
sudo systemctl start postgresql
```
## Arch Linux
1. Run:
```
sudo pacman -S nodejs postgresql openssl git wget unzip base-devel npm nginx elixir postgis
```
Now that dependencies are installed, before running MobiliZon you should start PostgreSQL and Redis:
```
sudo systemctl start postgresql
```
## Other distributions
Feel free to update this file in a pull request!

View File

@ -0,0 +1,15 @@
# Docker
You can quickly get a server running using Docker. You'll need both [Docker](https://www.docker.com/community-edition) and [Docker-Compose](https://docs.docker.com/compose/install/).
Start by cloning the repo
```bash
git clone https://framagit.org/framasoft/mobilizon && cd mobilizon
```
Then, just run `make` to build containers.
```bash
make
```
This will start a database container, an API container and the front-end container running on localhost.

View File

@ -0,0 +1,131 @@
# Install
## Dependencies
Follow the steps of the [dependencies guide](dependencies.html)
## Database
Create the production database and a mobilizon user inside PostgreSQL:
```bash
sudo -u postgres createuser -P mobilizon
sudo -u postgres createdb -O mobilizon mobilizon_prod
```
Then enable extensions PeerTube needs:
```bash
sudo -u postgres psql -c "CREATE EXTENSION postgis;" mobilizon_prod
sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" mobilizon_prod
sudo -u postgres psql -c "CREATE EXTENSION unaccent;" mobilizon_prod
```
## MobiliZon user
Create a `mobilizon` user with `/home/mobilizon` home:
```bash
sudo adduser --disabled-login mobilizon
sudo -i -u mobilizon
```
**On FreeBSD**
```bash
sudo pw useradd -n mobilizon -d /home/mobilizon -s /usr/local/bin/bash -m
sudo passwd mobilizon
```
You can now fetch the code with git:
```bash
git clone https://framagit.org/framasoft/mobilizon live && cd live
```
## Configuration
### Backend
Install Elixir dependencies
```bash
mix deps.get
```
Configure your instance with
```bash
mix mobilizon.instance gen
```
This will ask you questions about your instance and generate an `.env.prod` file.
### Migration
Run database migrations: `mix ecto.migrate`. You will have to do this again after most updates.
> If some migrations fail, it probably means you're not using a recent enough version of PostgreSQL,
or that you didn't installed [the required extensions](#database).
### Front-end
Go into the `js/` directory
```bash
cd js/
```
and install the Javascript dependencies
```bash
npm install
```
Finally, build the front-end with
```bash
npm run build
```
### Testing
Go back to the previous directory
```bash
cd ../
```
Now try to run the server
```bash
mix phx.server
```
It runs on port 4000.
## Services
### Systemd
Copy the `support/systemd/mobilizon.service` to `/etc/systemd/system`.
```bash
sudo cp support/systemd/mobilizon.service /etc/systemd/system/
```
Reload Systemd to detect your new file
```bash
sudo systemctl daemon-reload
```
And enable the service
```bash
systemctl enable --now mobilizon.service
```
It will run MobiliZon and enable startup on boot. You can follow the logs with
```bash
sudo journalctl -fu mobilizon.service
```

View File

@ -0,0 +1,64 @@
# Mobilizon
<p align="center">
<a href="https://joinmobilizon.org">
<img src="http://lutim.cpy.re/m9Y8rXRU.png" alt="Mobilizon">
</a>
</p>
MobiliZon is your federated organization and mobilization platform. Gather people with a convivial, ethical, and emancipating tool.
<p align="center">
<strong>Developed with ♥ by <a href="https://framasoft.org">Framasoft</a></strong>
</p>
<p align="center">
<a href="https://framasoft.org">
<img width="150px" src="http://lutim.cpy.re/Prd3ci7G.png" alt="Framasoft logo"/>
</a>
</p>
## Introduction
Mobilizon is a tool designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc.
The MobiliZon software is under a Free licence, so anyone can host a MobiliZon server, called an instance. These instances may federate with each other, so any person with an account on *ExampleMeet* will be able to register to an event created on *SpecimenEvent*.
## ✨ Features
### 👤 Identities
Do you want to separate your family gatherings from your associative activities or militant mobilizations?
You will have the power to create multiple identities from the same account, like so many social masks.
---
### 📅 Events and groups
Create your events and make sure they will appeal to everybody.
Privacy settings and participants roles are supported.
There's no lock-in, you can interact with the event without registration.
---
## Contributing
We appreciate any contribution to MobiliZon. Check our [CONTRIBUTING](contributing.html) file for more information.
## Links
### Learn more
* 🌐 Official website: [https://joinmobilizon.org](https://joinmobilizon.org)
* 💻 Source: [https://framagit.org/framasoft/mobilizon](https://framagit.org/framasoft/mobilizon)
* 📝 Wiki: [https://framagit.org/framasoft/mobilizon/wikis/home](https://framagit.org/framasoft/mobilizon/wikis/home)
### Discuss
* 💬 Matrix: `#Mobilizon:matrix.org` [Riot](https://riot.im/app/#/room/#Mobilizon:matrix.org)
* #⃣ IRC `#mobilizon` on Freenode
* 🗣️ Forum: [https://framacolibri.org/c/mobilizon](https://framacolibri.org/c/mobilizon)
### Follow
* 🐘 Mastodon: [https://framapiaf.org/@mobilizon](https://framapiaf.org/@mobilizon)
* 🐦 Twitter [https://twitter.com/@joinmobilizon](https://twitter.com/@joinmobilizon)
Note: Most federation code comes from [Pleroma](https://pleroma.social), which is `Copyright © 2017-2018 Pleroma Authors - AGPL-3.0`

View File

@ -0,0 +1,57 @@
# default nginx site config for Mobilizon
#
# Simple installation instructions:
# 1. Install your TLS certificate, possibly using Let's Encrypt.
# 2. Replace 'example.tld' with your instance's domain wherever it appears.
# 3. Copy this file to /etc/nginx/sites-available/ and then add a symlink to it
# in /etc/nginx/sites-enabled/ and run 'nginx -s reload' or restart nginx.
server {
server_name example.tld;
listen 80;
listen [::]:80;
return 301 https://$server_name$request_uri;
}
server {
server_name example.tld;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_session_timeout 5m;
ssl_trusted_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
# Add TLSv1.3 if it's supported by your system
ssl_protocols TLSv1.2;
ssl_ciphers 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA';
ssl_prefer_server_ciphers on;
ssl_ecdh_curve prime256v1;
# ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1;
ssl_stapling on;
ssl_stapling_verify on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml;
# the nginx default is 1m, not enough for large media uploads
client_max_body_size 16m;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_pass http://localhost:4000;
client_max_body_size 16m;
}
}

View File

@ -1,4 +1,4 @@
defmodule Mobilizon.Users.Service.ToolsTest do defmodule Mobilizon.Service.Users.ToolsTest do
use Mobilizon.DataCase use Mobilizon.DataCase
import Mobilizon.Factory import Mobilizon.Factory

View File

@ -4,7 +4,7 @@ defmodule MobilizonWeb.Resolvers.UserResolverTest do
alias Mobilizon.Actors.Actor alias Mobilizon.Actors.Actor
alias Mobilizon.Users.User alias Mobilizon.Users.User
alias MobilizonWeb.AbsintheHelpers alias MobilizonWeb.AbsintheHelpers
alias Mobilizon.Users.Service.ResetPassword alias Mobilizon.Service.Users.ResetPassword
import Mobilizon.Factory import Mobilizon.Factory
use Bamboo.Test use Bamboo.Test