Skip to content

Path conflicts in ./config #18

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

Open
iamdadmin opened this issue Feb 1, 2025 · 2 comments
Open

Path conflicts in ./config #18

iamdadmin opened this issue Feb 1, 2025 · 2 comments

Comments

@iamdadmin
Copy link

iamdadmin commented Feb 1, 2025

The folder ./config is being used by both the Laravel app, Frankenphp, and as XDG_CONFIG_HOME.

This results in an unclear/inconsistent storage.

I'd suggest either:

  1. Laravel app uses config, and all other paths are set under ./docker/storage/ i.e. ./docker/storage/xdg_config, ./docker/storage/caddy-data, ./docker/storage/caddy-config or another folder, either way one single folder outside the usual laravel project structure to avoid conflicts
  2. Laravel app moves into a subfolder of ./app or similar, and you create folders for caddy and XDG in the root

References;

Frankenphp uses data/caddy/ and config/caddy/ and will take that from the WORKDIR given in the laravelsail docker file
XDG_CONFIG_HOME only writes a .file but still shouldn't conflict with the rest
Laravel, well understood

@iamdadmin
Copy link
Author

iamdadmin commented Feb 7, 2025

This would be a simple fix, if it helps:

    environment:
      XDG_CONFIG_HOME: /var/www/caddy-config
      XDG_DATA_HOME: /var/www/caddy-data

Caddy and PsyShell (Tinker) will both use XDG_CONFIG env var, alternatively PsyShell can be given a config file

    environment:
      PSYSH_CONFIG: /var/www/html/tinker.config.php

In this config file you can set:

<?php

return [
    'historyFile' => '/var/www/psysh_history',
];

If you want them to persist outside the container, make a folder, I am assuming it can be ../Larasonic-storage so it lives in the parent folder on the local file system but naming it with Larasonic to keep them together/linked

    environment:
      XDG_CONFIG_HOME: /storage/caddy-config
      XDG_DATA_HOME: /storage/caddy-data
      PSYSH_CONFIG: /var/www/html/tinker.config.php
    volumes:
      - '../Larasonic-storage:/storage'

and change tinker.config.php as follows

<?php

return [
    'historyFile' => '/storage/psysh/psysh_history',
];

@pushpak1300
Copy link
Member

thanks I'll check this later and push a fix.

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

2 participants