Skip to content

Commit

Permalink
add luci support
Browse files Browse the repository at this point in the history
  • Loading branch information
stackia committed Jan 18, 2025
1 parent fac0ac0 commit cef1891
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/release-ipk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
- mipsel_mips32
sdk:
- "22.03.6"
- "23.05.4"

steps:
- uses: actions/checkout@v4
Expand All @@ -53,7 +52,7 @@ jobs:
run: |
RELEASE_TAG="${{ github.event.release.tag_name }}"
RELEASE_VERSION="${RELEASE_TAG#v}"
sed -i "s/1\.0\.0/${RELEASE_VERSION}/g" openwrt-support/rtp2httpd/Makefile configure.ac
sed -i "s/1\.0\.0/${RELEASE_VERSION}/g" openwrt-support/rtp2httpd/Makefile openwrt-support/luci-app-rtp2httpd/Makefile configure.ac
- name: Move src to openwrt-support
run: mv openwrt-support ../ && mkdir ../openwrt-support/rtp2httpd/src && mv ./* ../openwrt-support/rtp2httpd/src && mv ../openwrt-support ./
Expand All @@ -63,17 +62,8 @@ jobs:
env:
ARCH: ${{ matrix.arch }}-${{ matrix.sdk }}
FEED_DIR: ${{ github.workspace }}/openwrt-support
NO_DEFAULT_FEEDS: true
NO_SHFMT_CHECK: true
PACKAGES: rtp2httpd

- name: Rename packages
run: |
cd bin/packages/${{ matrix.arch }}/action
for f in *.ipk; do
mv "$f" "${f%.ipk}_${{ matrix.sdk }}.ipk"
done
cd -
PACKAGES: ${{ matrix.arch == 'x86_64' && 'luci-app-rtp2httpd' || 'rtp2httpd' }}

- name: Upload to release assets
run: gh release upload --repo ${{ github.repository }} ${{ github.event.release.tag_name }} bin/packages/${{ matrix.arch }}/action/*.ipk
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Makefile
rtp2httpd
!openwrt-support/rtp2httpd
!openwrt-support/rtp2httpd/Makefile
!openwrt-support/luci-app-rtp2httpd/Makefile
*.o
*.in
config.*
Expand Down
16 changes: 16 additions & 0 deletions openwrt-support/luci-app-rtp2httpd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-rtp2httpd
PKG_VERSION:=1.0.0
PKG_PO_VERSION:=1.0.0
PKG_RELEASE:=1

LUCI_TITLE:=LuCI Support for rtp2httpd
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+rtp2httpd

PKG_MAINTAINER:=Stackie Jia <[email protected]>

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"use strict";
"require form";
"require view";

return view.extend({
render: function () {
var m, s, o;

m = new form.Map(
"rtp2httpd",
_("rtp2httpd"),
_(
"rtp2httpd converts multicast RTP/UDP media into http stream. Here you can configure the settings."
)
);

s = m.section(form.TypedSection, "rtp2httpd");
s.anonymous = true;
s.addremove = true;

o = s.option(form.Flag, "disabled", _("rtp2httpd_Enabled"));
o.enabled = "0";
o.disabled = "1";
o.default = o.enabled;
o.rmempty = false;

o = s.option(
form.Flag,
"respawn",
_("rtp2httpd_Respawn"),
_("rtp2httpd_Auto restart after crash")
);
o.default = "0";

o = s.option(form.Value, "port", _("rtp2httpd_Port"));
o.datatype = "port";
o.default = "8080";

o = s.option(form.ListValue, "verbose", _("rtp2httpd_Verbose"));
o.value("0", _("rtp2httpd_Quiet"));
o.value("1", _("rtp2httpd_Error"));
o.value("2", _("rtp2httpd_Info"));
o.value("3", _("rtp2httpd_Debug"));
o.default = "1";

o = s.option(form.Value, "maxclients", _("rtp2httpd_Max clients"));
o.datatype = "range(1, 5000)";
o.default = "5";

o = s.option(
form.Value,
"hostname",
_("rtp2httpd_Hostname"),
_("rtp2httpd_Hostname to check in the Host: HTTP header")
);
o.datatype = "hostname";

o = s.option(
form.ListValue,
"fcc_nat_traversal",
_("rtp2httpd_FCC NAT traversal"),
_("rtp2httpd_Only needed when used as a downstream router")
);
o.value("0", _("rtp2httpd_Disabled"));
o.value("1", _("rtp2httpd_NAT punch hole"));
o.value("2", _("rtp2httpd_NAT-PMP"));
o.default = "0";

return m.render();
},
});
70 changes: 70 additions & 0 deletions openwrt-support/luci-app-rtp2httpd/po/en/rtp2httpd.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "rtp2httpd"
msgstr "rtp2httpd"

msgid "rtp2httpd converts multicast RTP/UDP media into http stream. Here you can configure the settings."
msgstr "rtp2httpd converts multicast RTP/UDP media into http stream. Here you can configure the settings."

msgid "rtp2httpd_Enabled"
msgstr "Enabled"

msgid "rtp2httpd_Respawn"
msgstr "Respawn"

msgid "rtp2httpd_Auto restart after crash"
msgstr "Auto restart after crash"

msgid "rtp2httpd_Port"
msgstr "Port"

msgid "rtp2httpd_Verbose"
msgstr "Logging level"

msgid "rtp2httpd_Quiet"
msgstr "Quiet"

msgid "rtp2httpd_Error"
msgstr "Error"

msgid "rtp2httpd_Info"
msgstr "Info"

msgid "rtp2httpd_Debug"
msgstr "Debug"

msgid "rtp2httpd_Max clients"
msgstr "Max clients allowed"

msgid "rtp2httpd_Hostname"
msgstr "Hostname"

msgid "rtp2httpd_Hostname to check in the Host: HTTP header"
msgstr "If enabled, rtp2httpd will only allow connections if the 'Host:' HTTP header matches the hostname"

msgid "rtp2httpd_FCC NAT traversal"
msgstr "FCC NAT traversal mode"

msgid "rtp2httpd_Only needed when used as a downstream router"
msgstr "Only needed when used as a downstream router"

msgid "rtp2httpd_Disabled"
msgstr "Disabled"

msgid "rtp2httpd_Don't use NAT traversal"
msgstr "Don't use NAT traversal"

msgid "rtp2httpd_NAT punch hole"
msgstr "NAT punch hole (Low reliability)"

msgid "rtp2httpd_NAT-PMP"
msgstr "NAT-PMP (Requires upstream router support)"

69 changes: 69 additions & 0 deletions openwrt-support/luci-app-rtp2httpd/po/zh_Hans/rtp2httpd.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "rtp2httpd"
msgstr "rtp2httpd"

msgid "rtp2httpd converts multicast RTP/UDP media into http stream. Here you can configure the settings."
msgstr "rtp2httpd 将组播 RTP/UDP 媒体转换为 HTTP 流。在这里进行配置。"

msgid "rtp2httpd_Enabled"
msgstr "启用"

msgid "rtp2httpd_Respawn"
msgstr "自动重启"

msgid "rtp2httpd_Auto restart after crash"
msgstr "程序崩溃后自动重启"

msgid "rtp2httpd_Port"
msgstr "端口"

msgid "rtp2httpd_Verbose"
msgstr "日志级别"

msgid "rtp2httpd_Quiet"
msgstr "Quiet"

msgid "rtp2httpd_Error"
msgstr "Error"

msgid "rtp2httpd_Info"
msgstr "Info"

msgid "rtp2httpd_Debug"
msgstr "Debug"

msgid "rtp2httpd_Max clients"
msgstr "最大客户端数"

msgid "rtp2httpd_Hostname"
msgstr "仅允许使用域名连接"

msgid "rtp2httpd_Hostname to check in the Host: HTTP header"
msgstr "开启后,只有 HTTP Host 头匹配指定域名时,rtp2httpd 才会允许连接"

msgid "rtp2httpd_FCC NAT traversal"
msgstr "FCC NAT 穿透模式"

msgid "rtp2httpd_Only needed when used as a downstream router"
msgstr "仅当作为二级路由并需要使用 FCC(快速频道切换)时启用"

msgid "rtp2httpd_Disabled"
msgstr "禁用"

msgid "rtp2httpd_Don't use NAT traversal"
msgstr "不使用 NAT 穿透"

msgid "rtp2httpd_NAT punch hole"
msgstr "NAT 打洞(可靠性较低)"

msgid "rtp2httpd_NAT-PMP"
msgstr "NAT-PMP(需要上级路由器支持)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"admin/services/rtp2httpd": {
"title": "rtp2httpd",
"action": {
"type": "view",
"path": "rtp2httpd"
},
"depends": {
"acl": ["luci-app-rtp2httpd"],
"uci": { "rtp2httpd": true }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"luci-app-rtp2httpd": {
"description": "Grant UCI access for luci-app-rtp2httpd",
"read": {
"uci": ["rtp2httpd"]
},
"write": {
"uci": ["rtp2httpd"]
}
}
}
1 change: 1 addition & 0 deletions src/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ void usage(FILE *f, char *progname)
"\t-m --maxclients <n> Serve max n requests simultaneously (dfl 5)\n"
"\t-l --listen [addr:]port Address/port to bind (default ANY:8080)\n"
"\t-c --config <file> Read this file, instead of\n"
"\t-C --noconfig Do not read the default config\n"
"\t-n --fcc-nat-traversal <0/1/2> NAT traversal for FCC media stream, 0=disabled, 1=punchhole, 2=NAT-PMP (default 0)\n"
"\t-H --hostname <hostname> Hostname to check in the Host: HTTP header (default none)\n"
"\t default " CONFIGFILE "\n",
Expand Down

0 comments on commit cef1891

Please sign in to comment.