diff --git a/.github/workflows/docker-plugins-e2e.yml b/.github/workflows/docker-plugins-e2e.yml new file mode 100644 index 000000000..2a7255d3b --- /dev/null +++ b/.github/workflows/docker-plugins-e2e.yml @@ -0,0 +1,39 @@ +name: E2E Docker Proxy Plugins Test + +on: + workflow_dispatch: + push: + branches: + - 'master' + schedule: + # run every sunday + - cron: '0 0 * * 0' +jobs: + docker: + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + + - name: Start containers + run: docker-compose -f "./e2e/docker/docker-build-install-plugin/docker-compose.yaml" up -d --build + + - name: Install node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + node-version: 18 + + - name: verdaccio cli + run: npm install -g verdaccio --registry=http://localhost:4873 + - name: gastby cli + run: npm install -g gatsby-cli --registry http://localhost:4873 + - name: netlify cli + run: npm install -g netlify-cli --registry http://localhost:4873 + - name: angular cli + run: npm install -g @angular/cli --registry http://localhost:4873 + + - name: Stop containers + if: always() + run: docker-compose -f "./e2e/docker/docker-build-install-plugin/docker-compose.yaml" down diff --git a/.github/workflows/docker-proxy-apache-e2e.yml b/.github/workflows/docker-proxy-apache-e2e.yml new file mode 100644 index 000000000..3d1e13b39 --- /dev/null +++ b/.github/workflows/docker-proxy-apache-e2e.yml @@ -0,0 +1,38 @@ +name: E2E Docker Proxy Apache Test + +on: + workflow_dispatch: + push: + branches: + - 'master' + schedule: + # run every sunday + - cron: '0 0 * * 0' +jobs: + docker: + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + + - name: Start containers + run: docker-compose -f "./e2e/docker/apache-verdaccio/docker-compose.yaml" up -d --build + + - name: Install node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + node-version: 18 + - name: verdaccio cli + run: npm install -g verdaccio --registry http://localhost + - name: gastby cli + run: npm install -g gatsby-cli --registry http://localhost + - name: netlify cli + run: npm install -g netlify-cli --registry http://localhost + - name: angular cli + run: npm install -g @angular/cli --registry http://localhost + + - name: Stop containers + if: always() + run: docker-compose -f "./e2e/docker/apache-verdaccio/docker-compose.yaml" down diff --git a/.github/workflows/docker-proxy-nginx-e2e.yml b/.github/workflows/docker-proxy-nginx-e2e.yml new file mode 100644 index 000000000..df9a9ba8b --- /dev/null +++ b/.github/workflows/docker-proxy-nginx-e2e.yml @@ -0,0 +1,41 @@ +name: E2E Docker Proxy Nginx Test + +on: + workflow_dispatch: + push: + branches: + - 'master' +jobs: + docker: + timeout-minutes: 10 + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + + - name: Start containers + run: docker-compose -f "./e2e/docker/proxy-nginx/docker-compose.yaml" up -d --build + + - name: Install node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + node-version: 18 + - name: npm setup + run: | + npm config set fetch-retries="5" + npm config set fetch-retry-factor="50" + npm config set fetch-retry-mintimeout="20000" + npm config set fetch-retry-maxtimeout="80000" + - name: verdaccio cli + run: npm install -g verdaccio --registry http://localhost + - name: gastby cli + run: npm install -g gatsby-cli --registry http://localhost + - name: netlify cli + run: npm install -g netlify-cli --registry http://localhost + - name: angular cli + run: npm install -g @angular/cli --registry http://localhost + + - name: Stop containers + if: always() + run: docker-compose -f "./e2e/docker/proxy-nginx/docker-compose.yaml" down diff --git a/e2e/docker/apache-verdaccio/apache_proxy/Dockerfile b/e2e/docker/apache-verdaccio/apache_proxy/Dockerfile new file mode 100644 index 000000000..4aef42efd --- /dev/null +++ b/e2e/docker/apache-verdaccio/apache_proxy/Dockerfile @@ -0,0 +1,6 @@ +FROM eboraas/apache +LABEL Juan Picado +# http://pierrecaserta.com/apache-proxy-one-docker-server-many-domains/ +RUN a2enmod proxy +COPY ./conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf +COPY ./conf/env.load /etc/apache2/mods-enabled/env.load diff --git a/e2e/docker/apache-verdaccio/apache_proxy/conf/000-default.conf b/e2e/docker/apache-verdaccio/apache_proxy/conf/000-default.conf new file mode 100644 index 000000000..4e322102f --- /dev/null +++ b/e2e/docker/apache-verdaccio/apache_proxy/conf/000-default.conf @@ -0,0 +1,17 @@ +ServerName localhost:80 +ServerAdmin admin@localhost + + + ServerName localhost + + Allow from localhost + + SSLProxyEngine On + ProxyRequests Off + ProxyPreserveHost On + AllowEncodedSlashes NoDecode + ProxyPass / http://verdaccio:4873/ nocanon + ProxyPassReverse / http://verdaccio:4873/ + CustomLog /var/log/apache2/verdaccio-access.log combined + ErrorLog /var/log/apache2/verdaccio-error.log + \ No newline at end of file diff --git a/e2e/docker/apache-verdaccio/apache_proxy/conf/env.load b/e2e/docker/apache-verdaccio/apache_proxy/conf/env.load new file mode 100644 index 000000000..163d75e89 --- /dev/null +++ b/e2e/docker/apache-verdaccio/apache_proxy/conf/env.load @@ -0,0 +1,4 @@ +LoadModule env_module /usr/lib/apache2/modules/mod_env.so +LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so +LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so +LoadModule socache_shmcb_module /usr/lib/apache2/modules/mod_socache_shmcb.so \ No newline at end of file diff --git a/e2e/docker/apache-verdaccio/docker-compose.yaml b/e2e/docker/apache-verdaccio/docker-compose.yaml new file mode 100644 index 000000000..c0596b396 --- /dev/null +++ b/e2e/docker/apache-verdaccio/docker-compose.yaml @@ -0,0 +1,23 @@ +version: '2' + +services: + verdaccio: + image: verdaccio/verdaccio:nightly-master + container_name: verdaccio + ports: + - '4873:4873' + volumes: + - verdaccio:/verdaccio + + apacheproxy: + build: apache_proxy/ + links: + - verdaccio + ports: + - '80:80' + volumes_from: + - verdaccio + +volumes: + verdaccio: + driver: local diff --git a/e2e/docker/docker-build-install-plugin/Dockerfile b/e2e/docker/docker-build-install-plugin/Dockerfile new file mode 100644 index 000000000..ab7acfe0e --- /dev/null +++ b/e2e/docker/docker-build-install-plugin/Dockerfile @@ -0,0 +1,8 @@ +FROM verdaccio/verdaccio:nightly-master +LABEL Juan Picado +ADD docker.yaml /verdaccio/conf/config.yaml +USER root +RUN npm install --global verdaccio-static-token \ + && npm install --global verdaccio-memory \ + && npm install --global verdaccio-auth-memory +USER $VERDACCIO_USER_UID diff --git a/e2e/docker/docker-build-install-plugin/docker-compose.yaml b/e2e/docker/docker-build-install-plugin/docker-compose.yaml new file mode 100644 index 000000000..183b46956 --- /dev/null +++ b/e2e/docker/docker-build-install-plugin/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '2' + +services: + verdaccio: + build: . + ports: + - '4873:4873' + volumes: + - verdaccio:/verdaccio +volumes: + verdaccio: + driver: local diff --git a/e2e/docker/docker-build-install-plugin/docker.yaml b/e2e/docker/docker-build-install-plugin/docker.yaml new file mode 100644 index 000000000..f17216ae8 --- /dev/null +++ b/e2e/docker/docker-build-install-plugin/docker.yaml @@ -0,0 +1,44 @@ +store: + memory: + limit: 1000 + +plugins: /verdaccio/plugins + +web: + title: Verdaccio Publish Config Test +auth: + auth-memory: + users: + foo: + name: foo + password: s3cret + bar: + name: bar + password: s3cret +uplinks: + npmjs: + url: https://registry.npmjs.org/ +packages: + '@*/*': + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: npmjs + '**': + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: npmjs +server: + keepAliveTimeout: 60 +middlewares: + audit: + enabled: true + static-token: + - token: mySecureToken + user: systemUser + password: systemPassword + - token: ABCD1234 + user: uncle + password: tom +logs: { type: stdout, format: pretty, level: http } diff --git a/e2e/docker/docker-e2e-ui/Dockerfile b/e2e/docker/docker-e2e-ui/Dockerfile new file mode 100644 index 000000000..22abc3203 --- /dev/null +++ b/e2e/docker/docker-e2e-ui/Dockerfile @@ -0,0 +1,3 @@ +FROM verdaccio/verdaccio:nightly-master +LABEL Juan Picado +ADD docker.yaml /verdaccio/conf/config.yaml diff --git a/e2e/docker/docker-e2e-ui/docker-compose.yaml b/e2e/docker/docker-e2e-ui/docker-compose.yaml new file mode 100644 index 000000000..183b46956 --- /dev/null +++ b/e2e/docker/docker-e2e-ui/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '2' + +services: + verdaccio: + build: . + ports: + - '4873:4873' + volumes: + - verdaccio:/verdaccio +volumes: + verdaccio: + driver: local diff --git a/e2e/docker/docker-e2e-ui/docker.yaml b/e2e/docker/docker-e2e-ui/docker.yaml new file mode 100644 index 000000000..411fd49ff --- /dev/null +++ b/e2e/docker/docker-e2e-ui/docker.yaml @@ -0,0 +1,37 @@ +storage: /verdaccio/storage/data + +plugins: /verdaccio/plugins + +web: + enable: true + title: verdaccio-server-e2e + login: true + +auth: + htpasswd: + file: /verdaccio/storage/htpasswd + +uplinks: + npmjs: + url: https://registry.npmjs.org/ + +packages: + '@verdaccio/*': + access: $all + publish: $authenticated + '@*/*': + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: npmjs + '**': + access: $all + publish: $authenticated + unpublish: $authenticated + proxy: npmjs + +middlewares: + audit: + enabled: true + +log: { type: stdout, format: json, level: info } diff --git a/e2e/docker/proxy-nginx/conf/nginx/Dockerfile b/e2e/docker/proxy-nginx/conf/nginx/Dockerfile new file mode 100755 index 000000000..acdaf67bf --- /dev/null +++ b/e2e/docker/proxy-nginx/conf/nginx/Dockerfile @@ -0,0 +1,3 @@ +FROM tutum/nginx +RUN rm /etc/nginx/sites-enabled/default +ADD sites-enabled /etc/nginx/sites-enabled diff --git a/e2e/docker/proxy-nginx/conf/nginx/sites-enabled/verdaccio-conf b/e2e/docker/proxy-nginx/conf/nginx/sites-enabled/verdaccio-conf new file mode 100755 index 000000000..dd3f86630 --- /dev/null +++ b/e2e/docker/proxy-nginx/conf/nginx/sites-enabled/verdaccio-conf @@ -0,0 +1,14 @@ +server { + listen 80 default_server; + access_log /var/log/nginx/verdaccio.log; + charset utf-8; + location / { + proxy_pass http://verdaccio:4873/; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } +} \ No newline at end of file diff --git a/e2e/docker/proxy-nginx/docker-compose.yaml b/e2e/docker/proxy-nginx/docker-compose.yaml new file mode 100644 index 000000000..1429611e0 --- /dev/null +++ b/e2e/docker/proxy-nginx/docker-compose.yaml @@ -0,0 +1,26 @@ +version: '2' + +services: + verdaccio: + image: verdaccio/verdaccio:nightly-master + container_name: verdaccio_root_path + ports: + - '4873:4873' + volumes: + - verdaccio:/verdaccio + + nginx: + restart: always + build: conf/nginx + ports: + - '80:80' + volumes: + - /www/public + volumes_from: + - verdaccio + links: + - verdaccio:verdaccio + +volumes: + verdaccio: + driver: local