openwrt/luci

luci-app-ttyd: integrate luci-ssl

開放

#5,347 建立於 2021年9月8日

 (16 則留言) (5 個反應) (0 位負責人)JavaScript (2,383 個分叉)batch import
help wanted

倉庫指標

星標
 (5,706 顆星)
PR 合併指標
 (平均合併 6天 21小時) (30 天內合併 44 個 PR)

描述

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.

貢獻者指南