Code Monkey home page Code Monkey logo

upagekite's People

Contributors

bjarnirunar avatar pagekite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vtt-info

upagekite's Issues

Add to pip and upip

People should be able to pip install upagekite

And upip as well, if that's feasible.

Deprecate/remove the static/folder/foo.py code path

I should remove the old "exec()" based code execution path (webroot/path/index.py etc.).

The microframework pattern is easier to read and more in line with developer expectations, keeping (and documenting) both doesn't feel justified. The RAM savings don't really justify the complexity, and if history has taught us anything RAM availability is only going to increase.

Change licenses

The current license, LGPL, isn't suitable for some embedded projects.

The license probably needs to change.

Need more debug info

When upagekite decides not to connect to anything, it's unclear from the debug output why. We need to be more verbose about what decisions are being made and various error states.

httpd: Accept and parse incoming POST or PUT

The current HTTPD cannot handle large requests, it only parses the HTTP headers, and only if those all fit in a single PageKite frame.

A state machine which handles requests spread over multiple frames and parses common POST request formats would be a really nice thing to have.

Ensure http_get closes sockets on error

From a user:

The ESP32 only can have 10 sockets opened at the same time. Sometimes, our code, was not able to open the UDP
socket, so this meant that someone was opening sockets without closing them correctly.

The problem is in the function http_get: When internet is not available(but Wi-Fi is available. Only local connection) or
when the connection fails, the socket remains opened.(you didn't close it). After 10 attempts, the board has 10 sockets opened,
and everything is not working.

httpd: Make webserver also listen on a local socket

Currently the httpd can only process requests that arrive over the pagekite tunnel.

We should make the httpd also listen on a normal socket, so upagekite.httpd can also be used for captive portals and initial setup (before we have WiFi credentials and internet access).

upagekite: Relay selection code does not work

The ESP32's DNS resolver only ever returns one IP address for a given query. This means the connector cannot look up the entire pool of available relays, and cannot make performance-base choices.

The quickest way to solve this will probably be to add a helper to pagekite.py on the server (relay) side, to perform lookups on the device's behalf. This needs more work.

upagekite/web: Add web security code

The micro-framework needs to support basic web security features by default.

A few ideas:

  • A method which requires HTTP Basic auth (username/password)
  • An option on the above method to allow unauthenticated access from the LAN
  • Easy-to-use CSRF in forms and the form parsing code
  • Review what kind of CORS headers should be included by default
  • Use default Referrer-policy to not leak domains/URLs to outside
  • Set cache-control defaults to "private" only

Change documentation strategy

The documentation focus here isn't great - too much about how to bootstrap and set up a "my way" dev environment, not enough about how to use the lib itself.

I should remove most of the content from the README and move it to a separate tutorial in the upagekite-tutorial project. At some point, adding dry reference-style docs here might make sense, but the focus will be on the tutorial to begin with, since it is also informing the current development work (when writing tutorials feels clunky, that's a sign the lib needs work).

Complete migration to asyncio

The current asyncio compatibility is incomplete; most socket operations happen on raw sockets and upagekite interleaves its own poll()-based event loop with that of asyncio.

This is useful because it facilitates the current, simple API for developing dynamic web apps.

But it's also inefficient and introduces some lag/jitter which it would be nice to eliminate or minimize.

upagekite: Proxy to external server

The current code can only hand requests to built-in servers running in the same process (a basic HTTPD is included). Like PageKite on other platforms, we should also support proxying requests to an external server for people with other needs.

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.