Sources for the website https://chromebooks-in-deutschland.de/
Please freel free to submit pull requests for features and bugfixes, they will be greatly appreciated.
- For Owners Setup credentials to run
firebase functions:shell
(and remember to remove the credentials). Otherwise everything should work without credentials using the emulator. - Use
yarn start
to start local development web server for frontend development with all Firebase emulators active. Can load full database dump frombackup.json
(create by downloading/api/data
from production), will generate random prices otherwise. - Device data is now static JSON, only dynamic data is in database
- Integromat used for email notifications for Cloud Build results based on Push Subscription to web hook from
cloud-build
Pub/Sub topic. - https://iconify.design/docs/icon-bundles/ explains about local icon bundles
- Lambda function can be tested locally via SAM,
pip install aws-sam-cli
in avenv
- Lambda deployment is via terragrunt and needs terraform and [sops](https://github.com/mozilla/sops
- Agents need keys in the database under
/keys
, emulator uses dummy key for local testing - Optimum agent run interval seems to be 7 minutes
Agent (download pecompiled binary from Releases) can be run with a script like this from a CRON job:
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")"
export CID_API_KEY=THE_SECRET_KEY
export CID_API_URL=https://DOMAIN_NAME/api
bins=( updateprice*linux* )
bin=${bins[-1]}
result="$(./$bin)"
if ! grep -q "OK: 1" <<<"$result" ; then
echo "$result"
exit 1
fi
(Make sure that the pattern matches the binaries that you use!)
Agent (from a source checkout checkout out to ./chromebooks-in-deutschland
) can be run with a script like this:
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")"
export CID_API_KEY=THE_SECRET_KEY
export CID_API_URL=https://DOMAIN_NAME/api
cd chromebooks-in-deutschland/functions
result="$(node updateprice.js)"
if ! grep -q "OK: 1" <<<"$result" ; then
echo "$result"
exit 1
fi
The agent can be also run as a Docker container. On Debian/Ubuntu simply install the chromebooks-in-deutschland-service
Debian package from the Releases. Make sure to create the configuration file /etc/chromebooks-in-deutschland.env
. It has to set the API key like this:
CID_API_KEY=some-api-key-uuid
This works on ARM (32/64bit) and X86_64. If you have curl
and jq
installed then you can get the URL for the latest DEB package like this:
curl -s https://api.github.com/repos/schlomo/chromebooks-in-deutschland/releases | jq -r '.[0].assets | .[] | select(.content_type == "application/x-debian-package").browser_download_url'
- On Raspberry Pi 1 consider modifying the unit to have a longer timeout, e.g. 600 seconds, to accomodate longer startup and image pull times.
- On ODROID C1+ I had to use host networking to get Docker to work on the old 3.10 kernel.
- If running on SD cards and having enough RAM, consider mounting
/var/lib/docker
ontmpfs
to reduce the load on the SD card.
Chromebooks are described in YAML files under chromebooks. We use one file per Chromebook model (to easily remove old data). The files must be sorted alphabetically (use a YAML sort tool for that). The filename reflects the Chromebook model name without the vendor as defined by the expiration data.
For datasheet we try to link to the vendors original documentation. Sources for that are:
- https://psref.lenovo.com/ - put the full variant code (including GE at the end) into the search box
- https://pcb.inc.hp.com/webapp/ - select the Germany catalog and search for the variant, sometimes the devices are listed only under their HP model code which must be "guessed" from other sources.
- A web search for "data sheet VARIANT pdf" or "tech spec VARIANT pdf" can also lead to useful spec sheets
Pull requests with more devices are most welcome!