Terminal Update.
This commit is contained in:
parent
9e50b2a6d3
commit
5fbcadad8b
11
DockerfileUbuntu
Normal file
11
DockerfileUbuntu
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
RUN apt update && apt install libreadline-dev libcurl4-openssl-dev libssl-dev libncurses5-dev libncursesw5-dev libsqlite3-dev libreadline6-dev zlib1g-dev libbz2-dev libffi-dev liblzma-dev python3 python3-pip python3-venv libjson-c-dev vim htop git curl wget -y
|
||||||
|
|
||||||
|
RUN wget https://retoor.molodetz.nl/api/packages/retoor/generic/r/1.0.0/r
|
||||||
|
|
||||||
|
RUN chmod +x r
|
||||||
|
|
||||||
|
RUN cp r /usr/local/bin
|
||||||
|
|
||||||
|
CMD ["r"]
|
5
Makefile
5
Makefile
@ -11,12 +11,15 @@ python:
|
|||||||
dump:
|
dump:
|
||||||
@$(PYTHON) -m snek.dump
|
@$(PYTHON) -m snek.dump
|
||||||
|
|
||||||
|
build:
|
||||||
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
$(GUNICORN) -w $(GUNICORN_WORKERS) -k aiohttp.worker.GunicornWebWorker snek.gunicorn:app --bind 0.0.0.0:$(PORT) --reload
|
$(GUNICORN) -w $(GUNICORN_WORKERS) -k aiohttp.worker.GunicornWebWorker snek.gunicorn:app --bind 0.0.0.0:$(PORT) --reload
|
||||||
|
|
||||||
install:
|
install:
|
||||||
python3.12 -m venv .venv
|
python3.12 -m venv .venv
|
||||||
$(PIP) install -e .
|
$(PIP) install -e .
|
||||||
|
docker build -f DockerfileUbuntu -t snek_ubuntu .
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class TerminalSession:
|
|||||||
|
|
||||||
async def read_output(self, ws):
|
async def read_output(self, ws):
|
||||||
self.sockets.append(ws)
|
self.sockets.append(ws)
|
||||||
if len(self.sockets) > 1 and self.buffer:
|
if len(self.sockets) > 1 and self.history:
|
||||||
start = 0
|
start = 0
|
||||||
try:
|
try:
|
||||||
start = self.history.index(b'\n')
|
start = self.history.index(b'\n')
|
||||||
|
@ -30,7 +30,10 @@ class TerminalSocketView(BaseView):
|
|||||||
user = await self.services.user.get(uid=self.session.get("uid"))
|
user = await self.services.user.get(uid=self.session.get("uid"))
|
||||||
root = await self.prepare_drive()
|
root = await self.prepare_drive()
|
||||||
|
|
||||||
command = f"docker run -v ./{root}/:/root --rm -it --memory 512M --cpus=0.5 -w /root ubuntu:latest /bin/bash"
|
|
||||||
|
|
||||||
|
|
||||||
|
command = f"docker run -v ./{root}/:/root -it --memory 512M --cpus=0.5 -w /root snek_ubuntu /bin/bash"
|
||||||
|
|
||||||
session = self.user_sessions.get(user["uid"])
|
session = self.user_sessions.get(user["uid"])
|
||||||
if not session:
|
if not session:
|
||||||
|
@ -92,11 +92,6 @@ if [ -f ~/.bash_aliases ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
cp ~/r /usr/local/bin
|
|
||||||
|
|
||||||
chmod +x /usr/local/bin/r
|
|
||||||
|
|
||||||
apt update && apt install libreadline-dev libcurl4-openssl-dev libssl-dev libncurses5-dev libncursesw5-dev libsqlite3-dev libreadline6-dev zlib1g-dev libbz2-dev libffi-dev liblzma-dev python3 python3-pip python3-venv libjson-c-dev vim htop git -y
|
|
||||||
|
|
||||||
echo "R is installed. Type r to run it."
|
echo "R is installed. Type r to run it."
|
||||||
|
|
||||||
|
BIN
terminal/r
BIN
terminal/r
Binary file not shown.
Loading…
Reference in New Issue
Block a user