-
Notifications
You must be signed in to change notification settings - Fork 39
35 lines (33 loc) · 1.38 KB
/
auth-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Oras Auth Tests
on:
pull_request: []
jobs:
test-auth:
runs-on: ubuntu-latest
container: ghcr.io/oras-project/registry:latest
steps:
- uses: actions/checkout@v3
- name: Install Python
run: |
apk update && apk add python3 make apache2-utils bash
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
rm get-pip.py
pip install --upgrade pip setuptools
make install
- name: Test Oras Python with Auth
env:
registry_host: localhost
registry_port: 5000
with_auth: true
REGISTRY_AUTH: "{htpasswd: {realm: localhost, path: /etc/docker/registry/auth.htpasswd}}"
REGISTRY_HTTP_TLS_CERTIFICATE: "/etc/docker/registry/server.cert"
REGISTRY_HTTP_TLS_KEY: "/etc/docker/registry/server.key"
REGISTRY_STORAGE_DELETE_ENABLED: "true"
run: |
htpasswd -cB -b auth.htpasswd myuser mypass
cp auth.htpasswd /etc/docker/registry/auth.htpasswd
apk add openssl
openssl req -newkey rsa:4096 -nodes -sha256 -keyout /etc/docker/registry/server.key -x509 -days 365 -subj "/C=IT/ST=Lombardy/L=Milan/O=Acme Org/OU=IT Department/CN=example.com" -out /etc/docker/registry/server.cert
registry serve /etc/docker/registry/config.yml & sleep 5
echo $PWD && ls $PWD && make test