1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 11:31:51 +00:00

increase glorytun timeout, add default config for shadowsocks and network, add custom theme

This commit is contained in:
Ycarus 2018-02-14 17:46:53 +01:00
parent eb53f75241
commit dab94ddfba
18 changed files with 2282 additions and 5 deletions

View file

@ -64,7 +64,7 @@ start_instance() {
procd_append_param command \
retry count -1 const 5000000 \
timeout 5000 \
timeout 9000 \
keepalive count 3 idle 10 interval 1
procd_set_param respawn 0 30 0

View file

@ -1,4 +1,4 @@
-- Copyright 2017 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.glorytun", package.seeall)

View file

@ -1,3 +1,4 @@
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Licensed to the public under the Apache License 2.0.

View file

@ -1,3 +1,4 @@
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Licensed to the public under the Apache License 2.0.

View file

@ -1,4 +1,5 @@
<%#
Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.

View file

@ -1,3 +1,4 @@
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2017 Yousong Zhou <yszhou4tech@gmail.com>
-- Licensed to the public under the Apache License 2.0.

View file

@ -0,0 +1,14 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=OpenMPTCProuter Theme (default)
LUCI_DEPENDS:=
include ../../luci.mk
# call BuildPackage - OpenWrt buildroot signature

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,3 @@
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed
// Uncompressed source: https://github.com/aFarkas/html5shiv
(function(a,b){function f(a){var c,d,e,f;b.documentMode>7?(c=b.createElement("font"),c.setAttribute("data-html5shiv",a.nodeName.toLowerCase())):c=b.createElement("shiv:"+a.nodeName);while(a.firstChild)c.appendChild(a.childNodes[0]);for(d=a.attributes,e=d.length,f=0;f<e;++f)d[f].specified&&c.setAttribute(d[f].nodeName,d[f].nodeValue);c.style.cssText=a.style.cssText,a.parentNode.replaceChild(c,a),c.originalElement=a}function g(a){var b=a.originalElement;while(a.childNodes.length)b.appendChild(a.childNodes[0]);a.parentNode.replaceChild(b,a)}function h(a,b){b=b||"all";var c=-1,d=[],e=a.length,f,g;while(++c<e){f=a[c],g=f.media||b;if(f.disabled||!/print|all/.test(g))continue;d.push(h(f.imports,g),f.cssText)}return d.join("")}function i(c){var d=new RegExp("(^|[\\s,{}])("+a.html5.elements.join("|")+")","gi"),e=c.split("{"),f=e.length,g=-1;while(++g<f)e[g]=e[g].split("}"),b.documentMode>7?e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,'$1font[data-html5shiv="$2"]'):e[g][e[g].length-1]=e[g][e[g].length-1].replace(d,"$1shiv\\:$2"),e[g]=e[g].join("}");return e.join("{")}var c=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveChildren&&e.shivDocument(b.document),b},a.createDocumentFragment=function(){return e.shivDocument(g())});if(!d&&h){var j=f("div");j.innerHTML=["x<style>","article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}","audio{display:none}","canvas,video{display:inline-block;*display:inline;*zoom:1}","[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}","mark{background:#FF0;color:#000}","</style>"].join(""),h.insertBefore(j.lastChild,h.firstChild)}return a}};e.shivDocument(b),a.html5=e;if(c||!a.attachEvent)return;a.attachEvent("onbeforeprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;b.namespaces.shiv||b.namespaces.add("shiv");var c=-1,d=new RegExp("^("+a.html5.elements.join("|")+")$","i"),e=b.getElementsByTagName("*"),g=e.length,j,k=i(h(function(a,b){var c=[],d=a.length;while(d)c.unshift(a[--d]);d=b.length;while(d)c.unshift(b[--d]);c.sort(function(a,b){return a.sourceIndex-b.sourceIndex}),d=c.length;while(d)c[--d]=c[d].styleSheet;return c}(b.getElementsByTagName("style"),b.getElementsByTagName("link"))));while(++c<g)j=e[c],d.test(j.nodeName)&&f(j);b.appendChild(b._shivedStyleSheet=b.createElement("style")).styleSheet.cssText=k}),a.attachEvent("onafterprint",function(){if(a.html5.supportsXElement||!b.namespaces)return;var c=-1,d=b.getElementsByTagName("*"),e=d.length,f;while(++c<e)f=d[c],f.originalElement&&g(f);b._shivedStyleSheet&&b._shivedStyleSheet.parentNode.removeChild(b._shivedStyleSheet)})})(this,document)

View file

@ -0,0 +1,21 @@
header h3 a, header .brand {
display:none !important;
}
@media screen and (max-device-width: 600px) {
#maincontent.container {
margin-top: 30px;
}
}
@media screen and (max-device-width: 360px) {
#maincontent.container {
margin-top: 60px;
}
}
@media screen and (max-device-width: 200px) {
#maincontent.container {
margin-top: 230px;
}
}

View file

@ -0,0 +1,30 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Copyright 2012 David Menting <david@nut-bolt.nl>
Licensed to the public under the Apache License 2.0.
-%>
<%
local ver = require "luci.version"
local disp = require "luci.dispatcher"
local request = disp.context.path
local category = request[1]
local tree = disp.node()
local categories = disp.node_childs(tree)
%>
<footer>
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> / <%= ver.distversion %>
<% if #categories > 1 then %>
<ul class="breadcrumb pull-right" id="modemenu">
<% for i, r in ipairs(categories) do %>
<li<% if request[1] == r then %> class="active"<%end%>><a href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a> <span class="divider">|</span></li>
<% end %>
</ul>
<% end %>
</footer>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,204 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Copyright 2012 David Menting <david@nut-bolt.nl>
Licensed to the public under the Apache License 2.0.
-%>
<%
local sys = require "luci.sys"
local util = require "luci.util"
local http = require "luci.http"
local disp = require "luci.dispatcher"
local boardinfo = util.ubus("system", "board")
local request = disp.context.path
local request2 = disp.context.request
local category = request[1]
local cattree = category and disp.node(category)
local leaf = request2[#request2]
local tree = disp.node()
local node = disp.context.dispatched
local categories = disp.node_childs(tree)
local c = tree
local i, r
-- tag all nodes leading to this page
for i, r in ipairs(request) do
if c.nodes and c.nodes[r] then
c = c.nodes[r]
c._menu_selected = true
end
end
-- send as HTML5
http.prepare_content("text/html")
local function nodeurl(prefix, name, query)
local url = controller .. prefix .. name .. "/"
if query then
url = url .. http.build_querystring(query)
end
return pcdata(url)
end
local function subtree(prefix, node, level)
if not level then
level = 1
end
local childs = disp.node_childs(node)
if #childs > 0 then
if level > 2 then
%>
<ul class="tabs">
<%
end
local selected_node
local selected_name
local i, v
for i, v in ipairs(childs) do
local nnode = node.nodes[v]
if nnode._menu_selected then
selected_node = nnode
selected_name = v
end
if level > 2 then
%>
<li class="tabmenu-item-<%=v%><%- if nnode._menu_selected or (node.leaf and v == leaf) then %> active<% end %>">
<a href="<%=nodeurl(prefix, v, nnode.query)%>"><%=striptags(translate(nnode.title))%></a>
</li>
<% end
end
if level > 2 then
%>
</ul>
<% end
if selected_node then
subtree(prefix .. selected_name .. "/", selected_node, level + 1)
end
end
end
-%>
<!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>">
<head>
<meta charset="utf-8">
<title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
<!--[if lt IE 9]><script src="<%=media%>/html5.js"></script><![endif]-->
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" href="<%=media%>/cascade.css">
<link rel="stylesheet" media="only screen and (max-device-width: 854px)" href="<%=media%>/mobile.css" type="text/css" />
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %><link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%>
<% if css then %><style title="text/css">
<%-= css %>
</style>
<% end -%>
<script src="<%=resource%>/xhr.js"></script>
</head>
<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %>">
<header>
<div class="fill">
<div class="container">
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
<ul class="nav">
<%-
local function submenu(prefix, node)
local childs = disp.node_childs(node)
if #childs > 0 then
%>
<ul class="dropdown-menu">
<%-
for i, r in ipairs(childs) do
local nnode = node.nodes[r]
local href = controller .. prefix .. r ..
(nnode.query and http.build_querystring(nnode.query) or "")
%>
<li><a href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a></li>
<%-
end
%>
</ul>
<%-
end
end
childs = disp.node_childs(cattree)
if #childs > 0 then
for i, r in ipairs(childs) do
local nnode = cattree.nodes[r]
local href = controller .. "/" .. category .. "/" .. r ..
(nnode.query and http.build_querystring(k.query) or "")
local grandchildren = disp.node_childs(nnode)
if #grandchildren > 0 then
%>
<li class="dropdown">
<a class="menu" href="#"><%=pcdata(striptags(translate(nnode.title)))%></a>
<%- submenu("/" .. category .. "/" .. r .. "/", nnode) %>
</li>
<% else %>
<li>
<a href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a>
</li>
<%
end
end
end
%>
</ul>
<%
-- calculate the number of unsaved changes
if tree.nodes[category] and tree.nodes[category].ucidata then
local ucichanges = 0
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do
for m, n in pairs(l) do
ucichanges = ucichanges + 1;
end
end
end
%>
<div class="pull-right">
<% if ucichanges > 0 then %>
<a class="label notice" href="<%=controller%>/<%=category%>/uci/changes"><%:Unsaved Changes%>: <%=ucichanges%></a>
<% end %>
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
<span class="label success" id="xhr_poll_status_on"><%:Auto Refresh%> <%:on%></span>
<span class="label" id="xhr_poll_status_off" style="display:none"><%:Auto Refresh%> <%:off%></span>
</span>
</div>
<% end %>
</div>
</div>
</header>
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<div class="container">
<div class="alert-message warning">
<h4><%:No password set!%></h4>
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br>
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a>
</div>
</div>
<%- end -%>
<div id="maincontent" class="container">
<% if category then subtree("/" .. category .. "/", cattree) end %>

View file

@ -0,0 +1,7 @@
#!/bin/sh
uci batch <<-EOF
set luci.themes.OpenMPTCProuter=/luci-static/openmptcprouter
set luci.main.mediaurlbase=/luci-static/openmptcprouter
commit luci
EOF
exit 0

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openmptcprouter-full
PKG_VERSION:=0.2
PKG_VERSION:=0.3
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
@ -37,7 +37,7 @@ MY_DEPENDS := \
luci-i18n-base-fr \
luci-i18n-firewall-en \
luci-i18n-firewall-fr \
luci-mod-admin-full luci-app-firewall luci-app-glorytun luci-app-shadowsocks-libev luci-app-unbound luci-theme-bootstrap luci-base
luci-mod-admin-full luci-app-firewall luci-app-glorytun luci-app-shadowsocks-libev luci-app-unbound luci-theme-openmptcprouter luci-base
define Package/$(PKG_NAME)

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openmptcprouter
PKG_VERSION:=0.53
PKG_VERSION:=0.60
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk

View file

@ -0,0 +1,23 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete network.wan1=interface
set network.wan1=interface
set network.wan1.ifname=eth0
set network.wan1.proto=none
set network.wan1.type=macvlan
set network.wan1.ip4table=wan
set network.wan1.multipath=master
set network.wan1.defaultroute=0
delete network.wan2=interface
set network.wan2=interface
set network.wan2.ifname=eth0
set network.wan2.proto=none
set network.wan2.type=macvlan
set network.wan2.ip4table=wan
set network.wan2.multipath=on
set network.wan2.defaultroute=0
commit network
EOF
rm -f /tmp/luci-indexcache
exit 0

View file

@ -0,0 +1,22 @@
#!/bin/sh
NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n")
if [ "$NBCPU" -gt 1 ]; then
for c in $(seq 2 $NBCPU); do
uci -q batch <<-EOF >/dev/null
set shadowsocks-libev.hi$c=ss_redir
set shadowsocks-libev.hi$c.server=sss0
set shadowsocks-libev.hi$c.local_address=0.0.0.0
set shadowsocks-libev.hi$c.local_port=1100
set shadowsocks-libev.hi$c.mode=tcp_and_udp
set shadowsocks-libev.hi$c.timeout=60
set shadowsocks-libev.hi$c.fast_open=1
set shadowsocks-libev.hi$c.reuse_port=1
set shadowsocks-libev.hi$c.mptcp=1
commit shadowsocks-libev
EOF
rm -f /tmp/luci-indexcache
done
fi
exit 0