typecho OK

This commit is contained in:
janson 2024-03-13 15:35:41 +08:00
parent fcd7f7200c
commit 7a9dc41f79
4 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -25,7 +25,7 @@ if container_running then
<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 %>

View File

@ -1,6 +1,4 @@
config main
option 'hostnet' '0'
option 'claim_token' ''
option 'port' '9080'
option 'config_path' ''

View File

@ -13,7 +13,6 @@ 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}
@ -21,7 +20,9 @@ do_install() {
[ -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 \
@ -29,6 +30,7 @@ do_install() {
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\""