What is the XML Tag for "post arguments" ???


Recommended Posts

  • 7 months later...

What do you mean editing of the XML is highly discouraged?
How then I suppose to be able to create my own plugin 😄

 

This are my own created plugins...

 

https://github.com/yaskor/unraid-docker-templates/tree/master/yaskor

There are some shortcommings of the xml-schema. One of it is, there is no tag for PostArguments
(Or there is, but the documentation of the plugin system is very bad - not existend)

Edited by kale-samil
Link to comment
1 minute ago, kale-samil said:

What do you mean editing of the XML is highly discouraged?

Because XML has specific syntax, not all characters are allowed as is, etc

2 minutes ago, kale-samil said:

How then I suppose to be able to create my own

See here https://forums.unraid.net/topic/57181-real-docker-faq/#comment-566084.  Nothing fancy.  You're just using the template screen.

 

 

3 minutes ago, kale-samil said:

One of it is, there is no tag for PostArguments

That's where you're wrong.  If you've entered in values into post args and have then looked at the resulting my* template stored on the flash drive for your installed container (/config/plugins/dockerMan/templates-user) you would see it

4 minutes ago, kale-samil said:

(Or there is, but the documentation of the plugin system is very bad - not existend)

Don't really see the need for extensive documentation on the xml schema since the only official xml schema and formatting is that generated by the template system.  Any further entries are only for CA purposes, and those are all fully documented in another link referenced by the prior link

Link to comment

 

8 minutes ago, kale-samil said:

Or why not just tell me whats the xml tag?

To be quite honest, I don't want people to be manually editing the xml's, especially if there's zero reason to.  Its a recipe for disaster.  I spend enough time fixing other people's xml's and having to bullet proof CA / the appfeed to be able to handle mistakes than to encourage people to make more of them.

Link to comment

@Squid

I allready made multiple Plugins with no problem

Im a dev my self so I know to handle XML 😄 But I can understand you.

The problem with CA for me is, there are not always the "WebApps" I need. So I build them myself.

Thank you again for your help

PS: A real documentation would be realy helpfull. Maybe I do one my self and post it here.

Security by obscurity is never a good option.
If you want people to create valid XML you should recommend them good xml-editors + a realy good documentation.

Edited by kale-samil
Link to comment
1 hour ago, kale-samil said:

    <PostArgs>
        --database /etc/database.db
    </PostArgs>

Case in point.  Technically, that entry resolves out to be

\n        --database /etc/database.db\n 

Which isn't probably what you want, and relying upon the underlying system to trim out the newlines isn't a real good idea.

Edited by Squid
Link to comment
50 minutes ago, kale-samil said:

Security by obscurity is never a good option.

Its not.  There's not a single standard xml entry that isn't defined and generated by the template system

 

50 minutes ago, kale-samil said:

If you want people to create valid XML you should recommend them good xml-editors + a realy good documentation.

You missed my point.  While I cannot speak for LT, I don't think that I'm stepping out of line in saying that we DONT want people to use any xml editor for docker templates.  There's absolutely 100% never a valid reason to create your own xml.  And your posted XML snippet proves it.

Edited by Squid
Link to comment

What I've posted is absolutly valid XML. Thats the reason it is working doe..

XML is a Standard with rules used by millions, you can't make up your own rules.

If you had answered my question right away, you and I would have saved time. If there where a real documentation
I've hadn't to ask in the first way... More time to save...

PS:
 

Quote

unRaid 6.2+

- On the Settings tab, docker, select Docker Authoring Mode
- On The Docker tab, select Add Container
- Fill out all of the relevant information, including the advanced section.  Note that you DO NOT need to fill out host ports or host volumes
- Click Save
- Copy and paste the ENTIRE XML that appears to an appropriately named XML file somewhere.
- Side note, the Categories which dockerMan generates are unofficial.  The only official entries for that are generated by the Application Template Categorizer.  (Although at this time and for the foreseeable future the two do match)


Can't find this Docker Authoring Mode, in Settings Tab/Docker.

 

Unbenannt.PNG

Link to comment
16 minutes ago, kale-samil said:

What I've posted is absolutly valid XML. Thats the reason it is working doe..

XML is a Standard with rules used by millions, you can't make up your own rules.

If you had answered my question right away, you and I would have saved time. If there where a real documentation
I've hadn't to ask in the first way... More time to save...

PS:
 


Can't find this Docker Authoring Mode, in Settings Tab/Docker.

 

Unbenannt.PNG

 

You need to disable docker first, then you get the option to turn on authoring mode. 

Just do it as @Squid say. Saves all the trouble with fixing broken templates. Being a developer doesn't mean you don't do mistakes. 

Link to comment

@saarg @Squid

Thank you.
Maybe disabling docker should be mentioned in the "documentation" to be able to turn on authoring mode 😄

Nevermind guys. I do my plugins for me and that way I want them to be made.
All Im asking for was a recent and complete documentation, so I can look myself and dont have to ask.

I don't know if you guys know there is allready one. But it is far from complete:
https://wiki.unraid.net/DockerTemplateSchema

Edited by kale-samil
Link to comment

Just because something works by accident does not mean that its correct.

 

Output of these two code snips are different

#!/usr/bin/php
<?
$xmlstr = <<<XML
<?xml version='1.0'?>
<test>
    <PostArgs>--database /etc/database.db</PostArgs>
</test>
XML;

$test = new SimpleXMLElement($xmlstr);
echo $test->PostArgs[0];
?>
!/usr/bin/php
<?
$xmlstr = <<<XML
<?xml version='1.0'?>
<test>
    <PostArgs>
        --database /etc/database.db
    </PostArgs>
</test>
XML;

$test = new SimpleXMLElement($xmlstr);
echo $test->PostArgs[0];
?>

 

Difference between the two is that the first xml does not include newlines in the string, the second does (before and after)  

 

Now, assume that you did this on your templates

<Network>
  bridge
</Network>

Instead of 

<Network>bridge</Network>

The system decides that the network type is NONE on the first, but does correctly pick bridge on the second.  What is between the opening and closing tags on XML is what the entry is.  That includes newlines.  And before you say that the system should automatically remove all newlines from all entries, and trim any opening / closing whitespace, how is it supposed to know that that is what you actually intend to have happen vs you intend to have the whitespace / newlines actually present in the entry (ie: Description)

 

Your snip works by accident, along with your other xml's in the repositories (ExtraParams section).  But they are not correct.

 

All I'm stating is that you're expecting full documentation on a schema that for all intents and purposes is an internal data structure when if you use the system as I've asked, everything is correct in the first place without any problems.  The template page is an xml editor effectively.

  • Upvote 1
Link to comment

@Squid

Sorry Squid but collapsing whitespaces and new lines in XML is standard.
Please read https://www.w3.org/2008/xmlsec/Drafts/xml-norm/Overview.html

This is why unraid gets it too, and why the guys at w3school don't bother at all in the example I posted.
And it is the reason why we use [br] for new lines in the discription tag (because regular newlines are trimed away - thats the standard).

Neverless I realy don't want to argue because I don't care.
I understand if I want an up to date documentation I have to write it my own by reverse engineering.
At least I now know there is this "authoring mode" it will help me to find everything I need.

Thank you for your help. And keep up the good work.

 

2ohei2.jpg

Edited by kale-samil
Link to comment

This all is a stupid argument that got out of hand.  Whether or not the xml optionally ignores whitespace or not.  But at the end of the day, @BRiT is correct.  Documenting the xml schema is akin to documenting every .cfg on the flash drive.  Nothing needs to be documented for what are all internally generated files by the GUI for what is not intended to be modified / created by a user.

 

My 2 cents on this is now finished.  Hopefully this thread fades off in oblivion and everyone can get on with their lives.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.