Skip to content

Commit

Permalink
Move refresh_token config to server section in OpenWrt
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Aug 25, 2021
1 parent 1017795 commit a560abf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
config aliyun
option refresh_token ''

config server
option enable '1'
option refresh_token ''
option host '0.0.0.0'
option port '8080'
option auth_user ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ start_service() {
local enable=$(uci_get_by_type server enable)
case "$enable" in
1|on|true|yes|enabled)
local refresh_token=$(uci_get_by_type aliyun refresh_token)
local refresh_token=$(uci_get_by_type server refresh_token)
local auth_user=$(uci_get_by_type server auth_user)
local auth_password=$(uci_get_by_type server auth_password)
local read_buf_size=$(uci_get_by_type server read_buffer_size 10485760)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ e.anonymous = true

enable = e:option(Flag, "enable", translate("enable"))
enable.rmempty = false
refresh_token = e:option(Value, "refresh_token", translate("Refresh Token"))
host = e:option(Value, "host", translate("Host"))
host.default = "0.0.0.0"
host.datatype = "ipaddr"
Expand All @@ -23,11 +24,6 @@ read_buffer_size = e:option(Value, "read_buffer_size", translate("Read Buffer Si
read_buffer_size.default = "10485760"
read_buffer_size.datatype = "uinteger"

e = m:section(TypedSection, "aliyun", translate("AliyunDrive"))
e.anonymous = true

refresh_token = e:option(Value, "refresh_token", translate("Refresh Token"))

local e = luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/aliyundrive-webdav restart")
Expand Down

0 comments on commit a560abf

Please sign in to comment.