no message

This commit is contained in:
kuaifan 2025-05-14 15:16:35 +08:00
parent 9c29c1ca9b
commit bc264109f3
5 changed files with 27 additions and 7 deletions

View File

@ -135,7 +135,7 @@ class Apps
// 执行docker-compose命令
$curlPath = "app/{$command}/{$appName}";
if ($command === 'up') {
$curlPath .= "?callback_url=" . urlencode("http://host.docker.internal:" . env("APP_PORT") . "/api/apps/install/callback?install_num=" . $updateConfig[$prefix . '_num']);
$curlPath .= "?callback_url=" . urlencode("http://nginx/api/apps/install/callback?install_num=" . $updateConfig[$prefix . '_num']);
}
$res = self::curl($curlPath);
if (Base::isError($res)) {
@ -821,7 +821,7 @@ class Apps
*/
private static function curl($path): array
{
$url = "http://nginx/appstore/api/{$path}";
$url = "http://appstore/api/{$path}";
$extra = [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . md5(env('APP_KEY')),

6
cmd
View File

@ -56,7 +56,7 @@ rand_string() {
if [[ `uname` == 'Linux' ]]; then
echo "$(date +%s%N | md5sum | cut -c 1-${lan})"
else
echo "$(docker run -it --rm alpine sh -c "date +%s%N | md5sum | cut -c 1-${lan}")"
echo "$(docker run -it --rm nginx:alpine sh -c "date +%s%N | md5sum | cut -c 1-${lan}")"
fi
}
@ -238,7 +238,7 @@ remove_by_network() {
}
uninstall_appstore() {
docker run -it --rm -v ${cur_path}/docker/appstore:/appstore alpine sh -c "find /appstore/configs -mindepth 1 -type d | sort -r | xargs rm -rf; rm -f /appstore/logs/*.log"
docker run -it --rm -v ${cur_path}/docker/appstore:/appstore nginx:alpine sh -c "find /appstore/configs -mindepth 1 -type d | sort -r | xargs rm -rf; rm -f /appstore/logs/*.log"
}
https_auto() {
@ -311,7 +311,7 @@ env_set() {
if [[ `uname` == 'Linux' ]]; then
sed -i "/^${key}=/c\\${key}=${val}" ${cur_path}/.env
else
docker run -it --rm -v ${cur_path}:/www alpine sh -c "sed -i "/^${key}=/c\\${key}=${val}" /www/.env"
docker run -it --rm -v ${cur_path}:/www nginx:alpine sh -c "sed -i "/^${key}=/c\\${key}=${val}" /www/.env"
fi
if [ $? -ne 0 ]; then
error "设置env参数失败"

View File

@ -11,6 +11,7 @@
"php": "^8.0",
"ext-curl": "*",
"ext-dom": "*",
"ext-ffi": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-imagick": "*",

View File

@ -1,7 +1,7 @@
services:
php:
container_name: "dootask-php-${APP_ID}"
image: "kuaifan/php:swoole-8.0.rc18"
image: "kuaifan/php:swoole-8.0.rc20"
shm_size: 2G
ulimits:
core:
@ -210,12 +210,14 @@ services:
privileged: true
image: "kuaifan/dootask-appstore:0.0.2"
volumes:
- shared_data:/usr/share/dootask
- /var/run/docker.sock:/var/run/docker.sock
- ./:/var/www
environment:
DOO_ENV: "/var/www"
HOST_PWD: "${PWD}"
network_mode: host
networks:
- extnetwork
restart: unless-stopped
networks:

View File

@ -0,0 +1,17 @@
location /appstore/ {
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host/appstore;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://appstore/;
}