Skip to content

Commit

Permalink
typecho OK
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanson committed Mar 13, 2024
1 parent fcd7f72 commit 7a9dc41
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion applications/luci-app-typecho/luasrc/model/cbi/typecho.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.default = "9080"
o.datatype = "port"
o:depends("hostnet", 0)

o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<label class="cbi-value-title">&nbsp;</label>
<div class="cbi-value-field">

<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open TypeCho%>" onclick="window.open('http://'+location.hostname+':<%=port%>/web/', '_blank')">
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open TypeCho%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
</div>
</div>
<% end %>
2 changes: 0 additions & 2 deletions applications/luci-app-typecho/root/etc/config/typecho
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
config main
option 'hostnet' '0'
option 'claim_token' ''
option 'port' '9080'
option 'config_path' ''

Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@ do_install() {
echo "config path is empty!"
exit 1
fi

[ -z "$image_name" ] && image_name="joyqi/typecho:nightly-php7.4"
echo "docker pull ${image_name}"
docker pull ${image_name}
docker rm -f typecho

[ -z "$port" ] && port=9080

local cmd="docker run --restart=unless-stopped -d -h TypeChoServer -v \"$config:/config\" "
mkdir -p $config
chmod 777 $config
local cmd="docker run --restart=unless-stopped -d -h TypeChoServer -v \"$config:/app/usr\" "

cmd="$cmd\
--dns=172.17.0.1 \
-p $port:80 "

local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
[ -z "$tz" ] || cmd="$cmd -e TZ=$tz"

cmd="$cmd -v /mnt:/mnt"
mountpoint -q /mnt && cmd="$cmd:rslave"
cmd="$cmd --name typecho \"$image_name\""
Expand Down

0 comments on commit 7a9dc41

Please sign in to comment.