Skip to content

Commit

Permalink
Merge pull request #21 from cisagov/bug/small_fixes
Browse files Browse the repository at this point in the history
Fix `mypy` Error and Correct Platforms in README
  • Loading branch information
mcdonnnj authored Oct 5, 2021
2 parents 1158454 + 844c6d1 commit ce100dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[![Docker Pulls](https://img.shields.io/docker/pulls/cisagov/vdp-scanner)](https://hub.docker.com/r/cisagov/vdp-scanner)
[![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/cisagov/vdp-scanner)](https://hub.docker.com/r/cisagov/vdp-scanner)
[![Platforms](https://img.shields.io/badge/platforms-amd64%20%7C%20arm%2Fv6%20%7C%20arm%2Fv7%20%7C%20arm64%20%7C%20ppc64le%20%7C%20s390x-blue)](https://hub.docker.com/r/cisagov/vdp-scanner/tags)
[![Platforms](https://img.shields.io/badge/platforms-amd64%20%7C%20arm%2Fv7%20%7C%20arm64-blue)](https://hub.docker.com/r/cisagov/vdp-scanner/tags)

This is a Docker project to scan either the
[GSA current Federal .gov domain list](https://github.com/GSA/data/blob/master/dotgov-domains/current-federal.csv)
Expand All @@ -25,7 +25,7 @@ Python library. Then it will output CSVs with agency and domain level results.
To run the `cisagov/vdp-scanner` image via Docker:

```console
docker run cisagov/vdp-scanner:0.0.4
docker run cisagov/vdp-scanner:0.0.5-rc.1
```

### Running with Docker Compose ###
Expand All @@ -38,7 +38,7 @@ docker run cisagov/vdp-scanner:0.0.4

services:
vdp-scanner:
image: 'cisagov/vdp-scanner:0.0.4'
image: 'cisagov/vdp-scanner:0.0.5-rc.1'
volumes:
- .:/task/host_mount
```
Expand Down Expand Up @@ -76,7 +76,7 @@ docker run cisagov/vdp-scanner:0.0.4
1. Pull the new image:

```console
docker pull cisagov/vdp-scanner:0.0.4
docker pull cisagov/vdp-scanner:0.0.5-rc.1
```

1. Recreate and run the container by following the [previous instructions](#running-with-docker).
Expand All @@ -85,11 +85,11 @@ docker run cisagov/vdp-scanner:0.0.4

The images of this container are tagged with
[semantic versions](https://semver.org). It is recommended that most users use
a version tag (e.g. `:0.0.4`).
a version tag (e.g. `:0.0.5-rc.1`).

| Image:tag | Description |
|-----------|-------------|
|`cisagov/vdp-scanner:0.0.4`| An exact release version. |
|`cisagov/vdp-scanner:0.0.5-rc.1`| An exact release version. |
|`cisagov/vdp-scanner:0.0`| The most recent release matching the major and minor version numbers. |
|`cisagov/vdp-scanner:0`| The most recent release matching the major version number. |
|`cisagov/vdp-scanner:edge` | The most recent image built from a merge into the `develop` branch of this repository. |
Expand Down Expand Up @@ -155,7 +155,7 @@ Build the image locally using this git repository as the [build context](https:/

```console
docker build \
--tag cisagov/vdp-scanner:0.0.4 \
--tag cisagov/vdp-scanner:0.0.5-rc.1 \
https://github.com/cisagov/vdp-scanner-docker.git#develop
```

Expand Down Expand Up @@ -186,7 +186,7 @@ Docker:
--file Dockerfile-x \
--platform linux/amd64 \
--output type=docker \
--tag cisagov/vdp-scanner:0.0.4 .
--tag cisagov/vdp-scanner:0.0.5-rc.1 .
```

## Contributing ##
Expand Down
4 changes: 3 additions & 1 deletion src/vdp_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ def get_local_csv(file: str) -> List[Dict[str, str]]:
def get_remote_csv() -> List[Dict[str, str]]:
"""Load domains from the CSV at the given URL."""
resp = requests.get(GITHUB_CSV_URL)
# Default to utf-8 encoding if there is no encoding in the response
encoding = resp.encoding if resp.encoding else "utf-8"
if resp.status_code != 200:
return []
csv_lines = [str(line, resp.encoding) for line in resp.iter_lines()]
csv_lines = [str(line, encoding) for line in resp.iter_lines()]

return list(csv.DictReader(csv_lines))

Expand Down
2 changes: 1 addition & 1 deletion src/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.4"
__version__ = "0.0.5-rc.1"

0 comments on commit ce100dc

Please sign in to comment.