Skip to content

Commit

Permalink
Merge pull request #9 from philhagen/master
Browse files Browse the repository at this point in the history
add systemd service file, readme cleanup
  • Loading branch information
MarkBaggett authored Jul 2, 2018
2 parents fb52275 + b827b4c commit 6336428
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ Here is an example of starting the server on port 8000 and only loading the top
student@SEC573:~$ python domain_stats.py --preload 100 -a ~/Downloads/top-1m.csv 8000
```
Note that a systemd startup file is provided, although you will likely need to adjust paths to the script and `top-1m.csv` file. The provided sample assumes you've cloned this repository to `/usr/local/share/domain_stats/`. Enable with something like the following, again substituting the appropraite paths:
```bash
$ sudo systemctl enable /usr/local/share/domain_stats/systemd/domain_stats.service
$ sudo systemctl start domain_stats.service
```
---
CHANGE LOG: Version 1.0 -> 1.1
*Update code to work in either Python2 or Python3
*Changed Default Content type of server response to TEXT.
*Added -d option which will load top 1000 domains from disk when -a top-1m.csv and --preload are not used.
*Added caching of "Domain not found" responses from WHOIS (Feature Request from resweb10)
*Added update_diskcache.py to create or update the local disk cache.
* Update code to work in either Python2 or Python3
* Changed Default Content type of server response to TEXT
* Added `-d` option which will load top 1000 domains from disk when `-a top-1m.csv` and `--preload` are not used.
* Added caching of "Domain not found" responses from WHOIS (Feature Request from @resweb10)
* Added update_diskcache.py to create or update the local disk cache.
Empty file modified domain_stats.py
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions systemd/domain_stats.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Domain Stats Alexa Top 1M Lookup
After=network.target

[Service]
WorkingDirectory=/usr/bin
ExecStart=/usr/local/share/domain_stats/domain_stats.py -a /usr/local/share/domain_stats/top-1m.csv --preload 0 10010
PIDFile=/var/run/domainstats-alexa.pid
Restart=always

[Install]
WantedBy=multi-user.target

0 comments on commit 6336428

Please sign in to comment.