Merge branch 'add-faq-to-docs' into 'master'

Add faq to docs

See merge request framasoft/mobilizon!593
This commit is contained in:
Thomas Citharel 2020-10-08 11:57:38 +02:00
commit 9c1843b426
8 changed files with 68 additions and 10 deletions

View File

@ -8,7 +8,10 @@ This is needed to set correct address for events, and more easily find events wi
However, providing a geocoding service is quite expensive, especially if you want to cover the whole Earth.
!!! note "Hardware setup"
To give an idea of what hardware is required to self-host a geocoding service, we successfully installed and used [Addok](#addok), [Pelias](#pelias) and [Mimirsbrunn](#mimirsbrunn) on a 8 cores/16GB RAM machine without any issues **importing only French addresses and data**.
To give an idea of what hardware is required to self-host a geocoding service, we successfully installed and used [Addok](#addok), [Pelias](#pelias) and [Mimirsbrunn](#mimirsbrunn) on a 8 cores/16GB RAM machine without any issues **importing only European addresses and data**.
!!! tip "Advised provider"
We had best results using the [Pelias](#pelias) geocoding provider.
## Change geocoder

View File

@ -0,0 +1,34 @@
---
title: FAQ
---
# FAQ
## Should I have a big server to run Mobilizon?
Not really. Being written in Elixir, Mobilizon doesn't need much resources once it's running. If you plan to open your instance to the public, plan in advance higher values for the following given requirements.
!!! note
If you plan to self-host a address/geocoding server as well, [the requirements are quite on another level](./configure/geocoders.md).
<dl>
<dt>CPU</dt>
<dd><b>One should be enough</b>
<p>Depending on your number of users and instances you federate with, extra CPUs will be helpful.</p>
</dd>
<dt>RAM</dt>
<dd>
<b>512MB should be enough for Mobilizon, Nginx and PostgreSQL</b>
<p>Mobilizon will use at least around ~256MB and PostgreSQL and nginx can use ~20MB. Extra memory can improve tasks like compiling and building dependencies.</p>
</dd>
<dt>Storage</dt>
<dd><b>Depends how many users and events you have</b>
<p>A little space will be needed for Mobilizon and it's dependencies (damn you <code>node_modules</code>) themselves. Otherwise, storage usage will grow mostly with user's profile pics and pictures associated to events. Also the PostgreSQL database can start to weigh a bit after a while, depending on how many events you create and how many other instances you follow.</p>
</dd>
<dt>Bandwidth</dt>
<dd>Any bandwidth will do, but higher numbers will improve the experience for users and will help federation.</dd>
</dl>

View File

@ -77,9 +77,9 @@ yarn install
Finally, we can build the front-end (this can take a few seconds).
!!! warning
Building front-end can consume up to 512MB of RAM by default. If it's too much or not sufficient for your setup, you can adjust the maximum memory used by prefixing the command with the following option:
Building front-end can consume up to 2048MB of RAM by default. If it's too much or not sufficient for your setup, you can adjust the maximum memory used by prefixing the command with the following option:
```
NODE_OPTIONS=--max_old_space_size=4096
NODE_BUILD_MEMORY=1024
```
```bash
yarn run build

View File

@ -50,6 +50,11 @@ yarn install
```
### Rebuild Mobilizon's front-end
!!! warning
Building front-end can consume up to 2048MB of RAM by default. If it's too much or not sufficient for your setup, you can adjust the maximum memory used by prefixing the command with the following option:
```
NODE_BUILD_MEMORY=1024
```
```bash
yarn run build
cd ../

View File

@ -1,10 +1,30 @@
const path = require("path");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
module.exports = {
runtimeCompiler: true,
lintOnSave: true,
filenameHashing: true,
outputDir: path.resolve(__dirname, "../priv/static"),
configureWebpack: (config) => {
// Limit the used memory when building
// Source : https://stackoverflow.com/a/55810460/10204399
// get a reference to the existing ForkTsCheckerWebpackPlugin
const existingForkTsChecker = config.plugins.filter(
(p) => p instanceof ForkTsCheckerWebpackPlugin
)[0];
// remove the existing ForkTsCheckerWebpackPlugin
// so that we can replace it with our modified version
config.plugins = config.plugins.filter((p) => !(p instanceof ForkTsCheckerWebpackPlugin));
// copy the options from the original ForkTsCheckerWebpackPlugin
// instance and add the memoryLimit property
const forkTsCheckerOptions = existingForkTsChecker.options;
forkTsCheckerOptions.memoryLimit = process.env.NODE_BUILD_MEMORY || 2048;
config.plugins.push(new ForkTsCheckerWebpackPlugin(forkTsCheckerOptions));
},
// configureWebpack: {
// optimization: {
// splitChunks: {

View File

@ -18,11 +18,8 @@ defmodule Mobilizon.Web.Views.Utils do
end
@spec replace_meta(String.t(), String.t()) :: String.t()
# TODO: Find why it's different in dev/prod and during tests
defp replace_meta(index_content, tags) do
index_content
|> String.replace("<meta name=\"server-injected-data\" />", tags)
|> String.replace("<meta name=server-injected-data>", tags)
String.replace(index_content, "<meta name=\"server-injected-data\">", tags)
end
@spec do_replacements(String.t(), String.t(), String.t()) :: {:safe, String.t()}
@ -30,7 +27,6 @@ defmodule Mobilizon.Web.Views.Utils do
index_content
|> replace_meta(tags)
|> String.replace("<html lang=\"en\">", "<html lang=\"#{locale}\">")
|> String.replace("<html lang=en>", "<html lang=\"#{locale}\">")
|> (&{:safe, &1}).()
end

View File

@ -144,7 +144,7 @@ defmodule Mobilizon.Mixfile do
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false},
{:ex_unit_notifier, "~> 0.1", only: :test},
{:dialyxir, "~> 1.0.0", only: [:dev], runtime: false},
{:exvcr, "~> 0.10", only: :test},
{:exvcr, "0.11.2", only: :test},
{:credo, "~> 1.4.0", only: [:dev, :test], runtime: false},
{:mock, "~> 0.3.4", only: :test},
{:elixir_feed_parser, "~> 2.1.0", only: :test},

View File

@ -51,7 +51,7 @@
"excoveralls": {:hex, :excoveralls, "0.13.2", "5ca05099750c086f144fcf75842c363fc15d7d9c6faa7ad323d010294ced685e", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1e7ed75c158808a5a8f019d3ad63a5efe482994f2f8336c0a8c77d2f0ab152ce"},
"exgravatar": {:hex, :exgravatar, "2.0.2", "638412896170409da114f98947d3f8d4f38e851b0e329c1cc4cd324d5e2ea081", [:mix], [], "hexpm", "f3deb5baa6fcf354a965d794ee73a956d95f1f79f41bddf69800c713cfb014a1"},
"exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm", "32e95820a97cffea67830e91514a2ad53b888850442d6d395f53a1ac60c82e07"},
"exvcr": {:hex, :exvcr, "0.12.0", "0a0b93b09590c0885bf798ef9959118a2c35ccd472e0a817398af8dfee1fd654", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.1", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "72189ff6d64151987ea548f7efd953bf383379c7ff7cfca7ddbd4832238d53cc"},
"exvcr": {:hex, :exvcr, "0.11.2", "24aec6ad13a659f10591911089c01f8d2691e2fff75710c924b64437cc1b36a1", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.1", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "0dad8a3065af4040933bc3ec296f28654b04e993a81054199c832fa86329e80f"},
"fast_html": {:hex, :fast_html, "2.0.4", "4910ee49f2f6b19692e3bf30bf97f1b6b7dac489cd6b0f34cd0fe3042c56ba30", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}], "hexpm", "3bb49d541dfc02ad5e425904f53376d758c09f89e521afc7d2b174b3227761ea"},
"fast_sanitize": {:hex, :fast_sanitize, "0.2.2", "3cbbaebaea6043865dfb5b4ecb0f1af066ad410a51470e353714b10c42007b81", [:mix], [{:fast_html, "~> 2.0", [hex: :fast_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "69f204db9250afa94a0d559d9110139850f57de2b081719fbafa1e9a89e94466"},
"file_info": {:hex, :file_info, "0.0.4", "2e0e77f211e833f38ead22cb29ce53761d457d80b3ffe0ffe0eb93880b0963b2", [:mix], [{:mimetype_parser, "~> 0.1.2", [hex: :mimetype_parser, repo: "hexpm", optional: false]}], "hexpm", "50e7ad01c2c8b9339010675fe4dc4a113b8d6ca7eddce24d1d74fd0e762781a5"},