Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strudel2_backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
strudel2_backend
Commits
fbedbfe7
Commit
fbedbfe7
authored
2 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
more logging
parent
2690009d
No related branches found
No related tags found
2 merge requests
!83
was trying to get the tunnel based on the csrf-token header which is wrong. So...
,
!82
was trying to get the tunnel based on the csrf-token header which is wrong. So...
Pipeline
#55185
passed
2 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
twsproxy/__init__.py
+6
-3
6 additions, 3 deletions
twsproxy/__init__.py
twsproxy/server/__init__.py
+1
-0
1 addition, 0 deletions
twsproxy/server/__init__.py
with
7 additions
and
3 deletions
twsproxy/__init__.py
+
6
−
3
View file @
fbedbfe7
...
...
@@ -107,7 +107,7 @@ class TWSProxy(threading.Thread):
import
re
import
requests
logger
=
logging
.
getLogger
()
token_format
=
[
b
'
Authorization: token (?P<authtok>\w+)[\W|$]
'
,
token_format
s
=
[
b
'
Authorization: token (?P<authtok>\w+)[\W|$]
'
,
b
'
token=(?P<authtok>\w+)[&|\W|$]
'
,
b
'
twsproxyauth=(?P<authtok>\w+)[\W|$]
'
]
...
...
@@ -184,6 +184,7 @@ def mainserver(port=None):
import
logging
import
sys
import
os
to_log
=
None
try
:
from
logging.handlers
import
TimedRotatingFileHandler
logger
=
logging
.
getLogger
()
...
...
@@ -192,12 +193,14 @@ def mainserver(port=None):
handler
.
setFormattter
(
formatter
)
logger
.
addHandler
(
handler
)
except
Exception
as
e
:
print
(
e
)
import
traceback
print
(
traceback
.
format_exc
())
to_log
=
"
{}
\n
"
.
format
(
e
)
to_log
=
to_log
+
traceback
.
format_exc
()
logging
.
basicConfig
(
filename
=
os
.
path
.
expanduser
(
"
~/.tws.log
"
),
format
=
"
%(asctime)s %(levelname)s:%(process)s: %(message)s
"
)
logger
=
logging
.
getLogger
()
logger
.
setLevel
(
logging
.
DEBUG
)
if
to_log
is
not
None
:
logger
.
debug
(
to_log
)
logger
.
debug
(
"
starting TWS proxy
"
)
if
port
is
None
:
try
:
...
...
This diff is collapsed.
Click to expand it.
twsproxy/server/__init__.py
+
1
−
0
View file @
fbedbfe7
...
...
@@ -34,6 +34,7 @@ class TWSServer:
while
not
self
.
stop
.
is_set
():
try
:
(
clientsocket
,
address
)
=
serversocket
.
accept
()
logger
.
debug
(
'
accepted connection {}
'
.
format
(
clientsocket
))
except
socket
.
timeout
:
continue
clientsocket
.
setblocking
(
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment