AP manageur V1.0

This commit is contained in:
yoann committed 2026-10-05 02:54:13 +02:00
1 parent 2d3f8d8b3c
commit bc2232c9fe
4 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Apache2 + NetworkManager embarqué + outils Wi-Fi + Python
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apache2 python3 \
&& apt full-upgrade -y && apt-get install -y --no-install-recommends \
apache2 nano python3 \
network-manager wpasupplicant dbus \
iw iproute2 rfkill wireless-regdb \
dnsmasq-base iptables nftables procps \
@@ -20,6 +20,7 @@ COPY ap.py /app/ap.py
ARG HTML_FILE=index.html
COPY ${HTML_FILE} /app/index.html
COPY ${HTML_FILE} /var/www/html/index.html
COPY favicon.png /var/www/html/favicon.png
# L'API n'est plus joignable que via Apache : le HTML appelle /api sur le même port (1001)
RUN sed -i 's#const API_URL=[^;]*;#const API_URL="";#' /app/index.html /var/www/html/index.html
COPY apache-ap.conf /etc/apache2/sites-available/000-default.conf
+1 -1
View File
@@ -516,4 +516,4 @@ if __name__ == '__main__':
os.chmod(SOCKET_PATH, 0o660)
try: shutil.chown(SOCKET_PATH, user='root', group='www-data')
except (LookupError, OSError): os.chmod(SOCKET_PATH, 0o666)
print(f'API AP sur le socket {SOCKET_PATH} (aucun port TCP)'); server.serve_forever()
server.serve_forever()
+1
View File
@@ -18,3 +18,4 @@ ServerName localhost
ErrorLog /dev/stderr
CustomLog /dev/stdout combined
</VirtualHost>
+1 -1
View File
@@ -71,7 +71,7 @@ WEB_PID=$!
trap 'log "Arrêt"; kill "$WEB_PID" "$API_PID" "$NM_PID" 2>/dev/null || true; exit 0' TERM INT
log "Interface web : http://<ip-de-la-machine>:${AP_WEB_PORT}/ (API interne par socket, aucun port)"
log "Interface web : http://<ip-de-la-machine>:${AP_WEB_PORT}/"
wait -n
log "Un service s'est arrêté, fermeture du conteneur"
kill "$WEB_PID" "$API_PID" "$NM_PID" 2>/dev/null || true