Skip to content

Commit 338070f

Browse files
author
Charles Overbeck
committed
Merge patch of diff of master and 1.13.0 tag
There was a network hiccup during hubflow release finish, and 1.13 code ended up only being merged to develop, not master.
1 parent c4fb9e9 commit 338070f

14 files changed

+164
-59
lines changed

.gitallowed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#initial .gitallowed, in the future this is where git-secrets false-positives should be added
22

33
scripts/tests/test-webservice-image-digest.py:.*sha256
4+
scripts/webservice-image-digest.py:.*sha256

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**Description**
2+
A description of the PR, should include a decent explanation as to why this change was needed and a decent explanation as to what this change does
3+
4+
**Issue**
5+
A link to a github issue or SEAB- ticket (using that as a prefix)
6+
7+
Please make sure that you've checked the following before submitting your pull request. Thanks!
8+
9+
- [ ] Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.

SECURITY.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The Dockstore system routinely receives security updates to the most recently
6+
released tagged minor version. All previous versions are unsupported.
7+
8+
## Reporting a Vulnerability
9+
10+
Users are able to open helpdesk tickets on [Discourse](https://discuss.dockstore.org/). Users can create helpdesk tickets in case of privacy complaints, security vulnerabilities, or any other urgent matter related to Dockstore. Helpdesk tickets will be addressed by Dockstore administrators.
11+
12+
The following steps can be taken to create a helpdesk ticket (also shown [here](https://discuss.dockstore.org/t/opening-helpdesk-tickets/1506)).
13+
14+
1. Navigate to [Discourse](https://discuss.dockstore.org/) and login.
15+
2. Select your profile icon, located in the top right corner of the screen.
16+
3. Select the `mail` icon, located in the dropdown.
17+
4. Send a message to the `dockstore_admins` group.
18+
19+
Note
20+
21+
> If you are unable to see a New Message button on the mail page, you may be considered a new user and have insufficient privileges. Entering 5 topics and viewing 30 posts over a minimum of 10 minutes will raise your privileges. You will be notified of any privilege changes to your account via the mailbox.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
- log_volume:/dockstore_logs
2525
- ./config/web.yml:/home/web.yml
2626
- ./config/init_webservice.sh:/home/init_webservice.sh
27-
- ${GITHUB_APP_PRIVATE_KEY_FILE}:/home/dockstore_github_app_private_key.pem
27+
- ${GITHUB_APP_PRIVATE_KEY_FILE}:/dockstore/github-key/dockstore-github-private-key.pem
2828
- ../language-plugins/:/root/.dockstore/language-plugins
2929
command: ["bash", "/home/init_webservice.sh"]
3030
ports:
Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
{
2-
"PUBLIC_LAUNCHER_IP_ADDRESS":"",
3-
"PRODUCTION":false,
4-
"DOCKSTORE_VERSION":"develop",
5-
"UI2_HASH":"develop",
6-
"GITHUB_CLIENT2_ID":"foobared",
7-
"GITHUB_CLIENT2_SECRET":"foobared",
8-
"QUAY_CLIENT_ID":"foobared",
9-
"QUAY_CLIENT_SECRET":"foobared",
2+
"AUTHORIZER_TYPE":"replaceme",
3+
"BD_CATALYST_SEVEN_BRIDGES_IMPORT_URL":"replaceme",
4+
"BD_CATALYST_TERRA_IMPORT_URL":"replaceme",
105
"BITBUCKET_CLIENT_ID":"foobared",
116
"BITBUCKET_CLIENT_SECRET":"foobared",
12-
"DOMAIN_NAME":"foobar",
13-
"HTTPS":false,
7+
"CHECK_URL_EXISTS_ENDPOINT":"replaceme",
8+
"CHECK_URL_LAMBDA_VERSION":"n/a",
149
"COMPOSE_SETUP_VERSION":"foo",
15-
"DEPLOY_COMMIT_ID":"foo",
16-
"DISCOURSE_URL":"foobar",
17-
"DISCOURSE_KEY":"foobar",
10+
"CWL_PARSING_LAMBDA_VERSION":"n/a",
11+
"DATABASE_DOMAIN":"postgres",
12+
"DATABASE_GENERATED":false,
13+
"DEPLOY_VERSION":"replaceme",
1814
"DISCOURSE_CATEGORY_ID":"10",
15+
"DISCOURSE_KEY":"foobar",
16+
"DISCOURSE_URL":"foobar",
17+
"DOCKSTORE_DBPASSWORD":"replaceme",
18+
"DOCKSTORE_VERSION":"develop",
1919
"DOCUMENTATION_URL":"foobar",
20+
"DOMAIN_NAME":"foobar",
21+
"ELASTICSEARCH_DOMAIN":"replaceme",
22+
"ELASTICSEARCH_MAX_CONCURRENT_SESSIONS":"123",
23+
"ELASTICSEARCH_PASSWORD":"replaceme",
24+
"ELASTICSEARCH_PORT":"80",
25+
"ELASTICSEARCH_PROTOCOL":"http",
26+
"ELASTICSEARCH_USER":"replaceme",
27+
"ELWAZI_IMPORT_URL": "replaceme",
28+
"EXTERNAL_GOOGLE_CLIENT_PREFIX1":"replaceme",
2029
"FEATURED_CONTENT_URL":"foobar",
21-
"GITHUB_APP_PRIVATE_KEY_FILE": "/replaceme",
30+
"FEATURED_NEWS_URL":"replaceme",
31+
"GALAXY_PLUGIN_VERSION":"0.0.6",
2232
"GITHUB_APP_ID": "1234",
2333
"GITHUB_APP_NAME": "foobar",
24-
"TOOLTESTER_BUCKET_NAME": "replaceme",
25-
"CHECK_URL_EXISTS_ENDPOINT":"replaceme",
26-
"TAG_MANAGER_ID":"foobar",
34+
"GITHUB_APP_PRIVATE_KEY_FILE": "/replaceme",
35+
"GITHUB_CLIENT2_ID":"foobared",
36+
"GITHUB_CLIENT2_SECRET":"foobared",
2737
"GITLAB_CLIENT_ID":"foobar",
2838
"GITLAB_CLIENT_SECRET":"foobar",
2939
"GOOGLE_CLIENT_ID":"potato",
3040
"GOOGLE_CLIENT_SECRET":"potato",
41+
"HTTPS":false,
42+
"IS_FARGATE_DEPLOY":false,
3143
"LOGSTASH":false,
3244
"LOGSTASH_HOST":"replaceme",
33-
"TERRA_IMPORT_URL":"replaceme",
34-
"ELWAZI_IMPORT_URL": "replaceme",
45+
"NEXTFLOW_PARSING_LAMBDA_VERSION":"n/a",
3546
"BD_CATALYST_SEVEN_BRIDGES_IMPORT_URL":"replaceme",
3647
"BD_CATALYST_TERRA_IMPORT_URL":"replaceme",
3748
"AUTHORIZER_TYPE":"replaceme",
@@ -40,17 +51,21 @@
4051
"DATABASE_GENERATED":false,
4152
"ORCID_CLIENT_ID":"replaceme",
4253
"ORCID_CLIENT_SECRET":"replaceme",
54+
"ORCID_SCOPE":"replaceme",
4355
"ORCID_URL":"replaceme",
44-
"ZENODO_CLIENT_ID":"replaceme",
45-
"ZENODO_CLIENT_SECRET":"replaceme",
46-
"ZENODO_URL":"replaceme",
56+
"POSTGRES_DBPASSWORD":"replaceme",
57+
"PRODUCTION":false,
58+
"PUBLIC_LAUNCHER_IP_ADDRESS":"",
59+
"QUAY_CLIENT_ID":"foobared",
60+
"QUAY_CLIENT_SECRET":"foobared",
61+
"SAM_PATH":"replaceme",
4762
"SLACK_URL":"replaeceme",
48-
"GALAXY_PLUGIN_VERSION":"0.0.6",
49-
"DATABASE_DOMAIN":"postgres",
50-
"DBUSER":"dockstore",
51-
"DBPASSWORD":"dockstore",
52-
"CWL_PARSING_LAMBDA_VERSION":"n/a",
63+
"TAG_MANAGER_ID":"foobar",
64+
"TERRA_IMPORT_URL":"replaceme",
65+
"TOOLTESTER_BUCKET_NAME": "replaceme",
66+
"UI2_HASH":"develop",
5367
"WDL_PARSING_LAMBDA_VERSION":"n/a",
54-
"NEXTFLOW_PARSING_LAMBDA_VERSION":"n/a",
55-
"CHECK_URL_LAMBDA_VERSION":"n/a"
68+
"ZENODO_CLIENT_ID":"replaceme",
69+
"ZENODO_CLIENT_SECRET":"replaceme",
70+
"ZENODO_URL":"replaceme"
5671
}

install_bootstrap

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,36 @@ MSG
2020
function template()
2121
{
2222
mkdir -p config
23+
24+
NGINX_CONF_DIRECTORY="config"
25+
NGINX_HTML2_DIRECTORY="config"
26+
WEBSERVICE_DIRECTORY="config"
27+
28+
if [ $IS_FARGATE_DEPLOY == "true" ]; then
29+
mkdir -p config/webservice
30+
mkdir -p config/nginx-conf
31+
mkdir -p config/nginx-html2
32+
# Place the config files into specific directories so they can be mounted to container paths as bind mounts
33+
NGINX_CONF_DIRECTORY="${NGINX_CONF_DIRECTORY}/nginx-conf"
34+
NGINX_HTML2_DIRECTORY="${NGINX_HTML2_DIRECTORY}/nginx-html2"
35+
WEBSERVICE_DIRECTORY="${WEBSERVICE_DIRECTORY}/webservice"
36+
37+
wget -qO ${NGINX_HTML2_DIRECTORY}/index.html https://gui.dockstore.org/${UI2_HASH}/index.html
38+
wget -qO ${NGINX_HTML2_DIRECTORY}/manifest.json https://gui.dockstore.org/${UI2_HASH}/manifest.json
39+
fi
40+
2341
mustache dockstore_launcher_config/compose.config templates/Dockerfile_ui2.template > config/Dockerfile_ui2
24-
mustache dockstore_launcher_config/compose.config templates/robots.txt.template > config/robots.txt
25-
mustache dockstore_launcher_config/compose.config templates/web.yml.template > config/web.yml
26-
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.conf.template > config/default.nginx_http.conf
27-
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.shared.conf.template > config/default.nginx_http.shared.conf
28-
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.security.conf.template > config/default.nginx_http.security.conf
29-
30-
mustache dockstore_launcher_config/compose.config templates/init_webservice.sh.template > config/init_webservice.sh
31-
mustache dockstore_launcher_config/compose.config templates/init_migration.sh.template > config/init_migration.sh
42+
mustache dockstore_launcher_config/compose.config templates/robots.txt.template > ${NGINX_HTML2_DIRECTORY}/robots.txt
43+
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.conf
44+
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.shared.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.shared.conf
45+
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.security.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.security.conf
46+
47+
mustache dockstore_launcher_config/compose.config templates/web.yml.template > ${WEBSERVICE_DIRECTORY}/web.yml
48+
mustache dockstore_launcher_config/compose.config templates/init_webservice.sh.template > ${WEBSERVICE_DIRECTORY}/init_webservice.sh
49+
mustache dockstore_launcher_config/compose.config templates/init_migration.sh.template > ${WEBSERVICE_DIRECTORY}/init_migration.sh
50+
chmod a+rx ${WEBSERVICE_DIRECTORY}/init_webservice.sh
51+
chmod a+rx ${WEBSERVICE_DIRECTORY}/init_migration.sh
52+
3253
mustache dockstore_launcher_config/compose.config templates/elasticsearch.yml > config/elasticsearch.yml
3354
mustache dockstore_launcher_config/compose.config templates/metricbeat.yml > config/metricbeat.yml
3455
mustache dockstore_launcher_config/compose.config templates/essnapshot_backup.sh > scripts/essnapshot_backup.sh
@@ -66,11 +87,13 @@ template
6687

6788
download_galaxy "$*"
6889

69-
# We need to set the environment variable for the image digest
70-
source .env
71-
DOCKSTORE_IMAGE_DIGEST=$(scripts/webservice-image-digest.py $DOCKSTORE_VERSION)
72-
echo "DOCKSTORE_IMAGE_DIGEST=$DOCKSTORE_IMAGE_DIGEST" >> .env
90+
if [ $IS_FARGATE_DEPLOY == "false" ]; then
91+
# We need to set the environment variable for the image digest
92+
source .env
93+
DOCKSTORE_IMAGE_DIGEST=$(scripts/webservice-image-digest.py $DOCKSTORE_VERSION)
94+
echo "DOCKSTORE_IMAGE_DIGEST=$DOCKSTORE_IMAGE_DIGEST" >> .env
7395

74-
docker-compose build
96+
docker-compose build
97+
fi
7598

7699
echo "Exiting now."

scripts/tests/test-webservice-image-digest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
base_command = "python {}".format(script_location)
1818
branch = "develop"
19+
full_directory = "develop-b667562"
1920
simple_tag = "digest_test"
2021
annotated_tag = "1.12.0-beta.1"
2122

@@ -28,6 +29,12 @@ class TestDigest(unittest.TestCase):
2829
# self.assertEqual(ret, "sha256:52cf6b09e89a238bfd1d98dd01139442d67fcaaa377c179f315dd06555f7bcae")
2930
# pass
3031

32+
def test_full_directory(self):
33+
cmd = "{} {}".format(base_command, full_directory)
34+
ret = subprocess.check_output(cmd, shell=True, universal_newlines=True).rstrip()
35+
self.assertEqual(ret, "sha256:08c67131daf6109fadb19d994d753ede7ae28e41c675322e2980327597bcb665")
36+
pass
37+
3138
def test_simple_tag(self):
3239
cmd = "{} {}".format(base_command, simple_tag)
3340
ret = subprocess.check_output(cmd, shell=True, universal_newlines=True).rstrip()

scripts/webservice-image-digest.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,24 @@
66
images by digest as opposed to by tag and will also guarantee the image pulled
77
from Quay has not been changed since being built.
88
9+
Assets in S3 follow the directory structure: `./branch-shortcommit/image-digest.txt`
10+
11+
Provide a git tag, branch, or branch-shorthash
12+
13+
The output is formatted to be easily used to select a specific image digest via docker
14+
15+
sha256:08c67131daf6109fadb19d994d753ede7ae28e41c675322e2980327597bcb665
16+
917
"""
1018

1119
import argparse
1220
import requests
21+
import string
1322

1423
parser = argparse.ArgumentParser(
1524
description='Gather an image digest for the Dockstore Webservice from S3 as created by CircleCI')
1625
parser.add_argument('tag', type=str,
17-
help='The git tag (or branch)')
26+
help='The git tag, branch, or branch-hash of a Webservice commit')
1827

1928
args = parser.parse_args()
2029

@@ -46,20 +55,26 @@ def get_commit_from_github(tag_or_branch):
4655
print("No commit for that tag or branch found!")
4756
exit(1)
4857

49-
def get_digest_from_s3(tag, commit):
58+
def get_digest_from_s3(directory):
5059
# downloads the image-digest.txt from a directory in S3
5160
base_url = "https://gui.dockstore.org"
52-
response = requests.get("{}/{}-{}/image-digest.txt".format(base_url, tag, commit[0:7]))
61+
response = requests.get("{}/{}/image-digest.txt".format(base_url, directory))
5362
if (response.status_code != 200):
54-
print("Expected a file at {}".format("{}/{}-{}/image-digest.txt".format(base_url, tag, commit[0:7])))
63+
print("Expected a file at {}".format("{}/{}/image-digest.txt".format(base_url, directory)))
5564
print("The image-digest.txt was not found in S3, did the build succeed?")
5665
exit(1)
5766
# There is a newline at the end of the file we rstrip
5867
return response.text.rstrip()
5968

6069
if __name__ == "__main__":
6170
# slashes are replaced with _ in docker image tags
62-
commit = get_commit_from_github(args.tag)
63-
circle_digest = get_digest_from_s3(args.tag, commit)
71+
# check to see if input includes a dash followed by 7 chars
72+
parsed = args.tag.split('-')
73+
if len(parsed) == 2 and len(parsed[1]) == 7 and all(c in string.hexdigits for c in parsed[1]):
74+
directory = args.tag
75+
else:
76+
commit = get_commit_from_github(args.tag)
77+
directory = "{}-{}".format(args.tag, commit[0:7])
78+
circle_digest = get_digest_from_s3(directory)
6479
print("sha256:{}".format(circle_digest))
6580
exit(0)

templates/default.nginx_http.conf.template

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ access_log off;
2626
resolver 127.0.0.11 valid=10s;
2727

2828
server {
29+
{{#IS_FARGATE_DEPLOY}}
30+
set $webservice "127.0.0.1";
31+
{{/IS_FARGATE_DEPLOY}}
32+
{{^IS_FARGATE_DEPLOY}}
2933
set $webservice "webservice";
34+
{{/IS_FARGATE_DEPLOY}}
3035
server_name .{{ DOMAIN_NAME }};
3136
include /etc/nginx/conf.d/default.nginx_http.shared.conf;
3237
include /etc/nginx/conf.d/default.nginx_http.security.conf;
@@ -102,7 +107,12 @@ server {
102107

103108
# Server block for access via IP instead of domain
104109
server {
110+
{{#IS_FARGATE_DEPLOY}}
111+
set $webservice "127.0.0.1";
112+
{{/IS_FARGATE_DEPLOY}}
113+
{{^IS_FARGATE_DEPLOY}}
105114
set $webservice "webservice";
115+
{{/IS_FARGATE_DEPLOY}}
106116
access_log /var/log/nginx/access.log custom;
107117
listen 4200 default_server;
108118

templates/default.nginx_http.security.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ add_header X-XSS-Protection "1; mode=block" always;
1818
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
1919

2020
# Explicitly list domains allowed to serve content for this site
21-
add_header Content-Security-Policy-Report-Only "report-uri https://api.dockstore-security.org/csp-report; default-src 'self'; object-src 'none'; base-uri 'self'; manifest-src 'self'; media-src 'self'; worker-src 'none'; script-src 'report-sample' 'self' 'unsafe-hashes' 'unsafe-inline' 'unsafe-eval' discuss.dockstore.org gui.dockstore.org *.twitter.com *.twimg.com www.google-analytics.com www.googletagmanager.com; style-src 'report-sample' 'self' 'unsafe-inline' cdnjs.cloudflare.com fonts.googleapis.com *.twitter.com *.twimg.com gui.dockstore.org; connect-src 'self' s3.amazonaws.com api.github.com view.commonwl.org www.google-analytics.com gui.dockstore.org; font-src 'self' fonts.gstatic.com gui.dockstore.org; frame-src 'self' discuss.dockstore.org platform.twitter.com; img-src data: 'self' avatars0.githubusercontent.com avatars1.githubusercontent.com avatars2.githubusercontent.com avatars3.githubusercontent.com camo.githubusercontent.com gui.dockstore.org i.imgur.com api.travis-ci.com img.shields.io quay.io via.placeholder.com *.wp.com *.googleusercontent.com www.googletagmanager.com www.google-analytics.com www.gravatar.com *.twitter.com *.twimg.com;" always;
21+
add_header Content-Security-Policy-Report-Only "report-uri https://api.dockstore-security.org/csp-report; default-src 'self'; object-src 'none'; base-uri 'self'; manifest-src 'self' dockstore.org; media-src 'self'; worker-src 'none'; script-src 'report-sample' 'self' 'unsafe-hashes' 'unsafe-inline' 'unsafe-eval' discuss.dockstore.org gui.dockstore.org *.twitter.com *.twimg.com www.google-analytics.com www.googletagmanager.com; style-src 'report-sample' 'self' 'unsafe-inline' cdnjs.cloudflare.com fonts.googleapis.com *.twitter.com *.twimg.com gui.dockstore.org; connect-src 'self' s3.amazonaws.com api.github.com view.commonwl.org www.google-analytics.com content.dockstore.org gui.dockstore.org; font-src 'self' fonts.gstatic.com gui.dockstore.org; frame-src 'self' discuss.dockstore.org platform.twitter.com youtube.com; img-src data: 'self' user-images.githubusercontent.com avatars.githubusercontent.com avatars0.githubusercontent.com avatars1.githubusercontent.com avatars2.githubusercontent.com avatars3.githubusercontent.com camo.githubusercontent.com circleci.com gui.dockstore.org gstatic.com i.imgur.com api.travis-ci.com travis-ci.com img.shields.io quay.io via.placeholder.com *.wp.com *.googleusercontent.com www.googletagmanager.com www.google-analytics.com www.gravatar.com *.twitter.com i.ytimg.com *.twimg.com zenodo.org;" always;
2222

2323
# Hide server header
2424
proxy_hide_header Server;

0 commit comments

Comments
 (0)