No description
This repository has been archived on 2026-02-11. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Elixir 97.4%
  • Dockerfile 2.5%
  • Shell 0.1%
Find a file
2019-11-18 10:00:32 -06:00
config “The reason we're successful, darling? My overall charisma, of course” 2019-04-25 12:51:08 -05:00
lib Fix telemetry deprecation warning 2019-10-03 12:36:42 +07:00
priv “The reason we're successful, darling? My overall charisma, of course” 2019-04-25 12:51:08 -05:00
rel use Distillery namespace (Distillery.Releases.Config) 2019-10-03 16:01:34 -05:00
test Cleanup tests output 2019-10-03 12:36:11 +07:00
.credo.exs Add Releases 2019-03-26 11:42:02 +00:00
.dockerignore Add Releases 2019-03-26 11:42:02 +00:00
.formatter.exs make it so 🚀 2019-03-20 22:01:50 +07:00
.gitignore “The reason we're successful, darling? My overall charisma, of course” 2019-04-25 12:51:08 -05:00
.gitlab-ci.yml “The reason we're successful, darling? My overall charisma, of course” 2019-04-25 12:51:08 -05:00
API.md API docs had wrong project name 2019-11-18 10:00:32 -06:00
COPYING Pleroma projects are AGPLv3 2019-04-25 20:56:55 +00:00
Dockerfile change to use mix distillery.release - ref https://github.com/bitwalker/distillery/blob/master/docs/introduction/installation.md 2019-10-03 15:56:15 -05:00
mix.exs Update dependencies 2019-10-03 11:20:44 +07:00
mix.lock Update dependencies 2019-10-03 11:20:44 +07:00
README.md Merge branch 'egor/fix-readme' into 'master' 2019-04-25 19:42:23 +00:00

Charisma (Work In Progress)

  • API Documentation
  • At the moment the only feature is the native push to iOS/Android devices
  • Internally it subscribes for web push notifications on the target pleroma instance and then forwards them to mobile devices via native push (similar to Mastodon).
  • Testing instance: https://roma.ugroza.ru/

Run

Requrements

  • PostgreSQL v9.5+

Environment Variables

  • SECRET_KEY_BASE — a secret key used as a base to generate secrets for encrypting and signing data.
  • PORT — a port to listen. The server URL port is expected to be 443.
  • HOSTNAME - a domain name of the server.
  • LOGGER_LEVEL — Optional, default: info.

APNS

  • APNS_KEY — A string with a key or path to a key file.
  • APNS_KEY_IDENTIFIER
  • APNS_TEAM_ID
  • APNS_MODE — Optional. Possible values: dev or prod, default: prod.
  • APNS_TOPIC — Optional.

Database

  • DATABASE_URL

or

  • DATABASE_USER
  • DATABASE_PASS
  • DATABASE_NAME
  • DATABASE_HOST

OTP Releases

  • Build: MIX_ENV=prod mix release --env=prod
  • Run: _build/prod/rel/charisma/bin/charisma foreground
  • Run migrations: _build/prod/rel/charisma/bin/charisma migrate
  • Config file: _build/prod/rel/charisma/etc/config.exs

Notification Payload

APNS Example

{
  "access_token": "YvRqZatg9c5180GxZL7nZ132jP-A3mKPQjY9uDs4t-A",
  "aps": {
    "alert": {"body": "@test: @user hello!", "title": "New Mention"}
  },
  "host": "https://pleroma.ugroza.ru",
  "icon": "https://pleroma.ugroza.ru/images/avi.png",
  "notification_id": 6,
  "notification_type": "mention",
  "pleroma": {"activity_id": "9gzdzzmJUyAfebXqi0"},
  "preferred_locale": "en"
}

FCM Example

{
  "notification": {"body": "@test: @egor 11"},
  "data": {
    "access_token": "WFiadabq18KUIFFm4o-D_9_tAiBy9hzyFIDJQCwwPvw",
    "host": "https://pleroma.ugroza.ru",
    "icon": "https://pleroma.ugroza.ru/images/avi.png",
    "notification_id": 160,
    "notification_type": "mention",
    "pleroma": {"activity_id": "9hBsUYRWO3yvxVmGUi"},
    "preferred_locale": "en",
    "title": "New Mention"
  }
}