Top Related Projects
Lean's LEDE source
openwrt常用软件包
An opensource OpenWrt variant for mainland China users.
Quick Overview
LuCI is the web interface for OpenWrt, a popular open-source router operating system. It provides a user-friendly interface for configuring and managing OpenWrt-based devices, making it easier for users to control their network settings and device functionality.
Pros
- User-friendly interface for managing OpenWrt devices
- Modular architecture allowing for easy customization and extension
- Supports multiple languages for internationalization
- Active development and community support
Cons
- Can be resource-intensive on low-end devices
- Learning curve for developers to create custom modules
- Some advanced features may require command-line interaction
- Occasional compatibility issues with certain OpenWrt versions
Code Examples
- Creating a simple LuCI page:
module("luci.controller.mymodule.mycontroller", package.seeall)
function index()
entry({"admin", "mymodule", "mypage"}, template("mymodule/mypage"), "My Page", 60)
end
This code creates a new page in the LuCI interface under the "admin" section.
- Defining a CBI model for configuration:
m = Map("myconfig", "My Configuration")
s = m:section(TypedSection, "mysection", "My Section")
s:option(Value, "myoption", "My Option")
return m
This code defines a configuration model for a custom module, creating a section with an input field.
- Creating a custom action:
function action_myaction()
local result = luci.sys.exec("some_command")
luci.http.write_json({ output = result })
end
This code defines a custom action that executes a system command and returns the result as JSON.
Getting Started
To start developing with LuCI:
- Set up an OpenWrt development environment
- Clone the LuCI repository:
git clone https://github.com/openwrt/luci.git
- Create a new module in the
applications
directory - Implement your controller, model, and view files
- Build and install your module on an OpenWrt device
- Access your new module through the LuCI web interface
For more detailed instructions, refer to the LuCI development documentation on the OpenWrt wiki.
Competitor Comparisons
Lean's LEDE source
Pros of lede
- More frequent updates and active development
- Includes additional packages and features not found in LuCI
- Optimized for Chinese users with region-specific improvements
Cons of lede
- Less stable compared to LuCI due to rapid development
- May have compatibility issues with some official OpenWrt packages
- Documentation primarily in Chinese, which can be challenging for non-Chinese users
Code comparison
LuCI:
local sys = require "luci.sys"
local fs = require "nixio.fs"
function action_restart()
luci.sys.call("/sbin/reboot >/dev/null 2>&1")
end
lede:
local sys = require "luci.sys"
local fs = require "nixio.fs"
function action_restart()
luci.sys.call("/sbin/reboot -f >/dev/null 2>&1")
end
The main difference in the code snippet is the addition of the -f
flag in the lede version, which forces an immediate reboot without syncing or unmounting filesystems.
openwrt常用软件包
Pros of openwrt-packages
- Larger collection of packages and applications for OpenWrt
- More frequent updates and additions of new packages
- Includes popular third-party packages not found in the official repositories
Cons of openwrt-packages
- Less official support and documentation compared to LuCI
- Potential compatibility issues with some packages
- May require more manual configuration and troubleshooting
Code Comparison
LuCI (openwrt/luci):
local sys = require "luci.sys"
local fs = require "nixio.fs"
function action_restart()
luci.sys.call("/etc/init.d/network restart >/dev/null 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "network", "network"))
end
openwrt-packages (kenzok8/openwrt-packages):
#!/bin/sh
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
. ${IPKG_INSTROOT}/lib/functions.sh
. ${IPKG_INSTROOT}/lib/functions/service.sh
if [ -s "${IPKG_INSTROOT}/etc/uci-defaults/luci-app-ssr-plus" ]; then
( . ${IPKG_INSTROOT}/etc/uci-defaults/luci-app-ssr-plus ) && rm -f ${IPKG_INSTROOT}/etc/uci-defaults/luci-app-ssr-plus
fi
The code comparison shows that LuCI focuses on core OpenWrt functionality, while openwrt-packages includes scripts for additional package management and configuration.
Pros of helloworld
- Focused on providing specific network tools and proxy solutions
- More lightweight and easier to integrate into existing OpenWrt setups
- Regularly updated with new features and improvements for bypassing network restrictions
Cons of helloworld
- Limited scope compared to LuCI's comprehensive web interface
- Less documentation and community support
- May require more technical knowledge to implement and configure
Code Comparison
helloworld (config.yaml):
proxy-groups:
- name: Proxy
type: select
proxies:
- ss
- vmess
- trojan
LuCI (lua):
local sys = require "luci.sys"
local fs = require "nixio.fs"
m = Map("example", translate("Example"))
s = m:section(TypedSection, "example", translate("Settings"))
s.anonymous = true
The helloworld code snippet shows a configuration for proxy groups, while the LuCI code demonstrates the structure of a typical Lua-based configuration page. LuCI provides a more comprehensive framework for building web interfaces, whereas helloworld focuses on specific networking configurations.
An opensource OpenWrt variant for mainland China users.
Pros of ImmortalWrt
- More frequent updates and active development
- Broader device support, including newer and less common hardware
- Enhanced performance optimizations for specific architectures
Cons of ImmortalWrt
- Potentially less stable due to rapid development cycle
- May have compatibility issues with some LuCI packages
- Smaller community and less documentation compared to OpenWrt/LuCI
Code Comparison
ImmortalWrt (config file snippet):
config system
option hostname 'ImmortalWrt'
option ttylogin '0'
option log_size '64'
option urandom_seed '0'
config timeserver 'ntp'
option enabled '1'
option enable_server '0'
list server 'ntp.aliyun.com'
list server 'time1.cloud.tencent.com'
OpenWrt/LuCI (config file snippet):
config system
option hostname 'OpenWrt'
option timezone 'UTC'
option ttylogin '0'
option log_size '64'
option urandom_seed '0'
config timeserver 'ntp'
option enabled '1'
option enable_server '0'
list server '0.openwrt.pool.ntp.org'
list server '1.openwrt.pool.ntp.org'
The code comparison shows differences in default configurations, such as hostname and NTP servers, reflecting the distinct focus of each project.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
OpenWrt luci feed
Description
This is the OpenWrt "luci"-feed containing LuCI - OpenWrt Configuration Interface.
Usage
This feed is enabled by default. Your feeds.conf.default (or feeds.conf) should contain a line like:
src-git luci https://github.com/openwrt/luci.git
To install all its package definitions, run:
./scripts/feeds update luci
./scripts/feeds install -a -p luci
API Reference
You can browse the generated API documentation directly on Github.
Development
Documentation for developing and extending LuCI can be found in the Wiki
License
See LICENSE file.
Package Guidelines
See CONTRIBUTING.md file.
Translation status
Use Weblate instead of direct editing of the *.po
files.
Top Related Projects
Lean's LEDE source
openwrt常用软件包
An opensource OpenWrt variant for mainland China users.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot