diff --git a/documentation/admin.md b/documentation/admin.md new file mode 100644 index 00000000..8d12653a --- /dev/null +++ b/documentation/admin.md @@ -0,0 +1,55 @@ +--- +layout: page +title: Spectrum 2 +--- + +#### About + +* [What is Spectrum 2?](about.html) + +#### Installation + +* [Installing using Docker](installation/docker.html) +* [Installing from source code](installation/from_source_code.html) + +#### Frontends + +* [Frontends overview](frontends/frontends.html) +* [XMPP Frontend](frontends/xmpp.html) + * [Using SSL in server mode](configuration/server_ssl.html) + * [Spectrum 2 as bouncer](configuration/bouncer.html) +* [Slack Frontend](frontends/slack.html) + +#### Backends + +* [Backends overview](backends/backends.html) +* [Libpurple backend](backends/libpurple.html) +* [Swiften backend](backends/swiften.html) +* [Libcommuni backend](backends/libcommuni.html) +* [Skype backend](backends/skype.html) +* [Twitter backend](backends/twitter.html) + +#### Tutorials + +* [XMPP Frontend](frontends/xmpp.html) + * [Spectrum 2 in gateway mode](tutorials/gateway_mode.html) + +#### Configuration + +* [Configuration file description](configuration/config_file.html) +* [MySQL Support](configuration/mysql.html) +* [PostgreSQL Support](configuration/postgresql.html) +* [Logging](configuration/logging.html) + + + +#### Management + +* [spectrum2_manager tool](management/spectrum2_manager.html) +* [Getting a backtrace](management/getting_backtrace.html) +* [Munin integration](management/munin.html) + +#### Development + +* [Spectrum 2 architecture](development/architecture.html) +* [Writing backend in any language (or How the backend works inside)](development/protocol.html) diff --git a/documentation/development/architecture.md b/documentation/development/architecture.md index fa46bb1c..3a63ce36 100644 --- a/documentation/development/architecture.md +++ b/documentation/development/architecture.md @@ -12,13 +12,15 @@ Spectrum 2 consist of several separate parts which cooperates together. This pag Directory| Description ---------|------------ ./src|Libtransport source codes -./include/transport|Libtransport headers +./include/transport|Libtransport header ./plugin/cpp|Libtransport-plugin source codes ./backends/|Various Spectrum 2 backends source codes +./spectrum/src|Spectrum 2 source codes +./spectrum/src/frontends| Spectrum 2 frontends source codes ## Libtransport -Libtransport is library providing the high-level interface for creating XMPP transports. It's used by the Spectrum 2 and by several transports. +Libtransport is library providing the high-level interface for creating transports. It's used by the Spectrum 2 and by several backends and by all frontends. Libtransport contains NetworkPluginServer class, which acts as server to which backends connect. Libtransport spawns the backend's processes when they are needed (for example when new user logs in) and destroys them when they are not needed anymore (for example when there are no active users on the backend). @@ -28,17 +30,19 @@ Name| Reason ----|------- Spectrum 2|It's the Spectrum 2 core Some backends|Connect the Spectrum2, use of Spectrum 2 database, parsing the config file, ... +Frontends|Core library for frontends development Libtransport uses: Name| Reason -----|------- -Swiften library|Connecting to Jabber sever and sending/receiving data from XMPP users +Swiften library|Historical reasons. It's used as a utils library and basic data structures are represented using classes from Swiften library. log4cxx|Logging protobuf|Protocol for libtransport - backends communication mysql-client|MySQL support sqlite3|SQLite3 support pqxx|PostgreSQL support +curl|HTTP requests for OAuth2 and REST frontends ## Libtransport-plugin @@ -74,3 +78,7 @@ Libtransport|Core library... Backends allow communication with particular legacy network and implements things like logging the user in, sending/receiving messages from legacy network and so on. Backend's life-cycle is controlled by the Spectrum 2 (or better said by the Libtransport's NetworkPluginServer class). Spectrum 2 spawns the backend and gives it `"--host localhost --port 32453"` parameters. Backend then has to connect the Spectrum 2 located at the given host/port and start receiving the commands sent by the Spectrum 2 main instance. For C++, there is wrapper class called NetworkPlugin which does the parsing and allows programmer to code backend just by implementing few virtual methods. + +## Frontends + +Frontends allow communication with the network Spectrum 2 users are using. Frontends are statically linked libraries currently. They are implementing `./include/transport/Frontend.h" class. diff --git a/documentation/frontends/slack.md b/documentation/frontends/slack.md new file mode 100644 index 00000000..36f3ae8e --- /dev/null +++ b/documentation/frontends/slack.md @@ -0,0 +1,28 @@ +--- +layout: config +title: Spectrum 2 +--- + +## Slack frontend Description + +Slack frontend allows users to use Slack as a frontend network for Spectrum 2. + +### Configuration + +You have to choose this frontend in Spectrum 2 configuration file to use it: + + [service] + frontend=slack + + +## Usage + +To use Slack 2 frontend with Spectrum2, you have to add new bot to your Slack team and get the API token. After that, you can use `spectrum2_manager` to set the API token: + + $ spectrum2_manager localhost set_oauth2_code API_TOKEN use_bot_token + +Use the real JID of your Spectrum 2 instance instead of `localhost`. Use the API token provided by the Slack instead of `API_TOKEN`. + +Once you do that, Spectrum 2 will contact the Slack team's primary owner with instructions how to configure it. + + diff --git a/documentation/index.md b/documentation/index.md index 8ada76e6..d6379fff 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -3,50 +3,22 @@ layout: page title: Spectrum 2 --- -#### About +## Documentation -* [What is Spectrum 2?](about.html) +