Commit Graph

291 Commits

Author SHA1 Message Date
Fabio Manganiello 1395c472c0
`docutils` moved to required dependencies. 2023-05-09 21:59:36 +02:00
Fabio Manganiello 56dc8d0972
Migrated the webapp to Tornado.
It was just too painful to find a combination of versions of  gunicorn,
gevent, eventlet, pyuwsgi etc. that could work on all of my systems.

On the other hand, Tornado works out of the box with no headaches.

Also in this commit:

- Updated a bunch of outdated/required integration dependencies.
- Black'd and LINTed a couple of old plugins.
2023-05-08 02:06:45 +02:00
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 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 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 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 91d1d33ab6
Exclude `tests` from pip installation. 2023-05-03 21:45:02 +02:00
Fabio Manganiello 12cca4991a
Fixed paths for Alembic's `package_data`. 2023-04-29 23:48:06 +02:00
Fabio Manganiello 78cee5d9b0
Added support for automatic database migrations.
Added Alembic environment and `run_db_migrations` logic to the entities
engine so database schema changes can be processed as soon as the
application is started.
2023-04-29 11:32:31 +02:00
Fabio Manganiello 87889142e0
Fixed compatibility with SQLAlchemy >= 2.0 in the `db` plugin. 2023-04-24 22:52:17 +02:00
Fabio Manganiello 2781eb1fb1
Merge branch 'master' into 29-generic-entities-support 2023-03-27 00:36:50 +02:00
Fabio Manganiello 7a368ebbb8
[#240] Migrated `clipboard` plugin from `pyperclip` to `pyclip`.
Closes: #240
2023-03-26 23:52:15 +02:00
Fabio Manganiello f5d9895521
Added `marshmallow_dataclass` to the requirements. 2023-03-26 03:44:57 +02:00
Fabio Manganiello 2f49ddf33a
Fallback logic that uses DBus to disconnect from a BT device.
This logic will be used if the connection wasn't opened by the current
process and therefore a call to DBus is required to terminate it.
2023-03-24 01:57:05 +01:00
Fabio Manganiello 3743ee4f00
s/TheengsGateway/TheengsDecoder/g now that the pip package has been published. 2023-03-20 01:41:21 +01:00
Fabio Manganiello 2411b961e8
[WIP] Big, big refactor of the Bluetooth integration.
- Merged together Bluetooth legacy and BLE plugins and scanners.
- Introduced Theengs as a dependency to infer BLE device types and
  create sub-entities appropriately.
- Using `BluetoothDevice` and `BluetoothService` entities as the bread
  and butter for all the Bluetooth plugin's components.
- Using a shared cache of devices and services between the legacy and
  BLE integrations, with merging/coalescing logic included.
- Extended list of discoverable services to include all those officially
  supported by the Bluetooth specs.
- Instantiate a separate pool of workers to discover services.
- Refactor of the Bluetooth events - all of them are now instantiated
  from a single `BluetoothDevice` object.
2023-03-13 02:31:21 +01:00
Fabio Manganiello 7fa545d7f8
Merge branch 'master' into 29-generic-entities-support 2023-02-22 00:46:33 +01:00
Fabio Manganiello c645ce6bb8
Bump version: 0.24.4 → 0.24.5 2023-02-22 00:32:57 +01:00
Fabio Manganiello 26d9aaa5b1
(Temporarily) specify `sqlalchemy<2.0.0`.
SQLAlchemy 2 has introduced several breaking changes that can break
several things in the application - especially where the code uses
`connection.execute()` with raw SQL statements.

We need to temporarily force the installation of versions from the 1.x
branch, while migrating the existing code to the new version.
2023-02-22 00:25:57 +01:00
Fabio Manganiello 613e32e7c1
Extended number of supported events and data fields in Bluetooth integration. 2023-02-18 01:15:10 +01:00
Fabio Manganiello 8469a1027f
Migrated/refactored `switchbot.bluetooth` integration.
- Out `gattlib` + `pybluez`, in `bleak`. It's not platform-dependent, it doesn't
  require libboost and other heavy build dependencies, and it doesn't require the
  user that runs the service from having special privileges to access raw
  Bluetooth sockets.

- Better integration with Platypush native entities. The devices are now mapped
  to write-only `EnumSwitch` entities, and the status returns the serialized
  representation of those entities instead of the previous intermediate
  representation.
2023-02-08 22:42:00 +01:00
Fabio Manganiello 84ce31cab0
Bump version: 0.24.3 → 0.24.4 2022-12-20 23:05:42 +01:00
Fabio Manganiello 6666f5581c
Bump version: 0.24.2 → 0.24.3 2022-12-17 00:31:22 +01:00
Fabio Manganiello 4c8190ac14
Bump version: 0.24.1 → 0.24.2 2022-12-10 15:37:49 +01:00
Fabio Manganiello 3b1147eaae Bump version: 0.24.0 → 0.24.1 2022-12-08 12:33:34 +01:00
Fabio Manganiello 73f6712f7a
Bump version: 0.23.6 → 0.24.0 2022-11-22 00:12:25 +01:00
Fabio Manganiello a2c8e27bd8 Removed PyJWT dependency.
PyJWT is a very brittle and cumbersome dependency that expects several
cryptography libraries to be already installed on the system, and it can
lead to hard-to-debug errors when ported to different systems.

Moreover, it installs the whole `cryptography` package, which is several
MBs in size, takes time to compile, and it requires a Rust compiler to
be present on the target machine.

Platypush will now use the Python-native `rsa` module to handle JWT
tokens.
2022-11-21 12:30:38 +01:00
Fabio Manganiello a0575ed6de
Bump version: 0.23.5 → 0.23.6 2022-09-19 20:41:02 +02:00
Fabio Manganiello c2a3f2f4f3
Bump version: 0.23.4 → 0.23.5 2022-09-18 19:55:05 +02:00
Fabio Manganiello e1aa214bad tidal-integration (#223)
Reviewed-on: #223
2022-09-16 21:48:09 +02:00
Fabio Manganiello 6c6e68b512
Added support for OPML import and export in the RSS plugin.
[closes #219]
2022-09-02 00:21:40 +02:00
Fabio Manganiello b11a0e8bbb
Bump version: 0.23.3 → 0.23.4 2022-08-28 15:27:54 +02:00
Fabio Manganiello cbe2e7bbfe
[WIP] 2022-08-04 03:08:54 +02:00
Fabio Manganiello b857ce60a7
Bump version: 0.23.2 → 0.23.3 2022-06-01 23:08:32 +02:00
Fabio Manganiello fee5fc4ae0
HTTP backend dependencies moved from optional to required
If Platypush is supposed to work also without a manually created
`config.yaml`, and the HTTP backend is enabled by default in that
configuration, then Flask and companions should be among the required
dependencies.
2022-04-27 14:52:41 +02:00
Fabio Manganiello 2e33d3b3c5
Bump version: 0.23.1 → 0.23.2 2022-03-27 16:43:36 +02:00
Fabio Manganiello 7c9e9d284d
Bump version: 0.23.0 → 0.23.1 2022-03-01 12:50:31 +01:00
Fabio Manganiello c0039c3f87
Bump version: 0.22.10 → 0.23.0 2022-03-01 01:33:43 +01:00
Fabio Manganiello 42ee149b95
Bump version: 0.22.9 → 0.22.10 2022-02-07 15:59:20 +01:00
Fabio Manganiello 1038090ffd
LINT fixes 2022-02-07 15:51:12 +01:00
Fabio Manganiello 786286eac6
Refactored D-Bus integration
- Added ability to listen for signals
- Improved introspection output
- `dbus` plugin and backend have now been merged
- Migrated from `dbus` to `pydbus`
2022-02-07 15:45:43 +01:00
Fabio Manganiello 833e1c49be
Bump version: 0.22.8 → 0.22.9 2022-01-06 14:08:55 +01:00
Fabio Manganiello 3e4b91cd6c
Removed pytz dependency 2022-01-05 18:04:32 +01:00
Fabio Manganiello 081da3eb84
Bump version: 0.22.7 → 0.22.8 2021-12-13 21:21:42 +01:00
Fabio Manganiello 6df9cbcf3c
Bump version: 0.22.6 → 0.22.7 2021-12-13 20:47:50 +01:00
Fabio Manganiello fa708663e1
Replaced command-line uwsgi wrapper in the backend.http docs with gunicorn
gunicorn makes it easier to set up a uWSGI wrapper
around the web application, and it's easier to
install and document than handling uwsgi as an
external system dependency.
2021-12-11 22:44:00 +01:00
Fabio Manganiello f74ca28382
Bump version: 0.22.5 → 0.22.6 2021-11-27 10:56:28 +01:00
Fabio Manganiello adb9672989
Bump version: 0.22.4 → 0.22.5 2021-11-15 00:12:42 +01:00
Fabio Manganiello d7b273434b
[#203] Added IRC integration 2021-11-14 19:43:19 +01:00