openwrt / openwrt/luci

luci-app-ttyd: integrate luci-ssl

Open
#5,347 17 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
JavaScript
Stars
7.9k
Forks
2.9k
Avg merge
4d 17h
Merged PRs (30d)
28

Description

It would be great if the same SSL certificates could be used for both luci-ssl and luci-app-ttyd. I tried pointing luci-app-ttyd at the /etc/uhttpd.crt and /etc/uhttpd.key files, but unfortunately this does not work as it seems uhttpd.key is in some binary format that ttyd does not understand and hence ttyd does not start. Not sure what the best solution to this would be - perhaps change the format for the automatically-generated uhttpd.key to something that both uhttpd and ttyd can understand, or alternatively to patch ttyd to understand whatever format is used for uhttpd.key.

As a side-note, installing luci-app-ttyd alongside luci-ssl without enabling SSL in luci-app-ttyd is rather useless as modern browsers tend to block the non-secure iframe that luci-app-ttyd uses to connect to ttyd when the page is served over HTTPS. So having a nice way to make this work out-of-the-box would be quite convenient.

Edit: @ysc3839 has a much better idea; set up a reverse proxy for ttyd as part of luci-app-ttyd. In this way, the SSL configuration for ttyd will follow the configuration for uhttpd. No oddball open ports, no mixed SSL/non-SSL issues, no mucking around with config files and generating SSL certs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the luci-app-ttyd configuration and the luci-ssl/uhttpd SSL setup described in the issue. Investigate how a reverse proxy for ttyd could follow the existing uhttpd configuration, then verify that ttyd works through HTTPS without a separate port or mixed-content iframe.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.