AllStarLink / Allmon3

Allmon is the standard web-based montitoring and management for the AllStarLink application. Allmon3 is the next generation of the venerable Allmon2 that is rewritten for performance, scalability, and responsiveness.
GNU Affero General Public License v3.0
15 stars 10 forks source link

allmon doesn't ignore comments in configuration file if the line doesn't begin with them. #227

Open fjb59 opened 2 weeks ago

fjb59 commented 2 weeks ago

in configuration file, you have some parameters alread setp but commented out because they are commented out at the begginng of the line allmon ignores them. but it doesn't ignore embedded comments To Reproduce Steps to reproduce the behavior: edit /etc/allmon3/allmon3.ini

uncomment the commented out example lines such as [590250] host = 127.0.0.1 # ip address or dns resolvable host port = 5038 # listening port user = admin # asterisk mananger user name pass = badpassword # change this password

but leave the embedded comments in

Expected behavior the parcel should ignore the comment tag, ';' or '#' and everything after it. It doesn't. it parses it as part of the parameter so in this case it thinks the username you are trying to log in with is 'admin # asterisk mananger user name' rather than just admin.

Log Information

i tracked this error by logging into asterisk via debug mode. it told me what i was trying to log in as. Also allmon3 --debug reprted that it couldn't cast ' 5038 # listening port '

Version Info Allmon v3 1.2.1

Additional context

removing embedded comments from the end of the lines solves the problem but all other software i've used allows embedded comments at the end of parameters. some people like myself like to leave them in.

jxmx commented 2 weeks ago

The standard syntax of an "INI File" doesn't support inline trailing comments. The Python INI parser is behaving to-spec. I'll leave this open for now to maybe add a note in the files about the trailing comments are for illustrative purposes only.

fjb59 commented 2 weeks ago

As long as people know to remove the inline comments. It should save confusion. It took me a while to track it down.

On 6 Jul 2024, at 19:26, Jason McCormick @.***> wrote:

The standard syntax of an "INI File" doesn't support inline trailing comments. The Python INI parser is behaving to-spec. I'll leave this open for now to maybe add a note in the files about the trailing comments are for illustrative purposes only.

— Reply to this email directly, view it on GitHub https://github.com/AllStarLink/Allmon3/issues/227#issuecomment-2211842079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWG6WMSNSI3PJVSW5EC6KMLZLAZFNAVCNFSM6AAAAABKOQV4JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRHA2DEMBXHE. You are receiving this because you authored the thread.