Skip to content
المشاريع

حول

Try JShell on Web

أدوات التطوير

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
جارٍ جمع السجل
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

tryjshell.org

1. About

tryjshell.org is a web terminal to try and test Java 27 and its preview features on the JShell tool.

print screen

1.1. Run on Web

1.2. Run on Docker

docker run -it --rm -p 8080:8080 rahmanusta/tryjshell

run.sh starts it with the same sandbox flags that are used in production.

1.3. Build

Maven runs inside Docker, so no local JDK is needed.

./build.sh     # image for the local architecture
./publish.sh   # multi-arch (amd64 + arm64) image, pushed to Docker Hub

2. Configuration

All settings are environment variables.

Variable Default Description

MAX_SESSIONS

12

Concurrent jshell sessions on the server

MAX_SESSIONS_PER_IP

3

Concurrent sessions per client IP (X-Real-IP from the proxy)

MAX_SESSION_MINUTES

60

Hard limit for a single session

POOL_SIZE

1

jshell processes kept warm for fast startup

ALLOWED_ORIGINS

(any)

Comma separated list of allowed WebSocket origins

JSHELL_OPTS

--enable-preview + heap limits

Options passed to jshell

3. Security model

JShell executes arbitrary Java code, so a visitor can run any program inside the container. The goal is to keep that contained:

  • No network. In production the container is only attached to an internal Docker network whose bridge has no address on the host. Code cannot reach the internet, the cloud metadata service, the host or other containers. Only nginx-proxy joins that network. See deploy/tryjshell_restart.sh.

  • Immutable image. Read-only root filesystem; the JDK and the server jar are owned by root. /tmp is a small noexec tmpfs, so dropped binaries cannot be executed.

  • Least privilege. Non-root user, all Linux capabilities dropped, no-new-privileges.

  • Resource limits. CPU, memory, process count and file descriptors are capped, as are sessions per IP and in total.

  • Session isolation and cleanup. Every session gets its own home, working directory and JShell preferences (history is not shared). When a session ends, its whole process tree and directory are removed; processes that try to escape with setsid/nohup are reaped within a minute.

Visitors still share one container and one Unix user, so a malicious visitor can observe or disturb other sessions running at the same time. Nothing else runs in the container.

4. License

MIT

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…