Commit 9a539d60 authored by Halunka Matthieu's avatar Halunka Matthieu
Browse files

Set CORS headers for healthcheck, and fix some SonarCloud issues

parent 0b863d69
......@@ -161,6 +161,8 @@ test:
reports:
junit:
- output/junit.xml
cobertura:
- output/coverage.xml
sonarcloud-check:
variables:
......
......@@ -28,13 +28,15 @@ ENV MENTION_PHONE ''
Juste use `docker-compose` command to set up the app. You can get HCaptcha key/secret by creating an account on their [site](https://www.hcaptcha.com/).
**Important** : if there is no user group yet, set `DEFAULT_GROUP_PK` to the value 0.
**Important** : if there is no user group yet, set `DEFAULT_GROUP_PK` to 0.
## Cron job command
If you have a doubt regarding the cron job that are executed, you can run `python3 manage.py crontab show` or `python3 manage.py crontab -l`.
If there is no crontab in response, you can run `python3 manage.py crontab add` to add them again, and then run the previous command to check if the cron job are active.
In case you cannot wait for the cron job to run, you can manually run it by getting the id of the cron job from `python3 manage.py crontab -l`, and then using `/usr/local/bin/python3 /app/manage.py crontab run <id>`
If there is no cron job in response, you can run `python3 manage.py crontab add` to add them again, and then run the previous command to check if cron jobs are active.
In case you cannot wait for the cron job to run, you can manually trigger it by getting the id of the cron job from `python3 manage.py crontab -l`, and then using `/usr/local/bin/python3 /app/manage.py crontab run <id>`
## Licence
......
......@@ -4,9 +4,9 @@
{% block content %}
<h3>Ajouter subscription
{% if type_sub == "U" %}
<b style="color: red">URGENTE</b>
<strong style="color: red">URGENTE</strong>
{% else %}
<b style="color: green">NORMALE</b>
<strong style="color: green">NORMALE</strong>
{% endif %}
sur l'écran <a href="{% url "view_screen" screen.pk %}">{{ screen.name }}</a>
</h3>
......
......@@ -11,7 +11,7 @@
href="{% url "content_view" content_detail.pk %}"><img
src="{{ content_detail.get_first_content_url }}"
style="max-height: 112.25px; max-width: 200px"
class="mr-3" alt="..."></a></div>
class="mr-3" alt="Image {{ content_detail.name }}"></a></div>
<div class="media-body">
<h5 class="mt-0 mb-1"><a
href="{% url "content_view" content_detail.pk %}">{{ content_detail.name }}</a>
......
......@@ -73,16 +73,16 @@
<div class="col-sm-9" style="" contenteditable="false">
{% if content.content_type == "I" %}
{% for image in images %}
<img src="{{ image.get_image_url }}" style="max-width: 100%; max-height: auto"> <br/>
<img src="{{ image.get_image_url }}" style="max-width: 100%; max-height: auto" alt="Image id {{ forloop.counter }}"/> <br/>
<h5 align="center">Dimensions : {{ image.get_image_size.0 }} x {{ image.get_image_size.1 }}</h5>
{% endfor %}
{% elif content.content_type == "Y" %}
<iframe id="ytplayer" type="text/html" height="100%" width="100%"
src="https://www.youtube.com/embed/{{ content.content_url }}?VQ=HD1080"
frameborder="0"></iframe>
frameborder="0" title="Youtube frame"></iframe>
{% elif content.content_type == "U" %}
<iframe id="ytplayer" type="text/html" height="100%" width="100%" src="{{ content.content_url }}"
frameborder="0"></iframe>
frameborder="0" title="Youtube frame"></iframe>
{% endif %}
</div>
</div>
......
......@@ -142,8 +142,7 @@
start();
</script>
<div style="min-height: 100%; min-width: 100%; display: table-cell; vertical-align: middle; text-align: center">
<div id="content1" style="vertical-align: center; text-align: center"><img style="max-height: 100%; max-width: 100%"
src="{{ static }}logo_start_screen.png">
<div id="content1" style="vertical-align: center; text-align: center"><img style="max-height: 100%; max-width: 100%" src="{{ static }}logo_start_screen.png" alt="Logo allumage écran"/>
</div>
<div id="content2" style="text-align: center; vertical-align: center; display: none;"></div>
</div>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="60">
......@@ -14,7 +14,7 @@
<body>
<div class="container">
<div class="jumbotron">
<p align="center"><img src="{% static "app_logo.png" %}" height="150px"></p>
<p align="center"><img src="{% static "app_logo.png" %}" height="150px" alt="Logo Affichage Dynamique"/></p>
<h1 class="display-4">Votre nouvel écran !</h1>
<p class="lead">Cet écran n'a pas encore été configuré, rendez-vous sur l'administration Django pour spécifier
l'id suivant</p>
......
......@@ -45,8 +45,8 @@
<!--/col-3-->
<div class="col-sm-9" style="" contenteditable="false">
<div class="card">
<h5 class="card-header">Flux urgents <i style="font-size: x-small">Aucun contenu "normal" ne s'affiche
si un contenu d'un flux prioritaire est actif</i> {% if can_admin %}<a
<h5 class="card-header">Flux urgents <em style="font-size: x-small">Aucun contenu "normal" ne s'affiche
si un contenu d'un flux prioritaire est actif</em> {% if can_admin %}<a
href="{% url "add_subscription" screen.pk "U" %}"><i aria-hidden="true"
class="far fa-plus-square"></i></a>{% endif %}</h5>
<div class="card-body">
......
......@@ -13,7 +13,7 @@ services:
volumes:
- media:/app/media
- staticfiles:/app/staticfiles
- nginx:/etc/nginx/conf.d
- ./scripts/nginx/default.conf:/etc/nginx/conf.d/default.conf
app:
build: .
......@@ -24,6 +24,7 @@ services:
- DEFAULT_GROUP_PK=0
- RESTAURANTS_GROUP_PK=1
- RESTAURANTS_FEED_PK=1
- SECRET_KEY=secret
networks:
- db
- web
......@@ -57,5 +58,4 @@ networks:
volumes:
staticfiles: {}
media: {}
nginx: {}
db: {}
\ No newline at end of file
......@@ -21,6 +21,8 @@ server {
alias /app/media;
}
location /healthcheck {
add_header Access-Control-Request-Method "OPTIONS, GET";
add_header Access-Control-Allow-Origin "*";
return 200;
}
location / {
......
image:
repository: registry.gitlab.com/sia-insa-lyon/bdeinsalyon/serveur-affichage-dynamique:latest
repository: registry.gitlab.com/sia-insa-lyon/bdeinsalyon/serveur-affichage-dynamique
tag: master
pullPolicy: Always
# Put all your environment variables here as long as they're not numbers or booleans
......
......@@ -24,6 +24,8 @@ server {
}
location /healthcheck {
add_header Access-Control-Request-Method "OPTIONS, GET";
add_header Access-Control-Allow-Origin "*";
return 200;
}
......
......@@ -38,7 +38,7 @@
{% endif %}
{{ form|crispy }}
<input type="hidden" name="next" value="{{ next }}">
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<button class="btn btn-lg btn-primary btn-block" type="submit">Se connecter</button>
<a href="{% url 'password_reset' %}">Mot de passe oublié ?</a><br/>
<a href="{% url 'registration_register' %}">Créer un compte</a>
</form>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment