Skip to content

Commit

Permalink
install ok
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v4s committed Dec 28, 2019
1 parent add99a4 commit f157eca
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
File renamed without changes.
7 changes: 4 additions & 3 deletions mitmoxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import mitmoxy

from mitmoxy.controllers.controller import Controller
from mitmoxy.utils.functions import get_conf

helpers = """
Bitoxy {version} -- Proxy Server
Expand Down Expand Up @@ -47,9 +48,9 @@ def show_version():

# function to execute controller
def exec_controller():
with open('conf/server.json') as file:
conf_server = json.load(file)

# get server configurations
conf_server = get_conf('conf/server.json')
# init controller and execute it
ctrl = Controller(command, conf_server)
ctrl.execute()

Expand Down
17 changes: 17 additions & 0 deletions mitmoxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

MITMOXY="$0"

while [ -h "$MITMOXY" ] ; do
ls=$(ls -ld "$MITMOXY")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
MITMOXY="$link"
else
MITMOXY=$(dirname "$MITMOXY")/"$link"
fi
done

MITMOXY=$(dirname "$MITMOXY")

cd "$MITMOXY" && ./mitmoxy.py "$@"
2 changes: 1 addition & 1 deletion mitmoxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

__version_info__ = ['0', '7', 'beta', '1']
__version_info__ = ['0', '9', 'beta', '1']

__version__ = '.'.join(__version_info__)

Expand Down
3 changes: 0 additions & 3 deletions mitmoxy/controllers/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, command=None, conf_server=None):
# set attributes
self.__conf_server = conf_server
self.__command = command
# self.__log = Logger(conf_log)

#####################################
# PRIVATE METHODS
Expand All @@ -32,8 +31,6 @@ def __invalid_command(self):

# method to start the servers
def __start_server(self):
# init fake ssl factory
# ssl_factory = FakeSslFactory()
# init proxy thread
proxy = Proxy(
self.__conf_server['address'],
Expand Down
2 changes: 1 addition & 1 deletion mitmoxy/factories/fake_cert_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __create_certificate(self, host):

# GENERATE CONFIGURATION FILE FOR CSR (CERTIFICATE SIGNING REQUEST)
# read template
file = open('template/cert/csr.conf', 'r')
file = open('%s/csr.conf' % self.__fake_gen_dir, 'r')
csr_conf = file.read()
file.close()
# set parameter on template
Expand Down
6 changes: 3 additions & 3 deletions template/completions/bitoxy → template/completions/mitmoxy
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Bitoxy completions script
# Mitmoxy completions script

_bitoxy_completions() {
_mitmoxy_completions() {
if [ "${#COMP_WORDS[@]}" != "2" ]; then
return
fi
COMPREPLY=($(compgen -W "start version help" -- "${COMP_WORDS[1]}"))
}

complete -F _bitoxy_completions bitoxy
complete -F _mitmoxy_completions mitmoxy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Unit]
Description=Bitoxy {version} - Proxy server
Description=Mitmoxy {version} - HTTP/HTTPS MITM Proxy server
After=network.target

[Service]
Type=simple
WorkingDirectory={workdir}
ExecStart=/usr/bin/bitoxy start
ExecStart=/usr/bin/mitmoxy start
Restart=no

[Install]
Expand Down

0 comments on commit f157eca

Please sign in to comment.