borpin
(Brian Orpin)
18 January 2019 19:54
1
Continuing the discussion from Development Roadmap 2019 - Robust Backup Process :
I have been running EmonCMS on Lighttpd for several years now quite happily. Unfortunately, it seems that the setup will not follow symlinks.
I have explicitly enabled it to follow symlinks without success.
When I did the install, I had to fiddle with the rewrite regexp to get it to work and my suspicion is that this is what is not working.
Anyone like to suggest what might be breaking it?
url.rewrite-if-not-file = (
"^/emoncms/([^?]*)$" => "/emoncms/index.php?q=$1",
"^/emoncms/([^?]*)\?(.*)$" => "/emoncms/index.php?q=$1&$2"
)
Directory
drwxrwxr-x 15 www-data www-data 4096 Jan 15 17:20 .
drwxrwxr-x 9 www-data www-data 4096 Jan 17 16:30 ..
drwxrwxr-x 3 www-data www-data 4096 Jan 17 17:16 admin
drwxrwxr-x 7 www-data www-data 4096 Jan 11 22:44 app
lrwxrwxrwx 1 www-data www-data 20 Jan 15 17:20 backup -> /root/backup/backup/
drwxrwxr-x 7 www-data www-data 4096 Jan 17 16:13 dashboard
drwxrwxr-x 6 www-data www-data 4096 Dec 27 11:20 device
drwxrwxr-x 3 www-data www-data 4096 Oct 12 22:36 eventp
drwxrwxr-x 5 www-data www-data 4096 Jan 11 22:50 feed
drwxr-xr-x 6 www-data www-data 4096 Jan 11 22:44 graph
drwxrwxr-x 4 www-data www-data 4096 Jan 11 22:50 input
drwxrwxr-x 4 www-data www-data 4096 Oct 12 22:36 process
drwxrwxr-x 4 www-data www-data 4096 Oct 12 22:36 schedule
drwxrwxr-x 2 www-data www-data 4096 Oct 12 22:36 time
drwxrwxr-x 5 www-data www-data 4096 Oct 12 22:36 user
drwxrwxr-x 6 www-data www-data 4096 Oct 12 22:36 vis
I know this is root, but by default everything is done as root on DietPi (let’s not go there).
If i try
/emoncms/graph/view
I get the graph page, if I try
/emoncms/backup/view
I get an error
URI not acceptable. No controller 'backup'. (view/)
Should that URI work?
pb66
(Paul)
18 January 2019 20:27
2
borpin:
Should that URI work?
I’m not the best at PHP, but when I look at the code I would “not”.
/emoncms/graph/view
would land in the “else” here and open the view.php
page
as there is no explicitly defined view
action.
Whereas with /emoncms/backup/view
there is no defined view
route OR else
to catch the view
url. The backup_view_php seems to be served at /emoncms/backup
ie when there is no action defined.
In contrast, the emoncms/input
(for example) seems to have the view
action explicitly defined, and it will open either the input_view.php
or device_view.php
depending on the users “beta” setting.
} else if ($route->action == 'view') {
$route->format = "html";
textdomain("messages");
$ui_version_2 = $user->get_preferences($session['userid'], 'deviceView');
if ($device && isset($ui_version_2) && $ui_version_2) {
$result = view("Modules/input/Views/device_view.php", array());
} else {
$result = view("Modules/input/Views/input_view.php", array());
}
To test the above theories I navigated to emoncms/graph/carrot
and still landed on the view page, so any undefined word will take you there not just “view”. I don’t have backup installed but I’m guessing you will find it at emoncms/backup
borpin
(Brian Orpin)
18 January 2019 20:47
3
No it is under Modules.
Solved it - it was a permission issue
Actually that code (in core.php
) could be simplified to a file_exists
for each of the folders found. No need to check for the link or dir really.
pb66
(Paul)
18 January 2019 20:52
4
borpin:
No it is under Modules.
We were discussing url paths rather than FS paths I meant http://emoncms/backup not it’s installed (symlinked) location.
As in
I don’t have backup installed but I’m guessing you will find the view at emoncms/backup
borpin
(Brian Orpin)
18 January 2019 20:56
5
Ah yes. in the end, with the right permissions, /emoncms/backup
works.
Cheers