vk-ssl-auto-deploy 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +1 -0
- package/package.json +1 -1
- package/views/admin.ejs +35 -0
package/app.js
CHANGED
|
@@ -58,6 +58,7 @@ server.listen(port, host, () => {
|
|
|
58
58
|
console.log('listenPort:', port);
|
|
59
59
|
console.log('管理后台地址: http://' + (host === '0.0.0.0' ? 'localhost' : host) + ':' + port + '/admin');
|
|
60
60
|
console.log(`管理后台口令: ${config.password}`);
|
|
61
|
+
console.log('证书接收接口: http://' + (host === '0.0.0.0' ? 'localhost' : host) + ':' + port + '/api/cert/callback');
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
// 导出应用
|
package/package.json
CHANGED
package/views/admin.ejs
CHANGED
|
@@ -620,6 +620,15 @@
|
|
|
620
620
|
</button>
|
|
621
621
|
</div>
|
|
622
622
|
|
|
623
|
+
<div style="margin-top: 30px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.05);">
|
|
624
|
+
<h3 style="color: #00ff88; margin-bottom: 15px; font-size: 1.2em;">证书接收API地址</h3>
|
|
625
|
+
<div style="display: flex; align-items: center; gap: 10px;">
|
|
626
|
+
<code id="callbackApiUrl" style="flex: 1; background: rgba(20, 20, 20, 0.8); padding: 10px 15px; border-radius: 6px; font-family: 'Consolas', 'Monaco', monospace; color: #00ff88; word-break: break-all; font-size: 0.9em;"></code>
|
|
627
|
+
<button onclick="copyCallbackUrl()" style="flex: none; padding: 10px 15px; min-width: auto;">复制</button>
|
|
628
|
+
</div>
|
|
629
|
+
<p class="hint" style="margin-top: 8px;">用于接收第三方推送的SSL证书</p>
|
|
630
|
+
</div>
|
|
631
|
+
|
|
623
632
|
<div style="margin-top: 30px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.05);">
|
|
624
633
|
<!-- 这里显示服务器,不是WebSocket 是为了方便用户理解 -->
|
|
625
634
|
<h3 style="color: #00ff88; margin-bottom: 15px; font-size: 1.2em;">服务器 连接状态</h3>
|
|
@@ -873,11 +882,37 @@
|
|
|
873
882
|
loadCertList();
|
|
874
883
|
connectWebSocket();
|
|
875
884
|
startScheduleInfoSync();
|
|
885
|
+
updateCallbackApiUrl();
|
|
876
886
|
|
|
877
887
|
// 搜索框事件
|
|
878
888
|
document.getElementById('certSearch').addEventListener('input', filterCerts);
|
|
879
889
|
}
|
|
880
890
|
|
|
891
|
+
// 更新证书接收API地址
|
|
892
|
+
function updateCallbackApiUrl() {
|
|
893
|
+
const protocol = window.location.protocol;
|
|
894
|
+
const host = window.location.host;
|
|
895
|
+
const apiUrl = `${protocol}//${host}/api/cert/callback`;
|
|
896
|
+
document.getElementById('callbackApiUrl').textContent = apiUrl;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// 复制证书接收API地址
|
|
900
|
+
function copyCallbackUrl() {
|
|
901
|
+
const apiUrl = document.getElementById('callbackApiUrl').textContent;
|
|
902
|
+
navigator.clipboard.writeText(apiUrl).then(() => {
|
|
903
|
+
showAlert('复制成功', '证书接收API地址已复制到剪贴板', 'success');
|
|
904
|
+
}).catch(() => {
|
|
905
|
+
// 降级方案
|
|
906
|
+
const textarea = document.createElement('textarea');
|
|
907
|
+
textarea.value = apiUrl;
|
|
908
|
+
document.body.appendChild(textarea);
|
|
909
|
+
textarea.select();
|
|
910
|
+
document.execCommand('copy');
|
|
911
|
+
document.body.removeChild(textarea);
|
|
912
|
+
showAlert('复制成功', '证书接收API地址已复制到剪贴板', 'success');
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
|
|
881
916
|
// 初始化
|
|
882
917
|
document.addEventListener('DOMContentLoaded', function() {
|
|
883
918
|
const storedPassword = getStoredPassword();
|