How to monetize services?

3 years ago by Alavi to c/selfhosted

Hi guys. how can I monetize my rustdesk servers? like, imagine I tell client X to pay 1$/month for using my server, how can I authenticate users? (prevent others from using the server so only people who are paying can use).

CONTEXT: I live in a country with very limited internet (like china) so using public servers is not good. I would also have to be able to maintain the costs of the server. so this is not illegal and not unethical.

macgregor 6 points 3 years ago

Not to sound like a wet blanket, but I think you'll find it hard to make enough money to cancel out your power bill, development and admin time compared to big box names like AWS, digital ocean, etc. It could also open you up to legal problems. If someone you don't know wants to pay you (someone with no reputation they shouldn't trust with their money and data) then you probably don't want the data they are trying to host any where near your servers (use your imagination...).

That said, if you're serious or want a learning exercise look for:

  • identity management/authentication - SSO or Oauth for an authentication layer. examples: Keycloak, Oauth proxy.
  • resource monitoring - Metrics, monitoring, logging. some of this is just for maintaining availability of your service but you may need metrics for usage billing or cutting off access if they go over allotments. Examples: ELK stack, Prometheus, grafana, Loki, datadog
  • API gateway - api rate limitingbased on identity, e.g. user Bob is only allowed to make 1000 API calls a month . Examples: 3scale.
  • domain specific resource access policies - this is where it gets tricky. Depending on what application you are offering as a service, there may be access/limitation policies built in you could use or generic external options. If not, you'll need to come up with a method on your own like an authorization proxy that intercepts requests and approves or denies based on identity and usage metrics. A decent API gateway solution should allow for this customization.

I am not aware of an out of the box solutions that solve all of these problems, but there are many solutions for specific parts of this hypothetical system which is what I tried to provide with some example tech names to start your search. It's not a simple problem, but it's one basically every internet company has solved on some level.

I think there are croud-source compute reselling services you can enroll your systems in but I'm blanking on names and again you'll be lucky to break even on power.

path: 0 613453, hotness: undefined, score: 6, children: 1
somegeek 1 point 3 years ago

thanks you. as for the data argument, rustdesk almost has no data, it's like a proxy between clients. I'll look into the cues you said. thank you.

path: 0 613453 681236, hotness: undefined, score: 1, children: 0
kn100 6 points 3 years ago

I wouldn't try selling services that are hosted on your residential internet connection. What happens when it goes down? Is your setup redundant? Etc.

path: 0 602515, hotness: undefined, score: 6, children: 1
somegeek 4 points 3 years ago

I didn't say they are on my residential internet.

path: 0 602515 602601, hotness: undefined, score: 4, children: 0
TheOneCurly 4 points 3 years ago

API keys are generally how this is done. You create an account system with billing and then allow account holders to generate API keys that must be included in every request. On your side you look up their account via the API key and check billing status before responding to the request.

If you don't have a lot of clients you could handle billing and key generation manually.

path: 0 603168, hotness: undefined, score: 4, children: 0
chiisana 3 points 3 years ago

If there is a way to handle auth, then you can maybe put it behind a SSO platform (Keycloak, fusionauth, authlia, etc) and slap a billing system (not familiar with open source solutions here, I used to use commercial solutions like Blesta and WHMCS) to activate/deactivate user accounts. You’d need to do a lot of the expropriation and heavy lifting yourself though.

path: 0 642566, hotness: undefined, score: 3, children: 2
somegeek 1 point 3 years ago

thanks! that seems great!

path: 0 642566 681178, hotness: undefined, score: 1, children: 0
somegeek 1 point 3 years ago
path: 0 642566 681168, hotness: undefined, score: 1, children: 0
XpeeN 2 points 3 years ago

I know nothing about how it works under the hood, but it sounds like you need to let a user register only when they pay, deactivate the account when they stopped and don't let users without account to use the server.

path: 0 610532, hotness: undefined, score: 2, children: 0
johntash 2 points 3 years ago

Assuming you have more than a handful clients, you'll probably want some sort of CRM/billing system to keep track of who's paid. And then you'll want a centralized IAM tool where you can provision new accounts or deactivate ones that stop paying.

That also depends on whether the underlying service supports some sort of sso/login federation.

You can also just do everything by hand for the beginning, until it takes up too much time.

path: 0 611750, hotness: undefined, score: 2, children: 1
somegeek 1 point 3 years ago

thanks. rustdesk doesn't have any authentication except for keys, which is generated for each server. someone suggested that I could spin up a server and key for each client.

path: 0 611750 681265, hotness: undefined, score: 1, children: 0
manitcor 2 points 3 years ago

im using keycloak but that may be overkill for you.

path: 0 603240, hotness: undefined, score: 2, children: 1
somegeek 2 points 3 years ago

thank you. I will look into it

path: 0 603240 681271, hotness: undefined, score: 2, children: 0
SwingingKoala 2 points 3 years ago
path: 0 604609, hotness: undefined, score: 2, children: 1
somegeek 1 point 3 years ago

rustdesk server has no authentication

path: 0 604609 681278, hotness: undefined, score: 1, children: 0
theacta 1 point 3 years ago

i liked the idea behind it and also liked its implementation but it starts to become rather boring after some days or months of its use

path: 0 602680, hotness: undefined, score: 1, children: 0
erev 1 point 3 years ago

You'd need to set up authentication and some way to take payment. The when the user pays, store data on if/when the user paid and when that expires/renews. Next, when the user authenticates, verify they've paid or have access, and go from there.

path: 0 602501, hotness: undefined, score: 1, children: 0
selfhosted
selfhosted

@lemmy.world

login for more options
63078
6830
6313

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

go to feed...