Commit Graph

3230 Commits

Author SHA1 Message Date
Fabio Manganiello 692180c653
Back to uvicorn workers from eventlet.
The eventlet API has way too many dependency issues with gunicorn.

Still TODO: Fix or at least mitigate the WSGI workers timeout issue when
they handle websocket connections.
2023-05-07 15:37:58 +02:00
Fabio Manganiello 8102178ba4
Updated dist files 2023-05-07 13:00:48 +02:00
Fabio Manganiello 29c0a11c37
Forced to use the gunicorn version on Github.
Reason: gunicorn maintainers no longer give a fuck about their project
and they aren't letting anybody take over either - see
https://github.com/benoitc/gunicorn/pull/2581

This is not how a FOSS project should be run. A project with 9k stars
and countless usages shouldn't end up in a situation where users beg for
two years for a new release that fixes a bad regression and a bad
security vulnerability. The way gunicorn is maintained and run is an
insult to the whole FOSS community.
2023-05-07 12:54:50 +02:00
Fabio Manganiello c0a948f8ce
Removed remaining references to websocket port. 2023-05-07 12:54:13 +02:00
Fabio Manganiello bdbbd24e6f
Only include /ws/events as a proxied websocket, without messing with the /ws route exposed by the Vue debugger 2023-05-07 12:22:51 +02:00
Fabio Manganiello 059fff8558
Updated dist files 2023-05-07 12:19:13 +02:00
Fabio Manganiello f9b0bc905e
Migrated websocket service.
The websocket service is no longer provided by a different service,
controlled by a different thread running on another port.

Instead, it's now exposed directly over Flask routes, using
WSGI+eventlet+simple_websocket.

Also, the SSL context options have been removed from `backend.http`, for
sake of simplicity. If you want to enable SSL, you can serve Platypush
through a reverse proxy like nginx.
2023-05-07 12:08:28 +02:00
Fabio Manganiello 3aefc9607d
Migrated from waitress to gunicorn.
`waitress`, unlike `gunicorn`, doesn't provide an easy way to plug into
a WSGI socket that can be used for the websocket interface.
2023-05-07 00:42:57 +02:00
Fabio Manganiello ca65db016e
Added description line to `conf.py`. 2023-05-06 23:26:07 +02:00
Fabio Manganiello 9951d62511
Added logic to automatically generate the secret key for Flask. 2023-05-06 22:04:48 +02:00
Fabio Manganiello d1f0e1976c
Exclude squashfs/loopback mounts from `system.disk_info`. 2023-05-06 18:53:16 +02:00
Fabio Manganiello e33a391d25
Updated dist files 2023-05-06 12:37:00 +02:00
Fabio Manganiello 4f78d61223
Improved UI on mobile. 2023-05-06 12:34:27 +02:00
Fabio Manganiello 6e939bbe62
Close modals and dropdown when ESC is pressed. 2023-05-05 20:46:42 +02:00
Fabio Manganiello e9e59c857a
Updated dist files 2023-05-05 02:51:33 +02:00
Fabio Manganiello 59bf1c2aa0
Added close button to the modal's header. 2023-05-05 02:48:41 +02:00
Fabio Manganiello 8af3ae17b8
A more efficient way of detecting the entity groups to display.
Instead of iterating over each of the entities in a grouping to find out
which groups should be displayed based on the selector's policy, the
selector can directly keep its `selectedGroups` attribute in sync with
the index.
2023-05-05 02:33:34 +02:00
Fabio Manganiello 373788377b
Created two separate actions under `variable` to delete/unset.
`delete` will actually remove the record from the database (same as
`unset`'s new behaviour), while `unset` will set it to null without
deleting it (same as the `unset`'s previous behaviour).
2023-05-05 02:21:18 +02:00
Fabio Manganiello 98b9d31dd4
Updated dist files 2023-05-05 01:10:24 +02:00
Fabio Manganiello 4383dbb2b4
Bluetooth UI toggle aligned to the right - like all other toggles. 2023-05-05 01:04:39 +02:00
Fabio Manganiello 285f3941d9
Always use an external uWSGI server to run the web service.
Added `waitress` dependency. For performance and security reasons, it's
better to always run the Flask application inside of a uWSGI server.

`waitress` also makes things easier by avoiding to ask the user to
manually provide the external executable arguments, as it was the case
with `uwsgi` and `gunicorn`.
2023-05-05 00:07:13 +02:00
Fabio Manganiello 2c254e8eb9
numpy and PIL should be required dependencies for all camera plugins. 2023-05-04 23:44:42 +02:00
Fabio Manganiello 99311a6e71
Updated dist files 2023-05-04 02:23:24 +02:00
Fabio Manganiello 7db09276ca
Some small style improvements. 2023-05-04 02:20:40 +02:00
Fabio Manganiello 2398cac572
A more efficient and clean logic for `selectedEntities` calculation. 2023-05-04 02:19:55 +02:00
Fabio Manganiello 394e27eaf2
Refactored style for UI dropdowns. 2023-05-04 02:19:09 +02:00
Fabio Manganiello 9fd7f7db04 Fixed compatibility with new Sphinx version 2023-05-04 01:05:27 +02:00
Fabio Manganiello c690230930
An `AssistantEvent` should not fail initialization if the assistant integration isn't found. 2023-05-04 00:28:50 +02:00
Fabio Manganiello 04b1dad6d8
Removed `test_cron_execution_upon_system_clock_change`.
The test is too brittle as it depends on small mocked clock skews and it
can easily fail.
2023-05-04 00:11:11 +02:00
Fabio Manganiello 91d1d33ab6
Exclude `tests` from pip installation. 2023-05-03 21:45:02 +02:00
Fabio Manganiello 5d1c8cf8e9
Additional null check on this.searchTerm 2023-05-03 03:33:34 +02:00
Fabio Manganiello 3482c29679
Updated dist files 2023-05-03 03:18:44 +02:00
Fabio Manganiello a06d0ef6a1
Merged all the items in the entities panel's header in the Selector component. 2023-05-03 03:14:46 +02:00
Fabio Manganiello 7c7818dd76
Fixed entity search.
It was broken by the previous refactor of the entities panel, which no
longer triggers the `watch` callback on the upstream `entityGroups`.

The new approach listens for entity updates on the frontend bus and
dynamically creates the entity groupings in `selectedGroups` if they are
missing.
2023-05-03 02:12:14 +02:00
Fabio Manganiello 9922305ac5
Fixed grouping for `entityGroups.id`.
Unlike the other entity groupings, which are 4-layered (`grouping ->
group -> entity_id -> entity`), the grouping by ID only needs 3 layers
(`grouping -> entity_id -> entity`).
2023-05-03 02:09:51 +02:00
Fabio Manganiello cc2ec1db7f
The HTTP Zeroconf service should be registered before the server starts. 2023-05-02 21:24:50 +02:00
Fabio Manganiello 55cb87d14f
Updated dist files 2023-05-02 10:24:11 +02:00
Fabio Manganiello 68359b88a9
More performance improvements for the entities page.
- Don't recalculate entity groups every time. Instead, keep them in sync
  every time an entity is added or removed.

- Removed `computedChildren` from the entity component - no null nodes
  are guaranteed to be passed now, so there's no need for another
  iteration on the list of children.

- `childrenByParentId` now only looks in the scope of the entity's
  children instead of searching all the entities.
2023-05-02 10:14:03 +02:00
Fabio Manganiello 0fc0a22cd7
Reintroduced loading icon spin animation. 2023-05-02 10:08:36 +02:00
Fabio Manganiello 3febfabdd7
Bluetooth LE blacklisted device notices moved `info -> debug`. 2023-05-01 22:10:06 +02:00
Fabio Manganiello 998990aabc
Made `Entity.children_ids` resilient against deleted objects. 2023-05-01 22:09:16 +02:00
Fabio Manganiello 9d82ce6ea9
Noisy beacons notice back to debug level.
There's just too many of them and it ends up polluting the logs.
2023-05-01 21:25:42 +02:00
Fabio Manganiello ce248ccfbb
Added `children_ids` to the entity attributes serialized in `to_json`. 2023-05-01 19:59:13 +02:00
Fabio Manganiello de76c2b6a8
Updated dist files 2023-05-01 10:12:43 +02:00
Fabio Manganiello 835ad9f2dc
Use plugin as a default entity grouping instead of category 2023-05-01 10:06:11 +02:00
Fabio Manganiello 85ecdcb0cb
Removed entity icon loading animation.
The animation has a big impact on page loading performance when the
system includes a high number of entities that all need their loading
animation to be render.
2023-05-01 09:49:34 +02:00
Fabio Manganiello 24c6b7b377
Updated dist files 2023-05-01 01:25:27 +02:00
Fabio Manganiello b7cf1a42de
Use a proxy value in the `variable` component for the textbox.
Otherwise the value may keep being overwritten while the user is typing
a new one.
2023-05-01 01:22:20 +02:00
Fabio Manganiello a3839e637d
Set a max-width: 600px for group containers. 2023-05-01 01:22:02 +02:00
Fabio Manganiello 1e43866978
Moved more entity common CSS out of the Vue component. 2023-05-01 01:21:18 +02:00