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

Option to redefine the default directory names #304

Open
kroegerama opened this issue Sep 6, 2015 · 13 comments
Open

Option to redefine the default directory names #304

kroegerama opened this issue Sep 6, 2015 · 13 comments

Comments

@kroegerama
Copy link

My webhoster has a folder called "logs" in the root directory of my website. This directory is read-only and only for logs of the webserver.
I can't install grav to the root, because grav does not let me change the default directory for logs (to e.g. grav_logs). It would be handy, if there was an option to change the default folder names.

@kroegerama kroegerama changed the title Redefine default directory names Option to redefine the default directory names Sep 6, 2015
@rhukster
Copy link
Member

rhukster commented Sep 7, 2015

This is already possible with setup.php and its configuration options. That is something I plan on documenting in the next few days.

@Sommerregen
Copy link
Contributor

I havn't tried yet, but adding

schemes:
  log:
    type: Stream
    prefixes:
      '': [grav_logs]

to the streams.yaml may also work. Since streams can be overloaded with other configurations. You may also try to save the above contents as a streams.yaml in your user/config directory.

EDIT: Placing the above contents in the user/config/streams.yaml works. 😄

@kroegerama
Copy link
Author

@Sommerregen Thanks a lot!

@kroegerama
Copy link
Author

I just realized that if:

  • the 'logs' directory exists, but is read-only
  • I define the 'grav_log' as log directory via yaml

Grav will not work and throw an error /homepages/.../htdocs/logs exists but is not writeable.

Edit:
Changing defines.php line 19 to define('LOG_DIR', ROOT_DIR .'grav_log/'); does not fix this.

@kroegerama kroegerama reopened this Sep 25, 2015
@hwmaier
Copy link
Contributor

hwmaier commented Nov 1, 2015

Some progress has been made in this respect, the assets, images, pages, data, plugins, themes folders can be relocated using streams. assets was added recently to the list, refer to #387 and #408.

However the CLIs still depend on hardcoded system, vendor and user folders, so those cannot yet be relocated. Same for the problem plugin.

Maybe user, system and vendor (latter is used by composer and pretty much a given standard anyway) should be considered as non-relocatable.

This would leave only CACHE_DIR and LOG_DIR left to made relocatable/configurable.

I tried to tackle the LOG_DIR yesterday but gave up once I ran into a chicken/egg problem with the dependencies of locator, config and log services on each other and the order of their initialization. To change from a define in the log service one needs the locator service which again needs the config and stream services which again need the uri service and so forth. Seems not easy to de-couple those services from each other.

@rhukster
Copy link
Member

rhukster commented Nov 2, 2015

I had to revert #408 due to problems with bin/grav clear. The asset stream does not appear to be defined at this point by default. Need to dig deeper but don't want to leave the develop branch broken, so reverted it.

@rhukster
Copy link
Member

rhukster commented Nov 2, 2015

ok, should be working again now.

@Komsomol
Copy link

Yes. Please make this editable. Some hosts at the moment permission lock /log folder. For example 1and1.com

1and1.com fits the environment requirements for Grav otherwise since the PHP version can easily be changed.

Is this working then now? The replies are a bit ambiguous?

@VincentRicard
Copy link

Ok I've been looking for it for a little while but I got exactly the same issue, as I'm on a shared server from 1and1 and the logs at the root can't be writable.

Is there anything that works already? I've been stuck with it for days now, and I would like to begin testing stuff online.

@ianmartorell
Copy link

I successfully deployed my site to 1and1 by moving all the files to a directory and then pointing the domain to it. I also had to uncomment the line RewriteBase / to make an internal server error go away.

@kirillaristov
Copy link

kirillaristov commented Aug 30, 2018

We would really like to move the system images folder somewhere to create an image directory at URL our_site_dot_com/images.

@mahagr
Copy link
Member

mahagr commented Sep 4, 2018

@kirillaristov You can copy system/config/streams.yaml to your site configuration and customize the folder from there.

@DaliborIlic
Copy link

@kirillaristov You can copy system/config/streams.yaml to your site configuration and customize the folder from there.

Tried, didn't work...

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

No branches or pull requests

10 participants