8000 Port PADD to a new and more robust language. · Issue #201 · pi-hole/PADD · GitHub
[go: up one dir, main page]

Skip to content

Port PADD to a new and more robust language. #201

Closed

Description

@dschaper

Is your feature request related to a problem? Please describe.

bash is great but it's close to hitting it's limits as far as extensibility and maintenance. I'm considering porting this to a new language and I'm looking for thoughts and ideas. My first thought is to use golang but that is a compiled language and would remove some of the transparency of the code. All the code would still be open source and available here with instructions to compile yourself if you felt that was more comfortable.

I may turn this in to a discussion topic if there are people interested in this or have other ideas and concerns.

Activity

  1. pinned this issue on Mar 4, 2022
  2. PromoFaux commented on Mar 4, 2022

    @PromoFaux
    Member

    Was recently recommended these Go libraries for console stuff by @goblinfactory

    May be of use here

  3. dschaper commented on Mar 4, 2022

    @dschaper
    MemberAuthor

    Thanks, I was going through a few tutorials with

    https://github.com/spf13/cobra
    and
    https://github.com/manifoldco/promptui

  4. goblinfactory commented on Mar 5, 2022

    @goblinfactory

    Go is a great language if you've come from C# ; you'll enjoy the simplicity and it will make you a better C# programmer.

    Adam mentioned me by name, and this is the first time I've seen the code, so not familiar with the project history, just reading from the top, and then a quick peek at the project, (appears to be a single bash file for self evident simplicity and reviewability and trusty-ness) ,that makes perfect sense.

    I think the concern about transparency is valid. While go binaries can be distributed as Brew binaries; if you already have Go installed, you can install utilities from source with a single command, go install {repo_url} and that installs it from source, so for all the go users that will run a future PADD written go, they'd most likely be doing it that way. (for security reasons).

    my 2 cents;
    Having taken a quick look at the bash script; running off a single config, I think the std lib flags package should be sufficient to get started with instead of cobra; and extra features like using Prompt UI might be better as another project that wraps the command line project, i.e just as a way to wizard config it "for you", thus keeping the core package size small for those who are happy to edit a config manually.

    Here are some go references that I think would be relevant here;

    Go standard library for parsing command line flags; start here
    https://gobyexample.com/command-line-flags

    The next level up from that accepting more complex command line options; as shown here
    https://github.com/jessevdk/go-flags

    Followed by more higher level abstractions like Cobra etc. Though the Go community frown upon you starting with a complex library until you've exhausted all simpler options first.

    I will take a look at the projects, I have a good friend who keeps telling me to setup a pihole for my home network. This is a good nudge to go do that; maybe I can help out somehow.

    cheers,
    Alan

  5. dschaper commented on Mar 5, 2022

    @dschaper
    MemberAuthor

    Great! Thanks a ton for the helpful information. I've used the stdlib flags and it seemed a little limited. The go-flags may be helpful but thinking over things, I honestly don't see a whole lot of CLI arguments that need to be passed.

    PADD essentially queries pihole-FTLs telnet API for status and some basic metrics and presents it in a dashboard like fashion.

    And thank you for the idiomatic Go advice on additional libraries!

  6. locked and limited conversation to collaborators on Mar 5, 2022
  7. converted this issue into a discussion #202 on Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0