Skip to content

Commit

Permalink
feat: Proxypass hackers.txt request to api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor authored and AEtherC0r3 committed Sep 29, 2018
1 parent 4aebbf8 commit e994e3d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
16 changes: 0 additions & 16 deletions grnet/mqtt.rb

This file was deleted.

16 changes: 16 additions & 0 deletions grnet/website-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ http {
index index.php index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location /hackers.txt {
proxy_pass https://api.lambdaspace.gr/api/v2.0/hackers;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
resolver 1.1.1.1;
}
location = /50x.html {
root /usr/share/nginx/html/;
}
Expand Down
13 changes: 3 additions & 10 deletions grnet/website.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ RUN git clone https://github.com/lambdaspace/new_website.git
# Install packages and build assets
WORKDIR /new_website
RUN yarn install
RUN node_modules/.bin/gulp --production
RUN yarn build

RUN rm -r node_modules

# Set the base image to Debian
FROM nginx:alpine

################## BEGIN INSTALLATION ######################
RUN apk add --update --no-cache ruby ruby-bundler ca-certificates &&\
echo 'gem: --no-document' > /etc/gemrc

RUN echo "*/5 * * * * wget https://community.lambdaspace.gr/c/5/l/latest.json -O /usr/share/nginx/html/latest.json" >> mycron && crontab mycron && rm mycron

# Mqtt script
COPY mqtt.rb /var/local/
RUN apk add --update --no-cache ca-certificates

# Forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
Expand All @@ -39,4 +32,4 @@ COPY --from=asset_builder /new_website/* ./
################## INSTALLATION END ######################

EXPOSE 80 443
CMD nginx -g "daemon off;" && gem install mqtt && ruby /var/local/mqtt.rb && /bin/bash
CMD nginx -g "daemon off;"

0 comments on commit e994e3d

Please sign in to comment.