simao / ota-lith

Mozilla Public License 2.0
7 stars 3 forks source link

WebApp Branch: Can't seem the find the buttons for creating a device/campaign/update #6

Closed Jeredriq closed 8 months ago

Jeredriq commented 2 years ago

WebApp seem to be usable for creating a device/campaign/update etc. Is there a version of webapp that can do these or it was always like this, just showing HERE documentation and device/campaign/updates you defined through API or cli.

Is there a working version, like a last stable release for the whole project? Or even for the webapp?

simao commented 2 years ago

What is not working on webapp? I can create updates and campaigns and update devices using the app. What is missing?

Jeredriq commented 2 years ago

I cant see the create update/campaign/device button. I can do it through API but I want to use solely webapp :D

simao commented 2 years ago

I pushed an update with the new ota web version that should show the buttons correctly.

But do keep in mind webapp is not supported at all and I don't even know what is the status of that project upstream, that is handled by HERE.

Jeredriq commented 2 years ago

I pulled your updates and its running on container (from the code) but I can't see the webapp's UI or homepage. But its running because I can check webapp's health so it must be running.

This is the error log:

webapp_1 | D|2021-11-30 11:41:41,775|c.a.auth.UiAuthAction|Session verification failed.
webapp_1 | com.advancedtelematic.auth.SecuredAction$MissingSessionKey: Key 'id_token' not found in session
webapp_1 | {"at":"2021-11-30T11:41:41.777Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"10","http_query":"''","http_method":"GET","http_path":"/","http_service_name":"ota-plus-web","traceid":"98a98a336dec7102","http_status":"303"}}
webapp_1 | D|2021-11-30 11:41:41,897|c.a.auth.NoLoginAction|Signed fake auth token for namespace default
webapp_1 | I|2021-11-30 11:41:41,922|c.a.libats.messaging.MessageBus$|Using local message bus
webapp_1 | {"at":"2021-11-30T11:41:41.929Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"134","http_query":"''","http_method":"GET","http_path":"/login","http_service_name":"ota-plus-web","traceid":"88c32b0bfd43724b","http_status":"303"}}
webapp_1 | I|2021-11-30 11:41:41,931|c.a.PlayMessageBusPublisher|published UserLogin - default
webapp_1 | {"at":"2021-11-30T11:41:42.183Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"20","http_content_ln":"1608","http_query":"''","http_method":"GET","http_path":"/","http_service_name":"ota-plus-web","traceid":"f41c1e1ebaf6da71","http_status":"200"}}
webapp_1 | {"at":"2021-11-30T11:41:42.234Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"6","http_content_ln":"2121","http_query":"''","http_method":"GET","http_path":"/assets/js/app.js","http_service_name":"ota-plus-web","traceid":"6c2a72b12eec0214","http_status":"404"}}
webapp_1 | {"at":"2021-11-30T11:41:42.243Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"17","http_content_ln":"82","http_query":"''","http_method":"GET","http_path":"/assets/js/omniture.js","http_service_name":"ota-plus-web","traceid":"e1d0f9312f9d8459","http_status":"200"}}
webapp_1 | {"at":"2021-11-30T11:41:42.245Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"16","http_content_ln":"2125","http_query":"''","http_method":"GET","http_path":"/assets/css/style.css","http_service_name":"ota-plus-web","traceid":"2123d4cc1837b1c3","http_status":"404"}}
webapp_1 | {"at":"2021-11-30T11:41:42.265Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"4","http_content_ln":"2121","http_query":"''","http_method":"GET","http_path":"/assets/js/app.js","http_service_name":"ota-plus-web","traceid":"2882c62dff82bf74","http_status":"404"}}
webapp_1 | {"at":"2021-11-30T11:41:42.298Z","level":"INFO","logger":"c.a.l.h.logging.RequestLoggingActor","msg":{"http_stime":"11","http_content_ln":"4286","http_query":"''","http_method":"GET","http_path":"/assets/img/icons/favicon.ico","http_service_name":"ota-plus-web","traceid":"c3bdd10a3d12d101","http_status":"200"}}
Jeredriq commented 2 years ago

If its not too much to ask, can you also write step by step your process of building the code and turning it into image. I am doing it from Readme but I always have problems.

The code I meant is this webapp: https://github.com/simao/ota-plus-server/tree/no-user-profile

With best regards

Jeredriq commented 2 years ago

The sbt runWebpack command runs npm/webpack (inside a docker container) to compile the Single-Page application (assets/js/app.js).

This step doesnt seem to work because I've run sudo sbt runWebpack in both ota-plus-server and ota-plus-web folders but app.js is not generated

simao commented 2 years ago

Hi,

I built and pushed the image to dockerhub again, you can try it again, maybe you need to do docker-compose down, docker pull simaom/ota-plus-web:fbeb80223434b91e05ee18b5dfed38af616adce9. and then try docker-compose up again.

I don't know why they wrote that in the README, what they mean is that runWebpack would need to be run inside a docker container with all the dependencies.

What I use to built this container is:

docker run -it -v /home/simao/ats/ota-plus-server:/app advancedtelematic/app-gitlab-job:0.0.2 sh -c cd /app/ota-plus-web/app/reactapp && npm ci && webpack -p
sbt docker:publishLocal

I then tag that image with my username, for example:

docker tag advancedtelematic/ota-plus-web:fbeb80223434b91e05ee18b5dfed38af616adce9 simaom/ota-plus-web:fbeb80223434b91e05ee18b5dfed38af616adce9

And then push it to dockerhub.

Jeredriq commented 2 years ago

Hi Simao,

Thank you so much for your help. Creating campaign from UI is bugged for some reason, it can't find the updates defined in previous step.

Also can you suggest the best way to debug the ota-plus-server since you're familiar with the project. I want to attach to docker container's process from visual studio code but I can just debug it from browser currently.

simao commented 2 years ago

I am not sure what you mean by bugged, but I can't reproduce it.

To debug with a jvm debugger it would probably be easier if you run the webapp from sbt with sbt -jvm-debug 5005 run and then connect your debugger on port 5005, instead of using the docker container.

Jeredriq commented 2 years ago

@simao I will close the issue but just a simple question I wanted to ask, ota-lith uses provisioning with device credentials while using scripts/gen-device.sh. scripts/get-credentials.zip

right?

simao commented 2 years ago

Yes.