🎨解决template渲染时遇到转移字符问题

This commit is contained in:
coward 2024-03-08 10:43:22 +08:00
parent 4597a1d442
commit d41a6e9ba2
8 changed files with 769 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
### Go template ### Go template
# If you prefer the allow list template instead of the deny list, see community template: # If you prefer the allow list template_data instead of the deny list, see community template_data:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
# #
# Binaries for programs and plugins # Binaries for programs and plugins

View File

@ -53,6 +53,5 @@ func (c CaptchaStore) Verify(id, answer string, clear bool) bool {
if os.Getenv("GIN_MODE") != "release" { if os.Getenv("GIN_MODE") != "release" {
return true return true
} }
storeAnswer := c.Get(id, clear) return strings.ToUpper(answer) == strings.ToUpper(c.Get(id, clear))
return strings.ToUpper(answer) == strings.ToUpper(storeAnswer)
} }

5
global/global.go Normal file
View File

@ -0,0 +1,5 @@
package global
import "sync"
type ServerConfigMap = sync.Map

1
go.mod
View File

@ -74,6 +74,7 @@ require (
github.com/prometheus/procfs v0.8.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/prometheus v1.8.2-0.20201028100903-3245b3267b24 // indirect github.com/prometheus/prometheus v1.8.2-0.20201028100903-3245b3267b24 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/atomic v1.10.0 // indirect go.uber.org/atomic v1.10.0 // indirect

2
go.sum
View File

@ -757,6 +757,8 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=

View File

@ -881,3 +881,717 @@
[2024-03-07 17:30:59.921] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1 [2024-03-07 17:30:59.921] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-07 17:30:59.924] INFO repository/system.go:59 [2.1686ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("b456253c6cdf4575acf6f22c0443b37e","2024-03-07 17:30:59","2024-03-07 17:30:59","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.239.10"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置") [2024-03-07 17:30:59.924] INFO repository/system.go:59 [2.1686ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("b456253c6cdf4575acf6f22c0443b37e","2024-03-07 17:30:59","2024-03-07 17:30:59","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.239.10"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-07 17:30:59.927] INFO repository/server.go:40 [2.224ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("613572f5d1be4b5ea866915894e80479","2024-03-07 17:30:59","2024-03-07 17:30:59","10.10.10.1/24",51820,"uIcQM4koYm5AFVy5DdJS+IXm/HdPDclz5iI2bcOFKF4=","77ZVC/0KnC6wfPTXiYqvuPfW3PcsgUpoa5fRCvIhpE8=","","","") [2024-03-07 17:30:59.927] INFO repository/server.go:40 [2.224ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("613572f5d1be4b5ea866915894e80479","2024-03-07 17:30:59","2024-03-07 17:30:59","10.10.10.1/24",51820,"uIcQM4koYm5AFVy5DdJS+IXm/HdPDclz5iI2bcOFKF4=","77ZVC/0KnC6wfPTXiYqvuPfW3PcsgUpoa5fRCvIhpE8=","","","")
[2024-03-08 09:20:01.006] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:20:01.018] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:01.019] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:20:01.019] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:01.019] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:01.021] INFO sqlite@v1.5.5/migrator.go:413 [1.5261ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:01.021] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:01.022] INFO sqlite@v1.5.5/migrator.go:423 [567.2µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:01.023] INFO sqlite@v1.5.5/migrator.go:423 [1.0278ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:01.025] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:01.025] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:01.026] INFO sqlite@v1.5.5/migrator.go:413 [585µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:01.027] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:01.027] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:01.028] INFO sqlite@v1.5.5/migrator.go:423 [545.2µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:01.030] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:20:01.031] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:01.031] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:20:01.031] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:01.031] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:20:01.032] INFO sqlite@v1.5.5/migrator.go:413 [1.14ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:20:01.032] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:20:01.032] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_wg_server`
[2024-03-08 09:20:01.033] INFO sqlite@v1.5.5/migrator.go:423 [592.4µs] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:20:01.035] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:20:01.036] INFO migrator/migrator.go:73 [506.7µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:01.036] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:20:01.036] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:01.036] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:01.038] INFO sqlite@v1.5.5/migrator.go:413 [1.0783ms] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:01.038] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:01.038] INFO sqlite@v1.5.5/migrator.go:423 [532.9µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:01.039] INFO sqlite@v1.5.5/migrator.go:423 [1.1028ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:01.041] INFO sqlite@v1.5.5/migrator.go:79 [512.3µs] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:01.041] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:01.042] INFO sqlite@v1.5.5/migrator.go:413 [531.8µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:01.043] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:01.043] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:01.045] INFO sqlite@v1.5.5/migrator.go:423 [1.2023ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:01.047] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:20:01.047] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:20:01.047] INFO migrator/migrator.go:73 [81.6µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:01.047] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:20:01.048] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:20:01.048] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:20:13.812] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:20:13.825] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:13.825] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:20:13.826] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:13.826] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:13.827] INFO sqlite@v1.5.5/migrator.go:413 [914.4µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:13.828] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:13.828] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:13.829] INFO sqlite@v1.5.5/migrator.go:423 [1.0009ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:13.831] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:13.831] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:13.832] INFO sqlite@v1.5.5/migrator.go:413 [1.0064ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:13.832] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:13.833] INFO sqlite@v1.5.5/migrator.go:423 [1.0003ms] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:13.834] INFO sqlite@v1.5.5/migrator.go:423 [999.8µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:13.835] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:20:13.835] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:13.835] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:20:13.835] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:13.835] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:20:13.837] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:20:13.837] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:20:13.838] INFO sqlite@v1.5.5/migrator.go:423 [1.0046ms] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:20:13.839] INFO sqlite@v1.5.5/migrator.go:423 [1.0087ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:20:13.840] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:20:13.840] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:13.840] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:20:13.840] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:13.841] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:13.842] INFO sqlite@v1.5.5/migrator.go:413 [1.0622ms] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:13.842] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:13.843] INFO sqlite@v1.5.5/migrator.go:423 [503.7µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:13.844] INFO sqlite@v1.5.5/migrator.go:423 [1.0144ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:13.845] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:13.845] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:13.847] INFO sqlite@v1.5.5/migrator.go:413 [1.0092ms] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:13.847] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:13.847] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:13.848] INFO sqlite@v1.5.5/migrator.go:423 [1.2552ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:13.850] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:20:13.850] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:20:13.850] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:13.850] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:20:13.851] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:20:13.851] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:20:14.812] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:20:14.814] INFO repository/system.go:59 [1.5941ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("e14e8349a6a446f9be0218600662b12f","2024-03-08 09:20:14","2024-03-08 09:20:14","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:20:14.817] INFO repository/server.go:40 [1.6594ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("0dba6bf0c23b48f2aea06087b7143351","2024-03-08 09:20:14","2024-03-08 09:20:14","10.10.10.1/24",51820,"gIukrBANNbMnuLpmZGU/vOPkOuToWHQMOinQnILb93U=","fTPugEY7JI9b2P+S9kuPJdRuHglgwwx+UT9Sz1ZRVRo=","","","")
[2024-03-08 09:20:14.817] ERROR component/wireguard.go:22 解析模板信息失败
[2024-03-08 09:20:14.817] ERROR script/db_migrate.go:170 应用配置文件失败: open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:20:14.817] ERROR script/db_migrate.go:33 open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:20:54.719] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:20:54.731] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:54.732] INFO sqlite@v1.5.5/migrator.go:125 [83.4µs] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:20:54.732] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:54.732] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:54.733] INFO sqlite@v1.5.5/migrator.go:413 [1.1861ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:54.734] INFO sqlite@v1.5.5/migrator.go:423 [502.9µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:54.734] INFO sqlite@v1.5.5/migrator.go:423 [533.3µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:54.735] INFO sqlite@v1.5.5/migrator.go:423 [590.9µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:54.737] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:54.737] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:20:54.738] INFO sqlite@v1.5.5/migrator.go:413 [563.6µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:20:54.738] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:20:54.739] INFO sqlite@v1.5.5/migrator.go:423 [614.9µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:20:54.740] INFO sqlite@v1.5.5/migrator.go:423 [1.0825ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:20:54.745] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:20:54.745] INFO migrator/migrator.go:73 [101µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:54.745] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:20:54.746] INFO sqlite@v1.5.5/migrator.go:79 [506.5µs] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:54.746] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:20:54.747] INFO sqlite@v1.5.5/migrator.go:413 [560.4µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:20:54.747] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:20:54.747] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:20:54.749] INFO sqlite@v1.5.5/migrator.go:423 [1.6629ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:20:54.752] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:20:54.752] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:54.753] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:20:54.753] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:54.753] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:54.754] INFO sqlite@v1.5.5/migrator.go:413 [607.1µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:54.754] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:54.754] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:54.756] INFO sqlite@v1.5.5/migrator.go:423 [1.112ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:54.758] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:20:54.758] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:20:54.759] INFO sqlite@v1.5.5/migrator.go:413 [567.2µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:20:54.759] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:20:54.759] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:20:54.760] INFO sqlite@v1.5.5/migrator.go:423 [1.5239ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:20:54.762] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:20:54.762] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:20:54.762] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:20:54.762] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:20:54.762] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:20:54.763] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:20:55.687] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:20:55.690] INFO repository/system.go:59 [1.7845ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("3fef88f544b64bbf8852ea9ca55e9930","2024-03-08 09:20:55","2024-03-08 09:20:55","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:20:55.692] INFO repository/server.go:40 [2.4339ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("8748d33f5aa34720a213ca4b30519bf6","2024-03-08 09:20:55","2024-03-08 09:20:55","10.10.10.1/24",51820,"SFBHgQj2/zYloRAkqQcV8TqXL6ebTItyk8ml+UQ0TEg=","CmFgadC0yECvJydQXjs8GHahufpVeXdJpc3tv02CnBI=","","","")
[2024-03-08 09:20:58.583] ERROR component/wireguard.go:22 解析模板信息失败
[2024-03-08 09:21:09.546] ERROR script/db_migrate.go:170 应用配置文件失败: open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:21:09.546] ERROR script/db_migrate.go:33 open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:21:17.356] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:21:17.368] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:17.369] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:21:17.369] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:17.369] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:21:17.370] INFO sqlite@v1.5.5/migrator.go:413 [668.2µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:21:17.371] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:21:17.372] INFO sqlite@v1.5.5/migrator.go:423 [533µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:21:17.373] INFO sqlite@v1.5.5/migrator.go:423 [1.113ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:21:17.374] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:17.375] INFO sqlite@v1.5.5/migrator.go:368 [955.1µs] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:21:17.375] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:21:17.375] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:21:17.377] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:21:17.378] INFO sqlite@v1.5.5/migrator.go:423 [1.1367ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:21:17.379] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:21:17.379] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:17.380] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:21:17.380] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:17.380] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:21:17.382] INFO sqlite@v1.5.5/migrator.go:413 [1.0713ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:21:17.382] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:21:17.383] INFO sqlite@v1.5.5/migrator.go:423 [1.0545ms] [rows:1] DROP TABLE `t_wg_server`
[2024-03-08 09:21:17.384] INFO sqlite@v1.5.5/migrator.go:423 [1.0104ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:21:17.385] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:21:17.385] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:17.386] INFO sqlite@v1.5.5/migrator.go:125 [53.6µs] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:21:17.386] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:17.386] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:21:17.387] INFO sqlite@v1.5.5/migrator.go:413 [62.6µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:21:17.387] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:21:17.388] INFO sqlite@v1.5.5/migrator.go:423 [1.0805ms] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:21:17.390] INFO sqlite@v1.5.5/migrator.go:423 [1.0976ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:21:17.391] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:17.392] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:21:17.393] INFO sqlite@v1.5.5/migrator.go:413 [1.1013ms] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:21:17.393] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:21:17.393] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:21:17.394] INFO sqlite@v1.5.5/migrator.go:423 [1.0939ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:21:17.396] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:21:17.396] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:21:17.397] INFO migrator/migrator.go:73 [60.3µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:17.397] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:21:17.397] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:21:17.397] INFO script/db_migrate.go:97 [528.6µs] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:21:28.579] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:21:28.591] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:28.591] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:21:28.591] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:28.591] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:21:28.593] INFO sqlite@v1.5.5/migrator.go:413 [1.0769ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:21:28.593] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:21:28.593] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:21:28.594] INFO sqlite@v1.5.5/migrator.go:423 [1.0884ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:21:28.597] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:28.597] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:21:28.598] INFO sqlite@v1.5.5/migrator.go:413 [655µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:21:28.598] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:21:28.599] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:21:28.600] INFO sqlite@v1.5.5/migrator.go:423 [1.1685ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:21:28.602] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:21:28.603] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:28.603] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:21:28.603] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:28.603] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:21:28.605] INFO sqlite@v1.5.5/migrator.go:413 [614.8µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:21:28.605] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:21:28.605] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:21:28.606] INFO sqlite@v1.5.5/migrator.go:423 [1.1621ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:21:28.609] INFO sqlite@v1.5.5/migrator.go:32 [51.8µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:21:28.609] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:28.609] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:21:28.609] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:28.609] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:21:28.610] INFO sqlite@v1.5.5/migrator.go:413 [623.2µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:21:28.611] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:21:28.611] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:21:28.612] INFO sqlite@v1.5.5/migrator.go:423 [1.1123ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:21:28.614] INFO sqlite@v1.5.5/migrator.go:79 [508.2µs] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:21:28.614] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:21:28.616] INFO sqlite@v1.5.5/migrator.go:413 [617.1µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:21:28.616] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:21:28.616] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:21:28.617] INFO sqlite@v1.5.5/migrator.go:423 [1.1735ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:21:28.619] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:21:28.619] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:21:28.620] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:21:28.620] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:21:28.620] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:21:28.620] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:21:29.887] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:21:29.891] INFO repository/system.go:59 [2.9817ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("b452319baeb148cdaacce8b9a328ae37","2024-03-08 09:21:29","2024-03-08 09:21:29","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:21:29.894] INFO repository/server.go:40 [2.3509ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("f724e63d07ea43478ca8303ddea1eaed","2024-03-08 09:21:29","2024-03-08 09:21:29","10.10.10.1/24",51820,"2KP+1XnchdCOff5gQDMMCQY9PZehZfy/z8/x61F6B30=","fN4iadK7qCEU7QEHVeRWTEJGQAJaSqKI585UEXXocH4=","","","")
[2024-03-08 09:21:45.125] ERROR component/wireguard.go:22 解析模板信息失败
[2024-03-08 09:21:45.126] ERROR script/db_migrate.go:170 应用配置文件失败: open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:21:45.126] ERROR script/db_migrate.go:33 open E:\Workspace\Go\wireguard-dashboard\template_data\wg.conf: The system cannot find the path specified.
[2024-03-08 09:22:05.676] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:22:05.689] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:22:05.690] INFO sqlite@v1.5.5/migrator.go:125 [547.9µs] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:22:05.690] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:22:05.690] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:22:05.692] INFO sqlite@v1.5.5/migrator.go:413 [1.0786ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:22:05.692] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:22:05.693] INFO sqlite@v1.5.5/migrator.go:423 [584µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:22:05.694] INFO sqlite@v1.5.5/migrator.go:423 [1.0356ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:22:05.696] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:22:05.696] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:22:05.697] INFO sqlite@v1.5.5/migrator.go:413 [515µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:22:05.697] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:22:05.698] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:22:05.699] INFO sqlite@v1.5.5/migrator.go:423 [1.0299ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:22:05.702] INFO sqlite@v1.5.5/migrator.go:32 [1.0031ms] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:22:05.702] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:22:05.702] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:22:05.702] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:22:05.702] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:22:05.703] INFO sqlite@v1.5.5/migrator.go:413 [1.0038ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:22:05.703] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:22:05.703] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:22:05.705] INFO sqlite@v1.5.5/migrator.go:423 [999.7µs] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:22:05.707] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:22:05.707] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:22:05.707] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:22:05.707] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:22:05.708] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:22:05.709] INFO sqlite@v1.5.5/migrator.go:413 [999.3µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:22:05.709] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:22:05.709] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:22:05.710] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:22:05.713] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:22:05.713] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:22:05.714] INFO sqlite@v1.5.5/migrator.go:413 [519.2µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:22:05.714] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:22:05.714] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:22:05.715] INFO sqlite@v1.5.5/migrator.go:423 [1.0653ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:22:05.717] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:22:05.717] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:22:05.717] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:22:05.717] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:22:05.718] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:22:05.718] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:22:06.664] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:22:06.667] INFO repository/system.go:59 [2.5373ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("30f27e4fe34d492ca83e8668a50cf5aa","2024-03-08 09:22:06","2024-03-08 09:22:06","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:22:06.669] INFO repository/server.go:40 [2.1792ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("c367ce3a2aab4e538fd5036ae41b311f","2024-03-08 09:22:06","2024-03-08 09:22:06","10.10.10.1/24",51820,"AF1pWGsvlk8qQDFim2CdijKV7k7UaPH7NSXH+XLthFE=","yno3cnEOIS4VqL0rlYwuwyutJ8gnoupawNdp2P8WtCE=","","","")
[2024-03-08 09:24:47.302] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:24:47.314] INFO migrator/migrator.go:73 [115.2µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:24:47.314] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:24:47.315] INFO sqlite@v1.5.5/migrator.go:79 [50.8µs] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:24:47.315] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:24:47.316] INFO sqlite@v1.5.5/migrator.go:413 [1.0791ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:24:47.316] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:24:47.317] INFO sqlite@v1.5.5/migrator.go:423 [587µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:24:47.318] INFO sqlite@v1.5.5/migrator.go:423 [1.1182ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:24:47.320] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:24:47.320] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:24:47.321] INFO sqlite@v1.5.5/migrator.go:413 [1.1506ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:24:47.321] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:24:47.322] INFO sqlite@v1.5.5/migrator.go:423 [57.1µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:24:47.324] INFO sqlite@v1.5.5/migrator.go:423 [1.7001ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:24:47.325] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:24:47.325] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:24:47.326] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:24:47.326] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:24:47.326] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:24:47.327] INFO sqlite@v1.5.5/migrator.go:413 [561.1µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:24:47.328] INFO sqlite@v1.5.5/migrator.go:423 [503.5µs] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:24:47.328] INFO sqlite@v1.5.5/migrator.go:423 [551.8µs] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:24:47.330] INFO sqlite@v1.5.5/migrator.go:423 [1.6683ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:24:47.331] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:24:47.332] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:24:47.332] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:24:47.333] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:24:47.333] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:24:47.334] INFO sqlite@v1.5.5/migrator.go:413 [536.7µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:24:47.334] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:24:47.335] INFO sqlite@v1.5.5/migrator.go:423 [542.9µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:24:47.336] INFO sqlite@v1.5.5/migrator.go:423 [1.0828ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:24:47.337] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:24:47.337] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:24:47.338] INFO sqlite@v1.5.5/migrator.go:413 [543µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:24:47.339] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:24:47.340] INFO sqlite@v1.5.5/migrator.go:423 [523.3µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:24:47.341] INFO sqlite@v1.5.5/migrator.go:423 [1.1427ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:24:47.343] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:24:47.343] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:24:47.343] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:24:47.343] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:24:47.343] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:24:47.343] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:24:48.315] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:24:48.318] INFO repository/system.go:59 [2.3237ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("539e8e370e814d1b8ca99543062da551","2024-03-08 09:24:48","2024-03-08 09:24:48","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:24:48.320] INFO repository/server.go:40 [1.8171ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("3fe8d368c71a4618a56f76e72d979217","2024-03-08 09:24:48","2024-03-08 09:24:48","10.10.10.1/24",51820,"KBvpECYi88Gprzqg7zIV09pJIdgnVxR9iskRQWVhKV8=","e9BF20z+oRm5cguyYyflKcijLQ6Wwo0ep3+oCmJxCyA=","","","")
[2024-03-08 09:35:18.572] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:35:18.587] INFO migrator/migrator.go:73 [586.5µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:18.587] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:35:18.587] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:18.587] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:18.589] INFO sqlite@v1.5.5/migrator.go:413 [1.0831ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:18.589] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:18.589] INFO sqlite@v1.5.5/migrator.go:423 [503.6µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:18.591] INFO sqlite@v1.5.5/migrator.go:423 [1.146ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:18.592] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:18.593] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:18.593] INFO sqlite@v1.5.5/migrator.go:413 [524.8µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:18.594] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:18.594] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:18.595] INFO sqlite@v1.5.5/migrator.go:423 [631.8µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:18.597] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:35:18.598] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:18.598] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:35:18.598] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:18.598] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:35:18.599] INFO sqlite@v1.5.5/migrator.go:413 [1.0199ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:35:18.599] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:35:18.599] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:35:18.601] INFO sqlite@v1.5.5/migrator.go:423 [1.8108ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:35:18.602] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:35:18.602] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:18.602] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:35:18.602] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:18.603] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:18.603] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:18.603] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:18.605] INFO sqlite@v1.5.5/migrator.go:423 [1.5083ms] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:18.606] INFO sqlite@v1.5.5/migrator.go:423 [1.0081ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:18.607] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:18.607] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:18.608] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:18.609] INFO sqlite@v1.5.5/migrator.go:423 [999.9µs] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:18.609] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:18.610] INFO sqlite@v1.5.5/migrator.go:423 [1.0998ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:18.612] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:35:18.613] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:35:18.613] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:18.613] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:35:18.613] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:35:18.613] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:35:19.561] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:35:19.566] INFO repository/system.go:59 [3.7972ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("b674361b45ac452ea8de47737fcda2c5","2024-03-08 09:35:19","2024-03-08 09:35:19","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:35:19.569] INFO repository/server.go:40 [2.332ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("e1453df18e0a4a8f9ece360e2eea3b8a","2024-03-08 09:35:19","2024-03-08 09:35:19","10.10.10.1/24",51820,"EDEq59rDY/FBEglLKjkDAIZR22TSMc4hqJ6evfknHW8=","4kYZRuixdu8KhdgVcpc7J5Gmoxt/Il94dmySGNj2mBo=","","","")
[2024-03-08 09:35:43.418] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:35:43.431] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:43.431] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:35:43.431] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:43.432] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:43.433] INFO sqlite@v1.5.5/migrator.go:413 [999.7µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:43.434] INFO sqlite@v1.5.5/migrator.go:423 [502.5µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:43.434] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:43.435] INFO sqlite@v1.5.5/migrator.go:423 [1.0027ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:43.437] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:43.437] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:43.438] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:43.438] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:43.439] INFO sqlite@v1.5.5/migrator.go:423 [503.8µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:43.441] INFO sqlite@v1.5.5/migrator.go:423 [2.0957ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:43.443] INFO sqlite@v1.5.5/migrator.go:32 [518.9µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:35:43.443] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:43.443] INFO sqlite@v1.5.5/migrator.go:125 [519.7µs] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:35:43.443] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:43.443] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:35:43.444] INFO sqlite@v1.5.5/migrator.go:413 [517.8µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:35:43.444] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:35:43.445] INFO sqlite@v1.5.5/migrator.go:423 [520.1µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-08 09:35:43.447] INFO sqlite@v1.5.5/migrator.go:423 [1.5518ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:35:43.448] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:35:43.449] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:43.449] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:35:43.449] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:43.449] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:43.450] INFO sqlite@v1.5.5/migrator.go:413 [550.7µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:43.451] INFO sqlite@v1.5.5/migrator.go:423 [518.7µs] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:43.451] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:43.452] INFO sqlite@v1.5.5/migrator.go:423 [1.0361ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:43.453] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:43.453] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:43.455] INFO sqlite@v1.5.5/migrator.go:413 [558µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:43.455] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:43.455] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:43.457] INFO sqlite@v1.5.5/migrator.go:423 [1.5581ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:43.459] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:35:43.459] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:35:43.459] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:43.460] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:35:43.460] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:35:43.460] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:35:54.435] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:35:54.448] INFO migrator/migrator.go:73 [64.3µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:54.448] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:35:54.448] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:54.448] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:54.450] INFO sqlite@v1.5.5/migrator.go:413 [744.5µs] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:54.450] INFO sqlite@v1.5.5/migrator.go:423 [74.7µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:54.450] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:54.452] INFO sqlite@v1.5.5/migrator.go:423 [1.1808ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:54.455] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:54.455] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:35:54.457] INFO sqlite@v1.5.5/migrator.go:413 [1.111ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:35:54.457] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:35:54.457] INFO sqlite@v1.5.5/migrator.go:423 [590.6µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:35:54.458] INFO sqlite@v1.5.5/migrator.go:423 [1.0854ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:35:54.460] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:35:54.460] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:54.460] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:35:54.460] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:54.460] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:35:54.461] INFO sqlite@v1.5.5/migrator.go:413 [545.7µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:35:54.461] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:35:54.462] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:35:54.463] INFO sqlite@v1.5.5/migrator.go:423 [1.1936ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:35:54.464] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:35:54.465] INFO migrator/migrator.go:73 [531.7µs] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:54.465] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:35:54.465] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:54.465] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:54.467] INFO sqlite@v1.5.5/migrator.go:413 [639.3µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:54.467] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:54.467] INFO sqlite@v1.5.5/migrator.go:423 [538µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:54.468] INFO sqlite@v1.5.5/migrator.go:423 [678.4µs] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:54.470] INFO sqlite@v1.5.5/migrator.go:79 [1.0038ms] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:35:54.470] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:35:54.470] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:35:54.472] INFO sqlite@v1.5.5/migrator.go:423 [53.9µs] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:35:54.472] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:35:54.473] INFO sqlite@v1.5.5/migrator.go:423 [1.0981ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:35:54.474] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:35:54.474] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:35:54.475] INFO migrator/migrator.go:73 [1.0037ms] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:35:54.475] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:35:54.475] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:35:54.475] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:35:55.409] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:35:55.412] INFO repository/system.go:59 [2.7994ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("c2efea9af3a648f4b9260d50a91054ff","2024-03-08 09:35:55","2024-03-08 09:35:55","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:35:55.415] INFO repository/server.go:40 [1.6153ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("66c03038ef9a4a18966eb03d928e1e5b","2024-03-08 09:35:55","2024-03-08 09:35:55","10.10.10.1/24",51820,"qGcIYQctyqQC9ErdE3057morVMgrv6pFkjZiJu0A7lk=","90N+Ybtuum7D+0ec8qGg7k357ZWcp/4UZW/LLGmLVQI=","","","")
[2024-03-08 09:36:13.647] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:36:13.661] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:13.661] INFO sqlite@v1.5.5/migrator.go:125 [541.6µs] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:36:13.661] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:13.661] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:13.663] INFO sqlite@v1.5.5/migrator.go:413 [1.1599ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:13.663] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:13.664] INFO sqlite@v1.5.5/migrator.go:423 [593.9µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:13.665] INFO sqlite@v1.5.5/migrator.go:423 [1.0804ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:13.666] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:13.667] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:13.668] INFO sqlite@v1.5.5/migrator.go:413 [1.0488ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:13.668] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:13.668] INFO sqlite@v1.5.5/migrator.go:423 [520.4µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:13.671] INFO sqlite@v1.5.5/migrator.go:423 [2.1161ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:13.673] INFO sqlite@v1.5.5/migrator.go:32 [528.2µs] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:36:13.673] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:13.673] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:36:13.673] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:13.673] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:36:13.674] INFO sqlite@v1.5.5/migrator.go:413 [522.9µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:36:13.674] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:36:13.675] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_wg_server`
[2024-03-08 09:36:13.677] INFO sqlite@v1.5.5/migrator.go:423 [2.1047ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:36:13.679] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:36:13.679] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:13.679] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:36:13.679] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:13.679] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:13.681] INFO sqlite@v1.5.5/migrator.go:413 [519.6µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:13.681] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:13.681] INFO sqlite@v1.5.5/migrator.go:423 [519.9µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:13.682] INFO sqlite@v1.5.5/migrator.go:423 [1.0556ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:13.685] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:13.685] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:13.686] INFO sqlite@v1.5.5/migrator.go:413 [552.7µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:13.687] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:13.687] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:13.689] INFO sqlite@v1.5.5/migrator.go:423 [1.6173ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:13.690] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:36:13.690] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:36:13.690] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:13.692] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:36:13.692] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:36:13.692] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:36:24.642] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:36:24.655] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:24.655] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:36:24.656] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:24.656] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:24.658] INFO sqlite@v1.5.5/migrator.go:413 [2.0004ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:24.658] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:24.658] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:24.660] INFO sqlite@v1.5.5/migrator.go:423 [1.0004ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:24.661] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:24.662] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:24.663] INFO sqlite@v1.5.5/migrator.go:413 [999.2µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:24.663] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:24.664] INFO sqlite@v1.5.5/migrator.go:423 [999µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:24.665] INFO sqlite@v1.5.5/migrator.go:423 [1.5062ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:24.666] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:36:24.666] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:24.666] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:36:24.668] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:24.668] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:36:24.669] INFO sqlite@v1.5.5/migrator.go:413 [1.0027ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:36:24.669] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:36:24.669] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:36:24.671] INFO sqlite@v1.5.5/migrator.go:423 [1.9994ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:36:24.672] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:36:24.672] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:24.673] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:36:24.673] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:24.673] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:24.674] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:24.674] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:24.674] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:24.677] INFO sqlite@v1.5.5/migrator.go:423 [2.9588ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:24.679] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:24.679] INFO sqlite@v1.5.5/migrator.go:368 [538.5µs] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:24.680] INFO sqlite@v1.5.5/migrator.go:413 [550.7µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:24.680] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:24.681] INFO sqlite@v1.5.5/migrator.go:423 [526.6µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:24.682] INFO sqlite@v1.5.5/migrator.go:423 [1.0937ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:24.683] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:36:24.683] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:36:24.684] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:24.684] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:36:24.684] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:36:24.684] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:36:25.645] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:36:25.648] INFO repository/system.go:59 [2.739ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("5f839b5ecfb04703a75436dfcad1f86b","2024-03-08 09:36:25","2024-03-08 09:36:25","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:36:25.651] INFO repository/server.go:40 [2.153ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("a4883067a4c84c9d9fb03c487affb92f","2024-03-08 09:36:25","2024-03-08 09:36:25","10.10.10.1/24",51820,"aA7CQSyD5uYLKW1ehfxMvmlIcYY4Tum8sFZBcsWTfWc=","1QjJw+r67RQDsV9mizOUZe9O/tS0dEpcNcuvQapX0iw=","","","")
[2024-03-08 09:36:46.102] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:36:46.115] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:46.115] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:36:46.115] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:46.115] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:46.117] INFO sqlite@v1.5.5/migrator.go:413 [1.5734ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:46.118] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:46.118] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:46.119] INFO sqlite@v1.5.5/migrator.go:423 [999.5µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:46.123] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:46.123] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:36:46.124] INFO sqlite@v1.5.5/migrator.go:413 [1.0089ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:36:46.124] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:36:46.124] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:36:46.125] INFO sqlite@v1.5.5/migrator.go:423 [1.5077ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:36:46.127] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:36:46.127] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:46.128] INFO sqlite@v1.5.5/migrator.go:125 [1ms] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:36:46.128] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:46.128] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:36:46.129] INFO sqlite@v1.5.5/migrator.go:413 [1.0004ms] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:36:46.129] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:36:46.129] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:36:46.130] INFO sqlite@v1.5.5/migrator.go:423 [999.1µs] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:36:46.132] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:36:46.132] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:46.133] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:36:46.133] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:46.133] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:46.134] INFO sqlite@v1.5.5/migrator.go:413 [1.0097ms] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:46.134] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:46.135] INFO sqlite@v1.5.5/migrator.go:423 [991µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:46.136] INFO sqlite@v1.5.5/migrator.go:423 [1.0533ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:46.138] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:36:46.138] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:36:46.139] INFO sqlite@v1.5.5/migrator.go:413 [545.4µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:36:46.140] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:36:46.140] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:36:46.141] INFO sqlite@v1.5.5/migrator.go:423 [1.1745ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:36:46.143] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:36:46.143] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:36:46.144] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:36:46.144] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:36:46.144] INFO script/db_migrate.go:60 [546.6µs] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:36:46.144] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:36:47.060] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:36:47.063] INFO repository/system.go:59 [2.617ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("60ede467a2b64392b2349d13846776c3","2024-03-08 09:36:47","2024-03-08 09:36:47","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:36:47.066] INFO repository/server.go:40 [2.5997ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("ed9b6cd8e5ec435897dd19b312c2c803","2024-03-08 09:36:47","2024-03-08 09:36:47","10.10.10.1/24",51820,"WD8Tj6xmOw4cfB2qLjKgcPfzAwQaeO8v+u6IVQ9r8Ww=","/+vSGX3ks7NSItSsoEDRCQT7SalKDOcDoA3SHuRRkWc=","","","")
[2024-03-08 09:42:07.913] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 09:42:07.930] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:42:07.930] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 09:42:07.931] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:42:07.931] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:42:07.932] INFO sqlite@v1.5.5/migrator.go:413 [1.0506ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:42:07.932] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:42:07.932] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:42:07.934] INFO sqlite@v1.5.5/migrator.go:423 [505µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:42:07.937] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:42:07.938] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 09:42:07.939] INFO sqlite@v1.5.5/migrator.go:413 [1.344ms] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 09:42:07.939] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 09:42:07.940] INFO sqlite@v1.5.5/migrator.go:423 [997.8µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 09:42:07.941] INFO sqlite@v1.5.5/migrator.go:423 [999.3µs] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 09:42:07.943] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 09:42:07.943] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:42:07.944] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 09:42:07.944] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:42:07.944] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 09:42:07.946] INFO sqlite@v1.5.5/migrator.go:413 [999.2µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 09:42:07.946] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 09:42:07.946] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_server`
[2024-03-08 09:42:07.948] INFO sqlite@v1.5.5/migrator.go:423 [1.0024ms] [rows:0] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 09:42:07.951] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 09:42:07.952] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:42:07.952] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 09:42:07.952] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:42:07.952] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:42:07.954] INFO sqlite@v1.5.5/migrator.go:413 [0s] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:42:07.954] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:42:07.955] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:42:07.956] INFO sqlite@v1.5.5/migrator.go:423 [999.1µs] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:42:07.957] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 09:42:07.957] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 09:42:07.959] INFO sqlite@v1.5.5/migrator.go:413 [1.0033ms] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 09:42:07.959] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 09:42:07.960] INFO sqlite@v1.5.5/migrator.go:423 [1.0012ms] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 09:42:07.961] INFO sqlite@v1.5.5/migrator.go:423 [997.4µs] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 09:42:07.964] INFO sqlite@v1.5.5/migrator.go:219 [998µs] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 09:42:07.964] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 09:42:07.964] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 09:42:07.964] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 09:42:07.964] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 09:42:07.965] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`
[2024-03-08 09:42:09.002] ERROR repository/system.go:28 record not found -> SELECT * FROM `t_setting` WHERE code = "SERVER_SETTING" ORDER BY `t_setting`.`id` LIMIT 1
[2024-03-08 09:42:09.005] INFO repository/system.go:59 [2.1716ms] [rows:1] INSERT INTO `t_setting` (`id`,`created_at`,`updated_at`,`code`,`data`,`describe`) VALUES ("bf270b8d670543b78b086c5af0e5fba3","2024-03-08 09:42:09","2024-03-08 09:42:09","SERVER_SETTING","{""MTU"":1450,""configFilePath"":""/etc/wireguard/wg0.conf"",""dnsServer"":""10.10.10.1/24"",""endpointAddress"":""222.183.237.53"",""firewallMark"":"""",""persistentKeepalive"":15,""table"":""""}","服务端全局配置")
[2024-03-08 09:42:09.007] INFO repository/server.go:40 [2.2008ms] [rows:1] INSERT INTO `t_wg_server` (`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) VALUES ("a2e2473f82f04974bf01a92c13a87dc9","2024-03-08 09:42:09","2024-03-08 09:42:09","10.10.10.1/24",51820,"cGdK/42YvQF4Nry6IdLmi28XSgqA2+i8rVF/SDj6glM=","FP5VPamqJsDGFDqua5SOgvVMUjrJgKOVGhuR7a9CHgg=","","","")
[2024-03-08 10:42:12.116] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_user"
[2024-03-08 10:42:12.130] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_user" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 10:42:12.131] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_user` LIMIT 1
[2024-03-08 10:42:12.131] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 10:42:12.131] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 10:42:12.132] INFO sqlite@v1.5.5/migrator.go:413 [1.0456ms] [rows:0] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 10:42:12.133] INFO sqlite@v1.5.5/migrator.go:423 [530.4µs] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 10:42:12.133] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] DROP TABLE `t_user`
[2024-03-08 10:42:12.134] INFO sqlite@v1.5.5/migrator.go:423 [1.0653ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 10:42:12.136] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 10:42:12.137] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_user" AND name = "t_user"
[2024-03-08 10:42:12.138] INFO sqlite@v1.5.5/migrator.go:413 [549.9µs] [rows:1] CREATE TABLE `t_user__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`avatar` varchar(255) NOT NULL,`name` varchar(50) NOT NULL,`account` varchar(50) NOT NULL,`email` varchar(255),`password` varchar(255) NOT NULL,`is_admin` int(1) NOT NULL,`status` tinyint(1) NOT NULL,PRIMARY KEY (`id`))
[2024-03-08 10:42:12.138] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_user__temp`(`id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status`) SELECT `id`,`created_at`,`updated_at`,`avatar`,`name`,`account`,`email`,`password`,`is_admin`,`status` FROM `t_user`
[2024-03-08 10:42:12.138] INFO sqlite@v1.5.5/migrator.go:423 [519.8µs] [rows:1] DROP TABLE `t_user`
[2024-03-08 10:42:12.140] INFO sqlite@v1.5.5/migrator.go:423 [2.1099ms] [rows:1] ALTER TABLE `t_user__temp` RENAME TO `t_user`
[2024-03-08 10:42:12.142] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_server"
[2024-03-08 10:42:12.142] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_server" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 10:42:12.143] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_server` LIMIT 1
[2024-03-08 10:42:12.143] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 10:42:12.143] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_server" AND name = "t_wg_server"
[2024-03-08 10:42:12.144] INFO sqlite@v1.5.5/migrator.go:413 [525.3µs] [rows:1] CREATE TABLE `t_wg_server__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`ip_scope` varchar(30) NOT NULL,`listen_port` int(10) NOT NULL,`private_key` text NOT NULL,`public_key` text NOT NULL,`post_up_script` text,`pre_down_script` text,`post_down_script` text,PRIMARY KEY (`id`))
[2024-03-08 10:42:12.145] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:1] INSERT INTO `t_wg_server__temp`(`id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script`) SELECT `id`,`created_at`,`updated_at`,`ip_scope`,`listen_port`,`private_key`,`public_key`,`post_up_script`,`pre_down_script`,`post_down_script` FROM `t_wg_server`
[2024-03-08 10:42:12.145] INFO sqlite@v1.5.5/migrator.go:423 [528µs] [rows:1] DROP TABLE `t_wg_server`
[2024-03-08 10:42:12.147] INFO sqlite@v1.5.5/migrator.go:423 [1.6428ms] [rows:1] ALTER TABLE `t_wg_server__temp` RENAME TO `t_wg_server`
[2024-03-08 10:42:12.149] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_wg_client"
[2024-03-08 10:42:12.149] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_wg_client" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 10:42:12.149] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_wg_client` LIMIT 1
[2024-03-08 10:42:12.149] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 10:42:12.149] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 10:42:12.150] INFO sqlite@v1.5.5/migrator.go:413 [538.7µs] [rows:1] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 10:42:12.151] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 10:42:12.151] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 10:42:12.153] INFO sqlite@v1.5.5/migrator.go:423 [1.0712ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 10:42:12.155] INFO sqlite@v1.5.5/migrator.go:79 [0s] [rows:1] PRAGMA foreign_keys
[2024-03-08 10:42:12.155] INFO sqlite@v1.5.5/migrator.go:368 [0s] [-] SELECT sql FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND name = "t_wg_client"
[2024-03-08 10:42:12.156] INFO sqlite@v1.5.5/migrator.go:413 [552.3µs] [rows:0] CREATE TABLE `t_wg_client__temp` (`id` varchar(36) NOT NULL,`created_at` datetime,`updated_at` datetime,`server_id` varchar(36) NOT NULL,`name` varchar(100) NOT NULL,`email` varchar(100),`subnet_range` varchar(255),`ip_allocation` varchar(30) NOT NULL,`allowed_ips` varchar(30) NOT NULL,`extra_allowed_ips` varchar(30),`endpoint` varchar(255),`use_server_dns` int(1),`enable_after_creation` int(1),`keys` text,`user_id` char(36) NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_t_wg_server_clients` FOREIGN KEY (`server_id`) REFERENCES `t_wg_server`(`id`))
[2024-03-08 10:42:12.156] INFO sqlite@v1.5.5/migrator.go:423 [0s] [rows:0] INSERT INTO `t_wg_client__temp`(`id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id`) SELECT `id`,`created_at`,`updated_at`,`server_id`,`name`,`email`,`subnet_range`,`ip_allocation`,`allowed_ips`,`extra_allowed_ips`,`endpoint`,`use_server_dns`,`enable_after_creation`,`keys`,`user_id` FROM `t_wg_client`
[2024-03-08 10:42:12.156] INFO sqlite@v1.5.5/migrator.go:423 [524.1µs] [rows:0] DROP TABLE `t_wg_client`
[2024-03-08 10:42:12.158] INFO sqlite@v1.5.5/migrator.go:423 [1.6216ms] [rows:0] ALTER TABLE `t_wg_client__temp` RENAME TO `t_wg_client`
[2024-03-08 10:42:12.160] INFO sqlite@v1.5.5/migrator.go:219 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type = "table" AND tbl_name = "t_wg_client" AND (sql LIKE "%CONSTRAINT ""fk_t_wg_server_clients"" %" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %" OR sql LIKE "%CONSTRAINT `fk_t_wg_server_clients`%" OR sql LIKE "%CONSTRAINT [fk_t_wg_server_clients]%" OR sql LIKE "%CONSTRAINT fk_t_wg_server_clients %")
[2024-03-08 10:42:12.160] INFO sqlite@v1.5.5/migrator.go:32 [0s] [-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="t_setting"
[2024-03-08 10:42:12.160] INFO migrator/migrator.go:73 [0s] [rows:1] SELECT sql FROM sqlite_master WHERE type IN ("table","index") AND tbl_name = "t_setting" AND sql IS NOT NULL order by type = "table" desc
[2024-03-08 10:42:12.160] INFO sqlite@v1.5.5/migrator.go:125 [0s] [-] SELECT * FROM `t_setting` LIMIT 1
[2024-03-08 10:42:12.160] INFO script/db_migrate.go:60 [0s] [rows:1] SELECT count(*) FROM `t_user` WHERE is_admin = 1
[2024-03-08 10:42:12.160] INFO script/db_migrate.go:97 [0s] [rows:1] SELECT count(*) FROM `t_wg_server`

View File

@ -0,0 +1,21 @@
package template_data
type Server struct {
Address string `json:"address"`
ListenPort int `json:"listenPort"`
PrivateKey string `json:"privateKey"`
MTU int `json:"mtu"`
PostUp string `json:"postUp"`
PreDown string `json:"preDown"`
PostDown string `json:"postDown"`
Table string `json:"table"`
Clients []Client `json:"clients"`
}
type Client struct {
PublicKey string `json:"publicKey"`
PresharedKey string `json:"presharedKey"`
AllowedIPS string `json:"allowedIps"`
PersistentKeepalive string `json:"persistentKeepalive"`
Endpoint string `json:"endpoint"`
}

View File

@ -3,11 +3,13 @@ package script
import ( import (
"encoding/json" "encoding/json"
"gitee.ltd/lxh/logger/log" "gitee.ltd/lxh/logger/log"
"github.com/spf13/cast"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"wireguard-dashboard/client" "wireguard-dashboard/client"
"wireguard-dashboard/component" "wireguard-dashboard/component"
"wireguard-dashboard/constant" "wireguard-dashboard/constant"
"wireguard-dashboard/model/entity" "wireguard-dashboard/model/entity"
"wireguard-dashboard/model/template_data"
"wireguard-dashboard/repository" "wireguard-dashboard/repository"
"wireguard-dashboard/utils" "wireguard-dashboard/utils"
) )
@ -130,9 +132,7 @@ func (s Script) InitServer() error {
// 根据密钥生成公钥 // 根据密钥生成公钥
publicKey := privateKey.PublicKey() publicKey := privateKey.PublicKey()
serverEnt := &entity.Server{
// 没有服务端,开始初始化
if err := repository.Server().Save(&entity.Server{
IpScope: "10.10.10.1/24", IpScope: "10.10.10.1/24",
ListenPort: 51820, ListenPort: 51820,
PrivateKey: privateKey.String(), PrivateKey: privateKey.String(),
@ -140,13 +140,32 @@ func (s Script) InitServer() error {
PostUpScript: "", PostUpScript: "",
PreDownScript: "", PreDownScript: "",
PostDownScript: "", PostDownScript: "",
}); err != nil { }
// 没有服务端,开始初始化
if err := repository.Server().Save(serverEnt); err != nil {
return err return err
} }
// 处理一下要渲染到配置文件上的数据
serverConfig := template_data.Server{
Address: serverEnt.IpScope,
ListenPort: serverEnt.ListenPort,
PrivateKey: serverEnt.PrivateKey,
MTU: cast.ToInt(data["MTU"]),
PostUp: serverEnt.PostUpScript,
PreDown: serverEnt.PreDownScript,
PostDown: serverEnt.PostDownScript,
Table: cast.ToString(data["table"]),
}
execData := map[string]any{
"Server": serverConfig,
}
// 数据库保存完毕,应用配置到配置文件当中 // 数据库保存完毕,应用配置到配置文件当中
err = component.Wireguard().Apply("E:\\Workspace\\Go\\wireguard-dashboard\\template\\wg.conf", err = component.Wireguard().Apply("E:\\Workspace\\Go\\wireguard-dashboard\\template\\wg.conf",
"E:\\Workspace\\Go\\wireguard-dashboard\\wg0.conf", nil) "E:\\Workspace\\Go\\wireguard-dashboard\\wg0.conf", execData)
if err != nil { if err != nil {
log.Errorf("应用配置文件失败: %v", err.Error()) log.Errorf("应用配置文件失败: %v", err.Error())
return err return err