Can't access api

@Tummerhore I tried it myself now.

Steps to reproduce:

Install Cockpit in the default docs root to see the expected paths.

  • username.uber.space points to /var/www/virtual/username/html
  • cd ~/html
  • git clone https://github.com/agentejo/cockpit.git .
  • nano bootstrap.php --> add debugging snippet directly after the constants defines and before function cockpit(...) starts
echo "<pre style='position:absolute;top:0;left:0;'>"; //avoid pre to get centered (body CSS)
print_r($_SERVER['DOCUMENT_ROOT']);                   // may differ from __DIR__
echo "\r\n";
print_r(get_defined_constants(true)['user']);         // list all user constants
print_r($app->config['paths']);                       // list all config paths
echo "</pre>";
die;
  • open https://username.uber.space in browser to see the expected constants

Now to the sub domain.

  • add sub domain uberspace web domain add test.myurl.de
  • test.myurl.de points to /var/www/virtual/username/test.myurl.de
  • cd /var/www/virtual/username/
  • mkdir test.myurl.de
  • cd test.myurl.de
  • git clone https://github.com/agentejo/cockpit.git .
  • nano bootstrap.php --> add debugging snippet from above
  • open https://test.myurl.de in browser to see the wrong constants
  • change .htaccess (see below)
  • add custom defines (see below)

.htaccess

  • nano .htaccess
  • uncomment RewriteBase /

defines.php

  • nano defines.php
  • copy the following snippet and save
<?php
define('COCKPIT_BASE_URL', '');
define('COCKPIT_BASE_ROUTE', '');
define('COCKPIT_DOCS_ROOT', __DIR__);
define('COCKPIT_SITE_DIR',  dirname(__DIR__));

Don’t forget to delete the debugging snippet in bootstrap.php.

Call /install in browser or use the cli to create a new user

I was able to login and to logout, I created a collection from the posts template and I saved one entry. I didn’t test anything else. So it seems to work with this setup.

1 Like