mirror of
https://github.com/coolsnowwolf/packages.git
synced 2025-05-01 15:10:12 +08:00
add webdav
This commit is contained in:
parent
b127832d7f
commit
0c612f14d9
51
net/webdav-hacdias/Makefile
Normal file
51
net/webdav-hacdias/Makefile
Normal file
@ -0,0 +1,51 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=webdav-hacdias
|
||||
PKG_VERSION:=4.2.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/hacdias/webdav.git
|
||||
PKG_SOURCE_DATE:=2022-5-30
|
||||
PKG_SOURCE_VERSION:=436a3b0
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=5587cf5bddfb5f8b57f8ad23e521ddfd6c623ebb2f7381555c3f20d7f147d7e8
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0 # https://github.com/openwrt/packages/issues/8498
|
||||
GO_PKG:=github.com/hacdias/webdav
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=File Transfer
|
||||
TITLE:=A powerful WebDav server written in Golang.
|
||||
URL:=https://github.com/hacdias/webdav
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
webdav command line interface is really easy to use so you can easily create a WebDAV server for your own user.
|
||||
By default, it runs on a random free port and supports JSON, YAML and TOML configuration.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/ $(1)/etc/config/ $(1)/etc/init.d/ $(1)/etc/webdav/
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/webdav $(1)/usr/bin/
|
||||
$(INSTALL_CONF) $(CURDIR)/files/webdav.yaml $(1)/etc/webdav/webdav.yaml
|
||||
$(INSTALL_CONF) $(CURDIR)/files/webdav.config $(1)/etc/config/webdav
|
||||
$(INSTALL_BIN) $(CURDIR)/files/webdav.init $(1)/etc/init.d/webdav
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
3
net/webdav-hacdias/files/webdav.config
Normal file
3
net/webdav-hacdias/files/webdav.config
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
config webdav 'config'
|
||||
option enabled '0'
|
22
net/webdav-hacdias/files/webdav.init
Normal file
22
net/webdav-hacdias/files/webdav.init
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
WEBDAV="/usr/bin/webdav"
|
||||
|
||||
WEBDAVCONFIG="/etc/webdav/webdav.yaml"
|
||||
|
||||
start() {
|
||||
local enabled="$(uci get webdav.config.enabled)"
|
||||
stop
|
||||
[ "${enabled}" == "1" ] || exit 0
|
||||
export HOME="/root/"
|
||||
"${WEBDAV}" -c "${WEBDAVCONFIG}" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall -9 pgrep "${WEBDAV}" >/dev/null 2>&1
|
||||
}
|
||||
|
37
net/webdav-hacdias/files/webdav.yaml
Normal file
37
net/webdav-hacdias/files/webdav.yaml
Normal file
@ -0,0 +1,37 @@
|
||||
# Server related settings
|
||||
address: 0.0.0.0
|
||||
port: 10880
|
||||
auth: true
|
||||
tls: false
|
||||
cert: cert.pem
|
||||
key: key.pem
|
||||
prefix: /
|
||||
|
||||
# Default user settings (will be merged)
|
||||
scope: .
|
||||
modify: true
|
||||
rules: []
|
||||
|
||||
# CORS configuration
|
||||
cors:
|
||||
enabled: true
|
||||
credentials: true
|
||||
allowed_headers:
|
||||
- Depth
|
||||
allowed_hosts:
|
||||
- http://localhost:8999
|
||||
allowed_methods:
|
||||
- GET
|
||||
exposed_headers:
|
||||
- Content-Length
|
||||
- Content-Range
|
||||
|
||||
users:
|
||||
- username: video
|
||||
password: 123
|
||||
scope: /mnt/sdb1
|
||||
modify: true
|
||||
rules:
|
||||
- regex: false
|
||||
allow: false
|
||||
path: /some/file
|
Loading…
Reference in New Issue
Block a user