bfabiszewski / ulogger-server

μlogger • web viewer for tracks uploaded with μlogger mobile client
GNU General Public License v3.0
538 stars 85 forks source link

relative path to sqlite db file #115

Closed martin-tef closed 4 years ago

martin-tef commented 4 years ago

I would like to suggest making the location of the sqlite DB file relative to the config.php or even better detect if it is a relative or absolute path. Benefits: -It makes it easier to rename or shift the ulogger-server directory somewhere else -Some hosters hide their internal directory structure and give you access only to a chroot environment. The webserver is working with a different directory structure than visible to you. In my case - I am using one.com - the "real" /customers/a/b/c//httpd.www/ is mapped to /www as my web root. Using only the /www in config.php will result in errors.

I made some tests with specifying only the file name and expected this to be in the same location as config.php. I noticed that setup.php was then creating the db in the scripts directory and when trying to access from the client, it was created in the client directory. As a workaround, it was possible to use manually created links in those locations (ln -s ../ulogger.db ulogger.db). But this is quite ugly.

bfabiszewski commented 4 years ago

Thanks! I didn't think about relative path. It sounds like a setup script bug. It should create database file relative to root directory. I will have a look at it.