Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

I have searched everywhere. Unfortunatly nothing found...

  • 7 months later...
  • Author

Hello Unraid Team,

 

it would be really nice if there where a posibility to add post arguments to my plugin xml.
Something like:

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

Advanced view on the template page

Sent via telekinesis

  • Author
1 minute ago, Squid said:

Advanced view on the template page

Sent via telekinesis
 

 

I know there is a field in the UI.

But my feature request is to be able to add the post argument(s) into the plugin xml.
There is allready a tag for ExtraParams but none for PostArguments
 

Once you add an entry into post args, then you'll see the entry in the xml.

 

IE: Manual editing of the XML is highly discouraged, and there is nothing that ever needs to be added into it that isn't supported by the template screen.

  • Author

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

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

  • Author

@Squid

Never mind I found it. Thank you VERY MUCH!!!

 

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

Edited by kale-samil

 

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.

  • Author

@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

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

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

  • Author

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

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. 

  • Author

@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

Never said the XML snip wasn't valid.  Merely that it includes a pair of newlines, which while it may work, only works by accident

  • Author

@Squid

So this guys got it wrong too?

https://www.w3schools.com/xml/

PS: valid means it is valid. If a XML is valid it should work because it is valid, not by accident...

Edited by kale-samil

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.

  • Author

@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

The documentation is use authoring mode in the UI. What is to be updated?

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.

  • Author
Quote

Whether or not the xml optionally ignores whitespace or not

Nice that I could help you too. 

Edited by kale-samil

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.