I searched the whole web regarding it and there is really no information about changing the default access key: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH
Endpoint=;Port=8888;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0
I want to change the access keys, is that possible?
This is my dockerfile:
FROM mcr.microsoft/dotnet/sdk:8.0
# Create and switch to a non-root user
RUN useradd -ms /bin/bash nonroot && \
mkdir -p /home/nonroot/signalr && \
chown -R nonroot:nonroot /home/nonroot
USER nonroot
WORKDIR /home/nonroot/signalr
# Install the SignalR Emulator
RUN dotnet tool install --global Microsoft.Azure.SignalR.Emulator
# Update PATH to include user's dotnet tools
ENV PATH="/home/nonroot/.dotnet/tools:${PATH}"
# Start the emulator with the custom access key
ENTRYPOINT ["asrs-emulator", "start", "-i", "0.0.0.0"]
My docker compose:
signalr-emulator:
container_name: signalr-emulator
image: signalr-emulator:latest
build:
dockerfile: signalr/Dockerfile
networks:
- marble-network
env_file:
- .env.signalr
volumes:
- signalr:/home/nonroot/.aspnet
- ./signalr/signalr-settings.json:/home/nonroot/signalr/settings.json
- ./signalr/signalr-appsettings.json:/home/nonroot/signalr/appsettings.json
ports:
- "7071:7071"
- "9999:8888"
signalr-appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Warning"
}
},
"AllowedHosts": "*",
"AccessKey": "This key is not working but included in: .Azure.SignalR.Emulator/appsettings.json and the file is being read according to the logs when running 'asrs-emulator start -i 0.0.0.0' | I also looked at the source code of the said repo, and it seems that the Access Key is hardcoded??"
}
signalr-settings.json
{
"UpstreamSettings": {
"Templates": [
{
"UrlTemplate": ":7071/runtime/webhooks/signalr",
"EventPattern": "*",
"HubPattern": "*",
"CategoryPattern": "*"
}
]
}
}
My main issue is where do i set the custom access key? Is it on an environment or a parameter in asrs-emulator
? Because according to it's help command, there is no such parameter for setting the custom access key. Its fixed to this:
Endpoint=;Port=8888;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0
References:
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745119255a4612316.html
评论列表(0条)