New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TorBot GUI #152
TorBot GUI #152
Conversation
ui/src/components/home.js
Outdated
render() { | ||
return ( | ||
<React.Fragment> | ||
<h1 align='center'>TorBot</h1> |
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.
Unclosed regular expression.
Unrecoverable syntax error. (76% scanned).
ui/src/components/home.js
Outdated
|
||
onSubmit(event) { | ||
let scope = this; | ||
let ws = new WebSocket('ws://localhost:8080') |
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.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Missing semicolon.
ui/src/app.js
Outdated
} | ||
} | ||
|
||
export default App; |
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.
'export' is only available in ES6 (use 'esversion: 6').
ui/src/app.js
Outdated
|
||
class App extends React.Component { | ||
render() { | ||
return <Home/>; |
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.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw '<'.
Expected an identifier and instead saw '>'.
Missing semicolon.
ui/src/app.js
Outdated
import Home from './components/home'; | ||
import './app.css'; | ||
|
||
class App extends React.Component { |
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.
'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
ui/src/app.js
Outdated
@@ -0,0 +1,11 @@ | |||
import React from 'react'; | |||
import Home from './components/home'; | |||
import './app.css'; |
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.
'import' is only available in ES6 (use 'esversion: 6').
ui/src/app.js
Outdated
@@ -0,0 +1,11 @@ | |||
import React from 'react'; | |||
import Home from './components/home'; |
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.
'import' is only available in ES6 (use 'esversion: 6').
modules/wsserver.py
Outdated
format='%(asctime)s %(levelname)-8s %(message)s', | ||
level=logging.INFO, | ||
datefmt='%Y-%m-%d %H:%M:%S') | ||
async def handle_msg(websocket, path): |
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.
expected 2 blank lines, found 0
self.response = proxyGET(link) | ||
else: | ||
self.response = requests.get(link) | ||
except (requests.exceptions.ChunkedEncodingError, requests.exceptions.HTTPError, requests.exceptions.ConnectionError, ConnectionError) as err: |
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.
line too long (150 > 79 characters)
return session.get(url, headers=headers) | ||
else: | ||
return session.get(url) | ||
|
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.
blank line at end of file
modules/proxy.py
Outdated
} | ||
session = requests.session() | ||
session.proxies = proxies | ||
def proxyGET(url, headers=None): |
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.
expected 2 blank lines, found 0
ui/webpack.config.js
Outdated
}); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
const path = require('path'); |
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.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
ui/src/renderer.js
Outdated
@@ -0,0 +1,8 @@ | |||
import React from 'react'; |
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.
'import' is only available in ES6 (use 'esversion: 6').
ui/src/electron-main.js
Outdated
mainWindow = new BrowserWindow(browserOptions); | ||
|
||
// Configuring locaiton for HTML outputted after React | ||
const startURL = url.format({ |
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.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
ui/src/electron-main.js
Outdated
const url = require('url'); | ||
|
||
function createWindow () { | ||
let browserOptions = {width: 800, height: 600}; |
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.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
modules/wsserver.py
Outdated
status = requests.head(link, timeout=5).ok | ||
yield {'name': link, 'status': status} | ||
except Exception as err: | ||
yield {'name': link, 'status': False, 'error': str(err)} |
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.
trailing whitespace
modules/wsserver.py
Outdated
|
||
soup = BeautifulSoup(response.text, 'html.parser') | ||
anchor_tags = soup.find_all('a') | ||
links = list() |
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.
local variable 'links' is assigned to but never used
modules/wsserver.py
Outdated
response = json.dumps(link) | ||
await websocket.send(response) | ||
|
||
async def get_links(websocket, url): |
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.
expected 2 blank lines, found 1
modules/wsserver.py
Outdated
level=logging.INFO, | ||
datefmt='%Y-%m-%d %H:%M:%S') | ||
|
||
async def handle_msg(websocket, path): |
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.
expected 2 blank lines, found 1
ui/src/components/links.js
Outdated
render() { | ||
let links = this.state.links; | ||
if (!links.length) { | ||
return <h1>Links Incoming</h1>; |
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.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw '<'.
Missing semicolon.
Unclosed regular expression.
Unrecoverable syntax error. (75% scanned).
ui/src/components/links.js
Outdated
* @memberof Links | ||
*/ | ||
render() { | ||
let links = this.state.links; |
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.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
ui/src/components/links.js
Outdated
*/ | ||
onHome(event) { | ||
this.websocket.close(1000); // Send normal closure code | ||
ReactDOM.render(<Home/>, document.getElementById('root')); |
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.
Expected ')' and instead saw 'Home'.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw ')'.
Expected an identifier and instead saw '<'.
Expected an identifier and instead saw '>'.
Missing semicolon.
ui/src/components/links.js
Outdated
return; | ||
} | ||
let stateLinks = this.state.links; | ||
stateLinks.push(link) |
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.
Missing semicolon.
return session.head(url, timeout=timeout, headers=headers) | ||
else: | ||
return session.head(url, timeout=timeout) | ||
|
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.
blank line at end of file
modules/proxy.py
Outdated
else: | ||
return session.get(url) | ||
|
||
def proxyHEAD(url, timeout=10, headers=None): |
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.
expected 2 blank lines, found 1
modules/proxy.py
Outdated
session = requests.session() | ||
session.proxies = proxies | ||
|
||
def proxyGET(url, headers=None): |
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.
expected 2 blank lines, found 1
modules/proxy.py
Outdated
Peforms HEAD request using socks5 proxy | ||
|
||
Args: | ||
url (string): url to retreive |
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.
trailing whitespace
modules/proxy.py
Outdated
def proxyHEAD(url, timeout=10, headers=None): | ||
""" | ||
Peforms HEAD request using socks5 proxy | ||
|
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.
blank line contains whitespace
modules/proxy.py
Outdated
Peforms GET request using socks5 proxy | ||
|
||
Args: | ||
url (string): url to retreive |
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.
trailing whitespace
modules/proxy.py
Outdated
def proxyGET(url, headers=None): | ||
""" | ||
Peforms GET request using socks5 proxy | ||
|
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.
blank line contains whitespace
modules/proxy.py
Outdated
host (string): host name or IP Address | ||
port (string): port number | ||
""" | ||
global proxies # Allows us to modify global variable directly |
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.
at least two spaces before inline comment
modules/proxy.py
Outdated
|
||
def setProxy(host, port): | ||
""" | ||
Sets host and port for tor proxies being used when performing |
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.
trailing whitespace
modules/proxy.py
Outdated
session = requests.session() | ||
session.proxies = proxies | ||
|
||
def setProxy(host, port): |
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.
expected 2 blank lines, found 1
} | ||
session.proxies = proxies | ||
|
||
def proxy_get(url, headers=None): |
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.
expected 2 blank lines, found 1
modules/proxy.py
Outdated
host (string): host name or IP Address | ||
port (string): port number | ||
""" | ||
global proxies #Allows us to modify global variable directly |
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.
inline comment should start with '# '
# If there's an exception then we assume the link is bad | ||
yield {'name': link, 'status': False, 'error': str(err)} | ||
|
||
def start_wsserver(): |
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.
expected 2 blank lines, found 1
return | ||
|
||
soup = BeautifulSoup(response.text, 'html.parser') | ||
anchor_tags = soup.find_all('a') # Anchor tags contain links |
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.
at least two spaces before inline comment
response = proxy_get(url) | ||
else: | ||
response = requests.get(url) | ||
except Exception as err: |
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.
trailing whitespace
path (string): contains origin of websocket message | ||
""" | ||
msg = await websocket.recv() | ||
data = json.loads(msg) # Load JSON response from front-end |
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.
at least two spaces before inline comment
response = requests.head(url) | ||
return dict(response.headers) | ||
|
||
async def get_links(url): |
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.
expected 2 blank lines, found 1
This is the beginning of a long road, I'm just laying out the initial front end architecture of TorBot. I'm using React, Electron, Yarn and Webpack. If you have any questions feel fee to ask in the PR, I'm going to fill out more information for those that are interested.