Skip to content

Commit

Permalink
[Enterprise] Configuration for DB sessions TO
Browse files Browse the repository at this point in the history
  • Loading branch information
elg committed Sep 20, 2019
1 parent ca0795a commit 35935b5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion passhportd/app/models_mod/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def show_port(self):


def show_sessionduration(self):
"""Return an int containing session durection in minutes"""
"""Return an int containing session duraion in minutes"""
if not self.sessiondur:
return 240
return self.sessiondur
Expand Down
2 changes: 1 addition & 1 deletion passhportd/app/views_mod/target/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def extgetaccess(ip, targetname, username):

#Date to stop access:
startdate = datetime.now()
stopdate = startdate + timedelta(hours=4)
stopdate = startdate + timedelta(hours=int(config.DB_SESSIONS_TO))
formatedstop = format(stopdate, '%Y%m%dT%H%M')

#Call the external script
Expand Down
3 changes: 2 additions & 1 deletion passhportd/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
SSH_KEY_FILE = conf.get("Environment", "SSH_KEY_FILE")

""" PaSSHport path """
OPEN_ACCESS_PATH = conf.get("Environment", "OPEN_ACCESS_PATH")
OPEN_ACCESS_PATH= conf.get("Environment", "OPEN_ACCESS_PATH")
PASSHPORT_PATH = conf.get("Environment", "PASSHPORT_PATH")
PYTHON_PATH = conf.get("Environment", "PYTHON_PATH")

Expand All @@ -51,3 +51,4 @@

""" MISC """
MAXLOGSIZE = conf.get("MISC", "MAXLOGSIZE")
DB_SESSIONS_TO = conf.get("MISC", "DB_SESSIONS_TO", fallback='4')
2 changes: 2 additions & 0 deletions passhportd/passhportd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ OPEN_ACCESS_PATH = /home/passhport/passhwall.sh
[MISC]
# Maximum log file size in MB
MAXLOGSIZE = 5
# Databases sessions default timeout in hours
DB_SESSIONS_TO = 12
3 changes: 3 additions & 0 deletions tools/updates_scripts/update201909.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
#Add new configuration field
grep "DB_SESSIONS_TO" /etc/passhport/passhportd.ini > /dev/null || echo "DB_SESSIONS_TO = 12" >> /etc/passhport/passhportd.ini

0 comments on commit 35935b5

Please sign in to comment.