Commit e7bf5cac authored by nimrod's avatar nimrod
Browse files

Revert "A general master branch."

This reverts commit d4d48591. I'm
reverting most of it but amending or mending a few things that I'm going
to move to ns4.
parent 7885e91e
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
FROM nginx:1.20.0-alpine
ARG TRANSMISSION
# hadolint ignore=DL3018
RUN rm -rf /etc/nginx/conf./* && \
    chmod 777 /run && \
@@ -15,12 +16,20 @@ RUN rm -rf /etc/nginx/conf./* && \
                -keyout /var/ssl/site.key \
                -nodes \
                -out /var/ssl/site.crt \
                -batch && \
                -days 2 \
                -subj "/C=US/ST=IL/L=None/O=None/OU=None/CN=localhost/" && \
    cp /var/ssl/site.crt /var/ssl/mail.crt && \
    cp /var/ssl/site.key /var/ssl/mail.key && \
    setcap CAP_NET_BIND_SERVICE=+ep "$(command -v nginx)" && \
    chown nginx /var/ssl/site.*
    chown nginx /var/ssl/site.* /var/ssl/mail.*
COPY www/ /var/www/
COPY conf.d/ /etc/nginx/conf.d/
COPY snippets/ /etc/nginx/snippets/
# Another option would be to copy the file to the template directory and have
# the environment variable substitution happen in runtime, but that way would
# miss checking the syntax during the build process.
# hadolint ignore=SC2097,SC2098
RUN TRANSMISSION=$TRANSMISSION sed -i "s/TRANSMISSION/$TRANSMISSION/" /etc/nginx/conf.d/www.shore.co.il.conf
USER nginx
RUN nginx -t
HEALTHCHECK CMD curl --fail --verbose --user-agent 'Docker health check' --header "Host: status" http://localhost/ || exit 1
+0 −5
Original line number Diff line number Diff line
@@ -4,11 +4,6 @@

> Web proxy Dockerized setup.

## Branches

The `master` branch doesn't have any configuration in it. The `ns4` and `host01`
branches have configuration for those hoss.

## License

This software is licensed under the MIT license (see `LICENSE.txt`).
+30 −0
Original line number Diff line number Diff line
map $host $git { default gitlab; }

server {
    listen      80;
    listen      [::]:80;
    server_name git.shore.co.il;
    include     snippets/robots-allow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/www-acme-challenge.conf;
    include     snippets/redirect-https.conf;
}

server {
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name git.shore.co.il;
    include     snippets/robots-allow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/ssl.conf;

    location / {
        proxy_pass              http://$git$request_uri;
        proxy_http_version      1.1;
        include                 snippets/proxy-headers.conf;
        proxy_set_header        X-Forwarded-Ssl on;
        client_max_body_size    512m;
    }
}
+34 −0
Original line number Diff line number Diff line
server {
    listen      80;
    listen      [::]:80;
    server_name imap.shore.co.il smtp.shore.co.il mta-sts.shore.co.il;
    root        /var/www/mail.shore.co.il/;
    include     snippets/robots-disallow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
}

server {
    listen                      443 ssl;
    listen                      [::]:443 ssl;
    server_name                 mta-sts.shore.co.il;
    root                        /var/www/mail.shore.co.il/;
    include                     snippets/robots-disallow-all.conf;
    include                     snippets/ads-txt.conf;
    include                     snippets/security-txt.conf;

    # Copied from snippetes/ssl.conf.
    add_header                  Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
    add_header                  Expect-CT "max-age=86400, enforce, report-uri=\"https://www.shore.co.il/about\"";
    include                     snippets/common-headers.conf;
    ssl_certificate             /var/ssl/mail.crt;
    ssl_certificate_key         /var/ssl/mail.key;
    ssl_protocols               TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers                 !kRSA:!3DES:!RC4:!DES:!MD5:!aNULL:!NULL:AESGCM+ECDH:AES256+ECDH:AES128:+SHA1;
    ssl_prefer_server_ciphers   on;
    ssl_session_cache           shared:SSL:50m;
    ssl_session_timeout         5m;
    ssl_stapling                on;
    ssl_stapling_verify         on;
    ssl_trusted_certificate     /etc/ssl/ocsp.pem;
}
+31 −0
Original line number Diff line number Diff line
map $host $nextcloud { default nextcloud; }

server {
    listen      80;
    listen      [::]:80;
    server_name nextcloud.shore.co.il;
    include     snippets/robots-disallow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/www-acme-challenge.conf;
    include     snippets/redirect-https.conf;
}

server {
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name nextcloud.shore.co.il;
    include     snippets/robots-disallow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/ssl.conf;
    include     snippets/nextcloud-well-known.conf;

    location / {
        proxy_pass              http://$nextcloud$request_uri;
        proxy_http_version      1.1;
        include                 snippets/proxy-headers.conf;
        proxy_hide_header       X-Frame-Options;
        client_max_body_size    512m;
    }
}
Loading