Api with diaspora

Hi there!
I currently run a diaspora pod and I would like to add a ttrss website that would use the same postgresql database so that users of my pod would not have to create a new user to use that service. In fact I would like the new user creation to be disabled and only use what is already in the database.
I don’t want to mess with my production database to make tests so I’m looking for a knowledgeable person to help me with that.
I can give you btc in exchange :wink:

Thanks!

Hooking one system into another system’s database is not really a good idea. Likely that both systems have different methods of storing data, so will not be 100% compatible.

Doing this will also likely require modifications to TTRSS code, which means you wont be able to easily update it in the future.

(I’m no expert on this though).

If I were to do this, I would look at automating an import from one database into the other, with some intelligent scripting, I’m guessing SQL can do this in some way, if it is on the same server/instance. Otherwise you can always script an export, then manipulate the data, and then import.

Wont be that easy though, gotta take into account that accounts will already be there, so some smarts to make sure you don’t break things is probably a good idea.

As for disabling new user creation, I’m pretty sure you can’t create a user unless you are an admin account, so that isn’t really an option. Unless there is a sign up option at the login screen, not on mine, assume that is an extra option you need to enable so shouldn’t be an issue on a default install.

Thank you for your long and interesting answer.
What I thought is that I could use the API from ttrss to interact with the diaspora database.
But maybe then I would need to also wait until the API from diaspora is also available.
Yes both will be on the same server, that’s also why I wanted to have both work together.
I’ll keep digging into how I could make this work.

LDAP?

(I have never used LDAP with ttrss and I have never used Diaspora, but I thought I’d give you a pointer for research).

Ldap doesn’t have anything to do with it.

Well it kinda does, again I’m no expert, but TTRSS does have the option to change the Auth method.
Apache does support LDAP auth, as well as other methods for authentication.

Not sure how this ties into account creation though, I’ve always used the built in auth.

Actually looking at the config.php, it has notes about Auth methods creating accounts automatically.
So if you can create a plugin that makes TTRSS authentication pass through to the Diaspora database, then it should automatically work for anyone who logs in.

Looks simpler than I originally thought :slight_smile:

EDIT: actually responding to your previous answer: API requires something to query it, so you’d need to automate a way to read and push info into the TTRSS API and the same for Diaspora.
An automated script solution, outside of either may work. I do not know the Diaspora platforma at all, but if it has a built in script/automation of any kind, you could I guess have it call the TTRSS APIs to create an account there when one is created on Diaspora. (i think the other option above is better though)

Actually I was thinking more simple : as both ttrss and diaspora use the same kind of database, just give read only right to ttrss to the login and password field of diaspora and like that people will be able to authenticate and ttrss will be able to create the rest of the tables it needs.

What could go right⸮…

But how is TTRSS going to access that table without you making some changes to it? which then goes back to one of my original points, making changes to TTRSS means updating gets annoying, unless you are happy with maintaining a fork.

This is what plugins are for essentially, extending/changing TTRSS functionality without changing the core code.

TT-RSS authentication is plugable. If you want to check against some other database table then write a custom plugin. See the two auth_* plugins it ships with for examples.