Commit graph

18 commits

Author SHA1 Message Date
Gina Häußge
261f6709a3 Depend on Flask-Assets 0.10
Compatibility adjustments and version pinning
2015-06-03 19:36:38 +02:00
Gina Häußge
b63f842210 Webassets are now written to ~/.octoprint/generated
Same holds true for cache files, so there should be no problem anymore with installs where the static folder is not writable.

Also introduced two new devel config vars to disable merging and minifying of the assets, solved the empty-less-bundle problem and made sure babel knows about the jinja extension.
2015-06-03 18:27:30 +02:00
Gina Häußge
157b78a052 WIP: Use Flask-Assets to merge js, css and less files
Should reduce number of requests and hence load times needed for loading web interface.

TODO: Handling of empty bundles needs to be fixed
2015-06-03 16:42:57 +02:00
Gina Häußge
d2bca10ac9 Slight refactoring of API key evaluation in restricted_access decorator
Actual test whether key is provided or not happens in before_request handler of flask app, hence the more granular processing in the decorator was unecessary since around november '14. Adjusted to only do the actual processing necessary to replicate login_required behaviour/login users if necessary.

Closes #516 (actually, that was solved since introduction of the before_request handler which took that work off the hands of the decorator, but now it's properly documented too)
2015-06-03 11:55:32 +02:00
Gina Häußge
fb85b228f0 Merge branch 'dev/translationsAsPackages' of github.com:foosel/OctoPrint into dev/translationsAsPackages
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
2015-06-02 13:46:10 +02:00
Gina Häußge
7f8a3849c7 Adjusted messages.js compilation, debugged new i18n handling and added logging 2015-06-02 13:31:41 +02:00
Gina Häußge
449dd4301e Allow translations to be stored in ~/.octoprint
That is the first step towards downloadable (and separately managed) translation packages, decoupled from the software's release cycle and source control. Since it will be impossible to properly maintain all languages concurrently with OctoPrint's releases, decoupling that will hopefully increase the user experience through preventing broken translations (or stalling releases due to having to wait for the translations to be updated).
2015-05-29 19:44:11 +02:00
Gina Häußge
739a185d1b Logging for flask view caching 2015-05-12 12:22:10 +02:00
Gina Häußge
9f54985ce5 Also support client side translations for plugins 2015-05-12 11:58:48 +02:00
Gina Häußge
b908ff5821 Enhanced flask-babel to also allow plugins to provide translated strings
This way plugins can maintain their own translations of their UIs. Some monkey patching was necessary, not the cleanest solution but it should work.
2015-05-11 18:44:30 +02:00
Gina Häußge
3f14fdb51b Allow disabling the cache during development
Set "devel > cache > enabled" to false in config.yaml to disable the cache. Defaults to true.
2015-04-22 09:45:25 +02:00
Mark Walker
e8f61e2dda Fix server error 500 when user is logged out
f98ebaaf moved the passive_logon code to a new function from
api/__init__.py to util/flask.py.  Before that move any fallthrough
would hit return NO_CONTENT, but now it returns nothing which makes
flask complain.
2015-04-15 17:17:19 -07:00
Gina Häußge
f98ebaafee WIP on introducing user settings (incl. interface language) 2015-03-18 11:30:08 +01:00
Gina Häußge
0a92b340ac Refactoring in octoprint.util
* Renamed a couple of camelCased methods to snake_case
  * Moved to better location what didn't make sense in the common util module
2015-02-27 10:28:16 +01:00
Gina Häußge
250d71b580 Added server side caching of main page
Index page will now be cached for up to five minutes, unless the
request contains "_refresh" in the query or the Cache-Control header
contains no-cache
2015-01-29 16:37:20 +01:00
Gina Häußge
e9beffc799 Properly recognize app session keys everywhere. Also fixed a bug where the ApiUser was not properly provisioned with his roles. 2014-11-14 17:58:42 +01:00
Gina Häußge
468e4b6d55 Support for a new type of API key
In order to solve the initial handshake problem with apps, OctoPrint now supports so called app session keys which are basically API keys with a limited validity. Obtaining those keys is based on a handshake procedure backed by RSA signatures. OctoPrint needs to be aware of apps and their associated public keys (with the AppPlugin there exists a mechanism to add additional recognized apps by installing a plugin). Apps perform the handshake by first requesting a temporary key with very limited validity, then sending a message back to OctoPrint containing their id, version, the temporary key and a signature created with their private key over these three pieces of data. OctoPrint then tries to verify the signature and if successful unlocks the key to be used as a fully recognized API key.
2014-11-14 14:30:25 +01:00
Gina Häußge
b4af85f405 Finalizing upload streaming support
Major refactoring of octoprint.server.util (divided into smaller submodules), extended Tornado to allow for request-specific max content lengths, introduced settings parameters to configure maximum upload size, maximum request body size and file suffixes

See #455
2014-08-05 11:26:13 +02:00