pipalacademy / self-hosting-101

MIT License
1 stars 0 forks source link

Onboarding flow for self-hosting-agent #5

Open anandology opened 2 years ago

anandology commented 2 years ago

When a new user starts with a new digital ocean droplet, the following are the steps that she need to do to get started with the learning journey.

Step 1: install agent

$ curl https://self-hosting-101.pipal.in/install.sh | sudo bash -

Step 2: run setup

$ self-hosting-agent connect
Passcode: xxxx

Option 1: Enter-email/username etc.

Option 2: Please open the following URL in your browser to connect this node with your account.

https://self-hosting-101.pipal.in/connect/abcd12345678

??
nikochiko commented 2 years ago

Authentication is implemented.

With the /connect endpoint, I think this would be the simplest solution:

Send IP address with /connect/{ip_address}, maybe after encoding it as base64. Then server will store this as a session cookie until user authenticates when it can be retrieved and stored in the table.

I considered passcode authentication, but there would have to be multiple HTTP requests (before to store the IP-address, and link it with the passcode), and then for authentication. I feel the sending IP address in the URL would be the simplest solution.

We should also have a self-hosting-agent check to see if the URL is connected. It should return an output like:

This node is connected to 'nikochiko'.