### Setup Mobilizon Database
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Executes the SQL script to set up the Mobilizon database, including user creation, database initialization, and extension installation.
```bash
sudo -u postgres psql -f /tmp/setup_db.psql
```
--------------------------------
### Execute PostgreSQL Database Setup Script
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Runs the generated SQL script to set up the PostgreSQL database, including user, database creation, and extension installation. Execute this as the postgres user with sudo.
```bash
sudo -u postgres psql -f setup_db.psql
```
--------------------------------
### Enable and Start PostgreSQL Service
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Enables the PostgreSQL service to start on boot and starts it immediately.
```bash
sudo systemctl --now enable postgresql
```
--------------------------------
### Enable and Start Mobilizon Service
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Enables the Mobilizon service to start on boot and starts it immediately.
```bash
sudo systemctl enable --now mobilizon.service
```
--------------------------------
### Create New Mobilizon Admin User with Production Environment
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks
Example of creating a new administrator user while ensuring the production environment is loaded. This command combines environment setup with user creation.
```bash
MIX_ENV=prod mix mobilizon.users.new "your@email.com" --admin --password "Y0urP4ssw0rd"
```
--------------------------------
### Install Frontend Dependencies
Source: https://docs.mobilizon.org/4.%20Contribute/development
Installs all Node.js dependencies required for the Mobilizon frontend development.
```bash
npm install
```
--------------------------------
### Install Image Optimization Tools (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs ImageMagick and webp for handling and optimizing uploaded images.
```bash
sudo apt install imagemagick webp
```
--------------------------------
### Install Basic Development Tools (Archlinux)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs essential build tools and utilities for Archlinux systems.
```bash
sudo pacman -S base-devel curl unzip openssl git cmake file
```
--------------------------------
### Start Mobilizon Development Server
Source: https://docs.mobilizon.org/4.%20Contribute/development
Starts the Phoenix development server for Mobilizon. The client development server will also launch and reload on file changes.
```bash
mix phx.server
```
--------------------------------
### Install Nginx Web Server (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs the Nginx web server, which is officially supported for Mobilizon.
```bash
sudo apt install nginx
```
--------------------------------
### Install PostgreSQL and PostGIS (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs the PostgreSQL database server, its contrib modules, and the PostGIS extension for geospatial data.
```bash
sudo apt install postgresql postgresql-contrib
sudo apt install --install-recommends postgis
```
--------------------------------
### Install Software Links with ASDF
Source: https://docs.mobilizon.org/4.%20Contribute/development
Installs all software versions defined in the project's ASDF configuration.
```bash
asdf install
```
--------------------------------
### Mobilizon Service Log Output Example
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Example output indicating the Mobilizon server is running and accessible.
```text
Running Mobilizon.Web.Endpoint with cowboy 2.8.0 at :::4000 (http)
Access Mobilizon.Web.Endpoint at https://your-mobilizon-domain.com
```
--------------------------------
### Install Basic Development Tools (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs essential build tools and utilities required for compiling software and managing packages.
```bash
sudo apt install build-essential curl unzip openssl git cmake file
```
--------------------------------
### Example: Create New Admin User in Docker
Source: https://docs.mobilizon.org/3.%20System%20administration/install/docker
Illustrates how to create a new administrator user via the mobilizon_ctl command inside the Docker environment.
```bash
docker compose exec mobilizon mobilizon_ctl users.new "your@email.com" --admin --password "Y0urP4ssw0rd"
```
--------------------------------
### Start Mobilizon Service
Source: https://docs.mobilizon.org/3.%20System%20administration/install/docker
Start the Mobilizon service and its database in detached mode. Migrations will run automatically before the service starts.
```bash
docker compose up -d
```
--------------------------------
### LDAP Authentication Configuration Example
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/auth
Example configuration for enabling and setting up an LDAP server connection in Mobilizon. Ensure all required fields like host, port, base, and bind credentials are correctly set.
```elixir
config :mobilizon, :ldap,
enabled: true,
host: "localhost",
port: 636,
ssl: true,
sslopts: [],
tls: true,
tlsopts: [],
base: "ou=users,dc=example,dc=local",
uid: "cn",
require_bind_for_search: true,
group: false,
bind_uid: "admin_account",
bind_password: "some_admin_password"
```
--------------------------------
### Start PostgreSQL Container
Source: https://docs.mobilizon.org/4.%20Contribute/development
Starts only the PostgreSQL database container. This is useful if you need to execute the IEx shell while the database is running.
```bash
docker compose start postgres
```
--------------------------------
### Test Mobilizon Startup and Log Output
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source_to_release
Starts Mobilizon as a daemon and tails the log file to verify a successful startup. Check for the 'Access Mobilizon.Web.Endpoint' message without errors.
```bash
/opt/mobilizon/bin/mobilizon daemon && tail tmp/log/erlang.log.1 -f
```
--------------------------------
### Generate Mobilizon Configuration
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Generates the runtime.exs and setup_db.psql files by prompting for setup details. Ensure MIX_ENV is set to prod for production environments.
```bash
MIX_ENV=prod mix mobilizon.instance gen
```
--------------------------------
### Install NodeJS Dependencies
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source
Install new or updated NodeJS dependencies.
```bash
npm install
```
--------------------------------
### Install PDF Export Python Module
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/exports
Installs the weasyprint Python module for PDF generation, running the command as the mobilizon user.
```bash
sudo -i -u mobilizon pip3 install weasyprint
```
--------------------------------
### Install Erlang and Elixir Packages (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs the Erlang runtime and Elixir programming language from the Erlang Solutions repository.
```bash
apt update
apt install esl-erlang
apt install elixir
```
--------------------------------
### Install Mobilizon Dependencies on Arch Linux
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs all necessary packages for Mobilizon using pacman. This command should be run as a root user.
```bash
sudo pacman -S nodejs postgresql openssl git wget unzip base-devel nginx elixir postgis imagemagick file libwebp
```
--------------------------------
### Install System Dependencies (Debian)
Source: https://docs.mobilizon.org/4.%20Contribute/development
Installs essential build tools and libraries required for Mobilizon development on Debian-based Linux systems.
```bash
sudo apt-get install build-essential curl unzip openssl git cmake file
```
--------------------------------
### Install Optional Image Optimization Dependencies on Ubuntu/Debian
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Installs optional packages for optimizing user-uploaded pictures, including gifsicle, jpegoptim, optipng, and pngquant.
```bash
sudo apt install gifsicle jpegoptim optipng pngquant
```
--------------------------------
### Create New Mobilizon Admin User
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks
Example of creating a new administrator user via the CLI. Replace placeholders with your desired email, admin status, and password.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl users.new "your@email.com" --admin --password "Y0urP4ssw0rd"
```
--------------------------------
### Start Mobilizon Server with IEx
Source: https://docs.mobilizon.org/4.%20Contribute/development
Launches the Mobilizon development server within an interactive Elixir shell (IEx), allowing for debugging and live interaction.
```bash
iex -S mix phx.server
```
--------------------------------
### Install PDF Export Dependencies (Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/exports
Installs the necessary system libraries for PDF rendering using weasyprint on Debian-based systems.
```bash
sudo apt install python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 libjpeg-dev zlib1g-dev
```
--------------------------------
### List All Actors
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_actors
Lists all available actors. Choose the command that matches your Mobilizon installation method (direct, Docker, or MIX environment).
```bash
sudo -u mobilizon ./bin/mobilizon_ctl actors
```
```bash
docker compose exec mobilizon mobilizon_ctl actors
```
```bash
MIX_ENV=prod mix mobilizon.actors
```
--------------------------------
### Generate VAPID Keys (Direct Installation)
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/push
Execute this command on a system where Mobilizon is installed directly to generate VAPID public keys for enabling browser push notifications.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl webpush.gen.keypair
```
--------------------------------
### Install Certbot for HTTPS Certificates (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Installs Certbot, a tool used to obtain and manage free Let's Encrypt SSL/TLS certificates.
```bash
sudo apt install certbot
```
--------------------------------
### Install Mobilizon Dependencies on Ubuntu/Debian
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Installs essential packages required for Mobilizon, including curl, tar, PostgreSQL, nginx, certbot, imagemagick, and file.
```bash
sudo apt install curl tar postgresql postgresql-contrib nginx certbot imagemagick file
sudo apt install --install-recommends postgis
```
--------------------------------
### Build Mobilizon Backend and Frontend
Source: https://docs.mobilizon.org/4.%20Contribute/development
Copies necessary build artifacts, fetches Elixir dependencies, compiles them, installs Node.js dependencies, builds the frontend assets, and generates Phoenix digests.
```bash
cp -r ../mobilizon/{deps,_build,node_modules} ./
MIX_ENV=dev mix deps.get
MIX_ENV=dev mix deps.compile
npm install
npm run build
MIX_ENV=dev mix phx.digest
```
--------------------------------
### Generate Mobilizon Configuration
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Generates the Mobilizon configuration file and database setup script. This command prompts for instance details to create the necessary configuration.
```bash
cd /opt/mobilizon
sudo -u mobilizon ./bin/mobilizon_ctl instance gen --output /etc/mobilizon/config.exs --output-psql /tmp/setup_db.psql
```
--------------------------------
### Example HTML Hook Snippet
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/reference
Demonstrates how to inject raw HTML code into the Mobilizon app's main page using HTML hooks. This example shows adding a script to the head section.
```elixir
config :mobilizon,
html_hooks: [app_index_html_head_last: ""]
```
--------------------------------
### Install ASDF Version Manager
Source: https://docs.mobilizon.org/4.%20Contribute/development
Installs the ASDF version manager and configures it for the current shell session. This is recommended for managing Elixir, Erlang, Node.js, and other language versions.
```bash
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc
. ~/.bashrc
```
--------------------------------
### Generate New Mobilizon Configuration Files
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/maintenance_tasks
Generates new configuration files for a Mobilizon instance. This command should only be run once during installation. Interactive prompts will appear if options are not specified.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl instance gen []
```
```bash
mix mobilizon.instance gen []
```
--------------------------------
### Perform Database Migrations
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/release
Navigates to the Mobilizon installation directory and runs the database migration command as the mobilizon user. This command can be run safely even if no migrations are needed.
```bash
cd /opt/mobilizon
sudo -u mobilizon ./bin/mobilizon_ctl migrate
```
--------------------------------
### Create New Profile
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_actors
Creates a new user profile. Requires email and optionally accepts username, display name, and type. Use the command corresponding to your installation method.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl actors.new []
```
```bash
docker compose exec mobilizon mobilizon_ctl actors.new []
```
```bash
MIX_ENV=prod mix mobilizon.actors.new []
```
--------------------------------
### Configure OAuth Providers for Ueberauth
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/auth
Add and configure OAuth providers for Mobilizon's authentication system using Ueberauth. This example shows how to set up Gitlab and Keycloak strategies with their default scopes.
```elixir
config :ueberauth,
Ueberauth,
providers: [
gitlab: {Ueberauth.Strategy.Gitlab, [default_scope: "read_user"]},
keycloak: {Ueberauth.Strategy.Keycloak, [default_scope: "openid email"]}
# ...
]
```
--------------------------------
### Install Elixir Dependencies
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Fetches and installs Elixir project dependencies using Mix. It may prompt to install Hex and rebar3 if they are not already present.
```bash
mix deps.get
```
--------------------------------
### List All Available Users Commands
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_users
Use these commands to list all available user management commands. Choose the command that matches your deployment environment (direct execution, Docker, or Mix).
```bash
sudo -u mobilizon ./bin/mobilizon_ctl users
```
```bash
docker compose exec mobilizon mobilizon_ctl users
```
```bash
MIX_ENV=prod mix mobilizon.users
```
--------------------------------
### Remove Database Setup Script
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Removes the temporary SQL script used for database setup after successful execution.
```bash
sudo rm /tmp/setup_db.psql
```
--------------------------------
### Run Mobilizon Backend Unit Tests
Source: https://docs.mobilizon.org/4.%20Contribute/development
Compiles the project, updates timezone data, creates and migrates the database, and then runs all backend unit tests.
```bash
# Compile
set -x
mix deps.get
mix compile
mix tz_world.update
mix ecto.create
mix ecto.migrate
set +x
# start test
mix test
```
--------------------------------
### Update System Packages (Ubuntu/Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Ensures your system's package list and installed packages are up-to-date before proceeding with installations.
```bash
sudo apt update
sudo apt dist-upgrade
```
--------------------------------
### Create Mobilizon Directories
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Creates necessary directories for Mobilizon uploads, exports, sitemap, and timezone data. Ensure these directories exist before proceeding.
```bash
mkdir -p /var/lib/mobilizon/uploads /var/lib/mobilizon/uploads/exports/csv /var/lib/mobilizon/sitemap /var/lib/mobilizon/timezones /var/lib/mobilizon/geo
```
--------------------------------
### Remove Old Source Installation
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source_to_release
Clean up the old Mobilizon source installation by removing the 'live' directory and dependency caches.
```bash
cd /home/mobilizon
rm -r live/ .cache/ .hex/ .mix/
```
--------------------------------
### Build Production Bundle with npm
Source: https://docs.mobilizon.org/4.%20Contribute/styleguide
Run `npm run build` to build a production bundle for the front-end. Linting errors from prettier and eslint should be reported during this process.
```shell
npm run build
```
--------------------------------
### Restart Mobilizon Service
Source: https://docs.mobilizon.org/3.%20System%20administration/configure
Restart the Mobilizon service after modifying configuration files. This command is applicable for both system installations and source installations.
```bash
systemctl restart mobilizon
```
--------------------------------
### Install ODS Export Python Module
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/exports
Installs the pyexcel-ods3 Python module for ODS generation, running the command as the mobilizon user.
```bash
sudo -i -u mobilizon pip3 install pyexcel-ods3
```
--------------------------------
### Follow a Mobilizon Instance (Direct Command)
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/relay
Use this command to make your Mobilizon instance follow another instance when running directly. Replace `` with the target instance's domain.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl relay.follow
```
```bash
sudo -u mobilizon ./bin/mobilizon_ctl relay.follow example.org
```
--------------------------------
### Create Mobilizon Configuration Directory
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Creates the configuration directory for Mobilizon and sets its ownership to the 'mobilizon' user.
```bash
mkdir -p /etc/mobilizon
chown -R mobilizon /etc/mobilizon
```
--------------------------------
### Create Mobilizon Data Directories
Source: https://docs.mobilizon.org/3.%20System%20administration/install/release
Creates necessary directories for user uploads, exports, and the GeoIP database, and sets their ownership to the 'mobilizon' user.
```bash
mkdir -p /var/lib/mobilizon/uploads /var/lib/mobilizon/uploads/exports/csv /var/lib/mobilizon/data
chown -R mobilizon /var/lib/mobilizon
```
--------------------------------
### Run Database Migrations
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Applies database migrations to the Mobilizon database. Always prefix mix commands with MIX_ENV=prod for production environments.
```bash
MIX_ENV=prod mix ecto.migrate
```
--------------------------------
### Install ODS Export Dependencies (Debian)
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/exports
Installs the necessary system libraries for ODS data generation using pyexcel-ods3 on Debian-based systems.
```bash
sudo apt install python3-pip libxml2-dev libxslt-dev
```
--------------------------------
### Search Events Variables Example 1
Source: https://docs.mobilizon.org/5.%20Interoperability/3.graphql_api
Example variables for the SearchEvents query, demonstrating search by term, location, radius, and date range.
```json
{
"beginsOn": "2022-02-28T23:00:00.000Z",
"endsOn": "2022-03-31T21:59:59.999Z",
"eventPage": 2,
"limit": 12,
"radius": 100,
"term": "culture",
"location": "u05cyfxcr"
}
```
--------------------------------
### Create Mobilizon Configuration Directory
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source_to_release
Creates the directory for Mobilizon's configuration files if it does not already exist. This is a prerequisite for moving configuration.
```bash
mkdir -p /etc/mobilizon
```
--------------------------------
### Follow Mobilizon Logs
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source
Monitor Mobilizon logs in real-time to verify the upgrade and check for errors.
```bash
sudo journalctl -u mobilizon -f
```
--------------------------------
### Clone Mobilizon Repository and Navigate
Source: https://docs.mobilizon.org/3.%20System%20administration/install/source
Clones the Mobilizon source code from the specified Git repository into a 'live' directory and then changes the current directory to 'live'.
```bash
git clone https://framagit.org/kaihuri/mobilizon live && cd live
```
--------------------------------
### Replace Mobilizon Installation
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/release
Removes the old Mobilizon installation directory and moves the newly extracted release to the /opt/mobilizon directory. Cleans up the temporary tarball.
```bash
sudo rm -rf /opt/mobilizon
sudo mv /tmp/mobilizon /opt/
sudo rm /tmp/mobilizon.tar.gz
```
--------------------------------
### Search Events Variables Example 2 (Tags)
Source: https://docs.mobilizon.org/5.%20Interoperability/3.graphql_api
Example variables for the SearchEvents query, demonstrating search by tags. Note that tags are treated as an 'OR' query.
```json
{
"eventPage": 3,
"limit": 12,
"radius": null,
"tags": "gratuit"
}
```
--------------------------------
### Execute Mobilizon CLI Command with Production Environment
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks
Prefix commands with MIX_ENV=prod to ensure they run with the production environment loaded. This is crucial for production deployments.
```bash
MIX_ENV=prod mix mobilizon.command.subcommand
```
--------------------------------
### Create and Migrate Mobilizon Database
Source: https://docs.mobilizon.org/4.%20Contribute/development
Creates the Mobilizon database using Ecto and applies all pending database migrations.
```bash
mix ecto.create
mix ecto.migrate
```
--------------------------------
### Create a New User Command
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_users
Execute these commands to create a new user. Replace `` with the desired email address. Options can be added to set the password, assign roles, or create a profile.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl users.new []
```
```bash
docker compose exec mobilizon mobilizon_ctl users.new []
```
```bash
MIX_ENV=prod mix mobilizon.users.new []
```
--------------------------------
### Install libssl1.1 on Linux Mint 21.3/22
Source: https://docs.mobilizon.org/4.%20Contribute/development
Resolves the error ''libcrypto.so.1.1: cannot open shared object file: No such file or directory'' on specific Linux Mint versions. This involves downloading and installing a .deb package.
```bash
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
```
--------------------------------
### Example Multipart Request Body for Media Upload
Source: https://docs.mobilizon.org/5.%20Interoperability/3.graphql_api
This example demonstrates the structure of a multipart/form-data request body for uploading media. It includes the 'query', 'variables', and the actual file content parts, highlighting the custom delimiter format.
```http
-----------------------------164507724316293925132493775707
Content-Disposition: form-data; name="query"
mutation uploadMedia($file: Upload!, $name: String!) {
uploadMedia(file: $file, name: $name) { id }
}
-----------------------------164507724316293925132493775707
Content-Disposition: form-data; name="variables"
{"name":"foo.jpg","file":"image1"}
-----------------------------164507724316293925132493775707
Content-Disposition: form-data; name="image1"; filename="foo.jpg"
Content-Type: image/jpeg
����JFIFHH��&vExifII*
�
�▒�(
[...]
-----------------------------164507724316293925132493775707
```
--------------------------------
### Follow a Mobilizon Instance (Docker Compose)
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/relay
Execute this command within a Docker Compose environment to follow another Mobilizon instance. Ensure you replace `` with the correct domain.
```bash
docker compose exec mobilizon mobilizon_ctl relay.follow
```
```bash
docker compose exec mobilizon mobilizon_ctl relay.follow example.org
```
--------------------------------
### Example Mobilizon API Response for Token Exchange
Source: https://docs.mobilizon.org/5.%20Interoperability/2.api_auth
This is an example of a successful JSON response when exchanging an authorization code for access and refresh tokens from the Mobilizon API. It includes the access token, its expiration time, the refresh token, its expiration time, allowed scopes, and token type.
```json
{
"access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJtb2JpbGl6b24iLCJleHAiOjE2Nzc4ODk5NDEsImlhdCI6MTY3Nzg2MTE0MSwiaXNzIjoibW9iaWxpem9uIiwianRpIjoiYTVkMDU4NGUtMTY2My00OTc3LTk1N2UtYjZjZjk1ZTlmYzgxIiwibmJmIjoxNjc3ODYxMTQwLCJzdWIiOiJBcHBUb2tlbjoxMiIsInR5cCI6ImFjY2VzcyJ9.7D6FPNRmSSZ8HDYh0GT12G_cPSF-UH_XfpQU1dGiOa9ADULciiQIKYnsrYP0QVrKnSWLfdP06d0SiCksQTSjKQ",
"expires_in": 28800,
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJtb2JpbGl6b24iLCJleHAiOjE2OTM1ODU5NDEsImlhdCI6MTY3Nzg2MTE0MSwiaXNzIjoibW9iaWxpem9uIiwianRpIjoiMTQ1MDk3NGMtOWE4NS00YmI3LWE5NTktODg5OGM5NzQxM2UzIiwibmJmIjoxNjc3ODYxMTQwLCJzdWIiOiJBcHBUb2tlbjoxMiIsInR5cCI6InJlZnJlc2gifQ.Ttn1PlqV3RZkewdwM-EIEgJwN8XTWB_PtmYSTkVCb7U7TrLqF5pVnN1brubj_ePLFohweLaJWah6X5ajNFNdrg",
"refresh_token_expires_in": 15724800,
"scopes": "write:event:create write:event:update write:event:delete",
"token_type": "bearer"
}
```
--------------------------------
### Configure Mimirsbrunn Geocoder
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/geocoders
Example configuration for the Mimirsbrunn geocoder. The endpoint can be set to nil.
```elixir
config :mobilizon, Mobilizon.Service.Geospatial.Mimirsbrunn,
endpoint: nil
```
--------------------------------
### Fetch Elixir Dependencies
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source
Download and install new or updated Elixir dependencies for production environment.
```bash
MIX_ENV=prod mix deps.get
```
--------------------------------
### Navigate to Mobilizon Root Directory
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source
Change the current directory to the Mobilizon installation's root folder.
```bash
cd /home/mobilizon/live
```
--------------------------------
### Set Mobilizon Directory Ownership
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/release
Sets the correct owner and group for the Mobilizon installation directory to ensure proper file permissions.
```bash
sudo chown -R mobilizon:mobilizon /opt/mobilizon
```
--------------------------------
### Clean Orphan Media Files (Direct Execution)
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/media
Run the media cleaning task directly on the server. Use options like --verbose, --days, or --dry-run for specific behaviors.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl media.clean_orphan []
```
--------------------------------
### Configure Pelias Geocoder
Source: https://docs.mobilizon.org/3.%20System%20administration/configure/geocoders
Example configuration for the Pelias geocoder. The endpoint can be set to nil if using a service like Geocode Earth.
```elixir
config :mobilizon, Mobilizon.Service.Geospatial.Pelias,
endpoint: nil
```
--------------------------------
### Show Actor Details
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_actors
Displays detailed information for a specific actor, identified by its username. Choose the command appropriate for your Mobilizon setup.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl actors.show
```
```bash
docker compose exec mobilizon mobilizon_ctl actors.show
```
```bash
MIX_ENV=prod mix mobilizon.actors.show
```
--------------------------------
### Run All Backend Tests
Source: https://docs.mobilizon.org/4.%20Contribute/tests
Execute all backend ExUnit tests. This is the primary command for backend testing.
```bash
mix test
```
--------------------------------
### Configure Mobilizon Endpoint Server
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source_to_release
Adds or updates the 'server: true' setting in the Mobilizon endpoint configuration. This ensures the endpoint starts a server.
```elixir
config :mobilizon, Mobilizon.Web.Endpoint,
+ server: true,
```
--------------------------------
### Copy Mobilizon Configuration File
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source_to_release
Copies the existing runtime configuration file to the new configuration directory. Ensure you copy the correct file based on your Mobilizon version.
```bash
cp config/runtime.exs /etc/mobilizon/config.exs
```
--------------------------------
### Refresh Remote Actor
Source: https://docs.mobilizon.org/3.%20System%20administration/CLI%20tasks/manage_actors
Refreshes the data for a remote actor, which can help resolve federation issues. Use the command that matches your installation environment.
```bash
sudo -u mobilizon ./bin/mobilizon_ctl actors.refresh
```
```bash
docker compose exec mobilizon mobilizon_ctl actors.refresh
```
```bash
MIX_ENV=prod mix mobilizon.actors.refresh
```
--------------------------------
### Switch to Mobilizon User
Source: https://docs.mobilizon.org/3.%20System%20administration/upgrading/source
Switch to the dedicated 'mobilizon' user to perform upgrade tasks.
```bash
sudo -i -u mobilizon
```
--------------------------------
### Run API Container with IEx
Source: https://docs.mobilizon.org/4.%20Contribute/development
Launches the API container with the IEx shell, connecting to the running database. This allows for interactive debugging and development.
```bash
docker compose run --service-ports --rm api iex -S mix phx.server
```