Procházet zdrojové kódy

vncserver socket based connections

pull/1/head
rodič
revize
99c14df7fa
9 změnil soubory, kde provedl 18 přidání a 55 odebrání
  1. +0
    -30
      tasks/vnc.yaml
  2. +0
    -7
      templates/vnc/Xvnc-session.j2
  3. +0
    -1
      templates/vnc/config.j2
  4. +0
    -4
      templates/vnc/vnc.conf.j2
  5. +0
    -3
      templates/vnc/vncserver.env.j2
  6. +6
    -4
      templates/vnc/vncserver.service.j2
  7. +0
    -5
      templates/vnc/xsession.j2
  8. +1
    -1
      templates/x11/xsession.j2
  9. +11
    -0
      vars/main.yaml

+ 0
- 30
tasks/vnc.yaml Zobrazit soubor

@@ -6,24 +6,6 @@
state: directory
mode: 0700

- name: vnc config
template:
src: vnc/config.j2
dest: ~/.vnc/config
mode: 0644

- name: vnc env
template:
src: vnc/vncserver.env.j2
dest: ~/.vnc/vncserver.env
mode: 0644

- name: vnc server config
template:
src: vnc/vnc.conf.j2
dest: ~/.vnc/vnc.conf
mode: 0644

- name: vnc passwd
copy:
content: "{{ lookup('pipe','pwgen 24 1' )}}"
@@ -54,15 +36,3 @@
src: vnc/vncserver.service.j2
dest: ~/.config/systemd/user/vncserver@.service
notify: systemd daemon-reload

- name: Xvnc-session script
template:
src: vnc/Xvnc-session.j2
dest: ~/.vnc/Xvnc-session
mode: 0755

- name: vnc xsession script
template:
src: vnc/xsession.j2
dest: ~/.vnc/xsession
mode: 0755

+ 0
- 7
templates/vnc/Xvnc-session.j2 Zobrazit soubor

@@ -1,7 +0,0 @@
#!/bin/sh

{{ansible_managed|comment}}

xrandr --output VNC-0 --primary

exec /etc/X11/Xsession ~/.vnc/xsession

+ 0
- 1
templates/vnc/config.j2 Zobrazit soubor

@@ -1 +0,0 @@
{{ ansible_managed | comment }}

+ 0
- 4
templates/vnc/vnc.conf.j2 Zobrazit soubor

@@ -1,4 +0,0 @@
{{ ansible_managed | comment }}

$desktopName = "{{inventory_hostname}}$ENV{DISPLAY}";
$geometry = "{{home_vncserver_geometry}}";

+ 0
- 3
templates/vnc/vncserver.env.j2 Zobrazit soubor

@@ -1,3 +0,0 @@
{{ ansible_managed | comment }}

VNCSERVER_OPTIONS="{{vncserver_options|replace('\n',' ')|trim}}"

+ 6
- 4
templates/vnc/vncserver.service.j2 Zobrazit soubor

@@ -19,10 +19,12 @@ Description=vncserver service - display %i
After=syslog.target network.target

[Service]
EnvironmentFile=%h/.vnc/vncserver.env
Type=forking
ExecStart=/usr/bin/vncserver -autokill %i $VNCSERVER_OPTIONS
ExecStop=/usr/bin/vncserver -kill %i
WorkingDirectory=%h
Environment=DISPLAY=%i
ExecStart=Xtigervnc $DISPLAY {{vncserver_options|replace('\n',' ')|trim}}
ExecStartPost=fish -c "while not xdpyinfo > /dev/null 2> /dev/null; sleep 0.1; end"
ExecStartPost=xrandr --output VNC-0 --primary
ExecStartPost=systemctl --user start xsession.target

[Install]
WantedBy=default.target

+ 0
- 5
templates/vnc/xsession.j2 Zobrazit soubor

@@ -1,5 +0,0 @@
#!/bin/sh

{{ansible_managed|comment}}

exec systemctl --user start --wait xsession.target

+ 1
- 1
templates/x11/xsession.j2 Zobrazit soubor

@@ -7,5 +7,5 @@ exec systemctl --user start --wait xsession.target
{% else %}
systemctl --user start vncserver@:{{home_vncserver_display_number}}.service
i3 -c ~/.config/i3/null.config &
exec xtigervncviewer localhost:{{home_vncserver_display_number}} -PasswordFile ~/.vnc/passwd -FullScreen=1 -Maximize=1
exec xtigervncviewer ~/.vnc/socket -PasswordFile ~/.vnc/passwd -FullScreen=1 -Maximize=1
{% endif %}

+ 11
- 0
vars/main.yaml Zobrazit soubor

@@ -135,6 +135,17 @@ timer_folder: ~/.timer
timer_config: {}

vncserver_options: |
-desktop %H%i
-auth %h/.Xauthority
-geometry {{home_vncserver_geometry}}
-depth 24
-rfbwait 30000
-rfbauth %h/.vnc/passwd
-rfbunixpath %h/.vnc/socket
-nolisten tcp
-pn
-localhost
-SecurityTypes VncAuth
{% if not home_vncserver_allow_resize %}
-AcceptSetDesktopSize=0
{% endif %}