Nodebb: building skins leaves behind minifier process

Created on 4 Dec 2018  路  10Comments  路  Source: NodeBB/NodeBB

image

bug

All 10 comments

Hello @barisusakli

I was applied the changes from 67ac8e3 but minimifier remains running, after forum restart.

Still around when you stop the forum and start it backup? It might be a different issue.

Minimifiers runs now every minute, or two or three minutes for 5 seconds. This seems better than before. But I don't know is if this the normal behaviour, ro minimifiers only must runs on rebuild.

Hmm do you have nginx setup to serve your static files? Take alook here https://docs.nodebb.org/configuring/scaling/

There is a bug in core right now where changing skins always builds the files.

The minifiers running are almost certainly from your users switching skins. Skins are now built with the theme on the server and distributed to users when said users decide to use them.

Right now, there's a bug which results in a skin that's been built already being rebuilt every time the user loads the site. This will soon be fixed.

Yes, I serve public files through nginx.

Thanks you friends

Would you mind sharing your nginx config? If you're serving public files with nginx, you shouldn't be encountering this issue.

Yes @pitaj for sure.

This is the old config file I was used as today.

upstream io_nodes {
    ip_hash;
    server 127.0.0.1:20000;
    server 127.0.0.1:20001;
}

server {
  listen       80;
  server_name www.domain.com.ar;
  return 301 https://domain.com.ar$request_uri;
#rewrite     ^   https://domain.com.ar$request_uri? permanent;
}

server {
  listen       80;
  server_name domain.com.ar;
  return 301 https://$server_name$request_uri;
}


server {
    listen 443 ssl http2;

    server_name domain.com.ar;
    root /opt/vapor/nodebb/public;

    access_log  /var/log/nginx/vapor-access.log;
    error_log   /var/log/nginx/vapor-error.log;

    ssl_certificate /etc/letsencrypt/live/domain.com.ar/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain.com.ar/privkey.pem;

    # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this topic first.
#    add_header Strict-Transport-Security "max-age=0";
##    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
#    add_header X-XSS-Protection "1; mode=block";
#    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;

proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_redirect off;

    # Socket.io Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    gzip            on;
    gzip_min_length 1000;
    gzip_proxied    off;
    gzip_types      text/plain application/xml application/x-javascript text/css application/json;

    location @nodebb {
        proxy_pass http://io_nodes;
    }

    location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css|google286887733fe4f063\.html) {
        root /opt/vapor/nodebb/public/;
        try_files $uri $uri/ @nodebb;
    }

    location / {
        proxy_pass http://io_nodes;
    }
}


And this is the current file I using based on your advice

upstream io_nodes {
    ip_hash;
    server 127.0.0.1:20000;
    server 127.0.0.1:20001;
}

server {
  listen       80;
  server_name www.domain.com.ar;
  return 301 https://domain.com.ar$request_uri;
#rewrite     ^   https://domain.com.ar$request_uri? permanent;
}

server {
  listen       80;
  server_name domain.com.ar;
  return 301 https://$server_name$request_uri;
}


server {
    listen 443 ssl http2;

    server_name domain.com.ar;
###    root /opt/vapor/nodebb/public;

    access_log  /var/log/nginx/vapor-access.log;
    error_log   /var/log/nginx/vapor-error.log;

    ssl_certificate /etc/letsencrypt/live/domain.com.ar/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain.com.ar/privkey.pem;

    # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this topic first.
#    add_header Strict-Transport-Security "max-age=0";
##    add_header X-Content-Type-Options nosniff;
###    add_header X-Frame-Options "SAMEORIGIN";
#    add_header X-XSS-Protection "1; mode=block";
#    add_header X-Robots-Tag none;
###    add_header X-Download-Options noopen;
###    add_header X-Permitted-Cross-Domain-Policies none;

###proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_redirect off;

    # Socket.io Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    gzip            on;
    gzip_min_length 1000;
    gzip_proxied    off;
    gzip_types      text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;

    location @nodebb {
        proxy_pass http://io_nodes;
    }

    location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css|google286887733fe4f063\.html) {
        root /opt/vapor/nodebb/public/;
        try_files $uri $uri/ @nodebb;
    }

    location ~ ^/assets/(.*) {
        root /opt/vapor/nodebb/;
        try_files /build/public/$1 /public/$1 @nodebb;
    }

    location /plugins/ {
        root /opt/vapor/nodebb/build/public/;
        try_files $uri @nodebb;
    }

    location / {
        proxy_pass http://io_nodes;
    }
}

Well, I revert to previous nginx configuration because get invalid csrf token and users can't login.

You should only need to add the assets and plugins location blocks to your old config to make it work.

Was this page helpful?
0 / 5 - 0 ratings