dracoox commited on
Commit
828977a
·
verified ·
1 Parent(s): 75ed8ad

Upload folder using huggingface_hub

Browse files
Files changed (17) hide show
  1. Dockerfile +84 -0
  2. README.md +46 -0
  3. app.json +10 -0
  4. conf.d/socat.conf +3 -0
  5. conf.d/websockify.conf +3 -0
  6. conf.d/websockify.sh +2 -0
  7. docker-compose.yml +23 -0
  8. expect_vnc.sh +7 -0
  9. heroku.yml +3 -0
  10. installnovnc +15 -0
  11. panel.tar +3 -0
  12. pys +12 -0
  13. run.sh +49 -0
  14. runbak.sh +45 -0
  15. runtime.txt +1 -0
  16. supervisord.conf +37 -0
  17. wakemydyno.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ #RUN echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse\n' > /etc/apt/sources.list
6
+
7
+ RUN apt-get update && \
8
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9
+ dbus-x11 \
10
+ nautilus \
11
+ gedit \
12
+ expect \
13
+ sudo \
14
+ vim \
15
+ vlc \
16
+ bash \
17
+ net-tools \
18
+ novnc \
19
+ xfce4 \
20
+ socat \
21
+ x11vnc \
22
+ xvfb \
23
+ supervisor \
24
+ curl \
25
+ git \
26
+ pulseaudio \
27
+ wget \
28
+ g++ \
29
+ unzip \
30
+ openssh-server \
31
+ ffmpeg \
32
+ firefox \
33
+ terminator \
34
+ htop \
35
+ gnupg2 \
36
+ locales \
37
+ xfonts-intl-chinese \
38
+ fonts-wqy-zenhei \
39
+ ibus \
40
+ ibus-gtk \
41
+ ibus-gtk3 \
42
+ ibus-clutter \
43
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
44
+ RUN dpkg-reconfigure locales
45
+
46
+ RUN sudo apt-get update && sudo apt-get install -y obs-studio
47
+
48
+ COPY . /app
49
+ RUN chmod +x /app/conf.d/websockify.sh
50
+ RUN chmod +x /app/run.sh
51
+ RUN chmod +x /app/expect_vnc.sh
52
+ RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list
53
+ RUN echo "deb http://deb.anydesk.com/ all main" >> /etc/apt/sources.list
54
+ RUN wget --no-check-certificate https://dl.google.com/linux/linux_signing_key.pub -P /app
55
+ RUN wget --no-check-certificate -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY -O /app/anydesk.key
56
+ RUN apt-key add /app/anydesk.key
57
+ RUN apt-key add /app/linux_signing_key.pub
58
+ RUN set -ex; \
59
+ apt-get update \
60
+ && apt-get install -y --no-install-recommends \
61
+ google-chrome-stable \
62
+ anydesk
63
+
64
+
65
+ ENV UNAME pacat
66
+
67
+ RUN apt-get update \
68
+ && DEBIAN_FRONTEND=noninteractive apt-get install --yes pulseaudio-utils
69
+
70
+ # Set up the user
71
+ RUN export UNAME=$UNAME UID=1000 GID=1000 && \
72
+ mkdir -p "/home/${UNAME}" && \
73
+ echo "${UNAME}:x:${UID}:${GID}:${UNAME} User,,,:/home/${UNAME}:/bin/bash" >> /etc/passwd && \
74
+ echo "${UNAME}:x:${UID}:" >> /etc/group && \
75
+ mkdir -p /etc/sudoers.d && \
76
+ echo "${UNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${UNAME} && \
77
+ chmod 0440 /etc/sudoers.d/${UNAME} && \
78
+ chown ${UID}:${GID} -R /home/${UNAME} && \
79
+ gpasswd -a ${UNAME} audio
80
+
81
+ RUN echo xfce4-session >~/.xsession
82
+ RUN echo "exec /etc/X11/Xsession /usr/bin/xfce4-session"
83
+
84
+ CMD ["/app/run.sh"]
README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
2
+ # NoVNC-for-Heroku
3
+ **Running a VNC server + NoVNC client on Heroku app**
4
+
5
+ ### Features:
6
+ - Running on Ubuntu 18.04 Docker Image
7
+ - Google Chrome included
8
+ - Lite Desktop xfce4
9
+ - Easy to use
10
+ - Can be easily customized
11
+ - Support Chinese Language and Pinyin input method, check Readme.txt in Desktop
12
+ - Use keyboard Shift button to switch input method
13
+ - Modified from megatron0000/heroku-vnc
14
+ - Password: demo2020
15
+ - Display resolution setting command:
16
+
17
+ xrandr -s 1440x900
18
+
19
+ xrandr -s 800x600
20
+
21
+ xrandr -s 1024x768
22
+
23
+ xrandr -s 1200x500
24
+
25
+ xrandr -s 1360x620
26
+
27
+ xrandr -s 1920x1080
28
+
29
+
30
+ ### Installation
31
+
32
+ ##### Requirement:
33
+ - Docker
34
+ - GIT
35
+ - A heroku account
36
+ - Stable Network
37
+ - A blank application
38
+
39
+ ##### Steps:
40
+ Click Deploy link in the top
41
+
42
+ You will be asked for the application name. After you enter the application name, everything will be done automatically. If there is no error, you can access your app at: https://yourappname.herokapp.com
43
+
44
+
45
+ I JUST EDITIED SOME CODES I AM NOT A OWNER OF THIS FILES
46
+ ~KING REMIX
app.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "VPS BY RixEtte",
3
+ "description": "Deploy VNC to Heroku.",
4
+ "keywords": ["VNC", "Docker"],
5
+ "env": {
6
+ },
7
+ "website": "",
8
+ "repository": "",
9
+ "stack": "container"
10
+ }
conf.d/socat.conf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [program:socat]
2
+ command=socat tcp-listen:6000,reuseaddr,fork unix:/tmp/.X11-unix/X0
3
+ autorestart=true
conf.d/websockify.conf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [program:websockify]
2
+ command=/app/conf.d/websockify.sh
3
+ autorestart=true
conf.d/websockify.sh ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ #!/bin/bash
2
+ websockify --web /usr/share/novnc $PORT localhost:5900
docker-compose.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '2'
2
+ services:
3
+ ide:
4
+ image: psharkey/intellij:latest
5
+ # image: psharkey/netbeans-8.1:latest
6
+ environment:
7
+ - DISPLAY=novnc:0.0
8
+ depends_on:
9
+ - novnc
10
+ networks:
11
+ - x11
12
+ novnc:
13
+ image: theasp/novnc:latest
14
+ environment:
15
+ # Adjust to your screen size
16
+ - DISPLAY_WIDTH=3840
17
+ - DISPLAY_HEIGHT=2160
18
+ ports:
19
+ - "80:80"
20
+ networks:
21
+ - x11
22
+ networks:
23
+ x11:
expect_vnc.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/expect -f
2
+ spawn vncpasswd
3
+ expect "*word:*"
4
+ send "demo2020\n"
5
+ expect "*Verify:*"
6
+ send "demo2020\n"
7
+ expect eof
heroku.yml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ build:
2
+ docker:
3
+ web: Dockerfile
installnovnc ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! bin/bash
2
+
3
+ echo This script is going to create a Docker Image with: Ubuntu 16.04 + Unity + noVNC
4
+ echo What is your application name?
5
+ echo Please enter correctly, if not, Stop this script and run it again
6
+ read appname
7
+ echo If your application name is correct, you can access https://$appname.herokuapp.com when this complete
8
+ echo Logging in to Container
9
+ heroku container:login
10
+ echo Deploying image
11
+ heroku container:push web --app $appname
12
+ echo Releasing app.
13
+ heroku container:release web --app $appname
14
+ echo Everything is set. Go to: https://$appname.herokuapp.com
15
+ echo GIT: https://github.com/hzhoanglee/Unity-NoVNC-for-Heroku
panel.tar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e579379f629a517257574f8c498ea151d572d533d5195210d73bae4f1cfd6c9c
3
+ size 10240
pys ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import HfApi
2
+
3
+ api = HfApi()
4
+
5
+ repo_url = api.create_repo(
6
+ name="rixette-vnc-space",
7
+ repo_type="space",
8
+ space_sdk="docker", # or 'gradio', 'streamlit', 'static'
9
+ exist_ok=False,
10
+ )
11
+
12
+ print("Repo created:", repo_url)
run.sh ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -ex
3
+ mkdir -p ~/.vnc ~/.config/xfce4
4
+ tar -xvf /app/panel.tar -C ~/.config/xfce4
5
+ rm -rf /usr/share/icons/Adwaita
6
+ cp -r /usr/share/icons/Humanity-Dark /usr/share/icons/Adwaita
7
+
8
+ mkdir -p /Desktop
9
+ cat << EOF > /Desktop/Chromium.desktop
10
+ [Desktop Entry]
11
+ Version=1.0
12
+ Type=Application
13
+ Name=Chromium
14
+ Comment=Access the Internet
15
+ Exec=/usr/bin/chromium-browser --no-sandbox --disable-dev-shm-usage
16
+ Icon=chromium-browser
17
+ Path=
18
+ Terminal=false
19
+ StartupNotify=true
20
+ EOF
21
+
22
+ #cat << EOF > /Desktop/AnyDesk.desktop
23
+ #[Desktop Entry]
24
+ #Version=1.0
25
+ #Type=Application
26
+ #Name=AnyDesk
27
+ #Comment=
28
+ #Exec=/usr/bin/anydesk
29
+ #Icon=anydesk
30
+ #Path=
31
+ #Terminal=false
32
+ #StartupNotify=true
33
+ #EOF
34
+
35
+ cat << EOF > /Desktop/Swicth_to_Chinese_input.sh
36
+ #!/bin/bash
37
+ im-config -s ibus
38
+ ibus-setup
39
+ EOF
40
+
41
+ cat << EOF > /Desktop/Readme.txt
42
+ Step 1: Excute Swicth_to_Chinese_input.sh on Deskop to switch input method.
43
+ Step 2: Select 'Input Method', then click add button, choose Chinese and Pinyin icon to add.
44
+ Step 3: Now it can support Chinese, Enjoy!
45
+ EOF
46
+
47
+ chmod +x /Desktop/Chromium.desktop
48
+ chmod +x /Desktop/Swicth_to_Chinese_input.sh
49
+ exec supervisord -c /app/supervisord.conf
runbak.sh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -ex
3
+ /app/expect_vnc.sh
4
+ mkdir -p ~/.vnc ~/.config/xfce4
5
+ tar -xvf /app/panel.tar -C ~/.config/xfce4
6
+ rm -rf /usr/share/icons/Adwaita
7
+ cp -r /usr/share/icons/Humanity-Dark /usr/share/icons/Adwaita
8
+ cat << EOF > ~/.vnc/xstartup
9
+ #!/bin/sh
10
+ xrdb $HOME/.Xresources
11
+ vncconfig -iconic &
12
+ startxfce4 &
13
+ EOF
14
+ chmod +x ~/.vnc/xstartup
15
+ vncserver -depth 32 -pixelformat rgb888 -geometry 1440x900 -geometry 800x600 -geometry 1024x768 -geometry 1360x620 -geometry 1366x768 -geometry 1920x1080 :1
16
+
17
+ mkdir -p /Desktop
18
+ cat << EOF > /Desktop/Chrome.desktop
19
+ [Desktop Entry]
20
+ Version=1.0
21
+ Type=Application
22
+ Name=Google Chrome
23
+ Comment=Access the Internet
24
+ Exec=/usr/bin/google-chrome-stable --no-sandbox --disable-dev-shm-usage
25
+ Icon=google-chrome
26
+ Path=
27
+ Terminal=false
28
+ StartupNotify=true
29
+ EOF
30
+
31
+ cat << EOF > /Desktop/Swicth_to_Chinese_input.sh
32
+ #!/bin/bash
33
+ im-config -s ibus
34
+ ibus-setup
35
+ EOF
36
+
37
+ cat << EOF > /Desktop/Readme.txt
38
+ Step 1: Excute Swicth_to_Chinese_input.sh on Deskop to switch input method.
39
+ Step 2: Select 'Input Method', then click add button, choose Chinese and Pinyin icon to add.
40
+ Step 3: Now it can support Chinese, Enjoy!
41
+ EOF
42
+
43
+ chmod +x /Desktop/Chrome.desktop
44
+ chmod +x /Desktop/Swicth_to_Chinese_input.sh
45
+ exec supervisord -c /app/supervisord.conf
runtime.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ "docker"
supervisord.conf ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [supervisord]
2
+ nodaemon=true
3
+
4
+ [program:startxfce4]
5
+ priority=10
6
+ directory=/
7
+ command=/usr/bin/startxfce4
8
+ autostart=true
9
+ autorestart=true
10
+ stopsignal=QUIT
11
+ environment=DISPLAY=":1",HOME="/"
12
+ stdout_logfile=/var/log/xfce4.log
13
+ stderr_logfile=/var/log/xfce4.err
14
+
15
+ [program:xvfb]
16
+ priority=10
17
+ directory=/
18
+ command=/usr/bin/Xvfb :1 -screen 0 1280x720x24+32
19
+ autostart=true
20
+ autorestart=true
21
+ stopsignal=QUIT
22
+ stdout_logfile=/var/log/xvfb.log
23
+ stderr_logfile=/var/log/xvfb.err
24
+
25
+ [program:x11vnc]
26
+ priority=10
27
+ directory=/
28
+ command=x11vnc -display :1 -xkb
29
+ #command=x11vnc -display :1 -listen localhost -xkb
30
+ autostart=true
31
+ autorestart=true
32
+ stopsignal=QUIT
33
+ stdout_logfile=/var/log/x11vnc.log
34
+ stderr_logfile=/var/log/x11vnc.err
35
+
36
+ [include]
37
+ files = /app/conf.d/*.conf
wakemydyno.txt ADDED
@@ -0,0 +1 @@
 
 
1
+