sync
Some checks failed
perso/huawei-3G-SMS-API/pipeline/head There was a failure building this commit

This commit is contained in:
Julien Cabillot 2023-02-21 14:22:54 -05:00
parent 470c4f3a79
commit c72820e561
3 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
FROM "python:3.7-alpine" FROM "python:3.11-alpine"
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>" LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"
COPY app /app COPY app /app
@ -6,7 +6,13 @@ COPY entrypoint.sh /app/entrypoint.sh
WORKDIR "/app" WORKDIR "/app"
RUN pip install --no-cache-dir --requirement requirements.txt # ntfy est pas encore dispo en dehors de testing sur alpine actuellement
RUN pip install --no-cache-dir --requirement requirements.txt && \
wget https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_x86_64.tar.gz && \
tar zxvf ntfy_2.0.1_linux_x86_64.tar.gz && \
cp -a ntfy_2.0.1_linux_x86_64/ntfy ~/.local/bin && \
mkdir ~/.config/ntfy && \
ntfy --help
#USER "nobody" #USER "nobody"

View File

@ -160,10 +160,14 @@ if __name__ == "__main__":
print('# Notif pushbullet') print('# Notif pushbullet')
pb.push_note("SMS", "From: %s\nDate: %s\n%s" % (messagesR[i]['Phone'], messagesR[i]['Date'], messagesR[i]['Content'])) pb.push_note("SMS", "From: %s\nDate: %s\n%s" % (messagesR[i]['Phone'], messagesR[i]['Date'], messagesR[i]['Content']))
# NTFY
# TODO: exec ntfy publish
# Log HTTP # Log HTTP
print('# Notif HTTP') print('# Notif HTTP')
datam = {'sender' : messagesR[i]['Phone'], 'date': messagesR[i]['Date'], 'content': messagesR[i]['Content']} datam = {'sender' : messagesR[i]['Phone'], 'date': messagesR[i]['Date'], 'content': messagesR[i]['Content']}
r = requests.post(url="https://sms.cabillot.eu", headers={'Content-Type': 'application/json' }, json=datam) # desactive
#r = requests.post(url="https://sms.cabillot.eu", headers={'Content-Type': 'application/json' }, json=datam)
#print(r.status_code) #print(r.status_code)
#Save #Save

View File

@ -9,7 +9,7 @@ services:
# Warning: may not work on ARM (ie: odroid n2) # Warning: may not work on ARM (ie: odroid n2)
cpus: 0.3 cpus: 0.3
cpu_shares: 1024 cpu_shares: 1024
pids_limit: 200 pids_limit: 10
volumes: volumes:
# To store plain text & json logs # To store plain text & json logs
- "./data:/app/data" - "./data:/app/data"