Bug 6269 - Binding in the my.tt file
: Binding in the my.tt file
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.0
: All All
: P2 enhancement (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-04 03:25 UTC by Dr Lovegrove
Modified: 2008-12-18 11:12 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
unified diff (1.36 KB, patch)
2007-12-04 12:17 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dr Lovegrove 2007-12-04 03:25:11 UTC
The my.tt file shipped with SqueezeCentre and Slimserver has a line which forces all MySql access to the database to be carried out on the same machine as the database is running. 

This is great for security, but a bit of a pain if the user wants to run something like Moose, which needs to access the database remotely. Moreso if their server is running on a NAS box with limited access rights. 

Re-implementing the line of the my.tt as a parameter which defaults to 127.0.0.1 would be equally secure, yet make it easier for applications such as Moose to access the database remotely since the parameter could be added to the server settings.

So, instead of this in the my.tt:
bind-address          = 127.0.0.1

We should have this:
bind-address          = [% bindAddress %]

Then in MySQLHelper.pm (by default) have this in createConfig:
my %config = (
       'basedir'  => $class->mysqlDir,
       'language' => $class->mysqlDir,
       'datadir'  => catdir($cacheDir, 'MySQL'),
       'socket'   => $class->socketFile,
       'pidFile'  => $class->pidFile,
       'errorLog' => catdir($cacheDir, 'mysql-error-log.txt'),
       'bindAddress' => $prefs->get('bindAddress'),
);

and define bindAddress to be '127.0.0.1' at the top of the file.

bindAddress should then be added to the server settings and maybe added to the front end, or a plugin written which forces it to not be bound.

If we kept the bindAddress to a string, we should be able to enter a range of IP's.

One further thing to note is that changing the value of bindAddress will probably require the my.cnf file in the cache to be deleted and the server and mysql restarting to take effect.
Comment 1 KDF 2007-12-04 12:17:59 UTC
Created attachment 2469 [details]
unified diff

this would be the unified diff. simply a default pref with no ui.  pref can be edited through the cli, I suppose or by manual edit of prefs file in short term.  needs more testing on various configs.
Comment 2 Dr Lovegrove 2007-12-06 03:59:16 UTC
(In reply to comment #1)
> Created an attachment (id=2469) [edit]
> unified diff
> this would be the unified diff. simply a default pref with no ui.  pref can be
> edited through the cli, I suppose or by manual edit of prefs file in short
> term.  needs more testing on various configs.  

I've tested the diff on two windows servers and it works well. 

Changing via the CLI works well too, although you can't set a pref to be an empty
string via the UI. A workaround seems to be two single quotes, which unbinds nicely.

I say go for it ! :-)
Comment 3 KDF 2007-12-06 12:10:51 UTC
merged at change 15072. Please test and report any issues.  Will revert if there are problems. Leaving open for now, pending any feedback.
Comment 4 Blackketter Dean 2007-12-17 12:16:50 UTC
I'll mark as fixed as the change has been merged in.  Reopen if the issue remains.  Thanks!
Comment 5 Chris Owens 2008-03-07 09:05:17 UTC
This bug is being closed since it was resolved for a version which is now released!  Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html

If you are still seeing this bug, please re-open it and we will consider it for a future release.