Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Michael Coughlin
GraceDB Server
Commits
34fc9771
Commit
34fc9771
authored
7 years ago
by
Tanner Prestegard
Committed by
GraceDB
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixing a few more small bugs for Gunicorn
parent
2e70518f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+5
-5
5 additions, 5 deletions
.gitignore
config/settings/base.py
+6
-2
6 additions, 2 deletions
config/settings/base.py
config/settings/test.py
+1
-1
1 addition, 1 deletion
config/settings/test.py
gracedb/events/test/test_perms.py
+17
-3
17 additions, 3 deletions
gracedb/events/test/test_perms.py
with
29 additions
and
11 deletions
.gitignore
+
5
−
5
View file @
34fc9771
*.swp
*~
*.pyc
apps/static/admin/
apps/static/rest_framework/
apps/static/debug_toolbar/
apps/static/django_extensions/
apps/static/guardian/
config/settings/secret.py
config/settings/local.py
docs/user_docs/build/*
docs/admin_docs/build/*
gracedb/static/admin/
gracedb/static/rest_framework/
gracedb/static/debug_toolbar/
gracedb/static/django_extensions/
gracedb/static/guardian/
This diff is collapsed.
Click to expand it.
config/settings/base.py
+
6
−
2
View file @
34fc9771
...
...
@@ -33,6 +33,10 @@ TEST_RUNNER = 'django.test.runner.DiscoverRunner'
# BrokenLinkEmailsMiddleware is enabled
MANAGERS
=
ADMINS
# Use forwarded host header for Apache -> Gunicorn reverse proxy configuration
USE_X_FORWARDED_HOST
=
True
SECURE_PROXY_SSL_HEADER
=
(
'
HTTP_X_FORWARDED_PROTO
'
,
'
https
'
)
# Base URL for TwiML bins (for Twilio phone/text alerts)
TWIML_BASE_URL
=
'
https://handler.twilio.com/twiml/
'
...
...
@@ -291,7 +295,7 @@ REST_FRAMEWORK = {
}
# Location of static components, CSS, JS, etc.
STATIC_ROOT
=
join
(
CONFIG
_ROOT
,
"
static/
"
)
STATIC_ROOT
=
join
(
PROJECT
_ROOT
,
"
static/
"
)
STATIC_URL
=
"
/gracedb-static/
"
STATICFILES_FINDERS
=
[
'
django.contrib.staticfiles.finders.FileSystemFinder
'
,
...
...
@@ -301,7 +305,7 @@ STATICFILES_FINDERS = [
STATICFILES_DIRS
=
[]
# Location of Bower packages.
BOWER_URL
=
"
bower-static
"
BOWER_URL
=
"
/
bower-static
/
"
BOWER_ROOT
=
join
(
GRACEDB_PATHS
[
"
home
"
],
"
bower_components/
"
)
# Added in order to perform data migrations on the auth and guardian apps
...
...
This diff is collapsed.
Click to expand it.
config/settings/test.py
+
1
−
1
View file @
34fc9771
...
...
@@ -29,7 +29,7 @@ INSTALLED_APPS += [
# if debug_toolbar is enabled and DEBUG is True.
if
DEBUG
and
debug_middleware
in
MIDDLEWARE
:
MIDDLEWARE
.
insert
(
MIDDLEWARE
.
index
(
debug_middleware
),
'
middleware.proxy.XForwardedForMiddleware
'
)
'
core.
middleware.proxy.XForwardedForMiddleware
'
)
# Tuple of IPs which are marked as internal, useful for debugging.
# Tanner (5 Dec. 2017): DON'T CHANGE THIS! Django Debug Toolbar exposes
...
...
This diff is collapsed.
Click to expand it.
gracedb/events/test/test_perms.py
+
17
−
3
View file @
34fc9771
...
...
@@ -33,14 +33,28 @@ TEST_NAMES = {
}
def
extra_args
(
user
):
"""
Utility for passing user details to request
"""
"""
Utility for passing user details to request. Needed because the web server
does some of the authentication work with Shibboleth
"""
if
not
user
:
return
{}
return
{
# Information needed from webserver
AUTH_DICT
=
{
'
REMOTE_USER
'
:
user
.
username
,
'
isMemberOf
'
:
'
;
'
.
join
([
g
.
name
for
g
in
user
.
groups
.
all
()])
'
isMemberOf
'
:
'
;
'
.
join
([
g
.
name
for
g
in
user
.
groups
.
all
()])
,
}
# Need to handle reverse proxy case where headers are used
# instead of Apache environment variables.
if
settings
.
USE_X_FORWARDED_HOST
:
for
k
in
AUTH_DICT
.
keys
():
AUTH_DICT
[
'
HTTP_
'
+
k
.
upper
()]
=
AUTH_DICT
.
pop
(
k
)
return
AUTH_DICT
def
request_event_creation
(
client
,
user
,
test
=
False
):
"""
Given a Django test client, attempt to create a CBC, gstlal,
...
...
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