GithubHelp home page GithubHelp logo

mycroftai / personal-backend Goto Github PK

View Code? Open in Web Editor NEW
114.0 24.0 32.0 39.06 MB

WORK IN PROGRESS: A Flask personal backend alternative for running your own version of https://home.mycroft.ai

License: Apache License 2.0

Python 100.00%

personal-backend's Issues

SLL handshake error?

If I start mycroft pointed at the local server, I get a TLS error:

./start-mycroft.sh debug
Already up to date.
Starting all mycroft-core services
Initializing...
Starting cli
12:27:59.603 - mycroft.api:is_paired:514 - WARNING - Could not get device info: SSLError(MaxRetryError('HTTPSConnectionPool(host=\'0.0.0.0\', port=6712): Max retries exceeded with url: /v0.1/device/ (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')])")))'))

It seems Mycroft doesn't like self-signed certificates? How can that be changed?

make python package executable

entry points should be added to setup.py to start backend and frontend from command line

in current state package needs to be imported and executed as shown in examples folder

pip package

what should be done about the pip package

i think it no longer makes sense for me to be the maintainer of it, it is currently under my account

start_backend.py not work

I'm trying to run the bakend but i get this response:

~/Documentos/Proyectos/api$ python3.6 examples/start_backend.py
Traceback (most recent call last):
  File "examples/start_backend.py", line 5, in <module>
    start_backend()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/__init__.py", line 70, in start_backend
    app = create_app()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/__init__.py", line 41, in create_app
    from personal_mycroft_backend.backend.stt import get_stt_routes
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/stt.py", line 25, in <module>
    engine = STTFactory.create()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/__init__.py", line 228, in create
    return clazz()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/__init__.py", line 74, in __init__
    super(GoogleSTT, self).__init__()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/__init__.py", line 42, in __init__
    super(TokenSTT, self).__init__()
  File "/home/andres/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/__init__.py", line 30, in __init__
    self.credential = self.config.get("credential", {})
AttributeError: 'NoneType' object has no attribute 'get'

Someone can help me with that?

localhost geolocation fails

when running on same machine (localhost) geolocation will produce incomplete dict, country code will be missing and there are extra unexpected arguments further down the line

Dockerize Software

Hey I was wondering if there were plans to dockerize the components required to run this backend? Thanks!

START

How can i start this backed?

sql session badly handled

sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id -1249903808 and this is thread id -1262486720 [SQL: 'SELECT devices.uuid AS devices_uuid, devices.created_at AS devices_created_at, devices.description AS devices_description, devices.name AS devices_name, devices.last_seen AS devices_last_seen, devices.expires_at AS devices_expires_at, devices."accessToken" AS "devices_accessToken", devices."refreshToken" AS "devices_refreshToken", devices.paired AS devices_paired, devices.subscription AS devices_subscription, devices.arch AS devices_arch, devices.user_id AS devices_user_id \nFROM devices \nWHERE devices.uuid = ?\n LIMIT ? OFFSET ?'] [parameters: [{}]] (Background on this error at: http://sqlalche.me/e/f405)

Login failures

When using the login form at the upper right and submitting valid credentials, I get the following in the log for the frontend:

[2019-01-24 22:03:22,098] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/olympus/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/olympus/personal-backend/personal_mycroft_backend/backend/decorators.py", line 14, in decorated_function
    resp = make_response(f(*args, **kwargs))
  File "/home/olympus/personal-backend/personal_mycroft_backend/backend/decorators.py", line 14, in decorated_function
    resp = make_response(f(*args, **kwargs))
  File "/home/olympus/personal-backend/personal_mycroft_backend/frontend/main.py", line 29, in login
    if utils.credentials_valid(username, password):
  File "/home/olympus/personal-backend/personal_mycroft_backend/frontend/utils.py", line 88, in credentials_valid
    return bcrypt.checkpw(password.encode('utf8'), user.password.encode('utf8'))
AttributeError: 'bytes' object has no attribute 'encode'
192.168.1.1 - - [24/Jan/2019 22:03:15] "POST / HTTP/1.1" 500 -

When submitting bogus credentials, it returns a 200 in the logs and no error on the browser side.

Anyone else seeing this?

Cannot start backend

Howdy, I am unable to launch the back end in python 2 or 3.

I have attempted using the specified "personal_backend.conf" and the auto created version, with the same error:

robot@robot-AI:~/personal-backend/examples$ python3 start_backend.py
Traceback (most recent call last):
File "start_backend.py", line 5, in
start_backend()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/init.py", line 70, in start_backend
app = create_app()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/init.py", line 41, in create_app
from personal_mycroft_backend.backend.stt import get_stt_routes
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/backend/stt.py", line 25, in
engine = STTFactory.create()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/init.py", line 228, in create
return clazz()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/init.py", line 74, in init
super(GoogleSTT, self).init()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/init.py", line 42, in init
super(TokenSTT, self).init()
File "/home/robot/.local/lib/python3.6/site-packages/personal_mycroft_backend/stt/init.py", line 30, in init
self.credential = self.config.get("credential", {})
AttributeError: 'NoneType' object has no attribute 'get'

Privacy improvements

The current code could be more privacy friendly. Issues:

  • A connection is made to https://ipapi.co/json/ in backend utils. Solution: assume a country code. Not the end of the world?
  • The HTML that flask generates tries to download bulma and font_awesome from a CDN. Solution: store these files locally.

New account creation requires email

Thinking this would be handled better via a local config or utility.
Might be useful to create a 1st run script that does a bit of this (cert setup, admin account creation) perhaps.

Use more normal pathing?

Software configs for linux tend to go into /etc. Mycroft itself already looks into /etc/mycroft/ for local configs. Mycroft is also using /opt/mycroft. Instead of hiding things in .mycroft, why not use one of those two?

Debian packages required

For installation on a RPi3 with Debian (Stretch or Jessie) I had to add some packages before installation completed successfully:
sudo apt-get install python-dev python3-dev libffi-dev libssl-dev

Client cannot connect to the server

Hi I have changed all settings and disabled SSL (for client - conf http instead of https, and for backend server conf ssl from true to false).
Client cannot connect to the server. Server log:
127.0.0.1 - - [16/Jan/2019 21:04:14] "GET /v0.1/device/ HTTP/1.1" 404 -
127.0.0.1 - - [16/Jan/2019 21:04:19] "GET /v0.1/device//subscription HTTP/1.1" 404 -
127.0.0.1 - - [16/Jan/2019 21:04:20] "GET /v0.1/device/ HTTP/1.1" 404 -
...
127.0.0.1 - - [16/Jan/2019 21:10:14] "GET /v0.1/device//setting HTTP/1.1" 404 -
127.0.0.1 - - [16/Jan/2019 21:10:14] "GET /v0.1/device/ HTTP/1.1" 404 -

secret key and salt

Hi,
Decided to have go getting this running, however I can't workout
where secret key and salt are coming from

I've had a look in some of the files and still can't work it out

I could use some guidance
Best Regards
dragonsKnight5

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.