Mobilizon: Unterschied zwischen den Versionen

Aus Hostsharing Wiki
Zur Navigation springen Zur Suche springen
KKeine Bearbeitungszusammenfassung
 
Zeile 17: Zeile 17:
== Download und Entpacken der Software ==
== Download und Entpacken der Software ==


  mkdir ~/tmp
<syntaxhighlight lang=shell>
  cd ~/tmp
mkdir ~/tmp
  wget https://joinmobilizon.org/latest-package -O mobilizon.tgz
cd ~/tmp
  cd ~
wget https://joinmobilizon.org/latest-package -O mobilizon.tgz
  tar xzf ~/tmp/mobilizon.tgz
cd ~
tar xzf ~/tmp/mobilizon.tgz
</syntaxhighlight>


== Konfiguration ==
== Konfiguration ==
Zeile 27: Zeile 29:
Die Datei ''config.exs'':
Die Datei ''config.exs'':


  cd ~/mobilizon
<syntaxhighlight lang=sh>
  ./bin/mobilizon_ctl instance gen --output ~/mobilizon/config.exs
cd ~/mobilizon
  !!! /home/pacs/peh19/users/mobilizon/mobilizon/config.exs not found! Please ensure it exists and that   
./bin/mobilizon_ctl instance gen --output ~/mobilizon/config.exs
  MOBILIZON_CONFIG_PATH is unset or points to an existing file
  What domain will your instance use? (e.g mobilizon.org) [] groups.hs-example.de
  What is the name of your instance? (e.g. Mobilizon) [] Mobilizon
  What's the address email will be send with? [noreply@groups.hs-example.de]
  What is the hostname of your database? [localhost]
  What is the name of your database? [mobilizon_prod] xyz00_mobilizon
  What is the user used to connect to your database? [mobilizon] xyz00_mobilizon
  What is the password used to connect to your database? [autogenerated]
  What port will the app listen to (leave it if you are using the default setup with nginx)? [4000] 37080
  Writing config to /home/pacs/xyz00/users/mobilizon/mobilizon/config.exs.
  Writing setup_db.psql.


  cat ~/mobilizon/config.exs
!!! /home/pacs/peh19/users/mobilizon/mobilizon/config.exs not found! Please ensure it exists and that   
MOBILIZON_CONFIG_PATH is unset or points to an existing file


  # Mobilizon instance configuration
What domain will your instance use? (e.g mobilizon.org) [] groups.hs-example.de
What is the name of your instance? (e.g. Mobilizon) [] Mobilizon
What's the address email will be send with? [noreply@groups.hs-example.de]
What is the hostname of your database? [localhost]
What is the name of your database? [mobilizon_prod] xyz00_mobilizon
What is the user used to connect to your database? [mobilizon] xyz00_mobilizon
What is the password used to connect to your database? [autogenerated]
What port will the app listen to (leave it if you are using the default setup with nginx)? [4000] 37080
Writing config to /home/pacs/xyz00/users/mobilizon/mobilizon/config.exs.
Writing setup_db.psql.
</syntaxhighlight>
 
<syntaxhighlight lang=elixir>
# cat ~/mobilizon/config.exs
#
# Mobilizon instance configuration
    
    
  import Config
import Config
 
 
  config :mobilizon, Mobilizon.Web.Endpoint,
config :mobilizon, Mobilizon.Web.Endpoint,
    server: true,
  server: true,
    url: [host: "groups.hs-example.de"],
  url: [host: "groups.hs-example.de"],
    http: [
  http: [
      ip: {127,0,0,1},
    ip: {127,0,0,1},
      port: 37080
    port: 37080
      ],
    ],
    secret_key_base: "XXXXXXXX"
  secret_key_base: "XXXXXXXX"
    
    
  config :mobilizon, Mobilizon.Web.Auth.Guardian,
config :mobilizon, Mobilizon.Web.Auth.Guardian,
    secret_key: "YYYYYYYY"
  secret_key: "YYYYYYYY"
    
    
  config :mobilizon, :instance,
config :mobilizon, :instance,
    name: "Mobilizon",
  name: "Mobilizon",
    description: "Change this to a proper description of your instance",  
  description: "Change this to a proper description of your instance",  
    hostname: "groups.hs-example.de",
  hostname: "groups.hs-example.de",
    registrations_open: false,
  registrations_open: false,
    demo: false,
  demo: false,
    allow_relay: true,
  allow_relay: true,
    federating: true,
  federating: true,
    email_from: "noreply@groups.hs-example.de",
  email_from: "noreply@groups.hs-example.de",
    email_reply_to: "noreply@groups.hs-example.de"
  email_reply_to: "noreply@groups.hs-example.de"
    
    
  config :mobilizon, Mobilizon.Storage.Repo,
config :mobilizon, Mobilizon.Storage.Repo,
    adapter: Ecto.Adapters.Postgres,
  adapter: Ecto.Adapters.Postgres,
    username: "xyz00_mobilizon",
  username: "xyz00_mobilizon",
    password: "******",
  password: "******",
    database: "xyz00_mobilizon",
  database: "xyz00_mobilizon",
    hostname: "localhost",
  hostname: "localhost",
    port: "5432",
  port: "5432",
    pool_size: 10
  pool_size: 10
    
    
  # manuell hinzugefuegt!
# manuell hinzugefuegt!
  config :mobilizon, Mobilizon.Web.Upload.Uploader.Local,  
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local,  
    uploads: "/home/storage/xyz00/users/mobilizon/uploads"
  uploads: "/home/storage/xyz00/users/mobilizon/uploads"
</syntaxhighlight>


== Datenbank-Initialisierung ==
== Datenbank-Initialisierung ==


  export MOBILIZON_CONFIG_PATH=$HOME/mobilizon/config.exs
<syntaxhighlight lang=shell>
  cd ~/mobilizon
export MOBILIZON_CONFIG_PATH=$HOME/mobilizon/config.exs
  ./bin/mobilizon_ctl migrate
cd ~/mobilizon
  ./bin/mobilizon_ctl users.new "webmaster@groups.hs-example.de" --admin --password "******"
./bin/mobilizon_ctl migrate
./bin/mobilizon_ctl users.new "webmaster@groups.hs-example.de" --admin --password "******"
</syntaxhighlight>


== Systemd-Service ==
== Systemd-Service ==


  cat ~/.config/systemd/user/mobilizon.service  
<syntaxhighlight lang=ini>
 
# cat ~/.config/systemd/user/mobilizon.service  
  [Unit]
#
  Description=Mobilizon Service
[Unit]
  After=network.target postgresql.service
Description=Mobilizon Service
After=network.target postgresql.service
    
    
  [Service]
[Service]
  Type=simple
Type=simple
  WorkingDirectory=%h/mobilizon
WorkingDirectory=%h/mobilizon
  ExecStart=%h/mobilizon/bin/mobilizon start
ExecStart=%h/mobilizon/bin/mobilizon start
  Restart=always
Restart=always
  Environment=MIX_ENV=prod
Environment=MIX_ENV=prod
  Environment=PATH=/usr/local/bin:/usr/bin:/bin
Environment=PATH=/usr/local/bin:/usr/bin:/bin
  Environment=HOME=%h
Environment=HOME=%h
  Environment=MOBILIZON_CONFIG_PATH=%h/mobilizon/config.exs
Environment=MOBILIZON_CONFIG_PATH=%h/mobilizon/config.exs
  Environment=ERL_EPMD_ADDRESS=127.0.0.1
Environment=ERL_EPMD_ADDRESS=127.0.0.1
  Environment=ERL_EPMD_PORT=37369
Environment=ERL_EPMD_PORT=37369
  Environment=LANG=de_DE.UTF-8
Environment=LANG=de_DE.UTF-8
  PrivateTmp=true
PrivateTmp=true
  NoNewPrivileges=true
NoNewPrivileges=true
    
    
  [Install]
[Install]
  WantedBy=default.target
WantedBy=default.target
</syntaxhighlight>


== Links ==
== Links ==

Aktuelle Version vom 24. Mai 2024, 11:12 Uhr

Mobilizon ist eine Plattform, die am sog. "Fediverse" teilnimmt. Das Fediverse bezeichnet ein Netzwerk föderierter, voneinander unabhängiger sozialer Netzwerke. Dazu gehören insbesondere die Micro-Blogging Plattformen Mastodon, Pleroma und Misskey.

Mobilizon stellt im Fediverse Funktionen für die Bekanntmachung von Veranstaltungen bereit. Veranstalungen werden hier organisiert, Terlnehmende werden mobilisiert. Mobilizon bietet gute Alternativen zu Facebook-Gruppen und -Fanpages.

Installation

Der Betrieb von Mobilizon erfordert in der Regel einen Webspace auf einem eigenen Managed Server, weil mehrere Server-Dienste betrieben werden und weil Erweiterungen in der PostgreSQL-Datenbank installiert werden müssen.

Vorbereitung

Zur Vorbereitung wird im Hostsharing-Webspace mit HSAdmin ein Service-User (im Beispiel xyz00-mobilizon) angelegt. Der Service-User wird Domain-Admin für die Domain, unter der die Mobilizon-Instanz später erreichbar sein soll. Im folgenden nutzen wir die Domain groups.hs-example.de als Beispiel.

Die Software verwendet PostgreSQL als Datenbanksystem mit der PostGIS-Erweiterung. Als weiteren Vobereitungsschritt legen wir mit HSAdmin einen User in PostgreSQL an und verwenden den PostgreSQL-User als Eigentümer für die Mobilizon-Datenbank. Im Folgenden heißen PostgreSQL-User und PostgreSQL-Datenbank beides xyz00_mobilizon.

Damit die PostGIS-Funktionalität in der neuen Datenbank zur Verfügung steht, muss der Hostsharing-Service die Erweiterungen postgis, pg_trgm und unaccent in der neu angelegten Datenbank einspielen. Wir bitten den Service in einer E-Mail an service@hostsharing.net unter Angabe Namens der Datenbank um die Aktivierung der Erweiterungen.

Download und Entpacken der Software

mkdir ~/tmp
cd ~/tmp
wget https://joinmobilizon.org/latest-package -O mobilizon.tgz
cd ~
tar xzf ~/tmp/mobilizon.tgz

Konfiguration

Die Datei config.exs:

cd ~/mobilizon
./bin/mobilizon_ctl instance gen --output ~/mobilizon/config.exs

!!! /home/pacs/peh19/users/mobilizon/mobilizon/config.exs not found! Please ensure it exists and that     
MOBILIZON_CONFIG_PATH is unset or points to an existing file

What domain will your instance use? (e.g mobilizon.org) [] groups.hs-example.de
What is the name of your instance? (e.g. Mobilizon) [] Mobilizon
What's the address email will be send with? [noreply@groups.hs-example.de] 
What is the hostname of your database? [localhost] 
What is the name of your database? [mobilizon_prod] xyz00_mobilizon
What is the user used to connect to your database? [mobilizon] xyz00_mobilizon
What is the password used to connect to your database? [autogenerated] 
What port will the app listen to (leave it if you are using the default setup with nginx)? [4000] 37080
Writing config to /home/pacs/xyz00/users/mobilizon/mobilizon/config.exs.
Writing setup_db.psql.
# cat ~/mobilizon/config.exs
# 
# Mobilizon instance configuration
  
import Config

config :mobilizon, Mobilizon.Web.Endpoint,
   server: true,
   url: [host: "groups.hs-example.de"],
   http: [
     ip: {127,0,0,1},
     port: 37080
    ],
   secret_key_base: "XXXXXXXX"
  
config :mobilizon, Mobilizon.Web.Auth.Guardian,
  secret_key: "YYYYYYYY"
  
config :mobilizon, :instance,
  name: "Mobilizon",
  description: "Change this to a proper description of your instance", 
  hostname: "groups.hs-example.de",
  registrations_open: false,
  demo: false,
  allow_relay: true,
  federating: true,
  email_from: "noreply@groups.hs-example.de",
  email_reply_to: "noreply@groups.hs-example.de"
  
config :mobilizon, Mobilizon.Storage.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "xyz00_mobilizon",
  password: "******",
  database: "xyz00_mobilizon",
  hostname: "localhost",
  port: "5432",
  pool_size: 10
  
# manuell hinzugefuegt!
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, 
  uploads: "/home/storage/xyz00/users/mobilizon/uploads"

Datenbank-Initialisierung

export MOBILIZON_CONFIG_PATH=$HOME/mobilizon/config.exs
cd ~/mobilizon
./bin/mobilizon_ctl migrate
./bin/mobilizon_ctl users.new "webmaster@groups.hs-example.de" --admin --password "******"

Systemd-Service

# cat ~/.config/systemd/user/mobilizon.service 
#
[Unit]
Description=Mobilizon Service
After=network.target postgresql.service
  
[Service]
Type=simple
WorkingDirectory=%h/mobilizon
ExecStart=%h/mobilizon/bin/mobilizon start
Restart=always
Environment=MIX_ENV=prod
Environment=PATH=/usr/local/bin:/usr/bin:/bin
Environment=HOME=%h
Environment=MOBILIZON_CONFIG_PATH=%h/mobilizon/config.exs
Environment=ERL_EPMD_ADDRESS=127.0.0.1
Environment=ERL_EPMD_PORT=37369
Environment=LANG=de_DE.UTF-8
PrivateTmp=true
NoNewPrivileges=true
  
[Install]
WantedBy=default.target

Links