diff --git a/server/base/cmd.go b/server/base/cmd.go
index 1fc4959..75d5f25 100644
--- a/server/base/cmd.go
+++ b/server/base/cmd.go
@@ -101,7 +101,7 @@ func initCmd() {
_, err := os.Stat(conf)
if errors.Is(err, os.ErrNotExist) {
// 没有配置文件,不做处理
- return
+ panic(err)
}
linkViper.SetConfigFile(conf)
diff --git a/server/conf/files/profile.xml b/server/conf/files/profile.xml
new file mode 100644
index 0000000..0df0912
--- /dev/null
+++ b/server/conf/files/profile.xml
@@ -0,0 +1,34 @@
+
+
+
+
+ false
+ false
+ false
+ IPSec
+ true
+ AllowRemoteUsers
+ AllowRemoteUsers
+ pinAllowed
+
+
+ Digital_Signature
+
+
+ ClientAuth
+
+
+
+
+ localhost
+
+
+
+
+
+ VPN Server
+ localhost
+
+
+
\ No newline at end of file
diff --git a/server/handler/link_auth.go b/server/handler/link_auth.go
index 83781bc..9d2a6be 100644
--- a/server/handler/link_auth.go
+++ b/server/handler/link_auth.go
@@ -19,7 +19,7 @@ func LinkAuth(w http.ResponseWriter, r *http.Request) {
userAgent := strings.ToLower(r.UserAgent())
xAggregateAuth := r.Header.Get("X-Aggregate-Auth")
xTranscendVersion := r.Header.Get("X-Transcend-Version")
- if !((strings.Contains(userAgent, "anyconnect") || strings.Contains(userAgent, "openconnect")) &&
+ if !((strings.Contains(userAgent, "anyconnect") || strings.Contains(userAgent, "openconnect")) &&
xAggregateAuth == "1" && xTranscendVersion == "1") {
w.WriteHeader(http.StatusForbidden)
fmt.Fprintf(w, "error request")
@@ -176,7 +176,7 @@ var auth_complete = `
- /profile.xml
+ /files/profile.xml
A8B0B07FBA93D06E8501E40AB807AEE2464E73B7
diff --git a/server/handler/server.go b/server/handler/server.go
index 8584cef..aef9fb1 100644
--- a/server/handler/server.go
+++ b/server/handler/server.go
@@ -77,9 +77,9 @@ func initRoute() http.Handler {
r.HandleFunc("/", LinkAuth).Methods(http.MethodPost)
r.HandleFunc("/CSCOSSLC/tunnel", LinkTunnel).Methods(http.MethodConnect)
r.HandleFunc("/otp_qr", LinkOtpQr).Methods(http.MethodGet)
- r.HandleFunc("/profile.xml", func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte(auth_profile))
- }).Methods(http.MethodGet)
+ // r.HandleFunc("/profile.xml", func(w http.ResponseWriter, r *http.Request) {
+ // w.Write([]byte(auth_profile))
+ // }).Methods(http.MethodGet)
r.PathPrefix("/files/").Handler(
http.StripPrefix("/files/",
http.FileServer(http.Dir(base.Cfg.FilesPath)),
diff --git a/systemd/anylink.service b/systemd/anylink.service
index 59c62d3..9f1fe68 100644
--- a/systemd/anylink.service
+++ b/systemd/anylink.service
@@ -9,7 +9,7 @@ User=root
WorkingDirectory=/usr/local/anylink-deploy
Restart=on-failure
RestartSec=5s
-ExecStart=/usr/local/anylink-deploy/anylink --conf=./conf/server.toml
+ExecStart=/usr/local/anylink-deploy/anylink --conf=/usr/local/anylink-deploy/conf/server.toml
[Install]
WantedBy=multi-user.target