This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 189
A ton of addedd stuff #78
Open
sofixa
wants to merge
22
commits into
ustream:master
Choose a base branch
from
Oxalide:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0214390
updating README
463992f
add optionable send of notification for resolved incidents
40ab5ad
add HipChat notification method
c471874
add better notification logging and result keeping
dba9d0c
add unacknowledge backend code
2359793
update requirements.txt for hipchat, django-debug-toolbar and securit…
d45c1af
add incident endpoint for API as an alias to create_event
30a1442
add django-debug-toolbar to settings and urls if DEBUG==True
1b2eaea
add better error management for hipchat and default settings.py config
b6fe592
fix email notifier to be able to use custom SMTP servers; add default…
8b7d61c
modify user notif_method template for better visibility
116cf33
front-end: add cosmetic glyphicons to menus; add confirmation before …
bde6341
add optional TLS for SMTP email notifier
1b54188
add UNACK support in incidents.py
fb706dd
notification tasks return result for easier debugging with Flower
aae607b
add more verbose errors from incidents.py and send resolve notifications
bab0a4a
add escalate_to_service: the possibility to escalate(basically send, …
db2c490
fix extra space in openduty/models.py
3dd4786
add the option to notify groups of people in escalation rules, events…
77f1382
add the option to search by incident_key with autosuggest for the lat…
1644473
add example systemd service files
5dddc86
add example nginx conf for reverse rpoxy to gunicorn
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Celery daemon | ||
After=network.target gunicorn.service | ||
|
||
[Service] | ||
ExecStart=/bin/sh -c "/$WorkingDirectory/env/bin/celery worker --uid=$User --gid=$Group --logfile=$LogFile --loglevel=info --pidfile=$PIDFile --autoscale=2,1 --app=openduty --workdir=/$WorkingDirectory" | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
ExecStop=/bin/kill -s TERM $MAINPID | ||
Restart=always | ||
RestartSec=3 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Service] | ||
Environment="User=www-data" | ||
Environment="Group=www-data" | ||
Environment="PIDFile=/run/openduty/celery.pid" | ||
Environment="WorkingDirectory=usr/local/bin/openduty" | ||
Environment="LogFile=/var/log/openduty/celery.log" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Flower Service | ||
After=network.target celery.service | ||
|
||
[Service] | ||
ExecStart=/bin/sh -c "/$WorkingDirectory/env/bin/python /$WorkingDirectory/env/bin/flower --app=openduty --port=5555 --logfile=$LogFile --loglevel=info --pidfile=$PIDFile --workdir=/$WorkingDirectory --url_prefix=flower" | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
ExecStop=/bin/kill -s TERM $MAINPID | ||
Restart=always | ||
RestartSec=3 | ||
|
||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Service] | ||
Environment="User=www-data" | ||
Environment="Group=www-data" | ||
Environment="PIDFile=/run/openduty/flower.pid" | ||
Environment="WorkingDirectory=usr/local/bin/openduty" | ||
Environment="LogFile=/var/log/openduty/flower.log" | ||
Environment="ErrorFiles=/var/log/openduty/flower.error.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=gunicorn daemon | ||
After=network.target | ||
|
||
[Service] | ||
PermissionsStartOnly=true | ||
User=www-data | ||
Group=www-data | ||
ExecStartPre=/bin/mkdir -p /var/run/openduty/ | ||
ExecStartPre=/bin/chown -R www-data:www-data /var/run/openduty | ||
ExecStart=/bin/sh -c "/$WorkingDirectory/env/bin/gunicorn --user=$User --workers=9 --pid=$PIDFile --log-file=$LogFile --log-level=Debug --capture-output --error-logfile=$ErrorLogFile --chdir=$WorkingDirectory --bind 0.0.0.0:8080 openduty.wsgi:application" | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
ExecStop=/bin/kill -s TERM $MAINPID | ||
Restart=always | ||
RestartSec=3 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Service] | ||
Environment="User=www-data" | ||
Environment="Group=www-data" | ||
Environment="PIDFile=/run/openduty/gunicorn.pid" | ||
Environment="WorkingDirectory=usr/local/bin/openduty" | ||
Environment="LogFile=/var/log/openduty/gunicorn.log" | ||
Environment="ErrorLogFile=/var/log/openduty/gunicorn.error.log" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just set the User= option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, all of these should likely be set as actual systemd options, not as environment variables:
Group=
PidFile=
WorkingDirectory
Setting these in environment variables, and then spawning a shell so that you can consume them as environment variables actually leads to less configurability in the long run.
A lot of this could be solved by setting
Type=forking
to let systemd know to just use it's default behavior for a forking process.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I'll take this PR and try to work on improving some of the systemd-isms this week.