Skip to content
Snippets Groups Projects
Unverified Commit 2c36ac91 authored by Shamil K Muhammed's avatar Shamil K Muhammed
Browse files

Update documentation

parent e42cc814
Branches
Tags
No related merge requests found
...@@ -6,11 +6,16 @@ A diaspora authenticator for matrix synapse. ...@@ -6,11 +6,16 @@ A diaspora authenticator for matrix synapse.
Installation Installation
------------ ------------
This package is not submitted to pypi yet, so you would have to make do This package is easy to install from pypi:
with the repo.
Just run this command to install: Just run this command to install:
.. code:: bash
pip install synapse-diaspora-auth
Alternatively, to install from git:
.. code:: bash .. code:: bash
pip install git+https://git.fosscommunity.in/necessary129/synapse-diaspora-auth.git pip install git+https://git.fosscommunity.in/necessary129/synapse-diaspora-auth.git
...@@ -28,33 +33,62 @@ should look like this: ...@@ -28,33 +33,62 @@ should look like this:
config: config:
pepper: <pepper> pepper: <pepper>
database: database:
name: "diaspora_production" engine: <db engine>
name: "<database>"
username: <db_user> username: <db_user>
password: <db_password> password: <db_password>
host: "127.0.0.1" host: "127.0.0.1"
port: 5432 port: <port>
You should get ``pepper`` from ``<DIASPORA_HOME>/database.yaml`` or from You should get ``pepper`` from ``<DIASPORA_HOME>/database.yaml`` or from
``<DIASPORA_HOME>/initializers/devise.rb`` as ``config.pepper``. ``<DIASPORA_HOME>/initializers/devise.rb`` as ``config.pepper``.
the engine should either be ``mysql`` or ``postgres``
The port is usually ``5432`` for PostgreSQL and ``3306`` for MariaDB/MySQL
Database Database
~~~~~~~~ ~~~~~~~~
synapse-diaspora-auth currently supports MySQL and PostgreSQL as the database engines.
PostgreSQL
^^^^^^^^^^
It is recommended to create a seperate user for synapse in the postgres It is recommended to create a seperate user for synapse in the postgres
database, with read-only access to ``diaspora_production``. database, with read-only access to ``<database>``.
To do that, first login to postgres as the root user: To do that, first login to postgres as the root user:
.. code:: bash .. code:: bash
sudo -u postgres psql diaspora_production sudo -u postgres psql <database>
then, run these commands: then, run these commands:
.. code:: sql .. code:: sql
CREATE user <db_user> WITH password '<db_password>'; CREATE user <db_user> WITH password '<db_password>';
GRANT CONNECT ON DATABASE diaspora_production TO <db_user>; GRANT CONNECT ON DATABASE <database> TO <db_user>;
GRANT SELECT ON users TO <db_user>; GRANT SELECT ON users TO <db_user>;
MySQL
^^^^^
The commands are almost the same in MySQL:
login to MySQL as root:
.. code:: bash
sudo mysql -u root
Then run these queries:
.. code:: sql
CREATE user '<db_user>'@'localhost' WITH password '<db_password>';
GRANT SELECT ON <database>.users TO '<db_user>'@'localhost';
And you will be good to go! And you will be good to go!
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment