mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 15:05:13 +08:00
🍓 Sync 2026-09-15 02:13:06
This commit is contained in:
1 parent
0e5393594c
commit
1dd96ac2bb
146 files changed
+26541
-508
No files matched your search
@@ -0,0 +1,97 @@
|
||||
#
|
||||
# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tailscale-next
|
||||
PKG_VERSION:=1.102.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
# Architecture mapping for pre-built binaries
|
||||
ifeq ($(ARCH),x86_64)
|
||||
TS_ARCH:=amd64
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
TS_ARCH:=arm64
|
||||
endif
|
||||
ifeq ($(ARCH),arm64)
|
||||
TS_ARCH:=arm64
|
||||
endif
|
||||
ifeq ($(ARCH),armv8)
|
||||
TS_ARCH:=arm64
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
TS_ARCH:=arm
|
||||
endif
|
||||
ifeq ($(ARCH),armv7)
|
||||
TS_ARCH:=arm
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
TS_ARCH:=386
|
||||
endif
|
||||
ifeq ($(ARCH),mips)
|
||||
TS_ARCH:=mips
|
||||
endif
|
||||
ifeq ($(ARCH),mipsel)
|
||||
TS_ARCH:=mipsle
|
||||
endif
|
||||
ifeq ($(ARCH),riscv64)
|
||||
TS_ARCH:=riscv64
|
||||
endif
|
||||
|
||||
PKG_SOURCE:=tailscale_$(PKG_VERSION)_$(TS_ARCH).tgz
|
||||
PKG_SOURCE_URL:=https://pkgs.tailscale.com/stable/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_MAINTAINER:=Dante <dante@seckv.com>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:tailscale:tailscale
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/tailscale-next
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
TITLE:=Zero config VPN (Next) - Pre-built Binary
|
||||
URL:=https://tailscale.com
|
||||
DEPENDS:=@(x86_64||aarch64||arm||i386||mips||mipsel||riscv64) +ca-bundle +kmod-tun +iptables
|
||||
PROVIDES:=tailscale tailscaled
|
||||
CONFLICTS:=tailscale tailscaled
|
||||
endef
|
||||
|
||||
define Package/tailscale-next/description
|
||||
It creates a secure network between your servers, computers,
|
||||
and cloud instances. Even when separated by firewalls or subnets.
|
||||
This package contains official pre-built static binaries.
|
||||
endef
|
||||
|
||||
define Package/tailscale-next/conffiles
|
||||
/etc/config/tailscale
|
||||
/etc/tailscale/
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
tar -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/tailscale-next/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tailscaled $(1)/usr/sbin/tailscaled
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tailscale $(1)/usr/sbin/tailscale
|
||||
$(INSTALL_BIN) ./files/tailscale.init $(1)/etc/init.d/tailscale
|
||||
$(INSTALL_DATA) ./files/tailscale.conf $(1)/etc/config/tailscale
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,tailscale-next))
|
||||
@@ -0,0 +1,23 @@
|
||||
# Tailscale
|
||||
This readme should help you with tailscale client setup.
|
||||
|
||||
> [!NOTE]
|
||||
> By default this package will use nftables. If you wish to use iptables, the config file `/etc/config/tailscale` can be modfied, changing the line `fw_mode 'nftables'` to `fw_mode 'iptables'`. You can then run `/etc/init.d/tailscale restart` to restart tailscale using your chosen method
|
||||
|
||||
## First setup
|
||||
|
||||
First, enable and run daemon
|
||||
|
||||
```
|
||||
/etc/init.d/tailscale enable
|
||||
/etc/init.d/tailscale start
|
||||
```
|
||||
|
||||
Then you should use tailscale utility to get a login link for your device.
|
||||
|
||||
Run command and finish device registration with the given URL.
|
||||
```
|
||||
tailscale up
|
||||
```
|
||||
|
||||
See the [OpenWrt wiki](https://openwrt.org/docs/guide-user/services/vpn/tailscale/start) for more detailed setup instructions
|
||||
@@ -0,0 +1,8 @@
|
||||
config settings 'settings'
|
||||
option service_enabled '0'
|
||||
option log_stderr '1'
|
||||
option log_stdout '1'
|
||||
option port '41641'
|
||||
option state_file '/etc/tailscale/tailscaled.state'
|
||||
# default to using nftables - change below to 'iptables' if still using iptables
|
||||
option fw_mode 'nftables'
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright 2020 Google LLC.
|
||||
# Copyright (C) 2021 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
USE_PROCD=1
|
||||
START=80
|
||||
|
||||
export TS_NO_LOGS_NO_SUPPORT=true
|
||||
|
||||
start_service() {
|
||||
local service_enabled
|
||||
local state_file
|
||||
local port
|
||||
local std_out
|
||||
|
||||
config_load tailscale
|
||||
config_get_bool service_enabled "settings" service_enabled 0
|
||||
[ "$service_enabled" -eq 1 ] || return 0
|
||||
|
||||
config_get_bool std_out "settings" log_stdout 1
|
||||
config_get port "settings" port 41641
|
||||
config_get state_file "settings" state_file /etc/tailscale/tailscaled.state
|
||||
local fw_mode="auto"
|
||||
if [ -x /usr/sbin/nft ] && command -v fw4 >/dev/null 2>&1; then
|
||||
fw_mode="nftables"
|
||||
elif [ -x /usr/sbin/iptables ]; then
|
||||
fw_mode="iptables"
|
||||
fi
|
||||
|
||||
/usr/sbin/tailscaled --cleanup
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /bin/sh -c 'exec /usr/sbin/tailscaled "$@" 2>&1' --
|
||||
|
||||
# Set backend firewall mode automatically based on active OpenWrt firewall
|
||||
procd_set_param env TS_DEBUG_FIREWALL_MODE="$fw_mode"
|
||||
|
||||
# Disable logging to log.tailscale.com
|
||||
procd_append_param env TS_NO_LOGS_NO_SUPPORT=true
|
||||
|
||||
# Set the port to listen on for incoming VPN packets.
|
||||
# Remote nodes will automatically be informed about the new port number,
|
||||
# but you might want to configure this in order to set external firewall
|
||||
# settings.
|
||||
procd_append_param command --port "$port"
|
||||
procd_append_param command --state "$state_file"
|
||||
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout "$std_out"
|
||||
procd_set_param stderr 0
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
/usr/sbin/tailscaled --cleanup
|
||||
killall -9 tailscaled 2>/dev/null || true
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "tailscale"
|
||||
}
|
||||
Reference in new issue
Block a user