From 833e7fc6ef3e05df6cf4df3521d66bc49fae3586 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 17 Sep 2023 08:23:39 -0500 Subject: [PATCH 01/34] =?UTF-8?q?Modificaci=C3=B3n=20IPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se agregan las Ip que se indican en el tutorial --- IOTMonitoringServer/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IOTMonitoringServer/settings.py b/IOTMonitoringServer/settings.py index 114ccc2f..29cf8738 100644 --- a/IOTMonitoringServer/settings.py +++ b/IOTMonitoringServer/settings.py @@ -27,7 +27,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ["localhost", "ip.maquina.visualizador"] +ALLOWED_HOSTS = ["localhost", "4.203.104.152"] # Application definition @@ -96,7 +96,7 @@ "NAME": "iot_data", # Nombre de la base de datos "USER": "dbadmin", # Nombre de usuario "PASSWORD": "uniandesIOT1234*", # Contraseña - "HOST": "ip.maquina.db", # Dirección IP de la base de datos + "HOST": "34.201.48.217", # Dirección IP de la base de datos "PORT": "", # Puerto de la base de datos } } @@ -156,7 +156,7 @@ CRISPY_TEMPLATE_PACK = 'bootstrap4' # Dirección del bróker MQTT -MQTT_HOST = "ip.maquina.mqtt" +MQTT_HOST = "44.193.11.31" # Puerto del bróker MQTT MQTT_PORT = 8082 From 1076138882c7c21b56f5236ae775399b41598f0a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 21 Sep 2023 18:12:44 -0500 Subject: [PATCH 02/34] =?UTF-8?q?Modificaci=C3=B3n=20IPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se agregan las Ip que se indican en el tutorial --- IOTMonitoringServer/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IOTMonitoringServer/settings.py b/IOTMonitoringServer/settings.py index 29cf8738..20a5f8dc 100644 --- a/IOTMonitoringServer/settings.py +++ b/IOTMonitoringServer/settings.py @@ -27,7 +27,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ["localhost", "4.203.104.152"] +ALLOWED_HOSTS = ["localhost", "3.237.205.218"] # Application definition @@ -96,7 +96,7 @@ "NAME": "iot_data", # Nombre de la base de datos "USER": "dbadmin", # Nombre de usuario "PASSWORD": "uniandesIOT1234*", # Contraseña - "HOST": "34.201.48.217", # Dirección IP de la base de datos + "HOST": "44.213.121.117", # Dirección IP de la base de datos "PORT": "", # Puerto de la base de datos } } @@ -156,7 +156,7 @@ CRISPY_TEMPLATE_PACK = 'bootstrap4' # Dirección del bróker MQTT -MQTT_HOST = "44.193.11.31" +MQTT_HOST = "18.205.3.25" # Puerto del bróker MQTT MQTT_PORT = 8082 From 61f400a83aace2492033d80d0247d443590e05bd Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:19:19 -0500 Subject: [PATCH 03/34] Prueba de sonar con Quality Gates --- receiver/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index 8becaf00..06cf8e2a 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -15,6 +15,12 @@ class City(models.Model): def str(self): return "{}".format(self.name) +class City2(models.Model): + name = models.CharField(max_length=50, unique=True, blank=False) + code = models.CharField(max_length=50, null=True) + + def str(self): + return "{}".format(self.name) class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) From 3575e5589d31b03f8ea5f2ba351da45adf57d600 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:22:20 -0500 Subject: [PATCH 04/34] prueba --- receiver/models.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/receiver/models.py b/receiver/models.py index 06cf8e2a..c6479f38 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -15,13 +15,6 @@ class City(models.Model): def str(self): return "{}".format(self.name) -class City2(models.Model): - name = models.CharField(max_length=50, unique=True, blank=False) - code = models.CharField(max_length=50, null=True) - - def str(self): - return "{}".format(self.name) - class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) code = models.CharField(max_length=50, null=True) From dfcfded29e995c47045a1ca2299a7ef213f05dd8 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:24:19 -0500 Subject: [PATCH 05/34] Prueba 2 --- receiver/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index c6479f38..bfaa351c 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -14,6 +14,13 @@ class City(models.Model): def str(self): return "{}".format(self.name) + +class City2(models.Model): + name = models.CharField(max_length=50, unique=True, blank=False) + code = models.CharField(max_length=50, null=True) + + def str(self): + return "{}".format(self.name) class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) From 79bc0f910580dee93a7d15aa784a7f9ef6d61d4b Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:29:53 -0500 Subject: [PATCH 06/34] Prueba3 --- receiver/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index bfaa351c..f65c26ec 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -22,6 +22,13 @@ class City2(models.Model): def str(self): return "{}".format(self.name) +class City2(models.Model): + name = models.CharField(max_length=50, unique=True, blank=False) + code = models.CharField(max_length=50, null=True) + + def str(self): + return "{}".format(self.name) + class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) code = models.CharField(max_length=50, null=True) From 94fc1e9a2c3a845cd4d31effa2f3b52a05437389 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:51:01 -0500 Subject: [PATCH 07/34] Prueba 4 --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index f65c26ec..7feb5bd0 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -45,6 +45,17 @@ def str(self): return "{}".format(self.name) +class Location(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Location(models.Model): description = models.CharField(max_length=200, blank=True) lat = models.DecimalField( From 9d3d58ba1c239c1aaec5be8caca0b429a009c3ea Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 22:56:27 -0500 Subject: [PATCH 08/34] Prueba5 --- receiver/models.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/receiver/models.py b/receiver/models.py index 7feb5bd0..122bfa2a 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -56,7 +56,18 @@ class Location(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) -class Location(models.Model): +class Location2(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + +class Location3(models.Model): description = models.CharField(max_length=200, blank=True) lat = models.DecimalField( max_digits=9, decimal_places=6, null=True, blank=True) From d552bdac3ba6d9c1ec588a3afd29184876ae82c7 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:07:27 -0500 Subject: [PATCH 09/34] Prueba6 --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index 122bfa2a..a3a65faf 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -78,6 +78,17 @@ class Location3(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location4(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: unique_together = ("city", "state", "country") From ccd194a76169031a4781aa2c6dfe6a4eea05b9de Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:13:30 -0500 Subject: [PATCH 10/34] Prueba7 --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index a3a65faf..90a1c69a 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -89,6 +89,17 @@ class Location4(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location5(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: unique_together = ("city", "state", "country") From 30bdef0d89ed29001b6497c88f88d3df6f1e961c Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:26:15 -0500 Subject: [PATCH 11/34] Prueba8 --- receiver/models.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index 90a1c69a..8617a486 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -100,6 +100,18 @@ class Location5(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location6(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + + class Meta: unique_together = ("city", "state", "country") From 28fb0ec2707169e9574138778cb1db2899981abd Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:33:47 -0500 Subject: [PATCH 12/34] Prueba9 --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index 8617a486..e2ca3479 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -111,6 +111,17 @@ class Location6(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location7(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: unique_together = ("city", "state", "country") From c79d41dcf609ff409655f1551f1aed7863b38ea4 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:39:52 -0500 Subject: [PATCH 13/34] Pruwba10 --- receiver/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/receiver/models.py b/receiver/models.py index e2ca3479..32096211 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -121,6 +121,7 @@ class Location7(models.Model): state = models.ForeignKey(State, on_delete=models.CASCADE) country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) + class Meta: From 3713ebbbcc454dfeb572b754cb21bb362a673356 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sat, 4 Nov 2023 23:49:50 -0500 Subject: [PATCH 14/34] Prueba11 --- receiver/models.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/receiver/models.py b/receiver/models.py index 32096211..a0792d7c 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -121,7 +121,18 @@ class Location7(models.Model): state = models.ForeignKey(State, on_delete=models.CASCADE) country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) - + +class Location10(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: From 8ab252b764077899c1ab9696b23fda0c1fc43a6e Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:10:38 -0500 Subject: [PATCH 15/34] =?UTF-8?q?Implementaci=C3=B3n=20de=20Sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 20 ++++++++++++++++++++ sonar-project.properties | 13 +++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..d232096b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..c311a6f1 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=alexyirsa_IOTMonitoringServer +sonar.organization=alexyirsa + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=IOTMonitoringServer +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 \ No newline at end of file From c4e10d2a23f7ef59b94c24ba01cb700bfbfc61ea Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:12:49 -0500 Subject: [PATCH 16/34] Prueba12 --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index a0792d7c..1ba973fc 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -133,6 +133,17 @@ class Location10(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location11(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: From cb86f941ef559fd732ad31243ba822f7cd3f6e7e Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:20:24 -0500 Subject: [PATCH 17/34] Prueba13 --- .github/workflows/build.yml | 14 +++++++++++--- receiver/models.py | 11 +++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d232096b..6cdc9967 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,19 @@ jobs: name: SonarCloud runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Instalación de librerías y dependencias + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/receiver/models.py b/receiver/models.py index 1ba973fc..9807e08c 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -144,6 +144,17 @@ class Location11(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location12(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: From 5c285f369f29e65891e6c8989800880795a38bc4 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:23:48 -0500 Subject: [PATCH 18/34] =?UTF-8?q?modificaci=C3=B3n=20de=20archivo=20con=20?= =?UTF-8?q?error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cdc9967..d0394152 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r requeriments.txt - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 13e8ff65299fe2d8029f1c3fefeb9b6281d71751 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:25:36 -0500 Subject: [PATCH 19/34] =?UTF-8?q?Modificaci=C3=B3n2=20archivo=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0394152..1df100d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requeriments.txt + pip install -r requeriments.py - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 4c1011643eb5d21845f14b31055b9134810046c8 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:27:23 -0500 Subject: [PATCH 20/34] =?UTF-8?q?Modificaci=C3=B3n=20extensi=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- requeriments.py => requeriments.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename requeriments.py => requeriments.txt (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1df100d2..d0394152 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requeriments.py + pip install -r requeriments.txt - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: diff --git a/requeriments.py b/requeriments.txt similarity index 100% rename from requeriments.py rename to requeriments.txt From e95462bd381c1590a04a48d4e498b62423bdfa84 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 11:28:36 -0500 Subject: [PATCH 21/34] Retiro de archivo de requerimientos --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0394152..8c5c73e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requeriments.txt - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 24cb52e1e237ef9e7bed5a843b8c302656f155e9 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:05:07 -0500 Subject: [PATCH 22/34] =?UTF-8?q?Actualizaci=C3=B3n=20de=20cobertura=20de?= =?UTF-8?q?=20pruebas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 5 +++++ sonar-project.properties | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c5c73e2..6142e380 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,11 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip + - name: pruebas+coverage + id: pruebas + run: | + python -m coverage run -m unittest discover tests + python -m coverage xml -i - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: diff --git a/sonar-project.properties b/sonar-project.properties index c311a6f1..11c60df2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,6 @@ sonar.projectKey=alexyirsa_IOTMonitoringServer sonar.organization=alexyirsa +sonar.coverage.exclusions=**tests/**,**src/vista/**,**docs/**,**setup.py** # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=IOTMonitoringServer From bde2edbab050a36126a007b39748b4f6c666cecd Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:07:49 -0500 Subject: [PATCH 23/34] Act 2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6142e380..e40814ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: - name: pruebas+coverage id: pruebas run: | - python -m coverage run -m unittest discover tests + python run -m unittest discover tests python -m coverage xml -i - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master From a1e572080ad805b605df389809d0e3120cb7dac7 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:10:47 -0500 Subject: [PATCH 24/34] Act 3 --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e40814ba..40645b93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,10 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip + pip install -r requirements.txt - name: pruebas+coverage id: pruebas - run: | - python run -m unittest discover tests - python -m coverage xml -i + run: pytest - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 052ea49813037775f42356b4147b6765c9a744fd Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:12:02 -0500 Subject: [PATCH 25/34] Act 4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40645b93..fbbdec99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r requeriments.txt - name: pruebas+coverage id: pruebas run: pytest From f4fe8718a6159beb74884a13bb938cc43d7f6245 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:12:50 -0500 Subject: [PATCH 26/34] Act 6 --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbbdec99..1654613a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip - pip install -r requeriments.txt - name: pruebas+coverage id: pruebas run: pytest From 508188056de7133094d0af6f0a4614e1b919fe95 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:14:11 -0500 Subject: [PATCH 27/34] Act 7 --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1654613a..88e5e656 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: - name: Instalación de librerías y dependencias run: | python -m pip install --upgrade pip + python -m pip install pytest - name: pruebas+coverage id: pruebas run: pytest From 8cab2e4732635f32a7ab948a786894021418a9cb Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:20:12 -0500 Subject: [PATCH 28/34] Avt 8 --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88e5e656..f05c2f62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,10 @@ jobs: python -m pip install pytest - name: pruebas+coverage id: pruebas - run: pytest + run: | + pytest + exit 1 + continueOnError: true - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From d852ddbd65d23a90dbaf34c8825988aeeaf70b92 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:21:37 -0500 Subject: [PATCH 29/34] Act 9 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f05c2f62..91d4e2f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: id: pruebas run: | pytest - exit 1 + exit 5 continueOnError: true - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master From 6bcf9d0fe9a95152fd71455f0a4c8ef6c82c3db5 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:30:40 -0500 Subject: [PATCH 30/34] Act 10 --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91d4e2f4..76307af5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,11 +22,10 @@ jobs: python -m pip install --upgrade pip python -m pip install pytest - name: pruebas+coverage - id: pruebas run: | pytest exit 5 - continueOnError: true + continue-on-error: true - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 7dcb5b6e13ef2fa0c175aeaa4943388bd2c12eba Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 18:44:50 -0500 Subject: [PATCH 31/34] Act de pruebas unitarias --- receiver/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/receiver/models.py b/receiver/models.py index 9807e08c..931c0311 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -155,6 +155,17 @@ class Location12(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) active = models.BooleanField(default=True) +class Location13(models.Model): + description = models.CharField(max_length=200, blank=True) + lat = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + lng = models.DecimalField( + max_digits=9, decimal_places=6, null=True, blank=True) + city = models.ForeignKey(City, on_delete=models.CASCADE) + state = models.ForeignKey(State, on_delete=models.CASCADE) + country = models.ForeignKey(Country, on_delete=models.CASCADE) + active = models.BooleanField(default=True) + class Meta: From 1a079f4d0a9d4a55272528d5f78ba8e2c45b205b Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 20:14:57 -0500 Subject: [PATCH 32/34] Se soluciona el Bug de cambio Null por blank en archivo models.py --- receiver/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/receiver/models.py b/receiver/models.py index 931c0311..4df6e041 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -10,7 +10,7 @@ class City(models.Model): name = models.CharField(max_length=50, unique=True, blank=False) - code = models.CharField(max_length=50, null=True) + code = models.CharField(max_length=50, blank=True) def str(self): return "{}".format(self.name) @@ -31,7 +31,7 @@ def str(self): class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) - code = models.CharField(max_length=50, null=True) + code = models.CharField(max_length=50, blank=True) def str(self): return "{}".format(self.name) @@ -39,7 +39,7 @@ def str(self): class Country(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) - code = models.CharField(max_length=50, null=True) + code = models.CharField(max_length=50, blank=True) def str(self): return "{}".format(self.name) From c0d73e6a7d86c884a7b6a90e8db8ebbb5e344176 Mon Sep 17 00:00:00 2001 From: alexyirsa Date: Sun, 5 Nov 2023 20:33:35 -0500 Subject: [PATCH 33/34] =?UTF-8?q?Eliminaci=C3=B3n=20de=20lineas=20duplicad?= =?UTF-8?q?as=20en=20el=20archivo=20models.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- receiver/models.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/receiver/models.py b/receiver/models.py index 4df6e041..799ab7f3 100644 --- a/receiver/models.py +++ b/receiver/models.py @@ -14,20 +14,6 @@ class City(models.Model): def str(self): return "{}".format(self.name) - -class City2(models.Model): - name = models.CharField(max_length=50, unique=True, blank=False) - code = models.CharField(max_length=50, null=True) - - def str(self): - return "{}".format(self.name) - -class City2(models.Model): - name = models.CharField(max_length=50, unique=True, blank=False) - code = models.CharField(max_length=50, null=True) - - def str(self): - return "{}".format(self.name) class State(models.Model): name = models.CharField(max_length=50, unique=False, blank=False) From f292b770781fe15f94e1353674dc8454aee43d0b Mon Sep 17 00:00:00 2001 From: edwin_torres Date: Sun, 5 Nov 2023 21:19:09 -0500 Subject: [PATCH 34/34] =?UTF-8?q?Eliminaci=C3=B3n=20de=20duplicidades?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/monitor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/control/monitor.py b/control/monitor.py index 43d7af0c..a7411fff 100644 --- a/control/monitor.py +++ b/control/monitor.py @@ -12,10 +12,7 @@ def analyze_data(): - # Consulta todos los datos de la última hora, los agrupa por estación y variable - # Compara el promedio con los valores límite que están en la base de datos para esa variable. - # Si el promedio se excede de los límites, se envia un mensaje de alerta. - + print("Calculando alertas...") data = Data.objects.filter(