From ffdd20a019548e0473da78d7fe323ea842ec7efe Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Mon, 13 Nov 2023 10:53:28 +0300 Subject: [PATCH] add ssl options to web --- README.md | 4 +- server/web/pages/template/html.go | 28 ++++++------- .../pages/template/pages/asset-manifest.json | 20 +++++----- server/web/pages/template/pages/index.html | 2 +- .../pages/static/js/runtime-main.64d07802.js | 2 - .../static/js/runtime-main.64d07802.js.map | 1 - server/web/pages/template/route.go | 28 ++++++------- web/src/components/About/index.jsx | 1 + .../Settings/SecondarySettingsComponent.jsx | 39 +++++++++++++++++++ .../components/Settings/defaultSettings.js | 3 ++ web/src/locales/bg/translation.json | 6 +++ web/src/locales/en/translation.json | 6 +++ web/src/locales/ru/translation.json | 6 +++ web/src/locales/ua/translation.json | 6 +++ web/src/locales/zh/translation.json | 6 +++ 15 files changed, 115 insertions(+), 43 deletions(-) delete mode 100644 server/web/pages/template/pages/static/js/runtime-main.64d07802.js delete mode 100644 server/web/pages/template/pages/static/js/runtime-main.64d07802.js.map diff --git a/README.md b/README.md index d8fc435..b10aa0a 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ allowing the cache size to be adjusted according to the system parameters and th ### Installation -Download the application for the required platform in the [releases](https://github.com/YouROK/TorrServer/releases) page. After installation, open the link in the browser.' +Download the application for the required platform in the [releases](https://github.com/YouROK/TorrServer/releases) page. After installation, open the link in the browser. #### Windows @@ -262,3 +262,5 @@ local:127.0.0.1 - [Anton111111 (Anton Potekhin)](https://github.com/Anton111111) - [lieranderl (Evgeni)](https://github.com/lieranderl) - [cocool97](https://github.com/cocool97) +- [shadeov](https://github.com/shadeov) +and others diff --git a/server/web/pages/template/html.go b/server/web/pages/template/html.go index 7609238..3ecfb73 100644 --- a/server/web/pages/template/html.go +++ b/server/web/pages/template/html.go @@ -118,23 +118,23 @@ var Mstile150x150png []byte //go:embed pages/site.webmanifest var Sitewebmanifest []byte -//go:embed pages/static/js/2.883fbd6e.chunk.js -var Staticjs2883fbd6echunkjs []byte +//go:embed pages/static/js/2.56a11991.chunk.js +var Staticjs256a11991chunkjs []byte -//go:embed pages/static/js/2.883fbd6e.chunk.js.LICENSE.txt -var Staticjs2883fbd6echunkjsLICENSEtxt []byte +//go:embed pages/static/js/2.56a11991.chunk.js.LICENSE.txt +var Staticjs256a11991chunkjsLICENSEtxt []byte -//go:embed pages/static/js/2.883fbd6e.chunk.js.map -var Staticjs2883fbd6echunkjsmap []byte +//go:embed pages/static/js/2.56a11991.chunk.js.map +var Staticjs256a11991chunkjsmap []byte -//go:embed pages/static/js/main.07e69ba8.chunk.js -var Staticjsmain07e69ba8chunkjs []byte +//go:embed pages/static/js/main.5883b760.chunk.js +var Staticjsmain5883b760chunkjs []byte -//go:embed pages/static/js/main.07e69ba8.chunk.js.map -var Staticjsmain07e69ba8chunkjsmap []byte +//go:embed pages/static/js/main.5883b760.chunk.js.map +var Staticjsmain5883b760chunkjsmap []byte -//go:embed pages/static/js/runtime-main.64d07802.js -var Staticjsruntimemain64d07802js []byte +//go:embed pages/static/js/runtime-main.f542387e.js +var Staticjsruntimemainf542387ejs []byte -//go:embed pages/static/js/runtime-main.64d07802.js.map -var Staticjsruntimemain64d07802jsmap []byte +//go:embed pages/static/js/runtime-main.f542387e.js.map +var Staticjsruntimemainf542387ejsmap []byte diff --git a/server/web/pages/template/pages/asset-manifest.json b/server/web/pages/template/pages/asset-manifest.json index e769031..b4d22d4 100644 --- a/server/web/pages/template/pages/asset-manifest.json +++ b/server/web/pages/template/pages/asset-manifest.json @@ -1,17 +1,17 @@ { "files": { - "main.js": "/static/js/main.07e69ba8.chunk.js", - "main.js.map": "/static/js/main.07e69ba8.chunk.js.map", - "runtime-main.js": "/static/js/runtime-main.64d07802.js", - "runtime-main.js.map": "/static/js/runtime-main.64d07802.js.map", - "static/js/2.883fbd6e.chunk.js": "/static/js/2.883fbd6e.chunk.js", - "static/js/2.883fbd6e.chunk.js.map": "/static/js/2.883fbd6e.chunk.js.map", + "main.js": "/static/js/main.5883b760.chunk.js", + "main.js.map": "/static/js/main.5883b760.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.f542387e.js", + "runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map", + "static/js/2.56a11991.chunk.js": "/static/js/2.56a11991.chunk.js", + "static/js/2.56a11991.chunk.js.map": "/static/js/2.56a11991.chunk.js.map", "index.html": "/index.html", - "static/js/2.883fbd6e.chunk.js.LICENSE.txt": "/static/js/2.883fbd6e.chunk.js.LICENSE.txt" + "static/js/2.56a11991.chunk.js.LICENSE.txt": "/static/js/2.56a11991.chunk.js.LICENSE.txt" }, "entrypoints": [ - "static/js/runtime-main.64d07802.js", - "static/js/2.883fbd6e.chunk.js", - "static/js/main.07e69ba8.chunk.js" + "static/js/runtime-main.f542387e.js", + "static/js/2.56a11991.chunk.js", + "static/js/main.5883b760.chunk.js" ] } \ No newline at end of file diff --git a/server/web/pages/template/pages/index.html b/server/web/pages/template/pages/index.html index 55f50d8..7e057d9 100644 --- a/server/web/pages/template/pages/index.html +++ b/server/web/pages/template/pages/index.html @@ -1 +1 @@ -TorrServer MatriX
\ No newline at end of file +TorrServer MatriX
\ No newline at end of file diff --git a/server/web/pages/template/pages/static/js/runtime-main.64d07802.js b/server/web/pages/template/pages/static/js/runtime-main.64d07802.js deleted file mode 100644 index e591937..0000000 --- a/server/web/pages/template/pages/static/js/runtime-main.64d07802.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c + diff --git a/web/src/components/Settings/SecondarySettingsComponent.jsx b/web/src/components/Settings/SecondarySettingsComponent.jsx index f4df837..7097476 100644 --- a/web/src/components/Settings/SecondarySettingsComponent.jsx +++ b/web/src/components/Settings/SecondarySettingsComponent.jsx @@ -34,6 +34,9 @@ export default function SecondarySettingsComponent({ settings, inputForm }) { UploadRateLimit, ConnectionsLimit, PeersListenPort, + SslPort, + SslCert, + SslKey, } = settings || {} return ( @@ -214,6 +217,42 @@ export default function SecondarySettingsComponent({ settings, inputForm }) {
+ +
+ +
+ +
) } diff --git a/web/src/components/Settings/defaultSettings.js b/web/src/components/Settings/defaultSettings.js index 878d710..0cc44c4 100644 --- a/web/src/components/Settings/defaultSettings.js +++ b/web/src/components/Settings/defaultSettings.js @@ -23,4 +23,7 @@ export default { UploadRateLimit: 0, ConnectionsLimit: 25, PeersListenPort: 0, + SslPort: 0, + SslCert: '', + SslKey: '', } diff --git a/web/src/locales/bg/translation.json b/web/src/locales/bg/translation.json index 452ab94..177d460 100644 --- a/web/src/locales/bg/translation.json +++ b/web/src/locales/bg/translation.json @@ -140,6 +140,12 @@ "RetrackersMode": "Режим за ретракери", "ResetToDefault": "Връщане по подразбиране", "Settings": "Настройки", + "SslPort": "HTTPS порт", + "SslPortHint": "По подразбиране: 8091", + "SslCert": "SSL сертификат", + "SslCertHint": "Път до SSL сертификат", + "SslKey": "SSL ключ", + "SslKeyHint": "Път до SSL ключ", "TorrentDisconnectTimeout": "Време на изчакване на връзката с торенти", "TorrentsSavePath": "Път за запазване на торенти", "Upload": "Качване", diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index 3240a14..9b53921 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -140,6 +140,12 @@ "RetrackersMode": "Retrackers Mode", "ResetToDefault": "Reset to default", "Settings": "Settings", + "SslPort": "HTTPS Port", + "SslPortHint": "Default: 8091", + "SslCert": "SSL Certificate", + "SslCertHint": "Path to SSL Certificate", + "SslKey": "SSL Key", + "SslKeyHint": "Path to SSL Key", "TorrentDisconnectTimeout": "Torrent Disconnect Timeout", "TorrentsSavePath": "Torrents Save Path", "Upload": "Upload", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index 8126360..db4b2ef 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -140,6 +140,12 @@ "RetrackersMode": "Ретрекеры", "ResetToDefault": "Настройки по умолчанию", "Settings": "Настройки", + "SslPort": "Порт для HTTPS", + "SslPortHint": "По умолчанию: 8091", + "SslCert": "SSL Сертификат", + "SslCertHint": "Путь к SSL сертификату", + "SslKey": "SSL Ключ", + "SslKeyHint": "Путь к SSL ключу", "TorrentDisconnectTimeout": "Тайм-аут отключения торрента", "TorrentsSavePath": "Путь хранения кеша", "Upload": "Отдача", diff --git a/web/src/locales/ua/translation.json b/web/src/locales/ua/translation.json index 58fa6e4..b137ac4 100644 --- a/web/src/locales/ua/translation.json +++ b/web/src/locales/ua/translation.json @@ -140,6 +140,12 @@ "RetrackersMode": "Ретрекери", "ResetToDefault": "Базові налаштування", "Settings": "Налаштування", + "SslPort": "Порт HTTPS", + "SslPortHint": "Типове значення: 8091", + "SslCert": "Сертифікат SSL", + "SslCertHint": "Шлях до сертифіката SSL", + "SslKey": "Ключ SSL", + "SslKeyHint": "Шлях до ключа SSL", "TorrentDisconnectTimeout": "Час очікування відключення торрента", "TorrentsSavePath": "Шлях для збереження кешу", "Upload": "Відвантаження", diff --git a/web/src/locales/zh/translation.json b/web/src/locales/zh/translation.json index f2a2dca..1e2aeca 100644 --- a/web/src/locales/zh/translation.json +++ b/web/src/locales/zh/translation.json @@ -140,6 +140,12 @@ "RetrackersMode": "Retrackers模式", "ResetToDefault": "重置为默认值", "Settings": "设置", + "SslPort": "HTTPS 端口", + "SslPortHint": "默认值:8091", + "SslCert": "SSL证书", + "SslCertHint": "SSL 证书的路径", + "SslKey": "SSL 密钥", + "SslKeyHint": "SSL 密钥的路径", "TorrentDisconnectTimeout": "种子断开超时", "TorrentsSavePath": "种子缓存保存路径", "Upload": "上传",