Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank Dashboard #809

Open
TheArhaam opened this issue Mar 4, 2023 · 2 comments
Open

Blank Dashboard #809

TheArhaam opened this issue Mar 4, 2023 · 2 comments

Comments

@TheArhaam
Copy link

Problem: I get a blank dashboard with just a header and footer at /admin/queues

Relevant Code Snippets:
queues.ts

import Queue from 'bull';
import bullMaster from "bull-master";

const dataQueue = new Queue<IMetadataJobData>('metadata-queue', queueOptions);
const upgradeQueue = new Queue<IUpgradeJobData>('upgrade-queue', queueOptions);

const bullMasterApp = bullMaster({
    queues: [dataQueue, upgradeQueue]
});

export default {
    dataQueue,
    upgradeQueue,
    bullMasterApp
}

index.ts

app.use('/admin/queues', queues.bullMasterApp)

Screenshot:
image

@TheArhaam
Copy link
Author

So i've figured out where the problem is coming from, I'm using helmet, which is adding a few headers that end up blocking the content.

Error in console:

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-SE2OW+eaxTyGbyJnSj2ymAjA1wIF5TGMSLPTr1N1A/w='), or a nonce ('nonce-...') is required to enable inline execution.

@TheArhaam
Copy link
Author

I've resolved the issue using the following helmet config:

app.use(helmet({
	contentSecurityPolicy: {
		directives: {
			defaultSrc: ["'self'"],
			scriptSrc: ["'self'", "'unsafe-inline'"],
			styleSrc: ["'self'", "https://fonts.googleapis.com", "'unsafe-inline'"],
			fontSrc: ["'self'", "https://fonts.gstatic.com"]
		}
	}
}));

I understand this might have a few security risks, leaving the issue open for a more secure suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant