-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for triple ttys in showroom (#8850)
- Loading branch information
Showing
3 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
ansible/roles/showroom/templates/service_triple_tty/service_triple_tty.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
tty-triple-top: | ||
image: {{ showroom_tty_image }}:{{ showroom_tty_image_tag }} | ||
container_name: tty-triple-top | ||
hostname: tty-triple-top | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
volumes: | ||
- "{{ showroom_user_home_dir }}/.ssh:{{ showroom_user_home_dir }}/.ssh" | ||
{% endif %} | ||
command: | ||
- "--ssh-user={{ showroom_tab_double_tty_top_username }}" | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
- "--ssh-config={{ showroom_user_home_dir }}/.ssh/config" | ||
- "--ssh-key={{ showroom_user_home_dir }}/.ssh/id_{{ showroom_ssh_key_type }}" | ||
- "--ssh-auth=publickey" | ||
{% elif showroom_ssh_method == 'password' %} | ||
- "--ssh-pass={{ showroom_ssh_password | default(f_user_data.default_ssh_password) | default(f_user_data.ssh_password) }}" | ||
{% endif %} | ||
- "--ssh-host={{ showroom_ssh_host | default(f_user_data.targethost) }}" | ||
- "--ssh-port={{ showroom_ssh_port | default(f_user_data.targetport) | default(22) }}" | ||
- "--base=/tty-triple-top" | ||
{% if showroom_ttys_enable_tmux %} | ||
- "--command=/usr/local/bin/showroom-tmux top" | ||
{% endif %} | ||
- "--allow-iframe=true" | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.services.tty-triple-top.loadbalancer.server.port=3000" | ||
- "traefik.http.routers.tty-triple-topentrypoints=terminalsecure" | ||
- "traefik.http.routers.tty-triple-top.tls.certresolver=le" | ||
- "traefik.http.routers.tty-triple-top.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-top`)" | ||
- "traefik.http.routers.tty-triple-top.middlewares=terminal-stripprefix" | ||
- "traefik.http.routers.tty-triple-top.middlewares=tty-triple-toptheader" | ||
- "traefik.http.middlewares.tty-triple-top-stripprefix.stripprefix.prefixes=/tty-triple-top" | ||
- "traefik.http.middlewares.tty-triple-toptheader.headers.customrequestheaders.X-Content-Type-Options=false" | ||
|
||
|
||
tty-triple-middle: | ||
image: {{ showroom_tty_image }}:{{ showroom_tty_image_tag }} | ||
container_name: tty-triple-middle | ||
hostname: tty-triple-middle | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
volumes: | ||
- "{{ showroom_user_home_dir }}/.ssh:{{ showroom_user_home_dir }}/.ssh" | ||
{% endif %} | ||
command: | ||
- "--ssh-user={{ showroom_tab_double_tty_bottom_username }}" | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
- "--ssh-config={{ showroom_user_home_dir }}/.ssh/config" | ||
- "--ssh-key={{ showroom_user_home_dir }}/.ssh/id_{{ showroom_ssh_key_type }}" | ||
- "--ssh-auth=publickey" | ||
{% elif showroom_ssh_method == 'password' %} | ||
- "--ssh-pass={{ showroom_ssh_password | default(f_user_data.default_ssh_password) | default(f_user_data.ssh_password) }}" | ||
{% endif %} | ||
- "--ssh-host={{ showroom_ssh_host | default(f_user_data.targethost) }}" | ||
- "--ssh-port={{ showroom_ssh_port | default(f_user_data.targetport) | default(22) }}" | ||
- "--base=/tty-triple-middle" | ||
{% if showroom_ttys_enable_tmux %} | ||
- "--command=/usr/local/bin/showroom-tmux middle" | ||
{% endif %} | ||
- "--allow-iframe=true" | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.services.tty-triple-middle.loadbalancer.server.port=3000" | ||
- "traefik.http.routers.tty-triple-middleentrypoints=terminalsecure" | ||
- "traefik.http.routers.tty-triple-middle.tls.certresolver=le" | ||
- "traefik.http.routers.tty-triple-middle.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-middle`)" | ||
- "traefik.http.routers.tty-triple-middle.middlewares=terminal-stripprefix" | ||
- "traefik.http.routers.tty-triple-middle.middlewares=tty-triple-middletheader" | ||
- "traefik.http.middlewares.tty-triple-middle-stripprefix.stripprefix.prefixes=/tty-triple-middle" | ||
- "traefik.http.middlewares.tty-triple-middletheader.headers.customrequestheaders.X-Content-Type-Options=false" | ||
|
||
|
||
tty-triple-bottom: | ||
image: {{ showroom_tty_image }}:{{ showroom_tty_image_tag }} | ||
container_name: tty-triple-bottom | ||
hostname: tty-triple-bottom | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
volumes: | ||
- "{{ showroom_user_home_dir }}/.ssh:{{ showroom_user_home_dir }}/.ssh" | ||
{% endif %} | ||
command: | ||
- "--ssh-user={{ showroom_tab_double_tty_bottom_username }}" | ||
{% if showroom_ssh_method == 'sshkey' %} | ||
- "--ssh-config={{ showroom_user_home_dir }}/.ssh/config" | ||
- "--ssh-key={{ showroom_user_home_dir }}/.ssh/id_{{ showroom_ssh_key_type }}" | ||
- "--ssh-auth=publickey" | ||
{% elif showroom_ssh_method == 'password' %} | ||
- "--ssh-pass={{ showroom_ssh_password | default(f_user_data.default_ssh_password) | default(f_user_data.ssh_password) }}" | ||
{% endif %} | ||
- "--ssh-host={{ showroom_ssh_host | default(f_user_data.targethost) }}" | ||
- "--ssh-port={{ showroom_ssh_port | default(f_user_data.targetport) | default(22) }}" | ||
- "--base=/tty-triple-bottom" | ||
{% if showroom_ttys_enable_tmux %} | ||
- "--command=/usr/local/bin/showroom-tmux bottom" | ||
{% endif %} | ||
- "--allow-iframe=true" | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.services.tty-triple-bottom.loadbalancer.server.port=3000" | ||
- "traefik.http.routers.tty-triple-bottomentrypoints=terminalsecure" | ||
- "traefik.http.routers.tty-triple-bottom.tls.certresolver=le" | ||
- "traefik.http.routers.tty-triple-bottom.rule=Host(`{{ showroom_host }}`) && PathPrefix(`/tty-triple-bottom`)" | ||
- "traefik.http.routers.tty-triple-bottom.middlewares=terminal-stripprefix" | ||
- "traefik.http.routers.tty-triple-bottom.middlewares=tty-triple-bottomtheader" | ||
- "traefik.http.middlewares.tty-triple-bottom-stripprefix.stripprefix.prefixes=/tty-triple-bottom" | ||
- "traefik.http.middlewares.tty-triple-bottomtheader.headers.customrequestheaders.X-Content-Type-Options=false" |
25 changes: 25 additions & 0 deletions
25
ansible/roles/showroom/templates/service_triple_tty/tab_triple_tty.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div id="terminal_tab" class="tabcontent"> | ||
<div class="split top"> | ||
<iframe | ||
id="tty-triple-top" | ||
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-top/" | ||
width="100%" | ||
style="border:none;"> | ||
</iframe> | ||
</div> | ||
<div class="split middle"> | ||
<iframe | ||
id="tty-triple-middle" | ||
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-top/" | ||
width="100%" | ||
style="border:none;"> | ||
</iframe> | ||
</div> | ||
<div class="split bottom"> | ||
<iframe id="tty-triple-bottom" | ||
src="https://{{ showroom_host }}:{{ showroom_primary_port }}/tty-bottom/" | ||
width="100%" | ||
style="border:none;"> | ||
</iframe> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
ansible/roles/showroom/templates/service_triple_tty/tablink_triple_tty.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<button class="tablinks" onclick="openTerminal(event, 'terminal_tab')" id="defaultOpen" tabindex="0">Terminals</button> |