Skip to content

Make PgAdmin, RedisCommander, and MyPhpAdmin usable for remote resources #2116

Description

Today these resources hardcode the endpoint information on the host (assuming host.docker.internal). We need to make these work for azure resources as well.

cc Mitch Denny (@mitchdenny) Tim Heuer (@timheuer)

Activity

  1. ghost added
    area-app-model
    on Feb 7, 2024
  2. mitchdenny commented on Feb 11, 2024

    @mitchdenny
    Member

    What would you envisage the API being like?

    We don't have a resource to hang the WithPgAdmin call off so we'd probably be looking to do what we had discussed previously and promote PgAdmin to its own resource with something like:

    var builder = DistributedApplication.CreateBuilder(args);
    var remotePgDb = builder.AddConnectionString("myconnection");
    builder.AddPgAdmin("pgadmin")
           .WithReference(remotePgDb);

    We would take advantage of a more specific WithReference implementation. An alternative could be something like this:

    var builder = DistributedApplication.CreateBuilder(args);
    var remotePgDb = builder.AddConnectionString("myconnection")
                            .WithPgAdmin();

    But remotePgDb is of type IResourceBuilder<IResourceWithConnectionString> so that could be somewhat confusing. Also, in this case we would need to introduce a kind of LinkAnnotation so that the lifecycle hook that generates the config for PgAdmin knows which of the possible many IResourceWithConnectionString instances it should treat as a postgres server.

  3. mitchdenny commented on Feb 11, 2024

    @mitchdenny
    Member

    Putting on the backlog for now but may bring forward into P4/P5 depending on where this conversation goes.

  4. DamianEdwards commented on Mar 9, 2024

    @DamianEdwards
    Member

    Bringing into preview.5 to fix the hard-coded use of host.docker.internal

  5. davidfowl commented on Mar 9, 2024

    @davidfowl
    CollaboratorAuthor

    That's already tracked #2639

  6. DamianEdwards commented on Mar 9, 2024

    @DamianEdwards
    Member

    So that tracks updating places in Aspire.Hosting and friends that still hardcode it?

  7. davidfowl commented on Mar 9, 2024

    @davidfowl
    CollaboratorAuthor

    Yes. In preview 4 this change centralized the hard coding (instead of hardcoding it in n places). In preview 5, the change will be to detect the container runtime so that it's available in a less hardcoded way. I think given the changes we've made to modeling endpoints, we should be able to fix it by expressing the endpoint reference in an expression and have the runtime replace it with the right value

  8. added
    area-integrations
    and removed
    area-app-model
    on Sep 7, 2024
  9. davidfowl commented on Sep 7, 2024

    @davidfowl
    CollaboratorAuthor

    This will be possible with enhancements Mitch Denny (@mitchdenny) is making to the app model.

  10. Alirexaa commented on Sep 7, 2024

    @Alirexaa
    Contributor

    This will be possible with enhancements Mitch Denny (@mitchdenny) is making to the app model.

    Could you please mention related PR/PRs?

    I could take this and work around it.

  11. mitchdenny commented on Sep 8, 2024

    @mitchdenny
    Member

    In the case of Redis you could probably subscribe to the ConnectionStringAvailableEvent (using builder.Eventing.Subscribe... and then overwrite the REDIS_HOSTS variable. This is something we'll try to get working in a built in way.

    There are a few concerns that we need to consider such as do we really want to be persisting a credential to a cloud hosted Postgres server in a config file that is written to a temp directory.

    That isn't such an issue for randomly generated passwords that are just used for development purposes but when we are talking about Azure hosted resources we should probably be a bit more circumspect.

  12. davidfowl commented on Sep 8, 2024

    @davidfowl
    CollaboratorAuthor

    Well in the case when the db is remote, but pgadmin is local it should just work

  13. added
    postgres
    redis
    on Sep 14, 2024
  14. Odonno commented on Sep 28, 2024

    @Odonno
    Contributor

    PgWeb also stores the password in a toml file. I don't recall seeing anything that says the admin UI is never published with other resources. AFAIK, connections are opened on the client so connection infos has to be passed via the network which mean passwords are sent via the network.

    In any case, I don't see a proper solution for this. Imagining symmetric hashing which imply storing the keys that also need to be sent with the client app...

    I am just curious to know your thoughts on this.

  15. Odonno commented on Oct 30, 2024

    @Odonno
    Contributor

    Any response on this?

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

    area-integrationspostgresredis

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions