Cockpit: How to setup cockpit to work only from its domain?

Created on 3 Mar 2018  路  2Comments  路  Source: agentejo/cockpit

Hello,

I will use Cockpit API on frontend with visible API key (not full access) but i dont want developers to have ability to request my data from anywhere.

Most helpful comment

On root directory there's an index.php.
You can find:
header("Access-Control-Allow-Origin: *");

Remove the star and put your own domain there.

header("Access-Control-Allow-Origin: example.com");

All 2 comments

On root directory there's an index.php.
You can find:
header("Access-Control-Allow-Origin: *");

Remove the star and put your own domain there.

header("Access-Control-Allow-Origin: example.com");

@6feferonka9 it's possible to configure cors by editing the file config/config.yaml or in Settings > System Settings through the UI:

# Cockpit settings
cors:
  allowedOrigins: https://example.com
Was this page helpful?
0 / 5 - 0 ratings

Related issues

crealx picture crealx  路  6Comments

victormoretti picture victormoretti  路  5Comments

solucionti picture solucionti  路  4Comments

Hughp135 picture Hughp135  路  4Comments

TechnicallyJoe picture TechnicallyJoe  路  6Comments