| @ -0,0 +1,17 @@ | |||
| name: shellcheck | |||
| on: | |||
| push: | |||
| branches: [ master ] | |||
| pull_request: | |||
| branches: [ master ] | |||
| jobs: | |||
| lint: | |||
| runs-on: ubuntu-latest | |||
| steps: | |||
| - uses: actions/checkout@v1 | |||
| - name: Lint check | |||
| uses: azohra/shell-linter@v0.2.0 | |||
| with: | |||
| path: "getssl" | |||
| @ -0,0 +1,28 @@ | |||
| FROM centos:centos7 | |||
| # Note this image uses gawk | |||
| # Update and install required software | |||
| RUN yum -y update | |||
| RUN yum -y install epel-release | |||
| RUN yum -y install git curl bind-utils wget which nginx | |||
| ENV staging "true" | |||
| ENV DUCKDNS_TOKEN 1d616aa9-b8e4-4bb4-b312-3289de82badb | |||
| WORKDIR /root | |||
| RUN mkdir /etc/nginx/pki | |||
| RUN mkdir /etc/nginx/pki/private | |||
| COPY ./test/test-config/nginx-ubuntu-no-ssl /etc/nginx/conf.d/default.conf | |||
| COPY ./test/test-config/nginx-centos7.conf /etc/nginx/nginx.conf | |||
| # BATS (Bash Automated Testings) | |||
| RUN git clone https://github.com/bats-core/bats-core.git /bats-core | |||
| RUN git clone https://github.com/jasonkarns/bats-support /bats-support | |||
| RUN git clone https://github.com/jasonkarns/bats-assert-1 /bats-assert | |||
| RUN /bats-core/install.sh /usr/local | |||
| EXPOSE 80 443 | |||
| # Run eternal loop - for testing | |||
| CMD tail -f /dev/null | |||
| @ -0,0 +1,25 @@ | |||
| FROM ubuntu:latest | |||
| # Note this image uses mawk1.3 | |||
| ENV staging "true" | |||
| ENV DUCKDNS_TOKEN 1d616aa9-b8e4-4bb4-b312-3289de82badb | |||
| # Update and install required software | |||
| RUN apt-get update --fix-missing | |||
| RUN apt-get install -y git curl dnsutils wget nginx-light | |||
| RUN apt-get install -y vim dos2unix # for debugging | |||
| # TODO test with drill, dig, host | |||
| WORKDIR /root | |||
| # Prevent "Can't load /root/.rnd into RNG" error from openssl | |||
| RUN touch /root/.rnd | |||
| # BATS (Bash Automated Testings) | |||
| RUN git clone https://github.com/bats-core/bats-core.git /bats-core | |||
| RUN git clone https://github.com/jasonkarns/bats-support /bats-support | |||
| RUN git clone https://github.com/jasonkarns/bats-assert-1 /bats-assert | |||
| RUN /bats-core/install.sh /usr/local | |||
| # Run eternal loop - for testing | |||
| CMD tail -f /dev/null | |||
| @ -1,8 +1,11 @@ | |||
| #!/usr/bin/env bash | |||
| if [ "$GETSSL_HOST" = "alpine.getssl.test" ]; then | |||
| if [ "$GETSSL_OS" = "alpine" ]; then | |||
| killall -HUP nginx >&3- | |||
| sleep 5 | |||
| elif [ "$GETSSL_OS" == "centos7" ]; then | |||
| pgrep nginx | head -1 | xargs kill -HUP | |||
| sleep 5 | |||
| else | |||
| service nginx restart >/dev/null >&3- | |||
| fi | |||
| @ -0,0 +1,37 @@ | |||
| # For more information on configuration, see: | |||
| # * Official English Documentation: http://nginx.org/en/docs/ | |||
| # * Official Russian Documentation: http://nginx.org/ru/docs/ | |||
| user nginx; | |||
| worker_processes auto; | |||
| error_log /var/log/nginx/error.log; | |||
| pid /run/nginx.pid; | |||
| # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. | |||
| include /usr/share/nginx/modules/*.conf; | |||
| events { | |||
| worker_connections 1024; | |||
| } | |||
| http { | |||
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |||
| '$status $body_bytes_sent "$http_referer" ' | |||
| '"$http_user_agent" "$http_x_forwarded_for"'; | |||
| access_log /var/log/nginx/access.log main; | |||
| sendfile on; | |||
| tcp_nopush on; | |||
| tcp_nodelay on; | |||
| keepalive_timeout 65; | |||
| types_hash_max_size 2048; | |||
| include /etc/nginx/mime.types; | |||
| default_type application/octet-stream; | |||
| # Load modular configuration files from the /etc/nginx/conf.d directory. | |||
| # See http://nginx.org/en/docs/ngx_core_module.html#include | |||
| # for more information. | |||
| include /etc/nginx/conf.d/*.conf; | |||
| } | |||
| @ -0,0 +1,4 @@ | |||
| curl -X POST https://api.github.com/repos/timkimber/getssl/dispatches ^ | |||
| -H "Accept: application/vnd.github.everest-preview+json" ^ | |||
| -H "Authorization: token 66f265bae085c817a3b72bff1cabe4aa3e7ea31b" ^ | |||
| --data "{\"event_type\": \"CUSTOM_ACTION_NAME_HERE\"}" | |||