mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
Compare commits
5 Commits
99af5b80ab
...
4d46b02422
Author | SHA1 | Date | |
---|---|---|---|
|
4d46b02422 | ||
|
10845934e8 | ||
|
755a380c53 | ||
|
e902f760ce | ||
|
bcc478a829 |
46
.docker/onepanel/compose.sample.yaml
Normal file
46
.docker/onepanel/compose.sample.yaml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
networks:
|
||||||
|
1panel-network:
|
||||||
|
driver: bridge
|
||||||
|
external: true
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
image: ghcr.io/cedar2025/xboard:new
|
||||||
|
volumes:
|
||||||
|
- ./.docker/.data/redis/:/data/
|
||||||
|
- ./.env:/www/.env
|
||||||
|
- ./.docker/.data/:/www/.docker/.data
|
||||||
|
- ./storage/logs:/www/storage/logs
|
||||||
|
- ./storage/theme:/www/storage/theme
|
||||||
|
environment:
|
||||||
|
- docker=true
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
# network_mode: host
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
command: php artisan octane:start --host=0.0.0.0 --port=7001
|
||||||
|
restart: on-failure
|
||||||
|
ports:
|
||||||
|
- 7001:7001
|
||||||
|
horizon:
|
||||||
|
image: ghcr.io/cedar2025/xboard:new
|
||||||
|
volumes:
|
||||||
|
- ./.docker/.data/redis/:/data/
|
||||||
|
- ./.env:/www/.env
|
||||||
|
- ./.docker/.data/:/www/.docker/.data
|
||||||
|
- ./storage/logs:/www/storage/logs
|
||||||
|
restart: on-failure
|
||||||
|
# network_mode: host
|
||||||
|
command: php artisan horizon
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777 --save 900 1 --save 300 10 --save 60 10000
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
volumes:
|
||||||
|
- ./.docker/.data/redis:/data
|
@ -94,7 +94,7 @@ class ClientController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function isBrowserAccess(Request $request): bool
|
private function isBrowserAccess(Request $request): bool
|
||||||
{
|
{
|
||||||
$userAgent = strtolower($request->header('User-Agent'));
|
$userAgent = strtolower($request->input('flag', $request->header('User-Agent')));
|
||||||
return str_contains($userAgent, 'mozilla')
|
return str_contains($userAgent, 'mozilla')
|
||||||
|| str_contains($userAgent, 'chrome')
|
|| str_contains($userAgent, 'chrome')
|
||||||
|| str_contains($userAgent, 'safari')
|
|| str_contains($userAgent, 'safari')
|
||||||
|
@ -87,8 +87,8 @@ class UniProxyController extends Controller
|
|||||||
|
|
||||||
$baseConfig = [
|
$baseConfig = [
|
||||||
'server_port' => (int) $serverPort,
|
'server_port' => (int) $serverPort,
|
||||||
'network' => $protocolSettings['network'] ?? null,
|
'network' => data_get($protocolSettings, 'network'),
|
||||||
'networkSettings' => $protocolSettings['network_settings'] ?? null,
|
'networkSettings' => data_get($protocolSettings, 'network_settings') ?: null,
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = match ($nodeType) {
|
$response = match ($nodeType) {
|
||||||
@ -116,9 +116,9 @@ class UniProxyController extends Controller
|
|||||||
...$baseConfig,
|
...$baseConfig,
|
||||||
'tls' => (int) $protocolSettings['tls'],
|
'tls' => (int) $protocolSettings['tls'],
|
||||||
'flow' => $protocolSettings['flow'],
|
'flow' => $protocolSettings['flow'],
|
||||||
'tls_settings' => (int) $protocolSettings['tls'] === 1
|
'tls_settings' => [...(int) $protocolSettings['tls'] === 1
|
||||||
? $protocolSettings['tls_settings']
|
? $protocolSettings['tls_settings']
|
||||||
: $protocolSettings['reality_settings']
|
: $protocolSettings['reality_settings']]
|
||||||
],
|
],
|
||||||
'hysteria' => [
|
'hysteria' => [
|
||||||
'server_port' => (int) $serverPort,
|
'server_port' => (int) $serverPort,
|
||||||
|
@ -107,7 +107,6 @@ class ConfigController extends Controller
|
|||||||
'show_protocol_to_server_enable' => (bool) admin_setting('show_protocol_to_server_enable', 0),
|
'show_protocol_to_server_enable' => (bool) admin_setting('show_protocol_to_server_enable', 0),
|
||||||
'default_remind_expire' => (bool) admin_setting('default_remind_expire', 1),
|
'default_remind_expire' => (bool) admin_setting('default_remind_expire', 1),
|
||||||
'default_remind_traffic' => (bool) admin_setting('default_remind_traffic', 1),
|
'default_remind_traffic' => (bool) admin_setting('default_remind_traffic', 1),
|
||||||
'remind_mail_enable' => (bool) admin_setting('remind_mail_enable', false),
|
|
||||||
'subscribe_path' => admin_setting('subscribe_path', 's'),
|
'subscribe_path' => admin_setting('subscribe_path', 's'),
|
||||||
|
|
||||||
],
|
],
|
||||||
@ -131,7 +130,8 @@ class ConfigController extends Controller
|
|||||||
'email_username' => admin_setting('email_username'),
|
'email_username' => admin_setting('email_username'),
|
||||||
'email_password' => admin_setting('email_password'),
|
'email_password' => admin_setting('email_password'),
|
||||||
'email_encryption' => admin_setting('email_encryption'),
|
'email_encryption' => admin_setting('email_encryption'),
|
||||||
'email_from_address' => admin_setting('email_from_address')
|
'email_from_address' => admin_setting('email_from_address'),
|
||||||
|
'remind_mail_enable' => (bool) admin_setting('remind_mail_enable', false),
|
||||||
],
|
],
|
||||||
'telegram' => [
|
'telegram' => [
|
||||||
'telegram_bot_enable' => (bool) admin_setting('telegram_bot_enable', 0),
|
'telegram_bot_enable' => (bool) admin_setting('telegram_bot_enable', 0),
|
||||||
|
@ -9,8 +9,8 @@ class ConfigSave extends FormRequest
|
|||||||
const RULES = [
|
const RULES = [
|
||||||
// invite & commission
|
// invite & commission
|
||||||
'invite_force' => '',
|
'invite_force' => '',
|
||||||
'invite_commission' => 'integer',
|
'invite_commission' => 'integer|nullable',
|
||||||
'invite_gen_limit' => 'integer',
|
'invite_gen_limit' => 'integer|nullable',
|
||||||
'invite_never_expire' => '',
|
'invite_never_expire' => '',
|
||||||
'commission_first_time_enable' => '',
|
'commission_first_time_enable' => '',
|
||||||
'commission_auto_check_enable' => '',
|
'commission_auto_check_enable' => '',
|
||||||
@ -44,7 +44,6 @@ class ConfigSave extends FormRequest
|
|||||||
'change_order_event_id' => '',
|
'change_order_event_id' => '',
|
||||||
'show_info_to_server_enable' => '',
|
'show_info_to_server_enable' => '',
|
||||||
'show_protocol_to_server_enable' => '',
|
'show_protocol_to_server_enable' => '',
|
||||||
'remind_mail_enable' => '',
|
|
||||||
'subscribe_path' => '',
|
'subscribe_path' => '',
|
||||||
// server
|
// server
|
||||||
'server_token' => 'nullable|min:16',
|
'server_token' => 'nullable|min:16',
|
||||||
@ -65,6 +64,7 @@ class ConfigSave extends FormRequest
|
|||||||
'email_password' => '',
|
'email_password' => '',
|
||||||
'email_encryption' => '',
|
'email_encryption' => '',
|
||||||
'email_from_address' => '',
|
'email_from_address' => '',
|
||||||
|
'remind_mail_enable' => '',
|
||||||
// telegram
|
// telegram
|
||||||
'telegram_bot_enable' => '',
|
'telegram_bot_enable' => '',
|
||||||
'telegram_bot_token' => '',
|
'telegram_bot_token' => '',
|
||||||
|
@ -92,7 +92,7 @@ class Server extends Model
|
|||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'fields' => [
|
'fields' => [
|
||||||
'allow_insecure' => ['type' => 'boolean', 'default' => false],
|
'allow_insecure' => ['type' => 'boolean', 'default' => false],
|
||||||
'server_port' => ['type' => 'integer', 'default' => null],
|
'server_port' => ['type' => 'string', 'default' => null],
|
||||||
'server_name' => ['type' => 'string', 'default' => null],
|
'server_name' => ['type' => 'string', 'default' => null],
|
||||||
'public_key' => ['type' => 'string', 'default' => null],
|
'public_key' => ['type' => 'string', 'default' => null],
|
||||||
'private_key' => ['type' => 'string', 'default' => null],
|
'private_key' => ['type' => 'string', 'default' => null],
|
||||||
|
@ -197,7 +197,8 @@ class ClashMeta implements ProtocolInterface
|
|||||||
'alterId' => 0,
|
'alterId' => 0,
|
||||||
'cipher' => 'auto',
|
'cipher' => 'auto',
|
||||||
'udp' => true,
|
'udp' => true,
|
||||||
'flow' => data_get($protocol_settings, 'flow')
|
'flow' => data_get($protocol_settings, 'flow'),
|
||||||
|
'tls' => false
|
||||||
];
|
];
|
||||||
|
|
||||||
switch (data_get($protocol_settings, 'tls')) {
|
switch (data_get($protocol_settings, 'tls')) {
|
||||||
|
@ -158,13 +158,13 @@ class General implements ProtocolInterface
|
|||||||
break;
|
break;
|
||||||
case 'httpupgrade':
|
case 'httpupgrade':
|
||||||
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
||||||
$config['host'] = data_get($protocol_settings, 'network_settings.headers.Host', $server['host']);
|
$config['host'] = data_get($protocol_settings, 'network_settings.host', $server['host']);
|
||||||
break;
|
break;
|
||||||
case 'xhttp':
|
case 'xhttp':
|
||||||
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
$config['path'] = data_get($protocol_settings, 'network_settings.path');
|
||||||
$config['host'] = data_get($protocol_settings, 'network_settings.headers.Host', $server['host']);
|
$config['host'] = data_get($protocol_settings, 'network_settings.host', $server['host']);
|
||||||
$config['mode'] = data_get($protocol_settings, 'network_settings.mode', 'auto');
|
$config['mode'] = data_get($protocol_settings, 'network_settings.mode', 'auto');
|
||||||
$config['extra'] = data_get($protocol_settings, 'network_settings.extra') ? Helper::encodeURIComponent(data_get($protocol_settings, 'network_settings.extra')) : null;
|
$config['extra'] = json_encode(data_get($protocol_settings, 'network_settings.extra'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,11 +62,16 @@ apt update && apt install -y git
|
|||||||
yum update && yum install -y git
|
yum update && yum install -y git
|
||||||
|
|
||||||
# 克隆代码
|
# 克隆代码
|
||||||
git clone -b compose-new --depth 1 https://github.com/cedar2025/Xboard ./
|
git clone -b new --depth 1 https://github.com/cedar2025/Xboard ./
|
||||||
|
|
||||||
|
# 复制配置文件
|
||||||
|
cp .docker/onepanel/compose.sample.yaml compose.yaml
|
||||||
|
|
||||||
# 安装依赖并初始化
|
# 安装依赖并初始化
|
||||||
docker compose run -it --rm web php artisan xboard:install
|
docker compose run -it --rm web php artisan xboard:install
|
||||||
```
|
```
|
||||||
|
> ⚠️ Mysql的连接地址需要使用1panel中Mysql菜单中连接信息里的容器连接地址,而不是本地的localhost地址。
|
||||||
|
![示例图](./images/1panel_mysql.png)
|
||||||
> 安装时选择使用内置 Redis,并输入之前创建的数据库信息
|
> 安装时选择使用内置 Redis,并输入之前创建的数据库信息
|
||||||
> 安装完成后请保存返回的后台地址和管理员账号密码
|
> 安装完成后请保存返回的后台地址和管理员账号密码
|
||||||
|
|
||||||
|
BIN
docs/images/1panel_mysql.png
Normal file
BIN
docs/images/1panel_mysql.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 228 KiB |
2
public/assets/admin/assets/index.css
vendored
2
public/assets/admin/assets/index.css
vendored
File diff suppressed because one or more lines are too long
60
public/assets/admin/assets/index.js
vendored
60
public/assets/admin/assets/index.js
vendored
File diff suppressed because one or more lines are too long
417
public/assets/admin/assets/vendor.js
vendored
417
public/assets/admin/assets/vendor.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user