mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-13 16:03:04 +00:00
196 lines
6.0 KiB
PHP
196 lines
6.0 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Config;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class ConfigSeeder extends Seeder
|
|
{
|
|
private array $configs = [
|
|
'account_expire_notification',
|
|
'active_times',
|
|
'admin_invite_days',
|
|
'affiliate_link_salt',
|
|
'alipay_qrcode',
|
|
'AppStore_id',
|
|
'AppStore_password',
|
|
'auto_release_port',
|
|
'ban_duration',
|
|
'bark_key',
|
|
'captcha_key',
|
|
'captcha_secret',
|
|
'checkin_interval',
|
|
'checkin_reward',
|
|
'checkin_reward_max',
|
|
'codepay_id',
|
|
'codepay_key',
|
|
'codepay_url',
|
|
'cryptomus_api_key',
|
|
'cryptomus_merchant_uuid',
|
|
'data_anomaly_notification',
|
|
'data_exhaust_notification',
|
|
'ddns_key',
|
|
'ddns_mode',
|
|
'ddns_secret',
|
|
'default_days',
|
|
'default_traffic',
|
|
'detection_check_times',
|
|
'dingTalk_access_token',
|
|
'dingTalk_secret',
|
|
'epay_key',
|
|
'epay_mch_id',
|
|
'epay_url',
|
|
'expire_days',
|
|
'f2fpay_app_id',
|
|
'f2fpay_private_key',
|
|
'f2fpay_public_key',
|
|
'forbid_mode',
|
|
'invite_num',
|
|
'is_activate_account',
|
|
'is_AliPay',
|
|
'is_ban_status',
|
|
'is_captcha',
|
|
'is_clear_log',
|
|
'is_custom_subscribe',
|
|
'is_email_filtering',
|
|
'is_forbid_robot',
|
|
'is_free_code',
|
|
'is_invite_register',
|
|
'is_otherPay',
|
|
'is_QQPay',
|
|
'is_rand_port',
|
|
'is_register',
|
|
'is_WeChatPay',
|
|
'iYuu_token',
|
|
'maintenance_content',
|
|
'maintenance_mode',
|
|
'maintenance_time',
|
|
'max_port',
|
|
'min_port',
|
|
'node_blocked_notification',
|
|
'node_daily_notification',
|
|
'node_offline_notification',
|
|
'node_renewal_notification',
|
|
'oauth_path',
|
|
'offline_check_times',
|
|
'password_reset_notification',
|
|
'paybeaver_app_id',
|
|
'paybeaver_app_secret',
|
|
'payjs_key',
|
|
'payjs_mch_id',
|
|
'payment_callback_url',
|
|
'payment_confirm_notification',
|
|
'payment_received_notification',
|
|
'paypal_app_id',
|
|
'paypal_client_id',
|
|
'paypal_client_secret',
|
|
'pushDeer_key',
|
|
'pushplus_token',
|
|
'rand_subscribe',
|
|
'recently_heartbeat',
|
|
'redirect_url',
|
|
'referral_money',
|
|
'referral_percent',
|
|
'referral_reward_type',
|
|
'referral_status',
|
|
'referral_traffic',
|
|
'register_ip_limit',
|
|
'reset_password_times',
|
|
'reset_traffic',
|
|
'server_chan_key',
|
|
'standard_currency',
|
|
'stripe_public_key',
|
|
'stripe_secret_key',
|
|
'stripe_signing_secret',
|
|
'subject_name',
|
|
'subscribe_domain',
|
|
'subscribe_max',
|
|
'subscribe_rate_limit',
|
|
'tasks_chunk',
|
|
'tasks_clean',
|
|
'tasks_close',
|
|
'telegram_token',
|
|
'tg_chat_token',
|
|
'theadpay_key',
|
|
'theadpay_mchid',
|
|
'theadpay_url',
|
|
'ticket_closed_notification',
|
|
'ticket_created_notification',
|
|
'ticket_replied_notification',
|
|
'traffic_abuse_limit',
|
|
'traffic_warning_percent',
|
|
'trojan_license',
|
|
'username_type',
|
|
'user_invite_days',
|
|
'v2ray_license',
|
|
'v2ray_tls_provider',
|
|
'webmaster_email',
|
|
'website_customer_service_code',
|
|
'website_home_logo',
|
|
'website_logo',
|
|
'website_name',
|
|
'website_security_code',
|
|
'website_statistics_code',
|
|
'website_url',
|
|
'web_api_url',
|
|
'wechat_aid',
|
|
'wechat_cid',
|
|
'wechat_encodingAESKey',
|
|
'wechat_qrcode',
|
|
'wechat_secret',
|
|
'wechat_token',
|
|
];
|
|
|
|
public function run(): void
|
|
{ // 系统参数
|
|
foreach ($this->configs as $config) {
|
|
Config::insert(['name' => $config]);
|
|
}
|
|
|
|
$presetDates = [
|
|
'invite_num' => 3,
|
|
'is_register' => 1,
|
|
'is_invite_register' => 2,
|
|
'website_name' => 'ProxyPanel',
|
|
'reset_password_times' => 3,
|
|
'website_url' => config('app.url'),
|
|
'active_times' => 3,
|
|
'checkin_reward' => 10,
|
|
'checkin_reward_max' => 500,
|
|
'checkin_interval' => 1440,
|
|
'referral_traffic' => 1024,
|
|
'referral_percent' => 0.2,
|
|
'referral_money' => 100,
|
|
'referral_status' => 1,
|
|
'default_traffic' => 1024,
|
|
'traffic_warning_percent' => 80,
|
|
'expire_days' => 15,
|
|
'reset_traffic' => 1,
|
|
'default_days' => 7,
|
|
'subscribe_max' => 3,
|
|
'min_port' => 10000,
|
|
'max_port' => 65535,
|
|
'traffic_abuse_limit' => 10,
|
|
'ban_duration' => 60,
|
|
'is_clear_log' => 1,
|
|
'subscribe_rate_limit' => 20,
|
|
'auto_release_port' => 30,
|
|
'register_ip_limit' => 5,
|
|
'detection_check_times' => 3,
|
|
'user_invite_days' => 7,
|
|
'admin_invite_days' => 7,
|
|
'standard_currency' => 'CNY',
|
|
'redirect_url' => 'https://www.baidu.com',
|
|
'tasks_chunk' => 3000,
|
|
'tasks_clean' => '{"notification_logs":"-18 months","node_daily_logs":"-13 months","node_hourly_logs":"-14 days","node_heartbeats":"-30 minutes","node_online_logs":"-14 days","payments":"-1 years","rule_logs":"-3 months","node_online_ips":"-7 days","user_baned_logs":"-3 months","user_daily_logs_nodes":"-36 days","user_daily_logs_total":"-3 months","user_hourly_logs":"-3 days","login_logs":"-3 months","subscribe_logs":"-2 months","traffic_logs":"-3 days","unpaid_orders":"-1 years"}',
|
|
'tasks_close' => '{"tickets":"-72 hours","confirmation_orders":"-12 hours","orders":"-15 minutes","verify":"-15 minutes"}',
|
|
'recently_heartbeat' => '-10 minutes',
|
|
];
|
|
|
|
foreach ($presetDates as $key => $value) {
|
|
Config::whereName($key)->update(['value' => $value]);
|
|
}
|
|
}
|
|
}
|