diff --git a/arduino/eeprom_prog/eeprom_prog.ino b/arduino/eeprom_prog/eeprom_prog.ino index 2a482ee..7ab58ce 100644 --- a/arduino/eeprom_prog/eeprom_prog.ino +++ b/arduino/eeprom_prog/eeprom_prog.ino @@ -1,3 +1,23 @@ +/* -*- coding: utf-8 -*- +* vim: tabstop=2 shiftwidth=2 softtabstop=2 +* +* BITE - A Basic/IoT/Example +* Copyright (C) 2020 Daniele Viganò +* +* BITE is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* BITE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . +*/ + #include #include diff --git a/arduino/tempLightSensor/tempLightSensor.ino b/arduino/tempLightSensor/tempLightSensor.ino index f6d1f4b..45a1094 100644 --- a/arduino/tempLightSensor/tempLightSensor.ino +++ b/arduino/tempLightSensor/tempLightSensor.ino @@ -1,3 +1,23 @@ +/* -*- coding: utf-8 -*- +* vim: tabstop=2 shiftwidth=2 softtabstop=2 +* +* BITE - A Basic/IoT/Example +* Copyright (C) 2020 Daniele Viganò +* +* BITE is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* BITE is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see . +*/ + #include #include #include diff --git a/bite/api/__init__.py b/bite/api/__init__.py index e69de29..30738a6 100644 --- a/bite/api/__init__.py +++ b/bite/api/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . diff --git a/bite/api/admin.py b/bite/api/admin.py index 0d27b99..19acefa 100644 --- a/bite/api/admin.py +++ b/bite/api/admin.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.contrib import admin from api.models import Device, WhiteList diff --git a/bite/api/apps.py b/bite/api/apps.py index d87006d..7677672 100644 --- a/bite/api/apps.py +++ b/bite/api/apps.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.apps import AppConfig diff --git a/bite/api/migrations/__init__.py b/bite/api/migrations/__init__.py index e69de29..30738a6 100644 --- a/bite/api/migrations/__init__.py +++ b/bite/api/migrations/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . diff --git a/bite/api/models.py b/bite/api/models.py index 80047b7..7c2863c 100644 --- a/bite/api/models.py +++ b/bite/api/models.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + import uuid from django.db import models diff --git a/bite/api/serializers.py b/bite/api/serializers.py index 80d4434..833bddc 100644 --- a/bite/api/serializers.py +++ b/bite/api/serializers.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from rest_framework import serializers from api.models import Device, device_validation diff --git a/bite/api/tests.py b/bite/api/tests.py index 75f1ee4..c6f02ca 100644 --- a/bite/api/tests.py +++ b/bite/api/tests.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.test import TestCase, Client from api.models import Device, WhiteList diff --git a/bite/api/urls.py b/bite/api/urls.py index 9ccd47f..d0579fd 100644 --- a/bite/api/urls.py +++ b/bite/api/urls.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """bite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: diff --git a/bite/api/views.py b/bite/api/views.py index fc5a022..77c2722 100644 --- a/bite/api/views.py +++ b/bite/api/views.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from rest_framework.viewsets import ModelViewSet from api.models import Device diff --git a/bite/bite/__init__.py b/bite/bite/__init__.py index e69de29..30738a6 100644 --- a/bite/bite/__init__.py +++ b/bite/bite/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . diff --git a/bite/bite/asgi.py b/bite/bite/asgi.py index bc61030..c17cb0c 100644 --- a/bite/bite/asgi.py +++ b/bite/bite/asgi.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """ ASGI config for bite project. diff --git a/bite/bite/settings.py b/bite/bite/settings.py index ac11422..06efa88 100644 --- a/bite/bite/settings.py +++ b/bite/bite/settings.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """ Django settings for bite project. diff --git a/bite/bite/urls.py b/bite/bite/urls.py index 651d14c..61d2561 100644 --- a/bite/bite/urls.py +++ b/bite/bite/urls.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """bite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: diff --git a/bite/bite/wsgi.py b/bite/bite/wsgi.py index 7db4be4..7190646 100644 --- a/bite/bite/wsgi.py +++ b/bite/bite/wsgi.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """ WSGI config for bite project. diff --git a/bite/manage.py b/bite/manage.py index 02eabe4..034f722 100755 --- a/bite/manage.py +++ b/bite/manage.py @@ -1,4 +1,23 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """Django's command-line utility for administrative tasks.""" import os import sys diff --git a/bite/telemetry/__init__.py b/bite/telemetry/__init__.py index b03e03d..bfe947b 100644 --- a/bite/telemetry/__init__.py +++ b/bite/telemetry/__init__.py @@ -1 +1,20 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + default_app_config = 'telemetry.apps.TelemetryConfig' diff --git a/bite/telemetry/admin.py b/bite/telemetry/admin.py index b5884d4..5bfb62d 100644 --- a/bite/telemetry/admin.py +++ b/bite/telemetry/admin.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.contrib import admin from telemetry.models import Telemetry diff --git a/bite/telemetry/apps.py b/bite/telemetry/apps.py index 9e1fd9c..6e4b0b1 100644 --- a/bite/telemetry/apps.py +++ b/bite/telemetry/apps.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.apps import AppConfig from health_check.plugins import plugin_dir diff --git a/bite/telemetry/health.py b/bite/telemetry/health.py index 82870ac..009f0f8 100644 --- a/bite/telemetry/health.py +++ b/bite/telemetry/health.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + import socket import paho.mqtt.client as mqtt from health_check.backends import BaseHealthCheckBackend diff --git a/bite/telemetry/management/commands/mqtt-to-db.py b/bite/telemetry/management/commands/mqtt-to-db.py index 73e1ee8..2bf71b7 100644 --- a/bite/telemetry/management/commands/mqtt-to-db.py +++ b/bite/telemetry/management/commands/mqtt-to-db.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + import socket import asyncio import json diff --git a/bite/telemetry/migrations/__init__.py b/bite/telemetry/migrations/__init__.py index e69de29..30738a6 100644 --- a/bite/telemetry/migrations/__init__.py +++ b/bite/telemetry/migrations/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . diff --git a/bite/telemetry/models.py b/bite/telemetry/models.py index bf6e23e..28b3d52 100644 --- a/bite/telemetry/models.py +++ b/bite/telemetry/models.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from django.db import models from django.core.validators import MinValueValidator from django.core.exceptions import ValidationError diff --git a/bite/telemetry/serializers.py b/bite/telemetry/serializers.py index 372039b..c12fb9c 100644 --- a/bite/telemetry/serializers.py +++ b/bite/telemetry/serializers.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from rest_framework import serializers from api.models import Device from telemetry.models import Telemetry diff --git a/bite/telemetry/tests.py b/bite/telemetry/tests.py index a6f3159..f568540 100644 --- a/bite/telemetry/tests.py +++ b/bite/telemetry/tests.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + import json from django.test import TestCase, Client from api.models import Device, WhiteList diff --git a/bite/telemetry/urls.py b/bite/telemetry/urls.py index 808906b..a1889c3 100644 --- a/bite/telemetry/urls.py +++ b/bite/telemetry/urls.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + """bite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: diff --git a/bite/telemetry/views.py b/bite/telemetry/views.py index afdb139..fc10bba 100644 --- a/bite/telemetry/views.py +++ b/bite/telemetry/views.py @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + from datetime import datetime from django.http import Http404 from rest_framework.viewsets import ModelViewSet diff --git a/docker/django/Dockerfile b/docker/django/Dockerfile index ac1647f..346f59c 100644 --- a/docker/django/Dockerfile +++ b/docker/django/Dockerfile @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + FROM python:3.8-alpine AS builder RUN apk update && apk add gcc musl-dev postgresql-dev \ && pip install psycopg2-binary diff --git a/docker/django/production.py.sample b/docker/django/production.py.sample index fab2e34..7dfe3fc 100644 --- a/docker/django/production.py.sample +++ b/docker/django/production.py.sample @@ -1,4 +1,21 @@ -# vim: syntax=python +# -*- coding: utf-8 -*- +# vim: syntax=python tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . from bite import settings diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index f0ac275..dcca815 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/docker-compose.prod.yml b/docker/docker-compose.prod.yml index 52bffeb..797b6b1 100644 --- a/docker/docker-compose.prod.yml +++ b/docker/docker-compose.prod.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1aa505a..6e994f5 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" networks: diff --git a/docker/edge/docker-compose.edge.yml b/docker/edge/docker-compose.edge.yml index f82d6a1..201443e 100644 --- a/docker/edge/docker-compose.edge.yml +++ b/docker/edge/docker-compose.edge.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/edge/docker-compose.modules.yml b/docker/edge/docker-compose.modules.yml index 7965a4e..b11a1cd 100644 --- a/docker/edge/docker-compose.modules.yml +++ b/docker/edge/docker-compose.modules.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" x-op-service-default: &service_default diff --git a/docker/ingress/docker-compose.traefik.yml b/docker/ingress/docker-compose.traefik.yml index e553934..382981e 100644 --- a/docker/ingress/docker-compose.traefik.yml +++ b/docker/ingress/docker-compose.traefik.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/ingress/nginx.conf b/docker/ingress/nginx.conf index 651bf1a..ab6f103 100644 --- a/docker/ingress/nginx.conf +++ b/docker/ingress/nginx.conf @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: syntax=nginx tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + user nginx; worker_processes auto; diff --git a/docker/mqtt/docker-compose.rabbitmq.yml b/docker/mqtt/docker-compose.rabbitmq.yml index 9ffb579..a56da97 100644 --- a/docker/mqtt/docker-compose.rabbitmq.yml +++ b/docker/mqtt/docker-compose.rabbitmq.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/mqtt/docker-compose.vernemq.yml b/docker/mqtt/docker-compose.vernemq.yml index 5bcb16e..355436a 100644 --- a/docker/mqtt/docker-compose.vernemq.yml +++ b/docker/mqtt/docker-compose.vernemq.yml @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=2 shiftwidth=2 softtabstop=2 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + version: "3.7" services: diff --git a/docker/ntpd/Dockerfile b/docker/ntpd/Dockerfile index 859f3c6..eea5209 100644 --- a/docker/ntpd/Dockerfile +++ b/docker/ntpd/Dockerfile @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + FROM alpine:3.9 RUN apk update && apk add chrony && \ diff --git a/docker/ntpd/Dockerfile.enc b/docker/ntpd/Dockerfile.enc index b0f8fcc..4e9f6f6 100644 --- a/docker/ntpd/Dockerfile.enc +++ b/docker/ntpd/Dockerfile.enc @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: syntax=dockerfile tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + FROM daniviga/ntpd COPY ./chrony.keys /etc/chrony/chrony.keys diff --git a/docker/simulator/Dockerfile b/docker/simulator/Dockerfile index f5e3206..971f342 100644 --- a/docker/simulator/Dockerfile +++ b/docker/simulator/Dockerfile @@ -1,3 +1,22 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + FROM python:3.8-alpine RUN pip3 install urllib3 paho-mqtt diff --git a/docker/simulator/device_simulator.py b/docker/simulator/device_simulator.py index 2c3c20d..3a348ba 100755 --- a/docker/simulator/device_simulator.py +++ b/docker/simulator/device_simulator.py @@ -1,4 +1,22 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# BITE - A Basic/IoT/Example +# Copyright (C) 2020 Daniele Viganò +# +# BITE is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# BITE is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . import os import json