mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
feat: 增加Nginx应用
This commit is contained in:
parent
000c475626
commit
5855e9b0d8
BIN
apps/icons/mysql.png
Normal file
BIN
apps/icons/mysql.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
apps/icons/nginx.png
Normal file
BIN
apps/icons/nginx.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
apps/icons/redis.png
Normal file
BIN
apps/icons/redis.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -5,6 +5,10 @@
|
||||
"key": "WebSite",
|
||||
"name": "网站"
|
||||
},
|
||||
{
|
||||
"key": "Server",
|
||||
"name": "服务器"
|
||||
},
|
||||
{
|
||||
"key": "Datastore",
|
||||
"name": "数据库"
|
||||
@ -21,6 +25,17 @@
|
||||
"author": "Oracle",
|
||||
"type": "internal",
|
||||
"source": "https://www.mysql.com"
|
||||
},
|
||||
{
|
||||
"key": "nginx",
|
||||
"name": "Nginx",
|
||||
"tags": ["Server"],
|
||||
"versions": ["1.23.1"],
|
||||
"short_desc": "高性能的HTTP和反向代理web服务器",
|
||||
"icon": "nginx.png",
|
||||
"author": "Nginx",
|
||||
"type": "internal",
|
||||
"source": "http://nginx.org/"
|
||||
}
|
||||
]
|
||||
}
|
@ -16,6 +16,7 @@ services:
|
||||
volumes:
|
||||
- ./data/:/var/lib/mysql
|
||||
- ./conf/my.cnf:/etc/mysql/my.cnf
|
||||
- ./log:/var/log/mysql
|
||||
command:
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
|
@ -16,6 +16,7 @@ services:
|
||||
volumes:
|
||||
- ./data/:/var/lib/mysql
|
||||
- ./conf/my.cnf:/etc/mysql/my.cnf
|
||||
- ./log:/var/log/mysql
|
||||
command:
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
|
0
apps/nginx/1.23.1/conf/conf.d/default.conf
Normal file
0
apps/nginx/1.23.1/conf/conf.d/default.conf
Normal file
29
apps/nginx/1.23.1/conf/nginx.conf
Normal file
29
apps/nginx/1.23.1/conf/nginx.conf
Normal file
@ -0,0 +1,29 @@
|
||||
events {
|
||||
# 设置网路连接序列化
|
||||
accept_mutex on;
|
||||
# 一个进程是否同时接受多个网络连接
|
||||
multi_accept on;
|
||||
# 事件驱动模型
|
||||
use epoll;
|
||||
# 最大连接数
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
#http全局块
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
#server块
|
||||
server {
|
||||
#server全局块
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
#location块
|
||||
location / {
|
||||
root html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
}
|
13
apps/nginx/1.23.1/docker-compose.yml
Normal file
13
apps/nginx/1.23.1/docker-compose.yml
Normal file
@ -0,0 +1,13 @@
|
||||
services:
|
||||
nginx1.23.1:
|
||||
container_name: ${CONTAINER_NAME}
|
||||
image: nginx:1.23.1
|
||||
restart: always
|
||||
ports:
|
||||
- ${PORT}:80
|
||||
volumes:
|
||||
- ./conf/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./www:/home/www
|
||||
- ./log:/var/log/nginx
|
||||
- ./conf/conf.d/default.conf:/etc/nginx/conf.d/default.conf
|
||||
- ./html:/usr/share/nginx/html
|
1
apps/nginx/1.23.1/html/index.html
Normal file
1
apps/nginx/1.23.1/html/index.html
Normal file
@ -0,0 +1 @@
|
||||
test
|
12
apps/nginx/1.23.1/params.json
Normal file
12
apps/nginx/1.23.1/params.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"formFields": [
|
||||
{
|
||||
"type": "number",
|
||||
"labelZh": "端口",
|
||||
"labelEn": "Port",
|
||||
"required": true,
|
||||
"default": 3306,
|
||||
"envKey": "PORT"
|
||||
}
|
||||
]
|
||||
}
|
@ -14,7 +14,6 @@ import (
|
||||
"github.com/1Panel-dev/1Panel/utils/files"
|
||||
"github.com/joho/godotenv"
|
||||
"golang.org/x/net/context"
|
||||
"math"
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
@ -219,8 +218,8 @@ func (a AppService) Install(name string, appDetailId uint, params map[string]int
|
||||
|
||||
port, ok := params["PORT"]
|
||||
if ok {
|
||||
port := int(math.Floor(port.(float64)))
|
||||
if common.ScanPort(string(port)) {
|
||||
portStr := strconv.FormatFloat(port.(float64), 'f', -1, 32)
|
||||
if common.ScanPort(portStr) {
|
||||
return errors.New("port is in used")
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ require (
|
||||
github.com/gorilla/websocket v1.5.0
|
||||
github.com/gwatts/gin-adapter v1.0.0
|
||||
github.com/jinzhu/copier v0.3.5
|
||||
github.com/joho/godotenv v1.4.0
|
||||
github.com/kr/pty v1.1.1
|
||||
github.com/mholt/archiver/v4 v4.0.0-alpha.7
|
||||
github.com/minio/minio-go/v7 v7.0.36
|
||||
@ -39,6 +40,7 @@ require (
|
||||
github.com/swaggo/swag v1.8.4
|
||||
github.com/xlzd/gotp v0.0.0-20220817083547-a63b9d03d72f
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
|
||||
golang.org/x/text v0.3.7
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gorm.io/driver/mysql v1.3.5
|
||||
@ -76,7 +78,6 @@ require (
|
||||
github.com/google/flatbuffers v1.12.1 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gorilla/securecookie v1.1.1 // indirect
|
||||
github.com/hashicorp/go-version v1.6.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
@ -117,7 +118,6 @@ require (
|
||||
go.opentelemetry.io/otel v1.0.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.0.0 // indirect
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
||||
golang.org/x/tools v0.1.10 // indirect
|
||||
|
@ -247,8 +247,6 @@ github.com/grokify/html-strip-tags-go v0.0.1 h1:0fThFwLbW7P/kOiTBs03FsJSV9RM2M/Q
|
||||
github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78=
|
||||
github.com/gwatts/gin-adapter v1.0.0 h1:TsmmhYTR79/RMTsfYJ2IQvI1F5KZ3ZFJxuQSYEOpyIA=
|
||||
github.com/gwatts/gin-adapter v1.0.0/go.mod h1:44AEV+938HsS0mjfXtBDCUZS9vONlF2gwvh8wu4sRYc=
|
||||
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
|
||||
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
|
@ -31,7 +31,7 @@
|
||||
<script lang="ts" setup name="appInstall">
|
||||
import { App } from '@/api/interface/app';
|
||||
import { InstallApp } from '@/api/modules/app';
|
||||
import { Rules } from '@/global/form-rues';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
@ -21,23 +21,25 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { SyncApp } from '@/api/modules/app';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
const activeName = ref('all');
|
||||
|
||||
// const sync = () => {
|
||||
// SyncApp().then((res) => {
|
||||
// console.log(res);
|
||||
// });
|
||||
// };
|
||||
const sync = () => {
|
||||
SyncApp().then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
};
|
||||
|
||||
const routerTo = (path: string) => {
|
||||
router.push({ path: path });
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
sync();
|
||||
const path = router.currentRoute.value.path;
|
||||
if (path === '/apps/all') {
|
||||
activeName.value = 'all';
|
||||
|
@ -96,14 +96,14 @@ const loginRules = reactive({
|
||||
|
||||
const loginForm = reactive<Login.ReqLoginForm>({
|
||||
name: 'admin',
|
||||
password: 'Calong@2015',
|
||||
password: 'Songliu123++',
|
||||
captcha: '',
|
||||
captchaID: '',
|
||||
authMethod: '',
|
||||
});
|
||||
const mfaLoginForm = reactive<Login.MFALoginForm>({
|
||||
name: 'admin',
|
||||
password: 'Calong@2015',
|
||||
password: 'Songliu123++',
|
||||
secret: '',
|
||||
code: '',
|
||||
authMethod: '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user