ascoderu / lokole

Source code for the Lokole project. Lokole enables communities in the Congo DRC to pool resources to access efficient communication via email at an affordable price.
https://ascoderu.ca
Apache License 2.0
45 stars 12 forks source link

Make webapp setup not require ssh #352

Open c-w opened 7 years ago

c-w commented 7 years ago

What's this?

Currently to set up a new Lokole device, the user needs to: 1) Burn an operating system to an SD card 2) Mount the SD card in the Lokole device 3) Connect the device to a router via Ethernet 4) SSH into the device 5) Download and run the setup script

This is a fairly technical process so it takes a bit of knowledge to setup a new device. It would be great if we could remove the SSH step from this process, e.g. by creating a custom OS build for Lokole.

Imported from https://github.com/ascoderu/opwen-setup/issues/4

c-w commented 6 years ago

Possible useful tool: https://github.com/treehouses (base RaspberryPi image with remote control for setup)

sbathgate commented 5 years ago

I just came across this issue, is it still outstanding? Have you explored pi-gen? I have only taken a summary review, but it looks like it would do exactly what you are looking for. I am happy to explore the route and see if I can put together a solution.

The following is a link to the official GitHub repo: [https://github.com/RPi-Distro/pi-gen]. This website has a good walkthrough of the setup procedure: [http://kmdouglass.github.io/posts/create-a-custom-raspbian-image-with-pi-gen-part-1/]

c-w commented 5 years ago

To my understanding pi-gen is a tool to create a custom distribution, i.e., a Linux image that may already have some software we need pre-installed (e.g. supervisord, nginx, python3, etc.). This is very useful but only part of the story since we also need some dynamic content like the client registration. How do you recommend to handle this if we move to a pi-gen image?

c-w commented 5 years ago

Just brainstorming: one option could be to re-use the mechanism that Raspberry Pi uses to enable some optional features via optional text files (e.g. if /boot/ssh exists SSH is enabled)... after we burn the image, we place a file with the client name on a well known location and then on first boot a script can pick up that file and register the client.

I don't know much in this area so any help would be appreciated!