Compare commits

..

No commits in common. "1d88e5c7237984b4338701c29bdd709b6796d0ce" and "662f5197e4b3124b81479e8bbdeeb427b1863fb5" have entirely different histories.

8 changed files with 4 additions and 128 deletions

View File

@ -2,9 +2,6 @@
This is a rewrite of my current website to Express.JS. This is a rewrite of my current website to Express.JS.
[Git repo](https://git.blek.codes/blek/homepage.js) | [Website](https://blek.codes) [Git repo](https://git.blek.codes/blek/homepage.js) | [Website](https://blek.codes)
# Warning: This branch is __experimental__
### This branch is untested and unstable, and probably won't work in production.
### Please don't use it for other purposes that development.
# Running an instance # Running an instance
First, [generate the app key](#generate-the-key). First, [generate the app key](#generate-the-key).

View File

@ -1,2 +0,0 @@
*
!.gitignore

View File

@ -1,49 +0,0 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
text/plain txt;
text/x-component htc;
text/mathml mml;
image/png png;
image/x-icon ico;
image/x-jng jng;
image/vnd.wap.wbmp wbmp;
image/svg+xml svg svgz;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/pdf pdf;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/zip zip;
application/octet-stream deb;
application/octet-stream bin exe dll;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/mpeg mp3;
audio/x-realaudio ra;
video/mpeg mpeg mpg;
video/quicktime mov;
video/x-flv flv;
video/x-msvideo avi;
video/x-ms-wmv wmv;
video/x-ms-asf asx asf;
video/x-mng mng;
}

View File

@ -1,43 +0,0 @@
user nobody nobody;
worker_processes 4;
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096; ## Default: 1024
}
http {
include mime.types;
include proxy.conf;
index index.html index.htm;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
gzip on;
gzip_types text/plain application/json application/x-json application/javascript application/x-javascript text/css text/x-css;
gzip_min_length 1024;
gzip_static on;
server {
listen 80;
location / {
proxy_pass http://server;
}
location /static {
root /var/www;
gzip_static on;
}
location /announce.json/ {
root /var/www;
}
}
}

View File

@ -1,10 +0,0 @@
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;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

View File

@ -7,6 +7,7 @@ services:
volumes: volumes:
- './:/opt/code' - './:/opt/code'
ports: ports:
- '${APP_PORT}:${APP_PORT}'
- '9229:9229' - '9229:9229'
env_file: ./.env env_file: ./.env
environment: environment:
@ -20,15 +21,6 @@ services:
- '6379:6379' - '6379:6379'
networks: networks:
- homepage - homepage
nginx:
image: nginx:alpine
ports:
- '${APP_PORT}:80'
networks:
- homepage
volumes:
- './config/nginx:/etc/nginx'
- './public:/var/www:ro'
db: db:
image: postgres:alpine image: postgres:alpine
ports: ports:

View File

@ -7,6 +7,8 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
- './:/opt/code' - './:/opt/code'
ports:
- '${APP_PORT}:${APP_PORT}'
env_file: ./.env env_file: ./.env
environment: environment:
APP_PORT: '${APP_PORT}' APP_PORT: '${APP_PORT}'
@ -17,15 +19,6 @@ services:
image: redis:alpine image: redis:alpine
networks: networks:
- homepage - homepage
nginx:
image: nginx:alpine
ports:
- '${APP_PORT}:80'
networks:
- homepage
volumes:
- './config/nginx:/etc/nginx'
- './public:/var/www:ro'
db: db:
restart: always restart: always
image: postgres:alpine image: postgres:alpine

View File

@ -13,9 +13,7 @@ const app = express();
const session = require('express-session'); const session = require('express-session');
const bodyparser = require('body-parser'); const bodyparser = require('body-parser');
// this runs behind nginx now, which handles const { APP_PORT } = process.env;
// the external port
const APP_PORT = 80; // process.env;
app.set('trust proxy', process.env.TRUST_PROXY); app.set('trust proxy', process.env.TRUST_PROXY);