-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from chaosbot/master
Rebase
- Loading branch information
Showing
22 changed files
with
199 additions
and
97 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
*.bak | ||
*.pyc | ||
.DS_Store | ||
.venv | ||
*.pyo | ||
*.secret | ||
*.swp | ||
*.tmp | ||
*~ | ||
.DS_Store | ||
.vagrant/ | ||
.venv | ||
__pycache__ | ||
github_pat.secret |
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 |
---|---|---|
@@ -1,18 +1,11 @@ | ||
# Opening a PR | ||
Once you open a pull request, ChaosBot will give it X seconds (where X is | ||
determined by github\_api.voting.get\_voting\_window) | ||
before collecting votes. During this time, you should let people know about | ||
your contribution, so that they may vote for it and ensure your hard work gets | ||
merged in. If you do not wish for ChaosBot to consider your PR for merging just | ||
yet, add "WIP" somewhere in your PR title. Remove it when you're ready for voting. | ||
|
||
Once you open a pull request, ChaosBot will give it X seconds (where X is determined by github\_api.voting.get\_voting\_window) before collecting votes. During this time, you should let people know about your contribution, so that they may vote for it and ensure your hard work gets merged in. If you do not wish for ChaosBot to consider your PR for merging just yet, add "WIP" somewhere in your PR title. Remove it when you're ready for voting. | ||
|
||
# Changing your PR | ||
You may change your PR at any time without losing votes, but keep in mind, any | ||
new changes will reset the vote window for additional time. | ||
|
||
You may change your PR at any time without losing votes, but keep in mind, any new changes will reset the vote window for additional time. | ||
|
||
# Merging your PR | ||
At the end of the voting window, ChaosBot will review the votes, and if your PR | ||
crosses a threshold, your changes will be merged in. To thank you for your merged | ||
contribution, ChaosBot will then follow you on GitHub. If your changes are not | ||
merged in, take the time to consider the feedback you received, and create a new | ||
PR with changes you believe people will be willing to vote for. | ||
|
||
At the end of the voting window, ChaosBot will review the votes, and if your PR crosses a threshold, your changes will be merged in. To thank you for your merged contribution, ChaosBot will then follow you on GitHub. If your changes are not merged in, take the time to consider the feedback you received, and create a new PR with changes you believe people will be willing to vote for. |
File renamed without changes.
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
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,3 @@ | ||
copy ..\..\requirements.txt . | ||
docker build -t chaos . | ||
del requirements.txt |
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,2 @@ | ||
cd ..\..\ | ||
docker run -it --rm -v %cd%:/root/workspace/Chaos -p 8082:80 -p 8081:8081 chaos |
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
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
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
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 |
---|---|---|
@@ -1,35 +1,40 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import http.server | ||
import socketserver | ||
import socket | ||
|
||
# set the process name to "chaos_server" so we can easily kill it with | ||
# "pkill chaos_server" | ||
|
||
|
||
def set_proc_name(newname): | ||
"""Change the process name using libc.so.6""" | ||
from ctypes import cdll, byref, create_string_buffer | ||
libc = cdll.LoadLibrary('libc.so.6') | ||
buff = create_string_buffer(len(newname) + 1) | ||
buff.value = newname.encode("ascii") | ||
libc.prctl(15, byref(buff), 0, 0, 0) | ||
|
||
|
||
set_proc_name("chaos_server") | ||
|
||
# start server on port 80 | ||
PORT = 80 | ||
Handler = http.server.SimpleHTTPRequestHandler | ||
|
||
|
||
class NoTimeWaitTCPServer(socketserver.ThreadingTCPServer): | ||
""" when a socket does is shutdown dance, it ends up in a TIME-WAIT state, | ||
which can prevent rebinding on it quickly. here we say "shut up, socket", | ||
let me rebind anyways even if you're in TIME-WAIT." that will teach it. """ | ||
"""When a socket does is shutdown dance, it ends up in a TIME-WAIT state, | ||
which can prevent rebinding on it quickly. Here we say "shut up, socket", | ||
let me rebind anyways even if you're in TIME-WAIT." That will teach it.""" | ||
|
||
def server_bind(self): | ||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
self.socket.bind(self.server_address) | ||
|
||
|
||
httpd = NoTimeWaitTCPServer(("", PORT), Handler) | ||
httpd.serve_forever() | ||
def main(): | ||
# set the process name to "chaos_server" so we can easily kill it with: | ||
# pkill chaos_server | ||
set_proc_name("chaos_server") | ||
|
||
port = 80 | ||
handler = http.server.SimpleHTTPRequestHandler | ||
httpd = NoTimeWaitTCPServer(("", port), handler) | ||
|
||
# serve HTTP on port 80 | ||
httpd.serve_forever() | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.