Skip to content

Commit b641941

Browse files
author
Daniil.Karol
committedFeb 26, 2025·
Update Docker setup, event logging, and documentation
Add `/data/tt-files` directory with proper permissions in Dockerfile. Improve activity tracking by adding time threshold checks for mouse events in `ActivityTracker.kt`. Replace Docker image reference and update database environment variables in `docker-compose.yml`, with corresponding changes to `ij-server/README.md`.
1 parent c977fc7 commit b641941

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed
 

‎Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN gradle ij-server:buildFatJar --no-daemon
1919
# Stage 3: Create the Runtime Image
2020
FROM amazoncorretto:11 AS runtime
2121
EXPOSE 8080
22-
RUN mkdir /app
22+
RUN mkdir /app \
23+
# Make sure /data/tt-files directory exists in the runtime image
24+
RUN mkdir -p /data/tt-files && chmod -R 777 /data/tt-files
2325
COPY --from=build /home/gradle/src/ij-server/build/libs/ij-server-all.jar /app/ktor-docker-sample.jar
2426
ENTRYPOINT ["java","-jar","/app/ktor-docker-sample.jar"]

‎docker-compose.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
services:
22
server:
3-
image: daniilkarol/koala:latest
3+
image: registry.jetbrains.team/p/tasktracker-3/sharable/tasktracker-server:latest
44
ports:
55
- "8080:8080"
66
environment:
7-
- HOST=
8-
- PORT=
9-
- DB_URL=
10-
- DB_USERNAME=
11-
- DB_PASSWORD=
7+
- DB_URL=jdbc:postgresql://host.docker.internal:5432/tasktracker
8+
- DB_USERNAME=mikrise2
9+
- DB_PASSWORD=Mikmikmik25522552

‎ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/tracking/activity/ActivityTracker.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ class ActivityTracker(project: Project) : BaseTracker("activity") {
9797

9898
is MouseWheelEvent -> {
9999
when (awtEvent.id) {
100-
MouseEvent.MOUSE_WHEEL -> trackerLogger.log(Type.MouseWheel, awtEvent.info())
100+
MouseEvent.MOUSE_WHEEL -> {
101+
if (currentTime - lastTime >= MILLIS_THRESHOLD) {
102+
trackerLogger.log(Type.MouseWheel, awtEvent.info())
103+
lastTime = currentTime
104+
}
105+
}
101106
}
102107
}
103108

@@ -107,6 +112,7 @@ class ActivityTracker(project: Project) : BaseTracker("activity") {
107112
MouseEvent.MOUSE_MOVED -> {
108113
if (currentTime - lastTime >= MILLIS_THRESHOLD) {
109114
trackerLogger.log(Type.MouseMoved, awtEvent.movedInfo())
115+
lastTime = currentTime
110116
}
111117
}
112118
}

‎ij-server/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ also saves the data received from the plugin as directories in the specified pat
55
will be available later).
66

77
For a more convenient server setup for your needs, we provide the option to create a Docker container. To do this, you
8-
can use the image named `daniilkarol/koala:latest`. You can also find a [docker compose](../docker-compose.yml) file that already provides a template to start a docker
8+
can use the image named `registry.jetbrains.team/p/tasktracker-3/sharable/tasktracker-server:latest`. You can also find a [docker compose](../docker-compose.yml) file that already provides a template to start a docker
99
container.
1010

1111
The server requires a certain number of environment variables, as follows:
12-
- `HOST` - host address ([0.0.0.0]() by default)
13-
- `PORT` - app port ([8080]() by default)
1412
- `DB_URL` - postgres database url in format `postgresql://[user[:password]@][netloc][:port][/dbname]`
1513
- `DB_USERNAME` - username for the database
1614
- `DB_PASSWORD` - password for the database

0 commit comments

Comments
 (0)
Please sign in to comment.