From bb6e8cc0621f93611e6de11de1c4c94d59506347 Mon Sep 17 00:00:00 2001 From: Charley <2555085@qq.com> Date: Thu, 13 Jul 2017 17:50:45 +0800 Subject: [PATCH 1/4] fix ss-panel wait mysql import and add admin User --- Dockerfile | 5 +++++ docker-compose.yml | 6 ++++++ docker-entrypoint.sh | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6a8018b3a..d9047ec98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,11 @@ FROM orvice/apache-base MAINTAINER orvice ENV SSPANEL_VERSION 4.0.0 + +RUN apt-get update && apt-get install -y \ + netcat \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /var/www/html # Install sspanel diff --git a/docker-compose.yml b/docker-compose.yml index 277d0fd75..0fbfb7ee0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: redis: restart: always image: redis:latest + ports: + - 6379:6379 container_name: sspanel_redis command: - --loglevel warning @@ -11,15 +13,19 @@ services: - ./redis_data:/var/lib/redis:Z mysql: + restart: always image: mysql container_name: sspanel_mysql environment: - MYSQL_ROOT_PASSWORD=sspanel - MYSQL_DATABASE=sspanel + - MYSQL_USER=sspanel + - MYSQL_PASSWORD=sspanel volumes: - ./mysql_data:/var/lib/mysql:Z ss-panel: + restart: always image: orvice/ss-panel:master ports: - 8080:80 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 0f0eecb73..90472a3f6 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,5 +1,16 @@ #!/bin/bash echo "Entry ss-panel" + +echo -n "waiting for MySQL connection..." + +while ! nc -w 1 $DB_HOST 3306 > /dev/null 2>&1 +do + echo -n . + sleep 1 +done + +echo 'ok' + if [ "$MIGRATION" = "false" ];then echo "Skip database migration" else From bfd372926b8fea29dfabf147318a99beb2b880a1 Mon Sep 17 00:00:00 2001 From: Charley <2555085@qq.com> Date: Mon, 17 Jul 2017 01:23:15 +0800 Subject: [PATCH 2/4] fix Config static get function --- app/Services/Config.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/Services/Config.php diff --git a/app/Services/Config.php b/app/Services/Config.php new file mode 100644 index 000000000..c32727848 --- /dev/null +++ b/app/Services/Config.php @@ -0,0 +1,20 @@ +get($key); + } +} \ No newline at end of file From 258c76ccdd0b8b0c7280b288ca50e8e7dd291193 Mon Sep 17 00:00:00 2001 From: Charley <2555085@qq.com> Date: Mon, 17 Jul 2017 15:19:15 +0800 Subject: [PATCH 3/4] fix MuV2 Get Users API ret --- app/Controllers/MuV2/NodeController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Controllers/MuV2/NodeController.php b/app/Controllers/MuV2/NodeController.php index f2c8725f5..2c5ab9107 100644 --- a/app/Controllers/MuV2/NodeController.php +++ b/app/Controllers/MuV2/NodeController.php @@ -16,6 +16,7 @@ public function users($request, $response, $args) { $users = User::all(); $res = [ + 'ret' => 1, 'msg' => 'ok', 'data' => $users, ]; From 019a24217e37fb2919e415c55fa9c09493f6f676 Mon Sep 17 00:00:00 2001 From: Charley <2555085@qq.com> Date: Mon, 17 Jul 2017 15:30:48 +0800 Subject: [PATCH 4/4] delete Notes --- app/Services/Config.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/Services/Config.php b/app/Services/Config.php index c32727848..53760fe85 100644 --- a/app/Services/Config.php +++ b/app/Services/Config.php @@ -1,10 +1,4 @@