ajout des recettes et fichiers de configuration du meta

This commit is contained in:
2022-12-14 19:45:04 +01:00
commit 25a3f8922d
47 changed files with 20703 additions and 0 deletions
@@ -0,0 +1,63 @@
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
# Release under the MIT license (see COPYING.MIT for the terms)
HOMEPAGE = "https://git.nas.benserv.fr/vincent/Kine-backend.git"
SUMMARY = "KineIntercom Configurateur Backend"
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7dda4e90ded66ab88b86f76169f28663"
LICENSE = "MIT"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI = "git://git.nas.benserv.fr/vincent/Kine-backend.git;protocol=https;branch=master"
SRC_URI[sha256sum] = ""
SRCREV = "27387991e39f4614510af3bf8a69e47f6c54a568"
PV = "1.0.0"
S = "${WORKDIR}/git"
DEPENDS += "${PYTHON_PN}-setuptools-scm-native kine-users"
RDEPENDS:${PN} = " \
${PYTHON_PN}-attrs \
${PYTHON_PN}-click \
${PYTHON_PN}-flask \
${PYTHON_PN}-flask-cors \
${PYTHON_PN}-flask-api \
${PYTHON_PN}-flask-jwt-extended \
${PYTHON_PN}-jsonschema \
${PYTHON_PN}-importlib-metadata \
${PYTHON_PN}-importlib-resources \
${PYTHON_PN}-markupsafe \
${PYTHON_PN}-itsdangerous \
${PYTHON_PN}-jinja2 \
${PYTHON_PN}-psutil \
${PYTHON_PN}-pyjwt \
${PYTHON_PN}-six \
${PYTHON_PN}-waitress \
${PYTHON_PN}-werkzeug \
${PYTHON_PN}-zipp \
${PYTHON_PN}-typing-extensions \
${PYTHON_PN}-pkgutil-resolve-name \
kine-users \
"
inherit setuptools3 systemd
SRC_URI += " file://configurateur_backend.service \
file://run_prod.py \
"
FILES:${PN} += " /opt/configurateur/bin/run_prod.py \
${systemd_unitdir}/system/configurateur_backend.service"
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "configurateur_backend.service"
do_install:append() {
install -d ${D}/opt/configurateur/bin
install -m 0644 ${WORKDIR}/run_prod.py ${D}/opt/configurateur/bin
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/configurateur_backend.service ${D}${systemd_unitdir}/system/
}
@@ -0,0 +1,17 @@
[Unit]
Description=Démarrage du Backend du Configurateur
StartLimitIntervalSec=300
StartLimitBurst=5
Wants=kineintercom.service
[Service]
Type=simple
User=pi
Group=pi
ExecStart=/usr/bin/python3 /opt/configurateur/bin/run_prod.py
Restart=on-failure
RestartSec=15s
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,13 @@
# -*- encoding: utf-8 -*-
# @author : vincent.benoit@benserv.fr
# @brief : KineIntercom Backend
from ConfBack import app
from ConfBack.config import ProdConfig
from waitress import serve
print("Launch Flask KineIntercom Backend ...")
ret, application = app.create_app(config=ProdConfig)
if ret:
serve(application, host="127.0.0.1", port=6000)
@@ -0,0 +1,32 @@
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
# Release under the MIT license (see COPYING.MIT for the terms)
HOMEPAGE = "https://git.nas.benserv.fr/vincent/Kine-frontend.git"
SUMMARY = "KineIntercom Configurateur Frontend"
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
#LIC_FILES_CHKSUM = "file://LICENSE;md5=7dda4e90ded66ab88b86f76169f28663"
LICENSE = "CLOSED"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI = " \
git://git.nas.benserv.fr/vincent/Kine-frontend.git;protocol=https;branch=master \
"
SRCREV = "cb0aa4b756b312ec7409a056aeb4e3b928fb9cf0"
PV = "1.0.0"
S = "${WORKDIR}/git"
RDEPENDS:${PN} = " \
apache2 \
"
FILES:${PN} = " \
/var/www/app-configurateur \
"
do_install() {
install -d ${D}/var/www/app-configurateur
cp -a ${WORKDIR}/git/prod/app-configurateur/* ${D}/var/www/app-configurateur
chown -R root:root ${D}/var/www/app-configurateur
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+406
View File
@@ -0,0 +1,406 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://git.nas.benserv.fr/vincent/Kine-backend/src/branch/master/db.json",
"type": "object",
"title": "KineIntercom database",
"description": "This document records the parameters of KineIntercom process",
"required": [
"CODE_PIN",
"DTMF_CODE",
"DTMF_DURATION",
"HORAIRES",
"INFOS",
"NUM_AUTORISE",
"OPERATION",
"PIN_ACTIF",
"TONE_DURATION",
"utilisateur"
],
"properties": {
"CODE_PIN": {
"type": "string",
"title": "Le code pin de la carte SIM",
"examples": [
"1234"
]
},
"DTMF_CODE": {
"type": "string",
"title": "Le code DTMF a envoyer par le module GSM",
"examples": [
"*"
]
},
"DTMF_DURATION": {
"type": "integer",
"title": "La duree du code DTMF a envoyer par le module GSM",
"examples": [
10
]
},
"HORAIRES": {
"type": "object",
"title": "Les horaires d'ouverture et de fermeture du module GSM",
"required": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
],
"properties": {
"Monday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Vendredi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Tuesday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Lundi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Wednesday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Samedi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Thursday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Dimanche",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Friday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Jeudi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Saturday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Mardi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
},
"Sunday": {
"type": "array",
"title": "Les horaires pour le jour de la semaine: Mercredi",
"items": {
"type": "object",
"title": "A Schema",
"required": [
"name",
"state"
],
"properties": {
"name": {
"type": "string",
"title": "Les tranches horaires par pas de 1/2 heure"
},
"state": {
"type": "integer",
"title": "L'etat d'ouverture (1) ou fermeture(0) du module GSM",
"examples": [
0,
1
]
}
}
}
}
}
},
"INFOS": {
"type": "object",
"title": "Les infos du module GSM",
"required": [
"control",
"manufacturer"
],
"properties": {
"control": {
"type": "object",
"title": "The control Schema",
"required": [
"call_ready",
"operator",
"service_provider",
"signal_dbm",
"signal_qos",
"sim_inserted"
],
"properties": {
"call_ready": {
"type": "boolean",
"default": false,
"title": "The call_ready Schema",
"examples": [
true,
false
]
},
"operator": {
"type": "string",
"default": "",
"title": "The operator Schema",
"examples": [
"SFR"
]
},
"service_provider": {
"type": "string",
"default": "",
"title": "The service_provider Schema",
"examples": [
"La poste mobile"
]
},
"signal_dbm": {
"type": "string",
"default": "",
"title": "The signal_dbm Schema",
"examples": [
"-75"
]
},
"signal_qos": {
"type": "string",
"default": "",
"title": "The signal_qos Schema",
"examples": [
"excellent"
]
},
"sim_inserted": {
"type": "boolean",
"default": false,
"title": "The sim_inserted Schema",
"examples": [
true,
false
]
}
}
},
"manufacturer": {
"type": "object",
"title": "The manufacturer Schema",
"required": [
"hardware_rev",
"identification",
"model",
"serial_number"
],
"properties": {
"hardware_rev": {
"type": "string",
"title": "The hardware_rev Schema",
"examples": [
"1418B02SIM868M32_BT_EAT"
]
},
"identification": {
"type": "string",
"title": "The identification Schema",
"examples": [
"SIMCOM_Ltd"
]
},
"model": {
"type": "string",
"title": "The model Schema",
"examples": [
"SIMCOM_SIM868"
]
},
"serial_number": {
"type": "string",
"title": "The serial_number Schema",
"examples": [
"864866057705260"
]
}
}
}
}
},
"NUM_AUTORISE": {
"type": "string",
"title": "The NUM_AUTORISE Schema",
"examples": [
"670100036"
]
},
"OPERATION": {
"type": "string",
"title": "The OPERATION Schema",
"examples": [
"Horaires"
]
},
"PIN_ACTIF": {
"type": "boolean",
"title": "The PIN_ACTIF Schema",
"examples": [
true,
false
]
},
"TONE_DURATION": {
"type": "integer",
"title": "The TONE_DURATION Schema",
"examples": [
2
]
},
"utilisateur": {
"type": "object",
"title": "L'utilisateur du configurateur",
"required": [
"id",
"password"
],
"properties": {
"id": {
"type": "string",
"title": "The id Schema",
"examples": [
"admin"
]
},
"password": {
"type": "string",
"title": "The password Schema",
"examples": [
"9ac564e9a29c952a3ddeffd8635adb0c252dbd1d58f3efde265e028f7f808aa9"
]
}
}
}
}
}
@@ -0,0 +1,17 @@
[Unit]
Description=Démarrage du processus KineIntercom
StartLimitIntervalSec=300
StartLimitBurst=5
After=getty.target
[Service]
Type=simple
User=pi
Group=pi
ExecStart=/usr/bin/python3 /usr/local/lib/python3.9/dist-packages/kineintercom/intercom.py
Restart=on-failure
RestartSec=15s
[Install]
WantedBy=multi-user.target
+44
View File
@@ -0,0 +1,44 @@
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
# Release under the MIT license (see COPYING.MIT for the terms)
HOMEPAGE = "https://git.nas.benserv.fr/vincent/KineIntercom.git"
SUMMARY = "KineIntercom Process"
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7dda4e90ded66ab88b86f76169f28663"
LICENSE = "MIT"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI = "git://git.nas.benserv.fr/vincent/KineIntercom.git;protocol=https;branch=master"
SRC_URI[sha256sum] = "573c6bf06324577d4007c9167eeaca7825927c5a396534ae1d86905db53e0386"
SRCREV = "fd79a53348416bf844e412eb6442773661b35aa0"
PV = "1.0.0"
S = "${WORKDIR}/git"
DEPENDS = "python3-setuptools-scm-native kine-users"
RDEPENDS:${PN} = "python3-apscheduler python3-jsonschema python3-pyserial rpi-gpio kine-users"
inherit setuptools3 systemd
SRC_URI += " file://database_origin.json \
file://db.json.schema \
file://kineintercom.service"
FILES:${PN} += " ${datadir}/kineintercom/database_origin.json \
${datadir}/kineintercom/db.json.schema \
${systemd_unitdir}/system/kineintercom.service"
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "kineintercom.service"
do_install:append() {
install -d ${D}${datadir}/kineintercom
install -m 0644 ${WORKDIR}/database_origin.json ${D}${datadir}/kineintercom/
install -m 0644 ${WORKDIR}/db.json.schema ${D}${datadir}/kineintercom/
install -d ${D}${sysconfdir}/kineintercom
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/kineintercom.service ${D}${systemd_unitdir}/system/
}
@@ -0,0 +1,9 @@
[Unit]
Description=Loads FR keymap if available
ConditionPathExists=/usr/share/keymaps/i386/azerty/fr-latin9.map.gz
[Service]
ExecStart=/bin/sh -c '/usr/bin/loadkeys fr'
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,24 @@
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
# Release under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "KineIntercom Services"
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
LICENSE = "CLOSED"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI = "file://loadkeysfr.service"
S = "${WORKDIR}"
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE_${PN} = "loadkeysfr.service"
FILES:${PN} = "${systemd_unitdir}/system/loadkeysfr.service"
do_install:append() {
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/loadkeysfr.service ${D}${systemd_unitdir}/system/
}
+23
View File
@@ -0,0 +1,23 @@
# Copyright (C) 2022 Vincent BENOIT <vincent.benoit@benserv.fr>
# Release under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "KineIntercom Users"
MAINTAINER = "Vincent BENOIT <vincent.benoit@benserv.fr>"
LICENSE = "CLOSED"
DEPENDS_${PN} = "base-files"
S = "${WORKDIR}"
inherit useradd
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "--system sudo; --system adm; --system crontab;"
# To change the password use something like this : "mkpasswd -m sha-512 p@ssw0rd -s 'seed'"
# mkpasswd from 'whois' debian package
USERADD_PARAM:${PN} = "--home-dir /home/pi --groups 'sudo,adm' --shell /bin/bash --password '\$6\$kineintercom\$GG8czkna4jULxnX/UcaaAekfnn1wJry7M/7O0zO89jDZ7lwE7Thv2UEGgBX4z8A6gIaARFyzESmQaFB3lLKns/' pi;"
# Specify whether to produce an output package even if it is empty
ALLOW_EMPTY:${PN} = "1"