When trying to get the status of a caster using the API, I get a response 403 Forbidden
-
Hi, I've run the caster locally in docker using a dockerfile to build the image:
FROM ubuntu:22.04 as builder # Install dependencies RUN apt-get update && apt-get install build-essential nano --assume-yes RUN useradd caster # Set the working directory WORKDIR /var/caster # Get the binary file and move it to the caster directory ADD yccaster-amd64 /var/caster/yccaster # Give execute permission to the binary file RUN chmod +x /var/caster/yccaster # Generate configuration file RUN /var/caster/yccaster init # Create session.log file for save events RUN touch /var/caster/session.log # Create session.log file for save logs RUN touch /var/log/caster.log # NTRIP caster EXPOSE 2101 # api interface EXPOSE 8080 EXPOSE 80 # Start the caster CMD ["/var/caster/yccaster"]
when running the image, I assign port 8080 for API and 2101 for caster:
then I add an API token for authorized requests
when requesting /health that does not require authorization, I get a status 200 response with an empty body
but when I try to request /status or other requests requiring authorization with a token, I constantly get a response with status 403 Forbidden
In fact, I run the caster in the GCP cloud in the kubernetes infrastructure, but I get the same error there, after which I tried to understand what the problem is locally. Maybe you can help me, thanks in advance! -
I want to add that at the same time the caster itself works, I publish the antenna data and receive them by the client.
-
@dmytro-hryn Well done!
Please use the latest version of the caster -
Hi @ilyavialkov, thanks i downloaded the latest version of the caster 1.0.6 but still can't use the api now i am getting error
"GET http://localhost:8080/health
Error: socket hang up"
-
@dmytro-hryn ok, I'll check it in a few days and get back to you
-
Hello @ilyavialkov, I was able to use the API locally, the address must be written in the configuration file like:
if write "localhost" or "127.0.0.1" does not work.I will try to set up the API in GCP kubernetes, at the moment I am getting an error:
maybe Load Balancing is not configured correctly.
I'll let you know when I'm done. -
@dmytro-hryn said in When trying to get the status of a caster using the API, I get a response 403 Forbidden:
to use the API locally, the address
Cool. Thank you for the investigation. Did not try it in Kub.
I'm very intriguing on your project. Can you share what are you building? -
@ilyavialkov i'm working on a project for a european company that makes robots that cut grass, initially we use caster BKG as a base but faced some problems with its operation and lack of necessary support. And now we are looking for an alternative, if everything suits us, we will buy a license and cooperate.