Package: whost
Cardshop Writer HostCardshop use writer hosts to download, write and ship SD-cards to recipient.
A WriterHost is an always-running, always-connected computer connected to one or more USB SD-card readers (physical device).Writer Hosts authenticate with the cardshop to fetch tasks. The WriterHost operator is contacted (email) when an SD-card must be inserted, retrieved and shipped.Requirementsalways-on-capable computer500GB storage or more.high-speed, direct, permanent connection to internet via ethernet.one or more good-quality USB SD-card readers (Kingston MobileLite G4)Awriteraccount on the cardshop.An assigned port on the demo server (seemaintenance).Ubuntu InstallJust a regular, fresh Ubuntu-server install. Bellow are thedefaults used for tests(you can customize them).Boot off the install media & selectInstall Ubuntu Serverat grub prompt.Select language (English)Select Keyboard layout (English (US),English (US))SelectInstall Ubuntu(not cloud instance)Configure the network (eth via dhcp)Proxy Address: noneMirror Address:http://archive.ubuntu.com/ubuntu(pre-filled default)Use an entire DiskChoose disk to install to:selected diskSummary: confirm and continueProfilename: whatever (ex:maint)server name: whatever (ex:bkored)username: whatever (ex:maint_user)password: whatever (ex:maint_pwd)Reboot nowRemove install media thenENTERSetup softwarelog-in and elevate asroot(sudo su -)set a password forroot(passwd)Make sure internet is workingConfigure SSH tunneling for remote accessGenerate SSH key pair forrootusingssh-keygen(no passphrase)Copy/root/.ssh/id_rsato/root/.ssh/tunnelShare (via email for example) public key with cardshop admin (it's located at/root/.ssh/id_rsa.pub).This file will be appened to/home/tunnel/.ssh/authorized_keyson the the tunneling server gateway by the cardshop admin, so the writer can connect.Download setup scriptcurl -L -o /tmp/whost-setup https://raw.githubusercontent.com/kiwix/cardshop/master/whost/whost-setupGo tohttps://wiki.kiwix.org/wiki/Cardshop/maintenance, pick a port for your host and update the writers tablerun the setup scriptchmod +x /tmp/whost-setup && REVERSE_SSH_PORT=XXX /tmp/whost-setup.Configure the writerThe writer is configured through a command-line tool that is launched automatically when logging-in asroot(not viasu).HotsportCardshopwriter-hostconfigurator
-------------------------------------------

::InternetConnectivity:CONNECTED
::Authentication:AUTHENTICATED
::HostStatus:ENABLED
::ConfiguredWriters:2::Choose:1ConfigureNetwork2ConfigureCredentials3ConfigureUSBWriters4Updatecodeandrestart5DisablethisHost6Exittoashell7Exit(logout)>You can launch it on any console viawhost-config.Initially, use theUpdate code and Restartoption to make sure you get all the fixes.First, make sureInternet ConnectivityshowsCONNECTED. If not, you should configure it externally or using theConfigure Networkhelper (only Ethernet).Second, configureAuthenticationusingConfigure Credentials. Enter your Scheduler's username and password (should be of thewriterrole) and press enter when asked for the API URL (default should be OK).Then,Configure USB Writers. For this, you'll need yourKingston mobilite G4USB readers. Kingston readers are seen as block devices (in/dev/sd_) when plugged, even when no card are inserted.WARNING: theUSB Writersconfiguration does not accept devices being removed or reinserted while the computer is running. If you accidentaly disconnect one of the reader, reconnect it and restart.For the initial configuration, shutdown the computer, plug the USB devices and then start the computer to proceed to the Configuration.>3::Alreadyconfiguredwriterdevices*A:/dev/sdc(Generic-USB3.0CRW-SDat2:0:0:1)*B:/dev/sde(Generic-USB3.0CRW-SDat3:0:0:1)::Choose:1Resetwritersconfig(removeALL)2Addonedevice3CANCEL
>To configure devices, follow on-screen's instructions: remove SD-cards from all ports then, when asked, enter any card into the desired device. The configurator will detect the card, its reader and assign aSlot Nameto it (a letter). You can now remove the SD-card and proceed to configure another device or exit.When your host picks up writing jobs, it will (once download is complete) ask you to insert a certain capacity SD-card intoSlot Xwhere slot is the assigned Slot Name. Make sure you label your physical slots on your readers with their assigned names. If you don't unplug the readers, those names won't change.Note: The recommended Kingston readers are actually 2 independent readers with different slots (1 x microSD and 1 x SD). You can choose to configure both of just the one you prefer but keep in mind that those are not interchangeable.Finally, you canEnable this host. This will trigger the launch (and automatic launch upon startup) of your downloader container and one writer container per configured USB reader.--You can check that your host is properly configured by:Exiting to shell and runningdocker psanddocker logs.Check theSchedulerpage on the Manager UI.Ask the cardshop admin to connect using the reverse SSH bridge (ssh -i /root/whost-maint.priv root@localhost -p 2111)