Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-Support: Allow linking with Lemmy/Pictrs DB #50

Open
tgxn opened this issue Oct 11, 2023 · 2 comments
Open

Docker-Support: Allow linking with Lemmy/Pictrs DB #50

tgxn opened this issue Oct 11, 2023 · 2 comments
Labels
Milestone

Comments

@tgxn
Copy link
Owner

tgxn commented Oct 11, 2023

We could run a small backed express instance alongside the frontend within the docker container build that:

This would require a few things, not a small task at all. Creating an API means We'd need to document it, support it (don't need to worry about backwards compat since only the packaged frontend will be able to use it)

Backend changes:

  • Change the Dockerfile to use express with some static middleware for the frontend.
  • Create a new basic express (or similar) server that has drivers for postgresql, pictrs? (is this a volume that we can mount?) etc
  • Expose this api at /api/v1

Frontend changes:

  • Detect if API is exposed or use build param in github action
  • Create modules fo things:
    • Viewing Pictrs Images and their links to Lemmy content (ability to delete unlinked images/view IP's? that ccreated them)
    • Viewing more user data? Does the Lemmy DB have user IPs, or something else we can use to detect spam accounts?
    • View other cool stats/data? Reports?

Unknowns:

  • Auth? Can we just use the same token mechanism that Lemmy uses? Should we add something more...
@tgxn
Copy link
Owner Author

tgxn commented Oct 31, 2023

I have some thoughts about the risk and possible performance issue if you would directly hook into the database of an lemmy instance. Could be a security risk if wrongly implemented. Or just a performance bottleneck.

I would see a possibility in #60 to make this possible. For example that it could use its own source, like a pre cached database, static file that gets updated or just direct access. They can choose directly who has access to that data.

And the responsibility goes further away from you of dealing with spam, authorisation and so on.

Originally posted by @Pdzly in #59 (comment)

Was thinking of running queries to get data on a schedule too might help with this.

Also I was considering other ways to share the local-user-data, like p2p or integration with google drive or something

@tgxn tgxn added the backend label Oct 31, 2023
@Pdzly
Copy link
Collaborator

Pdzly commented Oct 31, 2023

I would really not touch anything with google drive + user data. As some instances privacy policy or in general the countries privacy laws could be difficult. I would just cache those or let #60 cache it.

@tgxn tgxn added this to the backend milestone Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants