Skip to content

Commit

Permalink
Initial code
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Artamonov committed Jun 29, 2020
1 parent cd37fc3 commit b7f2114
Show file tree
Hide file tree
Showing 8 changed files with 493 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .goreleaser.yml
# Build customization
builds:
-
binary: "{{ .ProjectName }}"
ldflags: -s -w -X main.appName={{ .ProjectName }} -X main.appVer={{.Tag}}
goos:
- windows
- darwin
- linux
goarch:
- amd64
archives:
- name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
replacements:
darwin: mac
format: binary
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
release:
name_template: "{{.ProjectName}} v{{.Version}}"
changelog:
filters:
exclude:
- '[b|B]ump.*\sversion'
- '.*typo.*'
- '[V|v]ersion.*\sbump'
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .travis.yml
language: go
go:
- 1.13.x

# Only build tags
if: tag IS present

env:
- GO111MODULE=on

install:
- go get ./...

# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM amd64/alpine:latest

ARG binary_version

ENV AKAMAI_CLI_HOME=/cli

RUN apk add --no-cache --update openssl \
ca-certificates \
libc6-compat \
libstdc++ \
wget \
curl \
jq \
bash \
nodejs \
npm \
rm -rf /var/cache/apk/* && \
wget --quiet -O /usr/local/bin/akamai https://github.com/akamai/cli/releases/download/1.1.4/akamai-1.1.4-linuxamd64 && \
chmod +x /usr/local/bin/akamai && \
echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /root/.bashrc


RUN mkdir -p /cli/.akamai-cli && \
echo "[cli]" > /cli/.akamai-cli/config && \
echo "cache-path = /cli/.akamai-cli/cache" >> /cli/.akamai-cli/config && \
echo "config-version = 1" >> /cli/.akamai-cli/config && \
echo "enable-cli-statistics = false" >> /cli/.akamai-cli/config && \
echo "last-ping = 2018-04-27T18:16:12Z" >> /cli/.akamai-cli/config && \
echo "client-id =" >> /cli/.akamai-cli/config && \
echo "install-in-path =" >> /cli/.akamai-cli/config && \
echo "last-upgrade-check = ignore" >> /cli/.akamai-cli/config

RUN akamai install property --force && \
rm -rf /cli/.akamai-cli/src/akamai-cli-netlist/.git
RUN akamai install https://github.com/apiheat/akamai-cli-overview --force && \
rm -rf /cli/.akamai-cli/src/akamai-cli-overview/.git
# RUN wget --quiet -O /usr/local/bin/realcoverage https://github.com/apiheat/realcoverage/releases/download/v$binary_version/realcoverage_linux_amd64 && \
# chmod +x /usr/local/bin/realcoverage

ENV AKAMAI_CLI_HOME=/cli
VOLUME /cli
VOLUME /root/.edgerc

CMD ["/bin/bash"]
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ![realCoverage](images/realcoverage_logo.png "realCoverage")

CLI tools which is used to generate PDF report for domains presence in Akamai property configurations and check if domain resolves to Akamai IP.

__Under development__
Please forgive us for some error or issue.

## Dependencies

* [Akamai Overview CLI](https://github.com/apiheat/akamai-cli-overview) - to get account overview data
* [Akamai Property CLI](https://github.com/akamai/cli-property) - to get property configuration data
* [Akamai Diagnostic Tools CLI](https://github.com/apiheat/akamai-cli-diagnostic-tools) - to check if IP belongs to Akamai
* dig shell command

## Akamai Permissions

* Read Akamai contract groups
* List Akamai Properties
* Read Akamai Properties
* Use Akamai Diagnostic Tools

## Usage

### Setup edgerc credentials location

```shell
> export AKAMAI_EDGERC_SECTION="default"
> export AKAMAI_EDGERC_CONFIG="~/.edgerc"
```

### Generate report

```shell
> ./realcoverage -f input.yml -l logo.png -o report.pdf -c "My Company" -t "+0 12345678" -s "mycompany.nl"

Usage of realcoverage
-c string
Company name.
-f string
YAML file to parse.
-l string
Company logo file.
-o string
Output file name.
-s string
Company web site.
-t string
Company phone.
```
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module akamai/pdf

go 1.13

require (
github.com/blend/go-sdk v2.0.0+incompatible // indirect
github.com/dariubs/percent v0.0.0-20200128140941-b7801cf1c7e2
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/johnfercher/maroto v0.27.0
github.com/wcharczuk/go-chart v2.0.1+incompatible
gopkg.in/yaml.v2 v2.3.0
)
40 changes: 40 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
github.com/blend/go-sdk v2.0.0+incompatible h1:FL9X/of4ZYO5D2JJNI4vHrbXPfuSDbUa7h8JP9+E92w=
github.com/blend/go-sdk v2.0.0+incompatible/go.mod h1:3GUb0YsHFNTJ6hsJTpzdmCUl05o8HisKjx5OAlzYKdw=
github.com/boombuler/barcode v1.0.0 h1:s1TvRnXwL2xJRaccrdcBQMZxq6X7DvsMogtmJeHDdrc=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/dariubs/percent v0.0.0-20200128140941-b7801cf1c7e2 h1:5EPE4Uk7ucthLTJAZqZxu6LZluox5/AqXUxJDpzgJjg=
github.com/dariubs/percent v0.0.0-20200128140941-b7801cf1c7e2/go.mod h1:NDZpkezJ8QqyIW/510MywB5T2KdC8v/0oTlEoPcMsRM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gojp/goreportcard v0.0.0-20191001233754-41818f5fd295/go.mod h1:/DA2Xpp+OaR3EHafQSnT9SKOfbG2NPQR/qp6Qr8AgIw=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/johnfercher/maroto v0.27.0 h1:KOUi1NYg++3gAGiKIF9dCilL4c8etNXLuzTvZE/1g84=
github.com/johnfercher/maroto v0.27.0/go.mod h1:z/5eo/hH1g+01K4Mm0IVVbixHibtaNbZ9vHf+2H6fpM=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.4.2 h1:3u2ojTwxPPu3ysIOc5iTwcECpvkFCAe2RJ/tQrvfLi0=
github.com/jung-kurt/gofpdf v1.4.2/go.mod h1:rZsO0wEsunjT/L9stF3fJjYbAHgqNYuQB4B8FWvBck0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58 h1:nlG4Wa5+minh3S9LVFtNoY+GVRiudA2e3EVfcCi3RCA=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/wcharczuk/go-chart v2.0.1+incompatible h1:0pz39ZAycJFF7ju/1mepnk26RLVLBCWz1STcD3doU0A=
github.com/wcharczuk/go-chart v2.0.1+incompatible/go.mod h1:PF5tmL4EIx/7Wf+hEkpCqYi5He4u90sw+0+6FhrryuE=
golang.org/x/image v0.0.0-20190507092727-e4e5bf290fec h1:arXJwtMuk5vqI1NHX0UTnNw977rYk5Sl4jQqHj+hun4=
golang.org/x/image v0.0.0-20190507092727-e4e5bf290fec/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Binary file added images/realcoverage_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b7f2114

Please sign in to comment.