From 1ffd81a99b104c189f83a99226baa1fd6d17a0cd Mon Sep 17 00:00:00 2001 From: haim kastner Date: Sun, 1 Sep 2019 23:57:05 +0300 Subject: [PATCH 1/3] Add security.txt info route --- app.py | 8 ++++++++ static/.well-known/security.txt | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 static/.well-known/security.txt diff --git a/app.py b/app.py index 23c81a3..6bae031 100644 --- a/app.py +++ b/app.py @@ -21,11 +21,19 @@ def models_list(): def model_rf_commands(brand, model): return jsonify(get_device_commands(brand=brand, model=model)) + +# Get security help info +@app.route('/.well-known/security.txt') +def security_info(): + return app.send_static_file('.well-known/security.txt') + + # Get PORT from env. PORT = os.getenv("PORT") if not PORT: PORT = 5000 else: PORT = int(PORT) + if __name__ == '__main__': app.run(port=PORT) diff --git a/static/.well-known/security.txt b/static/.well-known/security.txt new file mode 100644 index 0000000..9ec64e0 --- /dev/null +++ b/static/.well-known/security.txt @@ -0,0 +1,4 @@ +This server build by an open-source project at https://github.com/casanet/rf-commands-repo . +If you would like to report a security issue in the code-base please open an issue in the repository, +or contact me directly via my profile https://github.com/haimkastner . +Thanks! From 1b63cb8144dd1f5e7ba3f94a9a9d4fa109479bca Mon Sep 17 00:00:00 2001 From: haim kastner Date: Sun, 1 Sep 2019 23:57:46 +0300 Subject: [PATCH 2/3] Update runing alone in md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31be390..1357701 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,14 @@ Simple, light-weight server for RF commands (such as: IR, 433 MHz etc.) for appl * create mongodb database named `ir-commands`. * create collection named `commands`. * set `DATABASE_URL` env ver with mongo url for example `mongodb://:@:/ir-commands`. +* run it using `python app.py`. +* in production run is recomended using `gunicorn`. # technologies The Server is Build with Ptyhon, on flask framwork for the HTTP Routing, mongoDB for the data storing. # purposes -If you have project that use RF commands for appliances (For exmple, see my great project [casanet](https://github.com/haimkastner/home-iot-server)), worry no more! this project will help with storing and fatching commands on demand. +If you have project that use RF commands for appliances (For exmple, see my great project [casanet](https://github.com/casanet/casanet-server)), worry no more! this project will help with storing and fatching commands on demand. With simple RESTfull API, you will be able the get all the avilable devices in the system, and their known commands. # stages From 595bc59da1c2160ea0d24c8dfe873de17d3cf369 Mon Sep 17 00:00:00 2001 From: Haim Kastner Date: Sun, 8 Sep 2019 11:51:33 +0300 Subject: [PATCH 3/3] Create CONTRIBUTING.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..71d5af7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing to the casanet project. + +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +## Getting started + +- Create a new branch and commit changes into it. +- Open a PR to the `development` branch (not master). + +Thank a lot!