mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-07 12:31:44 +08:00
修改profile文件
This commit is contained in:
@@ -101,7 +101,7 @@ func initCmd() {
|
||||
_, err := os.Stat(conf)
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
// 没有配置文件,不做处理
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
linkViper.SetConfigFile(conf)
|
||||
|
34
server/conf/files/profile.xml
Normal file
34
server/conf/files/profile.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/ AnyConnectProfile.xsd">
|
||||
|
||||
<ClientInitialization>
|
||||
<UseStartBeforeLogon UserControllable="false">false</UseStartBeforeLogon>
|
||||
<StrictCertificateTrust>false</StrictCertificateTrust>
|
||||
<RestrictPreferenceCaching>false</RestrictPreferenceCaching>
|
||||
<RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols>
|
||||
<BypassDownloader>true</BypassDownloader>
|
||||
<WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>
|
||||
<LinuxVPNEstablishment>AllowRemoteUsers</LinuxVPNEstablishment>
|
||||
<CertEnrollmentPin>pinAllowed</CertEnrollmentPin>
|
||||
<CertificateMatch>
|
||||
<KeyUsage>
|
||||
<MatchKey>Digital_Signature</MatchKey>
|
||||
</KeyUsage>
|
||||
<ExtendedKeyUsage>
|
||||
<ExtendedMatchKey>ClientAuth</ExtendedMatchKey>
|
||||
</ExtendedKeyUsage>
|
||||
</CertificateMatch>
|
||||
|
||||
<BackupServerList>
|
||||
<HostAddress>localhost</HostAddress>
|
||||
</BackupServerList>
|
||||
</ClientInitialization>
|
||||
|
||||
<ServerList>
|
||||
<HostEntry>
|
||||
<HostName>VPN Server</HostName>
|
||||
<HostAddress>localhost</HostAddress>
|
||||
</HostEntry>
|
||||
</ServerList>
|
||||
</AnyConnectProfile>
|
@@ -176,7 +176,7 @@ var auth_complete = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<vpn-profile-manifest>
|
||||
<vpn rev="1.0">
|
||||
<file type="profile" service-type="user">
|
||||
<uri>/profile.xml</uri>
|
||||
<uri>/files/profile.xml</uri>
|
||||
<hash type="sha1">A8B0B07FBA93D06E8501E40AB807AEE2464E73B7</hash>
|
||||
</file>
|
||||
</vpn>
|
||||
|
@@ -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)),
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user