Server Templates - DNS Settings

8 posts / 0 new
Last post
#1 Mon, 09/17/2007 - 22:07
RonCooper

Server Templates - DNS Settings

I was trying to hard code some nameservers into the server template under: BIND DNS Settings: BIND DNS records for new domains

I have the formatting correct, and a variable for $<DOM> works great. However it seems that it keeps stripping out the tabs and there isn't really a way to insert them from the interface either.

I was wondering if there was a work around for this. Here is an example of what I was trying to add. Names changed to protect the innocent. [code:1] $<DOM>. IN NS ns1.maindomain.net. $<DOM>. IN NS ns2.maindomain.net.[/code:1]

Ron<br><br>Post edited by: RonCooper, at: 2007/09/17 22:08

Tue, 09/18/2007 - 13:13
Joe
Joe's picture

Hey Ron,

Tabs are problematic in web browser text fields. We've got a rich editor for the website creation tool and I believe it handles tabs...but it's not able to generate clean enough text for any configuration files or Templates.

Doesn't it work with any kind of whitespace, though? I mean, is it merely appearance that's wrong here or does it actually not function when you punch it in using space instead of tab?

--

Check out the forum guidelines!

Tue, 09/18/2007 - 13:21 (Reply to #2)
RonCooper

If I use as is, it breaks DNS for the domain in question. It looks like it inserts line breaks in place of the tabs.

If there is a place I can update this text manually, I could do that - not sure where that is located though.

Tue, 09/18/2007 - 13:26 (Reply to #3)
RonCooper

Hmmm, after already responding, I thought - if it doesn't generate clean enough text for the templates - then why are we using it there? I would be happy to edit the files directly - just having a problem locating them - or wondering if they are in the db.

Tue, 09/18/2007 - 13:39 (Reply to #4)
Joe
Joe's picture

&quot;Hmmm, after already responding, I thought - if it doesn't generate clean enough text for the templates - then why are we using it there?&quot;

No, I didn't mean to imply we're using the editor that deals with tabs in the Server Templates page. It's used in the website builder page--but is not safe to use for configuration files, as is (but it does handle tabs, I believe).

I was saying that the basic HTML text field that we're using on that page does not handle tabs (as you've noticed--and it's actually hard to get tabs in their, you'd have to copy paste them in, since tabbing in a text field takes you to the next element on the page rather than putting anything in the box). But I'm pretty sure plain ol' spaces will work, they just don't look as nice.

The only reason I mentioned the editor is to point out that to make tabs work, we will have to build a custom JavaScript editor for Server Templates. It's a much harder job than it first appears. (And the off-the-shelf editor that we currently use for some other purposes is unsuitable for this job.)

&quot;just having a problem locating them - or wondering if they are in the db&quot;

No, there is no db for them to be in. We're flat file fanatics. (Some people, when presented with a problem involving data think, &quot;I know, I'll use a database&quot;, now they have two problems. Virtualmin meta-data is so small and unrelated to other records that it'd be madness to put it into a database...that hasn't stopped some of our competitors from doing so, but we're not mad.)

Anyway, Server Templates are a special case of module configuration, and they use the standard Webmin module configuration functions to read and write them. So, you'll find them in a file called &quot;config&quot; in the /etc/webmin/virtual-server directory. It's not particularly pretty to look at, but you can safely inject tabs. I'm not sure exactly which option you'll need, but it's probably one of the bind_ options. Try inserting just a single nonsense word in the Server Templates editor, and then you can search for it in the config file and know you've got the right one. ;-)

--

Check out the forum guidelines!

Tue, 09/18/2007 - 13:39 (Reply to #5)
RonCooper

I thought I would test your theory about the whitespace and replaced a working domain with spaces and that does appear to work. So I'll give the template a go with spaces - I expect it to work.

Tabs definitely through it a curve though.

Tue, 09/18/2007 - 13:45 (Reply to #6)
RonCooper

You beat me to the last response, thanks that location will help. I poked around a little last night but I should have quit at 2 AM.

I think I can live with the spaces, but if it does really bug me, then I know where to fix it. You are right - I was pasting in the tabs - because it is hard to get them in the input field.

Thanks for the quick attention and great product.

Fri, 09/21/2007 - 01:33
spazzwig

Not clear if the issue was getting &quot;clean&quot; tabs into the form or if there is an issue parsing tabs from it, but thought I'd tag on a note about a rather useful Firefox extension that allows you to use tabs in HTML text fields: http://tabinta.mozdev.org/

Topic locked