Skip to content

Commit 8dd8646

Browse files
authored
Merge pull request #1 from Epiteks/dev
v1.0
2 parents 716e263 + f020f00 commit 8dd8646

File tree

3 files changed

+65
-13
lines changed

3 files changed

+65
-13
lines changed

Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.5-alpine
2+
3+
MAINTAINER hug33k
4+
5+
ENV SMS_LOGIN login
6+
ENV SMS_TOKEN token
7+
ENV EPITECH_MAIL mail
8+
ENV EPITECH_PWD pwd
9+
ENV NOTIFYSMS_DIR /app
10+
11+
RUN echo "http://dl-2.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
12+
echo "http://dl-3.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
13+
echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
14+
echo "http://dl-5.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
15+
16+
RUN apk update; apk add apk-cron
17+
18+
RUN mkdir /app
19+
20+
COPY . /app/
21+
22+
RUN crontab -l | cat - /app/crontab | crontab -
23+
24+
RUN touch /var/log/cron.log
25+
26+
RUN pip install -r /app/requirements.txt
27+
28+
WORKDIR /app
29+
30+
CMD crond && tail -f /var/log/cron.log

README.md

+34-13
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,71 @@
11
# NotifySMS
22

3+
[![](https://images.microbadger.com/badges/version/epiteks/notifysms.svg)](https://microbadger.com/images/epiteks/notifysms)
4+
35
🔔 ➡ 📱 Get Epitech notifications by SMS via Free Mobile
46

57
## How to use it ?
68

7-
#### Setup
9+
### Via Docker
10+
11+
Via CLI :
12+
13+
````bash
14+
$> docker run -d -e "SMS_LOGIN=login" -e "SMS_TOKEN=token" -e "EPITECH_MAIL=mail" -e "EPITECH_PWD=pwd" epiteks/notifysms
15+
````
16+
17+
Via Docker Compose :
18+
````yaml
19+
notifysms:
20+
image: epiteks/notifysms
21+
environment:
22+
- SMS_LOGIN
23+
- SMS_TOKEN
24+
- EPITECH_MAIL
25+
- EPITECH_PWD
26+
restart: always
27+
````
28+
29+
### Local
830

931
You need to set these variables into your environment :
32+
- NOTIFYSMS_DIR
1033
- SMS_LOGIN
1134
- SMS_TOKEN
1235
- EPITECH_MAIL
1336
- EPITECH_PWD
1437

38+
`NOTIFYSMS_DIR` is the location of `NotifySMS` directory.
39+
1540
`SMS_*` are used by [`freemobilesms`](https://github.com/hug33k/freemobilesms).
1641
You can get these infos in your [Free Mobile panel](https://mobile.free.fr/moncompte/)
1742

1843
`EPITECH_*` are used to log you in via [our wrapper](https://github.com/epiteks/wrapitech).
1944

2045
Example :
2146
````bash
47+
export NOTIFYSMS_DIR=`pwd`
2248
export SMS_LOGIN=xxxxxxx
2349
export SMS_TOKEN=xxxxxxx
2450
2551
export SMS_TOKEN=unix_pwd
2652
````
2753

2854
Then you will need to install needed packages via [`pip`](https://pip.pypa.io/en/stable/installing/).
55+
2956
````bash
3057
$> pip install -r requirements.txt
3158
````
3259

33-
#### Let's run it
34-
35-
You will have to add a line to your `crontab` config.
60+
If you want to execute this program regularly, you can use cron.
61+
Command is available in `crontab`[crontab].
3662

3763
````sh
38-
$> crontab -e
39-
````
40-
41-
Then you need to add this (Based on how often you want to run it and where `NotifySMS` is located on your computer) :
42-
43-
````
44-
*/15 * * * * python3.5 $PATH_TO_NOTIFYSMS/main.py
64+
$> crontab -l | cat - crontab | crontab -
4565
````
4666

47-
(Here, it will run every 15 minutes `NotifySMS`, which is at $PATH_TO_NOTIFYSMS` location)
67+
This configuration will ask cron to execute `NotifySMS` every 2 minutes.
68+
You can change it before execute this command.
4869

4970
## FAQ
5071

@@ -58,7 +79,7 @@ But feel free to contribute !
5879

5980
Unfortunately, we don't support OAuth with [Wrapitech](https://github.com/epiteks/wrapitech).
6081

61-
Once again, feel free to contribute !`
82+
Once again, feel free to contribute !
6283

6384
#### What is `history.json` ? Can I delete it ?
6485

crontab

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*/2 * * * * python $NOTIFYSMS_DIR/main.py

0 commit comments

Comments
 (0)