Config.yaml does not work

I used the config.yaml to make settings regarding the mailer and to add additional user groups, but nothing happens. my settings don’t apply to Cockpit.

What did I do wrong?

Please explain some more, what you have done so far.

A few things, I could imagine:

Did you save the file in /path/to/cockpit/config/config.yaml?
Does the config file end with .yaml? - config.yml won’t work.
If there is a file config.php, the config.yaml will be ignored.

As there was no config folder, I created one and clicked on the link within cockpit to automatically create the config.yaml

after that I pasted the example markup from the documentation in the editor and made some changes.

this is my config-file now. (mail credentials censored)

# Cockpit settings
# cockpit App name
'app.name' => 'HTTP Status Codes',

# cockpit session name
'session.name' => 'mysession',

# app custom security key
'sec-key' => 'nfu89h3849kj******f3n§3pi2',

# site url (optional) - helpful if you're behind a reverse proxy
'site_url' => 'https://h****de.de',

    # define additional groups
'groups' => [
    'redakteur' => [
        '$admin' => false,
        '$vars' => [
            'finder.path' => '/storage/upload'
        ],
        'cockpit' => [
            'backend' => true,
            'finder' => false
        ],
        'collections' => [
            'manage' => true
        ]
        'singletons' => [
            'manage' => true
        ],
    ],
],

    # use smtp to send emails
'mailer' => [
    'from'       => 'cockpit@do****on.de',
    'transport'  => 'smtp'
    'host'       => '***',
    'user'       => '***'
    'password'   => '***',
    'port'       => 25,
    'auth'       => true,
    'encryption' => 'ssl' # '', 'ssl' or 'tls'
],

Rename config.yaml to config.php and it should work :wink:

Cockpit supports a config file in php format

return [
    'app.name' => 'just a test',
    'groups' => [
        // ...
    ],
];

or in yaml format

app.name: just a test

groups:
    redakteur:
        cockpit:
            backend: true

Unfortunately this doesnt work and result in a 500 Server error.

I don’t know what to do. Unfortunately the documentation is very poor.

Ah, I see. Renaming doesn’t work, if the file doesn’t contain valid PHP. The GUI defaults to create a config.yaml file, but the example in the docs is for a php file.

https://getcockpit.com/documentation/reference/configuration

Choose a file type first, than write valid yaml or valid php. If you choose a php config file, you have to return an array of settings.

<?php

return [

    # app name
    'app.name' => 'My Project X',
];

this worked.

As I said: the documentation is a bit poor …