Compare commits

...

5 Commits

Author SHA1 Message Date
xboard
4d46b02422 fix: correct know file issues
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
2025-01-14 18:45:25 +08:00
xboard
10845934e8 fix: correct know file issues 2025-01-14 18:35:09 +08:00
xboard
755a380c53 feat(admin): add i18n support and fix known issues 2025-01-14 18:20:26 +08:00
Xboard
e902f760ce
Merge pull request #315 from xiaoyaohanyue/docs/1panel
修改1panel部署文档
2025-01-14 14:25:09 +08:00
yaoyue
bcc478a829 修改1panel部署文档 2025-01-14 14:12:17 +08:00
13 changed files with 336 additions and 227 deletions

View 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

View File

@ -94,7 +94,7 @@ class ClientController extends Controller
*/
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')
|| str_contains($userAgent, 'chrome')
|| str_contains($userAgent, 'safari')

View File

@ -87,8 +87,8 @@ class UniProxyController extends Controller
$baseConfig = [
'server_port' => (int) $serverPort,
'network' => $protocolSettings['network'] ?? null,
'networkSettings' => $protocolSettings['network_settings'] ?? null,
'network' => data_get($protocolSettings, 'network'),
'networkSettings' => data_get($protocolSettings, 'network_settings') ?: null,
];
$response = match ($nodeType) {
@ -116,9 +116,9 @@ class UniProxyController extends Controller
...$baseConfig,
'tls' => (int) $protocolSettings['tls'],
'flow' => $protocolSettings['flow'],
'tls_settings' => (int) $protocolSettings['tls'] === 1
'tls_settings' => [...(int) $protocolSettings['tls'] === 1
? $protocolSettings['tls_settings']
: $protocolSettings['reality_settings']
: $protocolSettings['reality_settings']]
],
'hysteria' => [
'server_port' => (int) $serverPort,

View File

@ -107,7 +107,6 @@ class ConfigController extends Controller
'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_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'),
],
@ -131,7 +130,8 @@ class ConfigController extends Controller
'email_username' => admin_setting('email_username'),
'email_password' => admin_setting('email_password'),
'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_bot_enable' => (bool) admin_setting('telegram_bot_enable', 0),

View File

@ -9,8 +9,8 @@ class ConfigSave extends FormRequest
const RULES = [
// invite & commission
'invite_force' => '',
'invite_commission' => 'integer',
'invite_gen_limit' => 'integer',
'invite_commission' => 'integer|nullable',
'invite_gen_limit' => 'integer|nullable',
'invite_never_expire' => '',
'commission_first_time_enable' => '',
'commission_auto_check_enable' => '',
@ -44,7 +44,6 @@ class ConfigSave extends FormRequest
'change_order_event_id' => '',
'show_info_to_server_enable' => '',
'show_protocol_to_server_enable' => '',
'remind_mail_enable' => '',
'subscribe_path' => '',
// server
'server_token' => 'nullable|min:16',
@ -65,6 +64,7 @@ class ConfigSave extends FormRequest
'email_password' => '',
'email_encryption' => '',
'email_from_address' => '',
'remind_mail_enable' => '',
// telegram
'telegram_bot_enable' => '',
'telegram_bot_token' => '',

View File

@ -92,7 +92,7 @@ class Server extends Model
'type' => 'object',
'fields' => [
'allow_insecure' => ['type' => 'boolean', 'default' => false],
'server_port' => ['type' => 'integer', 'default' => null],
'server_port' => ['type' => 'string', 'default' => null],
'server_name' => ['type' => 'string', 'default' => null],
'public_key' => ['type' => 'string', 'default' => null],
'private_key' => ['type' => 'string', 'default' => null],

View File

@ -197,7 +197,8 @@ class ClashMeta implements ProtocolInterface
'alterId' => 0,
'cipher' => 'auto',
'udp' => true,
'flow' => data_get($protocol_settings, 'flow')
'flow' => data_get($protocol_settings, 'flow'),
'tls' => false
];
switch (data_get($protocol_settings, 'tls')) {

View File

@ -158,13 +158,13 @@ class General implements ProtocolInterface
break;
case 'httpupgrade':
$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;
case 'xhttp':
$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['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;
}

View File

@ -62,11 +62,16 @@ apt update && apt 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
```
> ⚠️ Mysql的连接地址需要使用1panel中Mysql菜单中连接信息里的容器连接地址而不是本地的localhost地址。
![示例图](./images/1panel_mysql.png)
> 安装时选择使用内置 Redis并输入之前创建的数据库信息
> 安装完成后请保存返回的后台地址和管理员账号密码

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long