Code Monkey home page Code Monkey logo

havid-19's Introduction

Please โญ this repo if you find it useful


PayPal

Havid-19

Havid-19 is a Flask and selenium powerd, easy to use docker container built for signing Covid-19 digital health statement.

Credits:

=======

  • Adam Russak for working with me on this project and writing the selenium part

Usage

docker-compose from hub

version: "3.7"

services:
  havid-19:
    image: techblog/havid-19
    container_name: havid-19
    restart: always
    labels:
      - "com.ouroboros.enable=true"
    environment:
      - USER_ID= #parents.education.gov.il portal user
      - USER_KEY= #parents.education.gov.il portal password
   ports:
      - "6700:6700"

Replace API_KEY with your bot token. if you do not have existing bot you can create one using the instruction in this article: Bots: An introduction for developers

In order to secure the bot and block unwanted calls from Unauthorized users add your allowd Id's with comma separated values into ALLOWED_IDS environmet. in order to get your id use @myidbot in telegram and send the /getid command. the result will be your ID:

Home Assistant Integration

In order to sign the statement, open your browser and nevigate to your container ip address with port 6700: http://Server_Ip_Address:6070/sign. The signing process takes about 8-10 seconds and in the ens you'll get a success message.

In oreder to get the image with the signing details nevigate to your container ip address with port 6700: http://Server_Ip_Address:6070/statement.

Donation


If you find this project helpful, you can give me a cup of coffee :)

paypal

havid-19's People

Contributors

dimagoltsman avatar dmatik avatar t0mer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

havid-19's Issues

webtop does not work

your documentation is not up to date
I have tested the webtop and it does not sign
they might have changed things

Using edu credentials from environment doesn't work

Hi,
In your tutorial, you state that environment variables can be set instead of the config.yaml file:
image

But it doesn't seem to work:

curl x.x.x.x:6700/edu/sign
"{\"signed\":\"0\",\"data\":\"Edu is not configured\"}"

This is a feature I really need since I want to use this image in AWS ECS on Fargate without mounting volumes from a host machine.

I get error

I try to sign the health statements and I get error.

2021-02-15 14:08:07.724 | INFO     | __main__:ReadConfig:28 - Reading Configuration
2021-02-15 14:08:07.732 | INFO     | __main__:sign_edu:43 - Starting Sign process at https://parents.education.gov.i
2021-02-15 14:08:07.883 | INFO     | Health_Statements:sign:18 - Starting process
2021-02-15 14:08:07.883 | DEBUG    | Health_Statements:sign:19 - -----------------------0000000000-----------------------------------------------
2021-02-15 14:08:07.884 | DEBUG    | Health_Statements:sign:20 - /opt/dockerbot/images/edu_approval.png
2021-02-15 14:08:20.496 | INFO     | helpers:fullpage_screenshot:58 - <selenium.webdriver.chrome.webdriver.WebDriver (session="6caac25ce786561ac74aa4ffff28f315")>
2021-02-15 14:08:22.816 | DEBUG    | helpers:log_browser:76 - Opened page. Url: https://parents.education.gov.il/prhnet/gov-education/corona/daily-health-statement, size: 251772
2021-02-15 14:08:22.844 | INFO     | Health_Statements:sign:78 - #################################################################################################
2021-02-15 14:08:22.845 | ERROR    | Health_Statements:sign:79 - Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="main-content"]/section[1]/div/health-declaration/div/div[1]/div[4]/div/div/div/input"}
  (Session info: headless chrome=86.0.4240.183)

Maybe the site is changed?

continues 404 in logs

docker-compose up

Recreating botvid-19 ... done
Attaching to botvid-19
botvid-19    | 2020-09-13 08:36:09.855 | INFO     | __main__:<module>:49 - I am listening...
botvid-19    | Traceback (most recent call last):
botvid-19    |   File "/usr/local/lib/python3.8/site-packages/telepot/loop.py", line 58, in run_forever
botvid-19    |     result = self._bot.getUpdates(offset=offset,
botvid-19    |   File "/usr/local/lib/python3.8/site-packages/telepot/__init__.py", line 1000, in getUpdates
botvid-19    |     return self._api_request('getUpdates', _rectify(p))
botvid-19    |   File "/usr/local/lib/python3.8/site-packages/telepot/__init__.py", line 491, in _api_request
botvid-19    |     return api.request((self._token, method, params, files), **kwargs)
botvid-19    |   File "/usr/local/lib/python3.8/site-packages/telepot/api.py", line 155, in request
botvid-19    |     return _parse(r)
botvid-19    |   File "/usr/local/lib/python3.8/site-packages/telepot/api.py", line 150, in _parse
botvid-19    |     raise exception.TelegramError(description, error_code, data)
botvid-19    | telepot.exception.TelegramError: ('Not Found', 404, {'ok': False, 'error_code': 404, 'description': 'Not Found'})

this continues in a loop, and the service is not starting.

my docker-compose file is

version: "3.7"
services:
 
  botvid-19:
    image: techblog/botvid-19
    container_name: botvid-19
    restart: always
    labels:
      - "com.ouroboros.enable=true"
    environment:
      - USER_ID=<>
      - USER_KEY=<>
    ports:
      - "6700:6700"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.