Skip to content

Commit

Permalink
Merge pull request #273 from Raphux/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
Raphux committed Feb 3, 2018
2 parents 60f768b + 9b8903d commit 27eca4c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
10 changes: 9 additions & 1 deletion passhport/connections_utils/scp.py
Expand Up @@ -12,9 +12,17 @@ def parse(originalcmd):
"""Parse the original scp command written by the user.
Obtain the target, create the command to pass"""
# We wait a command like :
#scp [option] /path/to/my/file user@bastion:targetname//path/on/destination
#scp file user@bastion:player//~
#ssh user@bastion player scp file user@ip:/path/to/file
#ssh user@bastion player rm file
#scp [option] /path/to/my/file user@bastion:targetname[//user//ip]//path/on/destination
# Specific players : 1. If targetname//user//ip//path then it's a scp on a server behind a target
# 2. We retrive the file on the target (targetname)
# 3. We execute a scp on the target (ssh passhport@target scp file user@ip
# 4. We execure a rm on the target (ssh passhport@target rm file
# or
#scp [option] user@bastion:targetname//path/on/destination/file /local/path

# and we should obtain the target name a line like
# scp -t /path/on/destination/file
# scp -f /path/on/destination/file /local/path
Expand Down
3 changes: 1 addition & 2 deletions passhport/passhport
Expand Up @@ -60,7 +60,6 @@ def post(url, data):
This is used to connect to passhportd, to log access"""
try:
if SSL:
print(data)
r = requests.post(url_passhport + url, data=data,
verify=SSL_CERTIFICAT)
else:
Expand Down Expand Up @@ -109,7 +108,7 @@ def checkandconnect(indexed_target_list, choice, username, originalcmd,
login + "@" + target + "-" + username
filelog = pathlog + filename
port = get(url_passhport + "target" + "/port/" +
target)
targetname)
sshoptions = get(url_passhport + "target" + \
"/sshoptions/" + targetname)

Expand Down
1 change: 0 additions & 1 deletion passhport/passhport.ini
Expand Up @@ -3,7 +3,6 @@
[SSL]
SSL = True
SSL_CERTIFICAT = /home/passhport/certs/cert.pem
SSL_KEY = /home/passhport/certs/key.pem

[Network]
# Passhportd hostname should always be localhost since both
Expand Down
6 changes: 0 additions & 6 deletions passhportd/wsgi.py

This file was deleted.

18 changes: 18 additions & 0 deletions tools/apache.conf
@@ -0,0 +1,18 @@
<VirtualHost *:80>
servername passhportd

WSGIDaemonProcess passhportd user=passhport group=passhport threads=5
WSGIScriptAlias / /home/passhport/passhportd.wsgi

<Directory /home/passhport>
WSGIProcessGroup passhportd
WSGIApplicationGroup %{GLOBAL}
Require all granted
Order deny,allow
Allow from all
</Directory>

LogLevel warn
CustomLog /var/log/apache2/passhportd.librit.fr-access.log combined
ErrorLog /var/log/apache2/passhportd.librit.fr-error.log
</VirtualHost>
8 changes: 8 additions & 0 deletions tools/passhportd.wsgi
@@ -0,0 +1,8 @@
activate_this = '/home/passhport/passhport-run-env/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))

import sys
sys.path.insert(0, '/home/passhport/passhport/passhportd')

from app import app as application

0 comments on commit 27eca4c

Please sign in to comment.