yi2020 / chromebooks-in-deutschland

Chromebooks in Deutschland Website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chromebooks in Deutschland

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.

Development

  • 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 from backup.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

  • Agents need keys in the database under /keys, emulator creates dummy key for local testing

  • Agent can be run like this with a binary:

    #!/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

    Or like this from source:

    #!/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
  • Lambda function can be tested locally via SAM, pip install aws-sam-cli in a venv

  • Lambda deployment is via terragrunt and needs terraform and sops

About

Chromebooks in Deutschland Website

License:Creative Commons Attribution Share Alike 4.0 International


Languages

Language:JavaScript 73.3%Language:HTML 14.8%Language:HCL 5.3%Language:CSS 4.8%Language:Shell 1.3%Language:Dockerfile 0.5%