Skip to content

Commit

Permalink
improve rustdesk key handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed Feb 18, 2024
1 parent d7620f1 commit 9755d83
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 31 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
ansible_role_template
=======================

DOCS: https://rustdesk.com/docs/en/self-host/
Core Ports:
TCP 21115-21117
UDP 21116

WORK IN PROGRESS!
29 changes: 7 additions & 22 deletions tasks/keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,17 @@
src: "{{ rustdesk__home }}/id_ed25519.pub"
register: _rustdesk_pubkey
rescue:
- name: Run Rustdesk Signal Server once to generate pubkey
ansible.builtin.command:
cmd: "{{ rustdesk__rustdesk_utils_executable_path }} genkeypair"
register: _rustdesk_gen_keys

- name: Write secret key to Server
ansible.builtin.copy:
content: "{{ _rustdesk_gen_keys.stdout_lines[1].split(':') | last | trim }}"
dest: "{{ rustdesk__home }}/id_ed25519"
mode: '0644'
owner: "{{ rustdesk__user }}"
group: "{{ rustdesk__group }}"

- name: Write public key to Server
ansible.builtin.copy:
content: "{{ _rustdesk_gen_keys.stdout_lines[0].split(':') | last | trim }}"
dest: "{{ rustdesk__home }}/id_ed25519.pub"
mode: '0644'
owner: "{{ rustdesk__user }}"
group: "{{ rustdesk__group }}"
- name: Run systemd setup to initially start rustdesk service and generate pubkeys
ansible.builtin.include_tasks:
file: 'install_systemd.yml'
when: ansible_service_mgr == "systemd"

- name: Get public key of rustdesk
ansible.builtin.slurp:
src: "{{ rustdesk__home }}/id_ed25519.pub"
register: _rustdesk_pubkey

- name: debug
- name: Show Rustdesk Public Key
ansible.builtin.debug:
msg: "Pubkey: {{ _rustdesk_pubkey.content }}"
msg: "Pubkey: {{ _rustdesk_pubkey.content | b64decode }}"
verbosity: 1
7 changes: 4 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
ansible.builtin.include_tasks:
file: 'directory.yml'

#- name: Create Keys for rustdesk
# ansible.builtin.include_tasks:
# file: 'keys.yml'
- name: Create Keys for rustdesk
ansible.builtin.include_tasks:
file: 'keys.yml'
when: ansible_service_mgr == "systemd"

- name: Setup homebox systemd service
ansible.builtin.include_tasks:
Expand Down
5 changes: 0 additions & 5 deletions tasks/set_rustdesk_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
rustdesk__version_target: "{{ rustdesk__version }}"
when: rustdesk__version != "latest"

- ansible.builtin.debug:
msg: |
rustdesk__hbbr_active_version.stdout: {{ rustdesk__hbbr_active_version.stdout[:-2] }}
rustdesk__remote_version: {{ rustdesk__remote_version[:-2] }}
- name: 'Assert that remote version is higher'
ansible.builtin.assert:
that:
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ rustdesk__dl_filename: "rustdesk-server-{{ ansible_system }}-{{ rustdesk__arch }
rustdesk__dl_url: "https://github.com/rustdesk/rustdesk-server/releases/download/{{ rustdesk__version_target }}/{{ rustdesk__dl_filename }}.zip"

# versionscheck
playbook_version_number: 3
playbook_version_number: 4
playbook_version_path: 'role_l3d.rustdesk.version'

0 comments on commit 9755d83

Please sign in to comment.