kale-samil Posted April 26, 2018 Share Posted April 26, 2018 I have searched everywhere. Unfortunatly nothing found... Quote Link to comment
kale-samil Posted December 7, 2018 Author Share Posted December 7, 2018 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> Quote Link to comment
Squid Posted December 7, 2018 Share Posted December 7, 2018 Advanced view on the template pageSent via telekinesis Quote Link to comment
kale-samil Posted December 7, 2018 Author Share Posted December 7, 2018 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 Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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. Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) 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 December 8, 2018 by kale-samil Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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 Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) @Squid Never mind I found it. Thank you VERY MUCH!!! <PostArgs> --database /etc/database.db </PostArgs> Edited December 8, 2018 by kale-samil Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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. Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) @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 December 8, 2018 by kale-samil Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 (edited) 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 December 8, 2018 by Squid Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 (edited) 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 December 8, 2018 by Squid Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 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. Quote Link to comment
saarg Posted December 8, 2018 Share Posted December 8, 2018 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. 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. Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) @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 December 8, 2018 by kale-samil Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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 Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) @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 December 8, 2018 by kale-samil Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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. 1 Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) @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. Edited December 8, 2018 by kale-samil Quote Link to comment
BRiT Posted December 8, 2018 Share Posted December 8, 2018 The documentation is use authoring mode in the UI. What is to be updated? Quote Link to comment
Squid Posted December 8, 2018 Share Posted December 8, 2018 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. Quote Link to comment
kale-samil Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) Quote Whether or not the xml optionally ignores whitespace or not Nice that I could help you too. Edited December 13, 2018 by kale-samil Quote Link to comment
Recommended Posts
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.