Skip to content

Commit e522faa

Browse files
mladkauohad2712
authored and
ohad2712
committed
fix: Adding client templates for Artifactory Container Registry
1 parent b03c57d commit e522faa

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# your unique broker identifier
2+
BROKER_TOKEN=<broker-token>
3+
4+
# your artifactory account username
5+
ARTIFACTORYCR_USERNAME=<username for artifactory>
6+
7+
# your artifactory account password
8+
ARTIFACTORYCR_PASSWORD=<password for artifactory>
9+
10+
# the container registry host name of your artifactory
11+
# (use the Subdomain method as the Reverse Proxy Method,
12+
# when configuring a Docker Repository or artifactory)
13+
ARTIFACTORYCR_HOSTNAME=cr.artifactory.yourdomain.com
14+
15+
# The URL of the Snyk broker server
16+
BROKER_SERVER_URL=https://broker-container.snyk.io
17+
18+
# the fine detail accept rules that allow Snyk to make API requests to your
19+
# gitlab instance
20+
ACCEPT=accept.json
21+
22+
# The path for the broker's internal healthcheck URL. Must start with a '/'.
23+
BROKER_HEALTHCHECK_PATH=/healthcheck
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"public":
3+
[
4+
{
5+
"//": "send any type of request to our connected server",
6+
"method": "any",
7+
"path": "/*"
8+
}
9+
],
10+
"private":
11+
[
12+
{
13+
"//": "Get the about page",
14+
"method": "GET",
15+
"path": "/v2/token",
16+
"origin": "https://${ARTIFACTORYCR_HOSTNAME}",
17+
"auth": {
18+
"scheme": "basic",
19+
"username": "${ARTIFACTORYCR_USERNAME}",
20+
"password": "${ARTIFACTORYCR_PASSWORD}"
21+
}
22+
},
23+
{
24+
"//": "Get the about page",
25+
"method": "GET",
26+
"path": "/v2/*",
27+
"origin": "https://${ARTIFACTORYCR_HOSTNAME}"
28+
}
29+
]
30+
}

dockerfiles/artifactory-cr/Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM node:8-slim
2+
3+
MAINTAINER Snyk Ltd
4+
5+
# Install broker
6+
RUN npm install --global snyk-broker
7+
8+
# Don't run as root
9+
WORKDIR /home/node
10+
USER node
11+
12+
# Generate default accept filter
13+
RUN broker init artifactory-cr
14+
15+
16+
17+
######################################
18+
# Custom Broker Client configuration #
19+
# Redefine in derived Dockerfile, #
20+
# or provide as runtime args `-e` #
21+
######################################
22+
23+
# Your unique Broker identifier
24+
ENV BROKER_TOKEN <broker-token>
25+
26+
# Your personal credentials to your Artifactory Container Registry
27+
ENV ARTIFACTORYCR_USERNAME <username>
28+
ENV ARTIFACTORYCR_PASSWORD <password>
29+
30+
# Your Artifactory Container Registry host
31+
ENV ARTIFACTORYCR_HOSTNAME your.artifactory.cr.hostname
32+
33+
# The port used by the broker client to accept internal connections
34+
# Default value is 7341
35+
# ENV PORT 7341
36+
37+
# The URL of your broker client (including scheme and port)
38+
# This will be used as the webhook payload URL coming in from Jira
39+
# ENV BROKER_CLIENT_URL http://<broker.client.hostname>:$PORT
40+
41+
EXPOSE $PORT
42+
43+
CMD ["broker", "--verbose"]

0 commit comments

Comments
 (0)