mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-02-26 20:35:21 +00:00
Compare commits
383 Commits
v2.13.4
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33b1a993ec | ||
|
|
67d40e186f | ||
|
|
52be66c43e | ||
|
|
ec46cabcd4 | ||
|
|
a7a9cc3acb | ||
|
|
020b3ebb33 | ||
|
|
c1c4baf389 | ||
|
|
672b5d6dd9 | ||
|
|
cd230b5878 | ||
|
|
a8f35062af | ||
|
|
da5955412d | ||
|
|
adb27fe67d | ||
|
|
d874af8692 | ||
|
|
0844dade98 | ||
|
|
71d59516e8 | ||
|
|
06e220e184 | ||
|
|
dc53647e76 | ||
|
|
4c04e89483 | ||
|
|
7241869a9e | ||
|
|
94f6191a21 | ||
|
|
cac52dd0ff | ||
|
|
906f177960 | ||
|
|
f52afced5d | ||
|
|
e8224ff0af | ||
|
|
a4fa83d0ce | ||
|
|
770716ebf8 | ||
|
|
f1067d3308 | ||
|
|
85c1a935ea | ||
|
|
51ef7f3b86 | ||
|
|
846b94f7e8 | ||
|
|
19e24c7e7e | ||
|
|
c1bc471dac | ||
|
|
608dc0b6bf | ||
|
|
0dbf268f37 | ||
|
|
c7437ddf8f | ||
|
|
627f43c729 | ||
|
|
fc4c5aac86 | ||
|
|
aff390f35d | ||
|
|
5f5a3870e4 | ||
|
|
40f363bd4f | ||
|
|
678fdd22c6 | ||
|
|
6c3cc83d66 | ||
|
|
5916fd5bee | ||
|
|
f105673904 | ||
|
|
a37d0b88d6 | ||
|
|
43bc2a743e | ||
|
|
269545256a | ||
|
|
e5df45e9ef | ||
|
|
5601dd14fc | ||
|
|
3e5655cfcd | ||
|
|
a90af83270 | ||
|
|
619a8e5acc | ||
|
|
6dcdefb57e | ||
|
|
787616010b | ||
|
|
5891c291d2 | ||
|
|
41a2a41e67 | ||
|
|
379099d7ed | ||
|
|
dbeab93c02 | ||
|
|
010cb562a0 | ||
|
|
7ff2fc1900 | ||
|
|
1c189a1888 | ||
|
|
f3c46487f6 | ||
|
|
fcca481d1b | ||
|
|
c59c237000 | ||
|
|
a62b6de9f2 | ||
|
|
d92cc953e1 | ||
|
|
1b6412688b | ||
|
|
1d14f72ba5 | ||
|
|
099243aff7 | ||
|
|
5fe12f69ba | ||
|
|
011191f645 | ||
|
|
eeab425ea4 | ||
|
|
13fbc53591 | ||
|
|
3f2aec7b86 | ||
|
|
09a3d65aa1 | ||
|
|
c910cf9512 | ||
|
|
304c51aae8 | ||
|
|
b552eb90ed | ||
|
|
b78ef9bcd3 | ||
|
|
7c67fafedf | ||
|
|
47b367d61e | ||
|
|
d19f5c1960 | ||
|
|
77662b4e7f | ||
|
|
c88de65d3a | ||
|
|
ac4efd2333 | ||
|
|
eab38d8934 | ||
|
|
4833dcbf3a | ||
|
|
c6fba1cbfe | ||
|
|
cdde543e8a | ||
|
|
0d62c26164 | ||
|
|
c3173d83b8 | ||
|
|
6ba40216cd | ||
|
|
3c54413752 | ||
|
|
65cf8ce583 | ||
|
|
a4bc8d5d21 | ||
|
|
2bcf5e91ce | ||
|
|
3e3d08b68f | ||
|
|
f90066822f | ||
|
|
bb4b5fb3aa | ||
|
|
8014f34195 | ||
|
|
4f8037ded2 | ||
|
|
e7a1f84e45 | ||
|
|
6f0931bed5 | ||
|
|
7f0c5d4364 | ||
|
|
60404b6f7e | ||
|
|
c2fddee2c7 | ||
|
|
b7402d47a0 | ||
|
|
f09876d31b | ||
|
|
8708a3bab8 | ||
|
|
218fadd168 | ||
|
|
9cf1d000c8 | ||
|
|
714bebbbc7 | ||
|
|
127008c9b5 | ||
|
|
7cc2bfbf6a | ||
|
|
de3b543d08 | ||
|
|
21f63e3db3 | ||
|
|
232b5b759a | ||
|
|
054742539f | ||
|
|
2b6a617599 | ||
|
|
187d21a0d5 | ||
|
|
c515815b0e | ||
|
|
3db02370fd | ||
|
|
4ad1af5576 | ||
|
|
a73d54fedc | ||
|
|
8c8005f817 | ||
|
|
83d993578b | ||
|
|
8532e7520f | ||
|
|
58d47cd69a | ||
|
|
bad3eac515 | ||
|
|
00b58f73f8 | ||
|
|
47981f0d56 | ||
|
|
38257859e2 | ||
|
|
a169e1131c | ||
|
|
a99cde9cd8 | ||
|
|
c69bd187af | ||
|
|
98fe622967 | ||
|
|
eddca3597d | ||
|
|
ed0b2306a2 | ||
|
|
17f6050de2 | ||
|
|
469d72a2f9 | ||
|
|
3ed3ec0001 | ||
|
|
24ff3c7b11 | ||
|
|
58dda941b8 | ||
|
|
f9f743499f | ||
|
|
534afe6067 | ||
|
|
9580903f5d | ||
|
|
df81c8425f | ||
|
|
b6f421c5fc | ||
|
|
c1ef3a3795 | ||
|
|
0aad939ccc | ||
|
|
7e092e265c | ||
|
|
cd01a2ee6b | ||
|
|
9e6720561a | ||
|
|
c50f0a144e | ||
|
|
2a9c1df3cb | ||
|
|
ef6391f22e | ||
|
|
0f46337710 | ||
|
|
1b84b8ace2 | ||
|
|
8ea8286cec | ||
|
|
7ca48f876b | ||
|
|
7c3c59c79f | ||
|
|
ef7f444404 | ||
|
|
f509e0bdba | ||
|
|
9b7af474bb | ||
|
|
28982b8bc2 | ||
|
|
19e654b998 | ||
|
|
eaf9f5ab1e | ||
|
|
4af0a968f0 | ||
|
|
df06eb6c2f | ||
|
|
74360cc9b3 | ||
|
|
16a301fc64 | ||
|
|
2d774124dc | ||
|
|
124737bbc6 | ||
|
|
d5d222ef2d | ||
|
|
b96e932c64 | ||
|
|
d09cb2884c | ||
|
|
71deabcc67 | ||
|
|
a78039b65f | ||
|
|
48acbd33ab | ||
|
|
32cabc0f83 | ||
|
|
03a82cd861 | ||
|
|
5f19f7125e | ||
|
|
8d35644190 | ||
|
|
ad2e4c8afe | ||
|
|
69f9031447 | ||
|
|
3308a308df | ||
|
|
59b0e75324 | ||
|
|
727bc944ea | ||
|
|
a0ef0d9048 | ||
|
|
d2e346c912 | ||
|
|
32a716b3a9 | ||
|
|
ef6918947c | ||
|
|
2deb5447d6 | ||
|
|
1bb29259ea | ||
|
|
fa20c7d8a4 | ||
|
|
4ed17fef01 | ||
|
|
fe316252f1 | ||
|
|
7747db994d | ||
|
|
9ffced265b | ||
|
|
50cf275328 | ||
|
|
7bcc34dea9 | ||
|
|
131e5fea4f | ||
|
|
4e412f18bb | ||
|
|
bb0a50eccb | ||
|
|
4185665570 | ||
|
|
9ea6fee3ce | ||
|
|
7ee9a3c9f0 | ||
|
|
afb196e5b6 | ||
|
|
0b464ac9fd | ||
|
|
f3efaae320 | ||
|
|
7b3c1fd061 | ||
|
|
ee42202348 | ||
|
|
c1ad7788f1 | ||
|
|
d33bb02c74 | ||
|
|
462c134751 | ||
|
|
b7dfaddbb1 | ||
|
|
11ee4f0820 | ||
|
|
19970a4220 | ||
|
|
59bac3b468 | ||
|
|
48753fb101 | ||
|
|
2a3978ae3f | ||
|
|
4ce5da5930 | ||
|
|
89d3756ee6 | ||
|
|
58c63096e4 | ||
|
|
b01a22c393 | ||
|
|
9c25410331 | ||
|
|
b3a901bbc5 | ||
|
|
3e3396ba9a | ||
|
|
3eb493bb8b | ||
|
|
8c8221a352 | ||
|
|
582681e3ff | ||
|
|
52fae6d35f | ||
|
|
6c0ea835ce | ||
|
|
fb52655374 | ||
|
|
336726db8d | ||
|
|
4a7853163e | ||
|
|
b30f8e47e2 | ||
|
|
6fa30840be | ||
|
|
05726aaab9 | ||
|
|
f85bb79f13 | ||
|
|
471b62c7fe | ||
|
|
55a1e0a4e7 | ||
|
|
f25afa3590 | ||
|
|
9211ba6d1a | ||
|
|
aeb44244a7 | ||
|
|
d2d204ab8e | ||
|
|
427afa55b4 | ||
|
|
bbe98a639a | ||
|
|
f0c0b465d9 | ||
|
|
6c2f6a9d39 | ||
|
|
2f6e3ad804 | ||
|
|
c9f453714b | ||
|
|
5e6ead1eee | ||
|
|
da519e72ba | ||
|
|
b13ebb2247 | ||
|
|
6b322582b9 | ||
|
|
7fe5070337 | ||
|
|
1b8f1fbb79 | ||
|
|
4abea1247d | ||
|
|
073ee95e56 | ||
|
|
fec8b3b083 | ||
|
|
168078eb40 | ||
|
|
2c9f8f4d64 | ||
|
|
8403a0c761 | ||
|
|
d18c8cf4f1 | ||
|
|
bf4eab541a | ||
|
|
f9edcb10e6 | ||
|
|
ba43c144f6 | ||
|
|
896951f6cd | ||
|
|
865b566ea6 | ||
|
|
45bc44c6fa | ||
|
|
4ff402fff4 | ||
|
|
1c6f54fa3c | ||
|
|
e8ca72fb6a | ||
|
|
4712633568 | ||
|
|
a1fb54c394 | ||
|
|
927e57257b | ||
|
|
e353a66556 | ||
|
|
991bddf891 | ||
|
|
c076ad145c | ||
|
|
80cf4406d5 | ||
|
|
3cb124d5a0 | ||
|
|
03b0513a24 | ||
|
|
0528d65317 | ||
|
|
f9991084fc | ||
|
|
56875bba52 | ||
|
|
b55f51bd63 | ||
|
|
20e2d5ffb3 | ||
|
|
86b7394620 | ||
|
|
91a1f39c02 | ||
|
|
5c114e9db7 | ||
|
|
fec9bffe29 | ||
|
|
e3cdc8bb30 | ||
|
|
ba79eefe5e | ||
|
|
bb94ce75c1 | ||
|
|
847c58b170 | ||
|
|
89b8b747e1 | ||
|
|
3231023513 | ||
|
|
dc89635971 | ||
|
|
cfa98361d1 | ||
|
|
c2177abe39 | ||
|
|
2c6d614597 | ||
|
|
484ce8db3c | ||
|
|
2c11c0c7e2 | ||
|
|
f1039ce2ef | ||
|
|
d49ff6e7c2 | ||
|
|
a87f24c9dc | ||
|
|
decdfec447 | ||
|
|
32ab3faf57 | ||
|
|
c7f999fa7a | ||
|
|
de7d3b0d19 | ||
|
|
2d4b7399c0 | ||
|
|
316b758455 | ||
|
|
890d06c863 | ||
|
|
81f2aa17d4 | ||
|
|
9b4c34915c | ||
|
|
fce569ca21 | ||
|
|
87ec9c4bdf | ||
|
|
2650648d68 | ||
|
|
fdc0c29f28 | ||
|
|
6cae088432 | ||
|
|
9d8c4cc30b | ||
|
|
66ebecdb43 | ||
|
|
60f3ee03c0 | ||
|
|
a4d54a0291 | ||
|
|
7536b1b1c9 | ||
|
|
5288fbd7af | ||
|
|
2c630bbdca | ||
|
|
0ec1a09c30 | ||
|
|
118c4793e3 | ||
|
|
d7384c568f | ||
|
|
0bcfe0bba6 | ||
|
|
74cbfb2c58 | ||
|
|
8ef65caa5a | ||
|
|
bc341c1dff | ||
|
|
5fc9febf1f | ||
|
|
b23ceebfd8 | ||
|
|
c281fc54a1 | ||
|
|
d0f7dc5b48 | ||
|
|
fb53df862e | ||
|
|
8d8463ae41 | ||
|
|
8774cfe5f9 | ||
|
|
4ca5cadd19 | ||
|
|
45a8d50e03 | ||
|
|
960d4bfe6f | ||
|
|
8c3c964c52 | ||
|
|
afd6134a3e | ||
|
|
9b2d60e67b | ||
|
|
9807e25d45 | ||
|
|
824c895f52 | ||
|
|
7f9b9dfea4 | ||
|
|
d848ba9f65 | ||
|
|
47db5c9aa6 | ||
|
|
79a9653b26 | ||
|
|
e5aae1f365 | ||
|
|
8959190d32 | ||
|
|
7e875eb27a | ||
|
|
cf7306e766 | ||
|
|
1c442dcce6 | ||
|
|
dadd10f89b | ||
|
|
8838dabe8a | ||
|
|
75c012b558 | ||
|
|
9be1381ffe | ||
|
|
f40fe56572 | ||
|
|
b4fd242eb7 | ||
|
|
911476f82f | ||
|
|
963125f963 | ||
|
|
e86a34f2f3 | ||
|
|
6ce9567e48 | ||
|
|
66fa08fd8e | ||
|
|
d783cc3b90 | ||
|
|
17cc75fe7d | ||
|
|
15394c6532 | ||
|
|
2d6252d75d | ||
|
|
b043e70fc0 | ||
|
|
87eef10ff8 | ||
|
|
dc03ad8239 | ||
|
|
ae5faa75fa | ||
|
|
b6dbb68ef3 | ||
|
|
b434bba12f | ||
|
|
f1d7203212 | ||
|
|
990ba28831 | ||
|
|
a85b5f664f |
104
.github/dependabot.yml
vendored
Normal file
104
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/backend"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
dev-patch-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "patch"
|
||||
dev-minor-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "minor"
|
||||
prod-patch-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "patch"
|
||||
prod-minor-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "minor"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/frontend"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
dev-patch-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "patch"
|
||||
dev-minor-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "minor"
|
||||
prod-patch-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "patch"
|
||||
prod-minor-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "minor"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/docs"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
dev-patch-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "patch"
|
||||
dev-minor-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "minor"
|
||||
prod-patch-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "patch"
|
||||
prod-minor-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "minor"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/test"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
dev-patch-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "patch"
|
||||
dev-minor-updates:
|
||||
dependency-type: "development"
|
||||
update-types:
|
||||
- "minor"
|
||||
prod-patch-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "patch"
|
||||
prod-minor-updates:
|
||||
dependency-type: "production"
|
||||
update-types:
|
||||
- "minor"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/docker"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
updates:
|
||||
update-types:
|
||||
- "patch"
|
||||
- "minor"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
- uses: actions/stale@v10
|
||||
with:
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
|
||||
17
README.md
17
README.md
@@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="https://nginxproxymanager.com/github.png">
|
||||
<br><br>
|
||||
<img src="https://img.shields.io/badge/version-2.13.4-green.svg?style=for-the-badge">
|
||||
<img src="https://img.shields.io/badge/version-2.14.0-green.svg?style=for-the-badge">
|
||||
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
|
||||
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
|
||||
</a>
|
||||
@@ -36,6 +36,10 @@ so that the barrier for entry here is low.
|
||||
- Advanced Nginx configuration available for super users
|
||||
- User management, permissions and audit log
|
||||
|
||||
::: warning
|
||||
`armv7` is no longer supported in version 2.14+. This is due to Nodejs dropping support for armhf. Please
|
||||
use the `2.13.7` image tag if this applies to you.
|
||||
:::
|
||||
|
||||
## Hosting your home network
|
||||
|
||||
@@ -43,16 +47,15 @@ I won't go in to too much detail here but here are the basics for someone new to
|
||||
|
||||
1. Your home router will have a Port Forwarding section somewhere. Log in and find it
|
||||
2. Add port forwarding for port 80 and 443 to the server hosting this project
|
||||
3. Configure your domain name details to point to your home, either with a static ip or a service like DuckDNS or [Amazon Route53](https://github.com/jc21/route53-ddns)
|
||||
3. Configure your domain name details to point to your home, either with a static ip or a service like
|
||||
- DuckDNS
|
||||
- [Amazon Route53](https://github.com/jc21/route53-ddns)
|
||||
- [Cloudflare](https://github.com/jc21/cloudflare-ddns)
|
||||
4. Use the Nginx Proxy Manager as your gateway to forward to your other web based services
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. Install Docker and Docker-Compose
|
||||
|
||||
- [Docker Install documentation](https://docs.docker.com/install/)
|
||||
- [Docker-Compose Install documentation](https://docs.docker.com/compose/install/)
|
||||
|
||||
1. [Install Docker](https://docs.docker.com/install/)
|
||||
2. Create a docker-compose.yml file similar to this:
|
||||
|
||||
```yml
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.3/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
|
||||
@@ -23,11 +23,19 @@
|
||||
"credentials": "dns_aliyun_access_key = 12345678\ndns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef",
|
||||
"full_plugin_name": "dns-aliyun"
|
||||
},
|
||||
"arvan": {
|
||||
"name": "ArvanCloud",
|
||||
"package_name": "certbot-dns-arvan",
|
||||
"version": ">=0.1.0",
|
||||
"dependencies": "",
|
||||
"credentials": "dns_arvan_key = Apikey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
||||
"full_plugin_name": "dns-arvan"
|
||||
},
|
||||
"azure": {
|
||||
"name": "Azure",
|
||||
"package_name": "certbot-dns-azure",
|
||||
"version": "~=1.2.0",
|
||||
"dependencies": "",
|
||||
"version": "~=2.6.1",
|
||||
"dependencies": "azure-mgmt-dns==8.2.0",
|
||||
"credentials": "# This plugin supported API authentication using either Service Principals or utilizing a Managed Identity assigned to the virtual machine.\n# Regardless which authentication method used, the identity will need the “DNS Zone Contributor” role assigned to it.\n# As multiple Azure DNS Zones in multiple resource groups can exist, the config file needs a mapping of zone to resource group ID. Multiple zones -> ID mappings can be listed by using the key dns_azure_zoneX where X is a unique number. At least 1 zone mapping is required.\n\n# Using a service principal (option 1)\ndns_azure_sp_client_id = 912ce44a-0156-4669-ae22-c16a17d34ca5\ndns_azure_sp_client_secret = E-xqXU83Y-jzTI6xe9fs2YC~mck3ZzUih9\ndns_azure_tenant_id = ed1090f3-ab18-4b12-816c-599af8a88cf7\n\n# Using used assigned MSI (option 2)\n# dns_azure_msi_client_id = 912ce44a-0156-4669-ae22-c16a17d34ca5\n\n# Using system assigned MSI (option 3)\n# dns_azure_msi_system_assigned = true\n\n# Zones (at least one always required)\ndns_azure_zone1 = example.com:/subscriptions/c135abce-d87d-48df-936c-15596c6968a5/resourceGroups/dns1\ndns_azure_zone2 = example.org:/subscriptions/99800903-fb14-4992-9aff-12eaf2744622/resourceGroups/dns2",
|
||||
"full_plugin_name": "dns-azure"
|
||||
},
|
||||
@@ -74,7 +82,7 @@
|
||||
"cloudns": {
|
||||
"name": "ClouDNS",
|
||||
"package_name": "certbot-dns-cloudns",
|
||||
"version": "~=0.6.0",
|
||||
"version": "~=0.7.0",
|
||||
"dependencies": "",
|
||||
"credentials": "# Target user ID (see https://www.cloudns.net/api-settings/)\n\tdns_cloudns_auth_id=1234\n\t# Alternatively, one of the following two options can be set:\n\t# dns_cloudns_sub_auth_id=1234\n\t# dns_cloudns_sub_auth_user=foobar\n\n\t# API password\n\tdns_cloudns_auth_password=password1",
|
||||
"full_plugin_name": "dns-cloudns"
|
||||
@@ -255,6 +263,14 @@
|
||||
"credentials": "dns_gcore_apitoken = 0123456789abcdef0123456789abcdef01234567",
|
||||
"full_plugin_name": "dns-gcore"
|
||||
},
|
||||
"glesys": {
|
||||
"name": "Glesys",
|
||||
"package_name": "certbot-dns-glesys",
|
||||
"version": "~=2.1.0",
|
||||
"dependencies": "",
|
||||
"credentials": "dns_glesys_user = CL00000\ndns_glesys_password = apikeyvalue",
|
||||
"full_plugin_name": "dns-glesys"
|
||||
},
|
||||
"godaddy": {
|
||||
"name": "GoDaddy",
|
||||
"package_name": "certbot-dns-godaddy",
|
||||
@@ -287,6 +303,14 @@
|
||||
"credentials": "dns_he_user = Me\ndns_he_pass = my HE password",
|
||||
"full_plugin_name": "dns-he"
|
||||
},
|
||||
"he-ddns": {
|
||||
"name": "Hurricane Electric - DDNS",
|
||||
"package_name": "certbot-dns-he-ddns",
|
||||
"version": "~=0.1.0",
|
||||
"dependencies": "",
|
||||
"credentials": "dns_he_ddns_password = verysecurepassword",
|
||||
"full_plugin_name": "dns-he-ddns"
|
||||
},
|
||||
"hetzner": {
|
||||
"name": "Hetzner",
|
||||
"package_name": "certbot-dns-hetzner",
|
||||
@@ -367,6 +391,14 @@
|
||||
"credentials": "dns_joker_username = <Dynamic DNS Authentication Username>\ndns_joker_password = <Dynamic DNS Authentication Password>\ndns_joker_domain = <Dynamic DNS Domain>",
|
||||
"full_plugin_name": "dns-joker"
|
||||
},
|
||||
"kas": {
|
||||
"name": "All-Inkl",
|
||||
"package_name": "certbot-dns-kas",
|
||||
"version": "~=0.1.1",
|
||||
"dependencies": "kasserver",
|
||||
"credentials": "dns_kas_user = your_kas_user\ndns_kas_password = your_kas_password",
|
||||
"full_plugin_name": "dns-kas"
|
||||
},
|
||||
"leaseweb": {
|
||||
"name": "LeaseWeb",
|
||||
"package_name": "certbot-dns-leaseweb",
|
||||
@@ -482,7 +514,7 @@
|
||||
"porkbun": {
|
||||
"name": "Porkbun",
|
||||
"package_name": "certbot-dns-porkbun",
|
||||
"version": "~=0.9",
|
||||
"version": "~=0.11.0",
|
||||
"dependencies": "",
|
||||
"credentials": "dns_porkbun_key=your-porkbun-api-key\ndns_porkbun_secret=your-porkbun-api-secret",
|
||||
"full_plugin_name": "dns-porkbun"
|
||||
@@ -527,6 +559,14 @@
|
||||
"credentials": "[default]\naws_access_key_id=AKIAIOSFODNN7EXAMPLE\naws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
"full_plugin_name": "dns-route53"
|
||||
},
|
||||
"simply": {
|
||||
"name": "Simply",
|
||||
"package_name": "certbot-dns-simply",
|
||||
"version": "~=0.1.2",
|
||||
"dependencies": "",
|
||||
"credentials": "dns_simply_account_name = UExxxxxx\ndns_simply_api_key = DsHJdsjh2812872sahj",
|
||||
"full_plugin_name": "dns-simply"
|
||||
},
|
||||
"spaceship": {
|
||||
"name": "Spaceship",
|
||||
"package_name": "certbot-dns-spaceship",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"database": {
|
||||
"engine": "knex-native",
|
||||
"knex": {
|
||||
"client": "sqlite3",
|
||||
"client": "better-sqlite3",
|
||||
"connection": {
|
||||
"filename": "/app/config/mydb.sqlite"
|
||||
},
|
||||
|
||||
305
backend/internal/2fa.js
Normal file
305
backend/internal/2fa.js
Normal file
@@ -0,0 +1,305 @@
|
||||
import crypto from "node:crypto";
|
||||
import bcrypt from "bcrypt";
|
||||
import { createGuardrails, generateSecret, generateURI, verify } from "otplib";
|
||||
import errs from "../lib/error.js";
|
||||
import authModel from "../models/auth.js";
|
||||
import internalUser from "./user.js";
|
||||
|
||||
const APP_NAME = "Nginx Proxy Manager";
|
||||
const BACKUP_CODE_COUNT = 8;
|
||||
|
||||
/**
|
||||
* Generate backup codes
|
||||
* @returns {Promise<{plain: string[], hashed: string[]}>}
|
||||
*/
|
||||
const generateBackupCodes = async () => {
|
||||
const plain = [];
|
||||
const hashed = [];
|
||||
|
||||
for (let i = 0; i < BACKUP_CODE_COUNT; i++) {
|
||||
const code = crypto.randomBytes(4).toString("hex").toUpperCase();
|
||||
plain.push(code);
|
||||
const hash = await bcrypt.hash(code, 10);
|
||||
hashed.push(hash);
|
||||
}
|
||||
|
||||
return { plain, hashed };
|
||||
};
|
||||
|
||||
const internal2fa = {
|
||||
/**
|
||||
* Check if user has 2FA enabled
|
||||
* @param {number} userId
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
isEnabled: async (userId) => {
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
return auth?.meta?.totp_enabled === true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get 2FA status for user
|
||||
* @param {Access} access
|
||||
* @param {number} userId
|
||||
* @returns {Promise<{enabled: boolean, backup_codes_remaining: number}>}
|
||||
*/
|
||||
getStatus: async (access, userId) => {
|
||||
await access.can("users:password", userId);
|
||||
await internalUser.get(access, { id: userId });
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
const enabled = auth?.meta?.totp_enabled === true;
|
||||
let backup_codes_remaining = 0;
|
||||
|
||||
if (enabled) {
|
||||
const backupCodes = auth.meta.backup_codes || [];
|
||||
backup_codes_remaining = backupCodes.length;
|
||||
}
|
||||
|
||||
return {
|
||||
enabled,
|
||||
backup_codes_remaining,
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Start 2FA setup - store pending secret
|
||||
*
|
||||
* @param {Access} access
|
||||
* @param {number} userId
|
||||
* @returns {Promise<{secret: string, otpauth_url: string}>}
|
||||
*/
|
||||
startSetup: async (access, userId) => {
|
||||
await access.can("users:password", userId);
|
||||
const user = await internalUser.get(access, { id: userId });
|
||||
const secret = generateSecret();
|
||||
const otpauth_url = generateURI({
|
||||
issuer: APP_NAME,
|
||||
label: user.email,
|
||||
secret: secret,
|
||||
});
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
|
||||
// ensure user isn't already setup for 2fa
|
||||
const enabled = auth?.meta?.totp_enabled === true;
|
||||
if (enabled) {
|
||||
throw new errs.ValidationError("2FA is already enabled");
|
||||
}
|
||||
|
||||
const meta = auth.meta || {};
|
||||
meta.totp_pending_secret = secret;
|
||||
|
||||
await authModel
|
||||
.query()
|
||||
.where("id", auth.id)
|
||||
.andWhere("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.patch({ meta });
|
||||
|
||||
return { secret, otpauth_url };
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable 2FA after verifying code
|
||||
*
|
||||
* @param {Access} access
|
||||
* @param {number} userId
|
||||
* @param {string} code
|
||||
* @returns {Promise<{backup_codes: string[]}>}
|
||||
*/
|
||||
enable: async (access, userId, code) => {
|
||||
await access.can("users:password", userId);
|
||||
await internalUser.get(access, { id: userId });
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
const secret = auth?.meta?.totp_pending_secret || false;
|
||||
|
||||
if (!secret) {
|
||||
throw new errs.ValidationError("No pending 2FA setup found");
|
||||
}
|
||||
|
||||
const result = await verify({ token: code, secret });
|
||||
if (!result.valid) {
|
||||
throw new errs.ValidationError("Invalid verification code");
|
||||
}
|
||||
|
||||
const { plain, hashed } = await generateBackupCodes();
|
||||
|
||||
const meta = {
|
||||
...auth.meta,
|
||||
totp_secret: secret,
|
||||
totp_enabled: true,
|
||||
totp_enabled_at: new Date().toISOString(),
|
||||
backup_codes: hashed,
|
||||
};
|
||||
delete meta.totp_pending_secret;
|
||||
|
||||
await authModel
|
||||
.query()
|
||||
.where("id", auth.id)
|
||||
.andWhere("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.patch({ meta });
|
||||
|
||||
return { backup_codes: plain };
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable 2FA
|
||||
*
|
||||
* @param {Access} access
|
||||
* @param {number} userId
|
||||
* @param {string} code
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
disable: async (access, userId, code) => {
|
||||
await access.can("users:password", userId);
|
||||
await internalUser.get(access, { id: userId });
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
|
||||
const enabled = auth?.meta?.totp_enabled === true;
|
||||
if (!enabled) {
|
||||
throw new errs.ValidationError("2FA is not enabled");
|
||||
}
|
||||
|
||||
const result = await verify({
|
||||
token: code,
|
||||
secret: auth.meta.totp_secret,
|
||||
guardrails: createGuardrails({
|
||||
MIN_SECRET_BYTES: 10,
|
||||
}),
|
||||
});
|
||||
|
||||
if (!result.valid) {
|
||||
throw new errs.AuthError("Invalid verification code");
|
||||
}
|
||||
|
||||
const meta = { ...auth.meta };
|
||||
delete meta.totp_secret;
|
||||
delete meta.totp_enabled;
|
||||
delete meta.totp_enabled_at;
|
||||
delete meta.backup_codes;
|
||||
|
||||
await authModel
|
||||
.query()
|
||||
.where("id", auth.id)
|
||||
.andWhere("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.patch({ meta });
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify 2FA code for login
|
||||
*
|
||||
* @param {number} userId
|
||||
* @param {string} token
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
verifyForLogin: async (userId, token) => {
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
const secret = auth?.meta?.totp_secret || false;
|
||||
|
||||
if (!secret) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try TOTP code first, if it's 6 chars. it will throw errors if it's not 6 chars
|
||||
// and the backup codes are 8 chars.
|
||||
if (token.length === 6) {
|
||||
const result = await verify({
|
||||
token,
|
||||
secret,
|
||||
// These guardrails lower the minimum length requirement for secrets.
|
||||
// In v12 of otplib the default minimum length is 10 and in v13 it is 16.
|
||||
// Since there are 2fa secrets in the wild generated with v12 we need to allow shorter secrets
|
||||
// so people won't be locked out when upgrading.
|
||||
guardrails: createGuardrails({
|
||||
MIN_SECRET_BYTES: 10,
|
||||
}),
|
||||
});
|
||||
|
||||
if (result.valid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Try backup codes
|
||||
const backupCodes = auth?.meta?.backup_codes || [];
|
||||
for (let i = 0; i < backupCodes.length; i++) {
|
||||
const match = await bcrypt.compare(token.toUpperCase(), backupCodes[i]);
|
||||
if (match) {
|
||||
// Remove used backup code
|
||||
const updatedCodes = [...backupCodes];
|
||||
updatedCodes.splice(i, 1);
|
||||
const meta = { ...auth.meta, backup_codes: updatedCodes };
|
||||
await authModel
|
||||
.query()
|
||||
.where("id", auth.id)
|
||||
.andWhere("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.patch({ meta });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Regenerate backup codes
|
||||
*
|
||||
* @param {Access} access
|
||||
* @param {number} userId
|
||||
* @param {string} token
|
||||
* @returns {Promise<{backup_codes: string[]}>}
|
||||
*/
|
||||
regenerateBackupCodes: async (access, userId, token) => {
|
||||
await access.can("users:password", userId);
|
||||
await internalUser.get(access, { id: userId });
|
||||
const auth = await internal2fa.getUserPasswordAuth(userId);
|
||||
const enabled = auth?.meta?.totp_enabled === true;
|
||||
const secret = auth?.meta?.totp_secret || false;
|
||||
|
||||
if (!enabled) {
|
||||
throw new errs.ValidationError("2FA is not enabled");
|
||||
}
|
||||
if (!secret) {
|
||||
throw new errs.ValidationError("No 2FA secret found");
|
||||
}
|
||||
|
||||
const result = await verify({
|
||||
token,
|
||||
secret,
|
||||
});
|
||||
|
||||
if (!result.valid) {
|
||||
throw new errs.ValidationError("Invalid verification code");
|
||||
}
|
||||
|
||||
const { plain, hashed } = await generateBackupCodes();
|
||||
|
||||
const meta = { ...auth.meta, backup_codes: hashed };
|
||||
await authModel
|
||||
.query()
|
||||
.where("id", auth.id)
|
||||
.andWhere("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.patch({ meta });
|
||||
|
||||
return { backup_codes: plain };
|
||||
},
|
||||
|
||||
getUserPasswordAuth: async (userId) => {
|
||||
const auth = await authModel
|
||||
.query()
|
||||
.where("user_id", userId)
|
||||
.andWhere("type", "password")
|
||||
.first();
|
||||
|
||||
if (!auth) {
|
||||
throw new errs.ItemNotFoundError("Auth not found");
|
||||
}
|
||||
|
||||
return auth;
|
||||
},
|
||||
};
|
||||
|
||||
export default internal2fa;
|
||||
@@ -630,7 +630,7 @@ const internalCertificate = {
|
||||
* @param {String} privateKey This is the entire key contents as a string
|
||||
*/
|
||||
checkPrivateKey: async (privateKey) => {
|
||||
const filepath = await tempWrite(privateKey, "/tmp");
|
||||
const filepath = await tempWrite(privateKey);
|
||||
const failTimeout = setTimeout(() => {
|
||||
throw new error.ValidationError(
|
||||
"Result Validation Error: Validation timed out. This could be due to the key being passphrase-protected.",
|
||||
@@ -660,8 +660,8 @@ const internalCertificate = {
|
||||
* @param {Boolean} [throwExpired] Throw when the certificate is out of date
|
||||
*/
|
||||
getCertificateInfo: async (certificate, throwExpired) => {
|
||||
const filepath = await tempWrite(certificate);
|
||||
try {
|
||||
const filepath = await tempWrite(certificate, "/tmp");
|
||||
const certData = await internalCertificate.getCertificateInfoFromFile(filepath, throwExpired);
|
||||
fs.unlinkSync(filepath);
|
||||
return certData;
|
||||
@@ -798,6 +798,11 @@ const internalCertificate = {
|
||||
certificate.domain_names.join(","),
|
||||
];
|
||||
|
||||
// Add key-type parameter if specified
|
||||
if (certificate.meta?.key_type) {
|
||||
args.push("--key-type", certificate.meta.key_type);
|
||||
}
|
||||
|
||||
const adds = internalCertificate.getAdditionalCertbotArgs(certificate.id);
|
||||
args.push(...adds.args);
|
||||
|
||||
@@ -858,6 +863,11 @@ const internalCertificate = {
|
||||
);
|
||||
}
|
||||
|
||||
// Add key-type parameter if specified
|
||||
if (certificate.meta?.key_type) {
|
||||
args.push("--key-type", certificate.meta.key_type);
|
||||
}
|
||||
|
||||
const adds = internalCertificate.getAdditionalCertbotArgs(certificate.id, certificate.meta.dns_provider);
|
||||
args.push(...adds.args);
|
||||
|
||||
@@ -938,6 +948,11 @@ const internalCertificate = {
|
||||
"--disable-hook-validation",
|
||||
];
|
||||
|
||||
// Add key-type parameter if specified
|
||||
if (certificate.meta?.key_type) {
|
||||
args.push("--key-type", certificate.meta.key_type);
|
||||
}
|
||||
|
||||
const adds = internalCertificate.getAdditionalCertbotArgs(certificate.id, certificate.meta.dns_provider);
|
||||
args.push(...adds.args);
|
||||
|
||||
@@ -979,6 +994,11 @@ const internalCertificate = {
|
||||
"--no-random-sleep-on-renew",
|
||||
];
|
||||
|
||||
// Add key-type parameter if specified
|
||||
if (certificate.meta?.key_type) {
|
||||
args.push("--key-type", certificate.meta.key_type);
|
||||
}
|
||||
|
||||
const adds = internalCertificate.getAdditionalCertbotArgs(certificate.id, certificate.meta.dns_provider);
|
||||
args.push(...adds.args);
|
||||
|
||||
|
||||
84
backend/internal/remote-version.js
Normal file
84
backend/internal/remote-version.js
Normal file
@@ -0,0 +1,84 @@
|
||||
import https from "node:https";
|
||||
import { ProxyAgent } from "proxy-agent";
|
||||
import { debug, remoteVersion as logger } from "../logger.js";
|
||||
import pjson from "../package.json" with { type: "json" };
|
||||
|
||||
const VERSION_URL = "https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest";
|
||||
|
||||
const internalRemoteVersion = {
|
||||
cache_timeout: 1000 * 60 * 15, // 15 minutes
|
||||
last_result: null,
|
||||
last_fetch_time: null,
|
||||
|
||||
/**
|
||||
* Fetch the latest version info, using a cached result if within the cache timeout period.
|
||||
* @return {Promise<{current: string, latest: string, update_available: boolean}>} Version info
|
||||
*/
|
||||
get: async () => {
|
||||
if (
|
||||
!internalRemoteVersion.last_result ||
|
||||
!internalRemoteVersion.last_fetch_time ||
|
||||
Date.now() - internalRemoteVersion.last_fetch_time > internalRemoteVersion.cache_timeout
|
||||
) {
|
||||
const raw = await internalRemoteVersion.fetchUrl(VERSION_URL);
|
||||
const data = JSON.parse(raw);
|
||||
internalRemoteVersion.last_result = data;
|
||||
internalRemoteVersion.last_fetch_time = Date.now();
|
||||
} else {
|
||||
debug(logger, "Using cached remote version result");
|
||||
}
|
||||
|
||||
const latestVersion = internalRemoteVersion.last_result.tag_name;
|
||||
const version = pjson.version.split("-").shift().split(".");
|
||||
const currentVersion = `v${version[0]}.${version[1]}.${version[2]}`;
|
||||
return {
|
||||
current: currentVersion,
|
||||
latest: latestVersion,
|
||||
update_available: internalRemoteVersion.compareVersions(currentVersion, latestVersion),
|
||||
};
|
||||
},
|
||||
|
||||
fetchUrl: (url) => {
|
||||
const agent = new ProxyAgent();
|
||||
const headers = {
|
||||
"User-Agent": `NginxProxyManager v${pjson.version}`,
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
logger.info(`Fetching ${url}`);
|
||||
return https
|
||||
.get(url, { agent, headers }, (res) => {
|
||||
res.setEncoding("utf8");
|
||||
let raw_data = "";
|
||||
res.on("data", (chunk) => {
|
||||
raw_data += chunk;
|
||||
});
|
||||
res.on("end", () => {
|
||||
resolve(raw_data);
|
||||
});
|
||||
})
|
||||
.on("error", (err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
compareVersions: (current, latest) => {
|
||||
const cleanCurrent = current.replace(/^v/, "");
|
||||
const cleanLatest = latest.replace(/^v/, "");
|
||||
|
||||
const currentParts = cleanCurrent.split(".").map(Number);
|
||||
const latestParts = cleanLatest.split(".").map(Number);
|
||||
|
||||
for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) {
|
||||
const curr = currentParts[i] || 0;
|
||||
const lat = latestParts[i] || 0;
|
||||
|
||||
if (lat > curr) return true;
|
||||
if (lat < curr) return false;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
export default internalRemoteVersion;
|
||||
@@ -15,10 +15,10 @@ const internalReport = {
|
||||
const userId = access.token.getUserId(1);
|
||||
|
||||
const promises = [
|
||||
internalProxyHost.getCount(userId, access_data.visibility),
|
||||
internalRedirectionHost.getCount(userId, access_data.visibility),
|
||||
internalStream.getCount(userId, access_data.visibility),
|
||||
internalDeadHost.getCount(userId, access_data.visibility),
|
||||
internalProxyHost.getCount(userId, access_data.permission_visibility),
|
||||
internalRedirectionHost.getCount(userId, access_data.permission_visibility),
|
||||
internalStream.getCount(userId, access_data.permission_visibility),
|
||||
internalDeadHost.getCount(userId, access_data.permission_visibility),
|
||||
];
|
||||
|
||||
return Promise.all(promises);
|
||||
|
||||
@@ -4,9 +4,12 @@ import { parseDatePeriod } from "../lib/helpers.js";
|
||||
import authModel from "../models/auth.js";
|
||||
import TokenModel from "../models/token.js";
|
||||
import userModel from "../models/user.js";
|
||||
import twoFactor from "./2fa.js";
|
||||
|
||||
const ERROR_MESSAGE_INVALID_AUTH = "Invalid email or password";
|
||||
const ERROR_MESSAGE_INVALID_AUTH_I18N = "error.invalid-auth";
|
||||
const ERROR_MESSAGE_INVALID_2FA = "Invalid verification code";
|
||||
const ERROR_MESSAGE_INVALID_2FA_I18N = "error.invalid-2fa";
|
||||
|
||||
export default {
|
||||
/**
|
||||
@@ -59,6 +62,25 @@ export default {
|
||||
throw new errs.AuthError(`Invalid scope: ${data.scope}`);
|
||||
}
|
||||
|
||||
// Check if 2FA is enabled
|
||||
const has2FA = await twoFactor.isEnabled(user.id);
|
||||
if (has2FA) {
|
||||
// Return challenge token instead of full token
|
||||
const challengeToken = await Token.create({
|
||||
iss: issuer || "api",
|
||||
attrs: {
|
||||
id: user.id,
|
||||
},
|
||||
scope: ["2fa-challenge"],
|
||||
expiresIn: "5m",
|
||||
});
|
||||
|
||||
return {
|
||||
requires_2fa: true,
|
||||
challenge_token: challengeToken.token,
|
||||
};
|
||||
}
|
||||
|
||||
// Create a moment of the expiry expression
|
||||
const expiry = parseDatePeriod(data.expiry);
|
||||
if (expiry === null) {
|
||||
@@ -129,6 +151,65 @@ export default {
|
||||
throw new error.AssertionFailedError("Existing token contained invalid user data");
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify 2FA code and return full token
|
||||
* @param {string} challengeToken
|
||||
* @param {string} code
|
||||
* @param {string} [expiry]
|
||||
* @returns {Promise}
|
||||
*/
|
||||
verify2FA: async (challengeToken, code, expiry) => {
|
||||
const Token = TokenModel();
|
||||
const tokenExpiry = expiry || "1d";
|
||||
|
||||
// Verify challenge token
|
||||
let tokenData;
|
||||
try {
|
||||
tokenData = await Token.load(challengeToken);
|
||||
} catch {
|
||||
throw new errs.AuthError("Invalid or expired challenge token");
|
||||
}
|
||||
|
||||
// Check scope
|
||||
if (!tokenData.scope || tokenData.scope[0] !== "2fa-challenge") {
|
||||
throw new errs.AuthError("Invalid challenge token");
|
||||
}
|
||||
|
||||
const userId = tokenData.attrs?.id;
|
||||
if (!userId) {
|
||||
throw new errs.AuthError("Invalid challenge token");
|
||||
}
|
||||
|
||||
// Verify 2FA code
|
||||
const valid = await twoFactor.verifyForLogin(userId, code);
|
||||
if (!valid) {
|
||||
throw new errs.AuthError(
|
||||
ERROR_MESSAGE_INVALID_2FA,
|
||||
ERROR_MESSAGE_INVALID_2FA_I18N,
|
||||
);
|
||||
}
|
||||
|
||||
// Create full token
|
||||
const expiryDate = parseDatePeriod(tokenExpiry);
|
||||
if (expiryDate === null) {
|
||||
throw new errs.AuthError(`Invalid expiry time: ${tokenExpiry}`);
|
||||
}
|
||||
|
||||
const signed = await Token.create({
|
||||
iss: "api",
|
||||
attrs: {
|
||||
id: userId,
|
||||
},
|
||||
scope: ["user"],
|
||||
expiresIn: tokenExpiry,
|
||||
});
|
||||
|
||||
return {
|
||||
token: signed.token,
|
||||
expires: expiryDate.toISOString(),
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Object} user
|
||||
* @returns {Promise}
|
||||
|
||||
@@ -2,10 +2,13 @@ import fs from "node:fs";
|
||||
import NodeRSA from "node-rsa";
|
||||
import { global as logger } from "../logger.js";
|
||||
|
||||
const keysFile = '/data/keys.json';
|
||||
const mysqlEngine = 'mysql2';
|
||||
const postgresEngine = 'pg';
|
||||
const sqliteClientName = 'sqlite3';
|
||||
const keysFile = '/data/keys.json';
|
||||
const mysqlEngine = 'mysql2';
|
||||
const postgresEngine = 'pg';
|
||||
const sqliteClientName = 'better-sqlite3';
|
||||
|
||||
// Not used for new setups anymore but may exist in legacy setups
|
||||
const legacySqliteClientName = 'sqlite3';
|
||||
|
||||
let instance = null;
|
||||
|
||||
@@ -84,6 +87,7 @@ const configure = () => {
|
||||
}
|
||||
|
||||
const envSqliteFile = process.env.DB_SQLITE_FILE || "/data/database.sqlite";
|
||||
|
||||
logger.info(`Using Sqlite: ${envSqliteFile}`);
|
||||
instance = {
|
||||
database: {
|
||||
@@ -183,7 +187,7 @@ const configGet = (key) => {
|
||||
*/
|
||||
const isSqlite = () => {
|
||||
instance === null && configure();
|
||||
return instance.database.knex && instance.database.knex.client === sqliteClientName;
|
||||
return instance.database.knex && [sqliteClientName, legacySqliteClientName].includes(instance.database.knex.client);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,7 @@ const certbot = new signale.Signale({ scope: "Certbot ", ...opts });
|
||||
const importer = new signale.Signale({ scope: "Importer ", ...opts });
|
||||
const setup = new signale.Signale({ scope: "Setup ", ...opts });
|
||||
const ipRanges = new signale.Signale({ scope: "IP Ranges", ...opts });
|
||||
const remoteVersion = new signale.Signale({ scope: "Remote Version", ...opts });
|
||||
|
||||
const debug = (logger, ...args) => {
|
||||
if (isDebugMode()) {
|
||||
@@ -22,4 +23,4 @@ const debug = (logger, ...args) => {
|
||||
}
|
||||
};
|
||||
|
||||
export { debug, global, migrate, express, access, nginx, ssl, certbot, importer, setup, ipRanges };
|
||||
export { debug, global, migrate, express, access, nginx, ssl, certbot, importer, setup, ipRanges, remoteVersion };
|
||||
|
||||
43
backend/migrations/20260131163528_trust_forwarded_proto.js
Normal file
43
backend/migrations/20260131163528_trust_forwarded_proto.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import { migrate as logger } from "../logger.js";
|
||||
|
||||
const migrateName = "trust_forwarded_proto";
|
||||
|
||||
/**
|
||||
* Migrate
|
||||
*
|
||||
* @see http://knexjs.org/#Schema
|
||||
*
|
||||
* @param {Object} knex
|
||||
* @returns {Promise}
|
||||
*/
|
||||
const up = function (knex) {
|
||||
logger.info(`[${migrateName}] Migrating Up...`);
|
||||
|
||||
return knex.schema
|
||||
.alterTable('proxy_host', (table) => {
|
||||
table.tinyint('trust_forwarded_proto').notNullable().defaultTo(0);
|
||||
})
|
||||
.then(() => {
|
||||
logger.info(`[${migrateName}] proxy_host Table altered`);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Undo Migrate
|
||||
*
|
||||
* @param {Object} knex
|
||||
* @returns {Promise}
|
||||
*/
|
||||
const down = function (knex) {
|
||||
logger.info(`[${migrateName}] Migrating Down...`);
|
||||
|
||||
return knex.schema
|
||||
.alterTable('proxy_host', (table) => {
|
||||
table.dropColumn('trust_forwarded_proto');
|
||||
})
|
||||
.then(() => {
|
||||
logger.info(`[${migrateName}] proxy_host Table altered`);
|
||||
});
|
||||
};
|
||||
|
||||
export { up, down };
|
||||
@@ -21,6 +21,7 @@ const boolFields = [
|
||||
"enabled",
|
||||
"hsts_enabled",
|
||||
"hsts_subdomains",
|
||||
"trust_forwarded_proto",
|
||||
];
|
||||
|
||||
class ProxyHost extends Model {
|
||||
|
||||
@@ -9,39 +9,42 @@
|
||||
"scripts": {
|
||||
"lint": "biome lint",
|
||||
"prettier": "biome format --write .",
|
||||
"validate-schema": "node validate-schema.js"
|
||||
"validate-schema": "node validate-schema.js",
|
||||
"regenerate-config": "node scripts/regenerate-config"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
||||
"ajv": "^8.17.1",
|
||||
"archiver": "^5.3.0",
|
||||
"@apidevtools/json-schema-ref-parser": "^15.2.2",
|
||||
"ajv": "^8.18.0",
|
||||
"archiver": "^7.0.1",
|
||||
"batchflow": "^0.4.0",
|
||||
"bcrypt": "^5.0.0",
|
||||
"body-parser": "^1.20.3",
|
||||
"compression": "^1.7.4",
|
||||
"express": "^4.20.0",
|
||||
"bcrypt": "^6.0.0",
|
||||
"better-sqlite3": "^12.6.2",
|
||||
"body-parser": "^2.2.2",
|
||||
"compression": "^1.8.1",
|
||||
"express": "^5.2.1",
|
||||
"express-fileupload": "^1.5.2",
|
||||
"gravatar": "^1.8.2",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"knex": "2.4.2",
|
||||
"liquidjs": "10.6.1",
|
||||
"lodash": "^4.17.21",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"knex": "3.1.0",
|
||||
"liquidjs": "10.24.0",
|
||||
"lodash": "^4.17.23",
|
||||
"moment": "^2.30.1",
|
||||
"mysql2": "^3.15.3",
|
||||
"mysql2": "^3.17.5",
|
||||
"node-rsa": "^1.1.1",
|
||||
"objection": "3.0.1",
|
||||
"objection": "3.1.5",
|
||||
"otplib": "^13.3.0",
|
||||
"path": "^0.12.7",
|
||||
"pg": "^8.16.3",
|
||||
"pg": "^8.18.0",
|
||||
"proxy-agent": "^6.5.0",
|
||||
"signale": "1.4.0",
|
||||
"sqlite3": "^5.1.7",
|
||||
"temp-write": "^4.0.0"
|
||||
"temp-write": "^6.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apidevtools/swagger-parser": "^10.1.0",
|
||||
"@biomejs/biome": "^2.3.2",
|
||||
"chalk": "4.1.2",
|
||||
"nodemon": "^2.0.2"
|
||||
"@apidevtools/swagger-parser": "^12.1.0",
|
||||
"@biomejs/biome": "^2.4.3",
|
||||
"chalk": "5.6.2",
|
||||
"nodemon": "^3.1.14"
|
||||
},
|
||||
"signale": {
|
||||
"displayDate": true,
|
||||
|
||||
@@ -14,6 +14,7 @@ import schemaRoutes from "./schema.js";
|
||||
import settingsRoutes from "./settings.js";
|
||||
import tokensRoutes from "./tokens.js";
|
||||
import usersRoutes from "./users.js";
|
||||
import versionRoutes from "./version.js";
|
||||
|
||||
const router = express.Router({
|
||||
caseSensitive: true,
|
||||
@@ -46,6 +47,7 @@ router.use("/users", usersRoutes);
|
||||
router.use("/audit-log", auditLogRoutes);
|
||||
router.use("/reports", reportsRoutes);
|
||||
router.use("/settings", settingsRoutes);
|
||||
router.use("/version", versionRoutes);
|
||||
router.use("/nginx/proxy-hosts", proxyHostsRoutes);
|
||||
router.use("/nginx/redirection-hosts", redirectionHostsRoutes);
|
||||
router.use("/nginx/dead-hosts", deadHostsRoutes);
|
||||
|
||||
@@ -53,4 +53,26 @@ router
|
||||
}
|
||||
});
|
||||
|
||||
router
|
||||
.route("/2fa")
|
||||
.options((_, res) => {
|
||||
res.sendStatus(204);
|
||||
})
|
||||
|
||||
/**
|
||||
* POST /tokens/2fa
|
||||
*
|
||||
* Verify 2FA code and get full token
|
||||
*/
|
||||
.post(async (req, res, next) => {
|
||||
try {
|
||||
const { challenge_token, code } = await apiValidator(getValidationSchema("/tokens/2fa", "post"), req.body);
|
||||
const result = await internalToken.verify2FA(challenge_token, code);
|
||||
res.status(200).send(result);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import express from "express";
|
||||
import internal2FA from "../internal/2fa.js";
|
||||
import internalUser from "../internal/user.js";
|
||||
import Access from "../lib/access.js";
|
||||
import { isCI } from "../lib/config.js";
|
||||
@@ -325,4 +326,130 @@ router
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* User 2FA status
|
||||
*
|
||||
* /api/users/123/2fa
|
||||
*/
|
||||
router
|
||||
.route("/:user_id/2fa")
|
||||
.options((_, res) => {
|
||||
res.sendStatus(204);
|
||||
})
|
||||
.all(jwtdecode())
|
||||
.all(userIdFromMe)
|
||||
|
||||
/**
|
||||
* POST /api/users/123/2fa
|
||||
*
|
||||
* Start 2FA setup, returns QR code URL
|
||||
*/
|
||||
.post(async (req, res, next) => {
|
||||
try {
|
||||
const result = await internal2FA.startSetup(res.locals.access, req.params.user_id);
|
||||
res.status(200).send(result);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* GET /api/users/123/2fa
|
||||
*
|
||||
* Get 2FA status for a user
|
||||
*/
|
||||
.get(async (req, res, next) => {
|
||||
try {
|
||||
const status = await internal2FA.getStatus(res.locals.access, req.params.user_id);
|
||||
res.status(200).send(status);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* DELETE /api/users/123/2fa?code=XXXXXX
|
||||
*
|
||||
* Disable 2FA for a user
|
||||
*/
|
||||
.delete(async (req, res, next) => {
|
||||
try {
|
||||
const code = typeof req.query.code === "string" ? req.query.code : null;
|
||||
if (!code) {
|
||||
throw new errs.ValidationError("Missing required parameter: code");
|
||||
}
|
||||
await internal2FA.disable(res.locals.access, req.params.user_id, code);
|
||||
res.status(200).send(true);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* User 2FA enable
|
||||
*
|
||||
* /api/users/123/2fa/enable
|
||||
*/
|
||||
router
|
||||
.route("/:user_id/2fa/enable")
|
||||
.options((_, res) => {
|
||||
res.sendStatus(204);
|
||||
})
|
||||
.all(jwtdecode())
|
||||
.all(userIdFromMe)
|
||||
|
||||
/**
|
||||
* POST /api/users/123/2fa/enable
|
||||
*
|
||||
* Verify code and enable 2FA
|
||||
*/
|
||||
.post(async (req, res, next) => {
|
||||
try {
|
||||
const { code } = await apiValidator(
|
||||
getValidationSchema("/users/{userID}/2fa/enable", "post"),
|
||||
req.body,
|
||||
);
|
||||
const result = await internal2FA.enable(res.locals.access, req.params.user_id, code);
|
||||
res.status(200).send(result);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* User 2FA backup codes
|
||||
*
|
||||
* /api/users/123/2fa/backup-codes
|
||||
*/
|
||||
router
|
||||
.route("/:user_id/2fa/backup-codes")
|
||||
.options((_, res) => {
|
||||
res.sendStatus(204);
|
||||
})
|
||||
.all(jwtdecode())
|
||||
.all(userIdFromMe)
|
||||
|
||||
/**
|
||||
* POST /api/users/123/2fa/backup-codes
|
||||
*
|
||||
* Regenerate backup codes
|
||||
*/
|
||||
.post(async (req, res, next) => {
|
||||
try {
|
||||
const { code } = await apiValidator(
|
||||
getValidationSchema("/users/{userID}/2fa/backup-codes", "post"),
|
||||
req.body,
|
||||
);
|
||||
const result = await internal2FA.regenerateBackupCodes(res.locals.access, req.params.user_id, code);
|
||||
res.status(200).send(result);
|
||||
} catch (err) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${err}`);
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
40
backend/routes/version.js
Normal file
40
backend/routes/version.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import express from "express";
|
||||
import internalRemoteVersion from "../internal/remote-version.js";
|
||||
import { debug, express as logger } from "../logger.js";
|
||||
|
||||
const router = express.Router({
|
||||
caseSensitive: true,
|
||||
strict: true,
|
||||
mergeParams: true,
|
||||
});
|
||||
|
||||
/**
|
||||
* /api/version/check
|
||||
*/
|
||||
router
|
||||
.route("/check")
|
||||
.options((_, res) => {
|
||||
res.sendStatus(204);
|
||||
})
|
||||
|
||||
/**
|
||||
* GET /api/version/check
|
||||
*
|
||||
* Check for available updates
|
||||
*/
|
||||
.get(async (req, res, _next) => {
|
||||
try {
|
||||
const data = await internalRemoteVersion.get();
|
||||
res.status(200).send(data);
|
||||
} catch (error) {
|
||||
debug(logger, `${req.method.toUpperCase()} ${req.path}: ${error}`);
|
||||
// Send 200 even though there's an error to avoid triggering update checks repeatedly
|
||||
res.status(200).send({
|
||||
current: null,
|
||||
latest: null,
|
||||
update_available: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -71,6 +71,11 @@
|
||||
"propagation_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"key_type": {
|
||||
"type": "string",
|
||||
"enum": ["rsa", "ecdsa"],
|
||||
"default": "rsa"
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
|
||||
23
backend/schema/components/check-version-object.json
Normal file
23
backend/schema/components/check-version-object.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "object",
|
||||
"description": "Check Version object",
|
||||
"additionalProperties": false,
|
||||
"required": ["current", "latest", "update_available"],
|
||||
"properties": {
|
||||
"current": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Current version string",
|
||||
"example": "v2.10.1"
|
||||
},
|
||||
"latest": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Latest version string",
|
||||
"example": "v2.13.4"
|
||||
},
|
||||
"update_available": {
|
||||
"type": "boolean",
|
||||
"description": "Whether there's an update available",
|
||||
"example": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@
|
||||
"enabled",
|
||||
"locations",
|
||||
"hsts_enabled",
|
||||
"hsts_subdomains"
|
||||
"hsts_subdomains",
|
||||
"trust_forwarded_proto"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -141,6 +142,11 @@
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../common.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"trust_forwarded_proto":{
|
||||
"type": "boolean",
|
||||
"description": "Trust the forwarded headers",
|
||||
"example": false
|
||||
},
|
||||
"certificate": {
|
||||
"oneOf": [
|
||||
{
|
||||
|
||||
18
backend/schema/components/token-challenge.json
Normal file
18
backend/schema/components/token-challenge.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "object",
|
||||
"description": "Token object",
|
||||
"required": ["requires_2fa", "challenge_token"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"requires_2fa": {
|
||||
"description": "Whether this token request requires two-factor authentication",
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"challenge_token": {
|
||||
"description": "Challenge Token used in subsequent 2FA verification",
|
||||
"example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,8 @@
|
||||
"enabled": true,
|
||||
"locations": [],
|
||||
"hsts_enabled": false,
|
||||
"hsts_subdomains": false
|
||||
"hsts_subdomains": false,
|
||||
"trust_forwarded_proto": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"locations": [],
|
||||
"hsts_enabled": false,
|
||||
"hsts_subdomains": false,
|
||||
"trust_forwarded_proto": false,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2025-10-28T00:50:24.000Z",
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"trust_forwarded_proto": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/trust_forwarded_proto"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/http2_support"
|
||||
},
|
||||
@@ -122,6 +125,7 @@
|
||||
"locations": [],
|
||||
"hsts_enabled": false,
|
||||
"hsts_subdomains": false,
|
||||
"trust_forwarded_proto": false,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2025-10-28T00:50:24.000Z",
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"trust_forwarded_proto": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/trust_forwarded_proto"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/http2_support"
|
||||
},
|
||||
@@ -119,6 +122,7 @@
|
||||
"locations": [],
|
||||
"hsts_enabled": false,
|
||||
"hsts_subdomains": false,
|
||||
"trust_forwarded_proto": false,
|
||||
"certificate": null,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
|
||||
55
backend/schema/paths/tokens/2fa/post.json
Normal file
55
backend/schema/paths/tokens/2fa/post.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"operationId": "loginWith2FA",
|
||||
"summary": "Verify 2FA code and get full token",
|
||||
"tags": ["tokens"],
|
||||
"requestBody": {
|
||||
"description": "2fa Challenge Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"challenge_token": {
|
||||
"minLength": 1,
|
||||
"type": "string",
|
||||
"example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||
},
|
||||
"code": {
|
||||
"minLength": 6,
|
||||
"maxLength": 8,
|
||||
"type": "string",
|
||||
"example": "012345"
|
||||
}
|
||||
},
|
||||
"required": ["challenge_token", "code"],
|
||||
"type": "object"
|
||||
},
|
||||
"example": {
|
||||
"challenge_token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
|
||||
"code": "012345"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"expires": "2025-02-04T20:40:46.340Z",
|
||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/token-object.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,14 @@
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/token-object.json"
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "../../components/token-object.json"
|
||||
},
|
||||
{
|
||||
"$ref": "../../components/token-challenge.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
92
backend/schema/paths/users/userID/2fa/backup-codes/post.json
Normal file
92
backend/schema/paths/users/userID/2fa/backup-codes/post.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"operationId": "regenUser2faCodes",
|
||||
"summary": "Regenerate 2FA backup codes",
|
||||
"tags": ["users"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Verification Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"code": {
|
||||
"minLength": 6,
|
||||
"maxLength": 8,
|
||||
"type": "string",
|
||||
"example": "123456"
|
||||
}
|
||||
},
|
||||
"required": ["code"],
|
||||
"type": "object"
|
||||
},
|
||||
"example": {
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"backup_codes": [
|
||||
"6CD7CB06",
|
||||
"495302F3",
|
||||
"D8037852",
|
||||
"A6FFC956",
|
||||
"BC1A1851",
|
||||
"A05E644F",
|
||||
"A406D2E8",
|
||||
"0AE3C522"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["backup_codes"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"backup_codes": {
|
||||
"description": "Backup codes",
|
||||
"example": [
|
||||
"6CD7CB06",
|
||||
"495302F3",
|
||||
"D8037852",
|
||||
"A6FFC956",
|
||||
"BC1A1851",
|
||||
"A05E644F",
|
||||
"A406D2E8",
|
||||
"0AE3C522"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"example": "6CD7CB06"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
||||
48
backend/schema/paths/users/userID/2fa/delete.json
Normal file
48
backend/schema/paths/users/userID/2fa/delete.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"operationId": "disableUser2fa",
|
||||
"summary": "Disable 2fa for user",
|
||||
"tags": ["users"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "code",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"minLength": 6,
|
||||
"maxLength": 6,
|
||||
"example": "012345"
|
||||
},
|
||||
"required": true,
|
||||
"description": "2fa Code",
|
||||
"example": "012345"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
||||
92
backend/schema/paths/users/userID/2fa/enable/post.json
Normal file
92
backend/schema/paths/users/userID/2fa/enable/post.json
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"operationId": "enableUser2fa",
|
||||
"summary": "Verify code and enable 2FA",
|
||||
"tags": ["users"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Verification Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"code": {
|
||||
"minLength": 6,
|
||||
"maxLength": 8,
|
||||
"type": "string",
|
||||
"example": "123456"
|
||||
}
|
||||
},
|
||||
"required": ["code"],
|
||||
"type": "object"
|
||||
},
|
||||
"example": {
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"backup_codes": [
|
||||
"6CD7CB06",
|
||||
"495302F3",
|
||||
"D8037852",
|
||||
"A6FFC956",
|
||||
"BC1A1851",
|
||||
"A05E644F",
|
||||
"A406D2E8",
|
||||
"0AE3C522"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["backup_codes"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"backup_codes": {
|
||||
"description": "Backup codes",
|
||||
"example": [
|
||||
"6CD7CB06",
|
||||
"495302F3",
|
||||
"D8037852",
|
||||
"A6FFC956",
|
||||
"BC1A1851",
|
||||
"A05E644F",
|
||||
"A406D2E8",
|
||||
"0AE3C522"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"example": "6CD7CB06"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
||||
57
backend/schema/paths/users/userID/2fa/get.json
Normal file
57
backend/schema/paths/users/userID/2fa/get.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"operationId": "getUser2faStatus",
|
||||
"summary": "Get user 2fa Status",
|
||||
"tags": ["users"],
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"enabled": false,
|
||||
"backup_codes_remaining": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["enabled", "backup_codes_remaining"],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Is 2FA enabled for this user",
|
||||
"example": true
|
||||
},
|
||||
"backup_codes_remaining": {
|
||||
"type": "integer",
|
||||
"description": "Number of remaining backup codes for this user",
|
||||
"example": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
backend/schema/paths/users/userID/2fa/post.json
Normal file
52
backend/schema/paths/users/userID/2fa/post.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"operationId": "setupUser2fa",
|
||||
"summary": "Start 2FA setup, returns QR code URL",
|
||||
"tags": ["users"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"secret": "JZYCEBIEEJYUGPQM",
|
||||
"otpauth_url": "otpauth://totp/Nginx%20Proxy%20Manager:jc%40jc21.com?secret=JZYCEBIEEJYUGPQM&period=30&digits=6&algorithm=SHA1&issuer=Nginx%20Proxy%20Manager"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["secret", "otpauth_url"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"secret": {
|
||||
"description": "TOTP Secret",
|
||||
"example": "JZYCEBIEEJYUGPQM",
|
||||
"type": "string"
|
||||
},
|
||||
"otpauth_url": {
|
||||
"description": "OTP Auth URL for QR Code generation",
|
||||
"example": "otpauth://totp/Nginx%20Proxy%20Manager:jc%40jc21.com?secret=JZYCEBIEEJYUGPQM&period=30&digits=6&algorithm=SHA1&issuer=Nginx%20Proxy%20Manager",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
||||
26
backend/schema/paths/version/check/get.json
Normal file
26
backend/schema/paths/version/check/get.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"operationId": "checkVersion",
|
||||
"summary": "Returns any new version data from github",
|
||||
"tags": ["public"],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"current": "v2.12.0",
|
||||
"latest": "v2.13.4",
|
||||
"update_available": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/check-version-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,6 +293,16 @@
|
||||
"$ref": "./paths/tokens/post.json"
|
||||
}
|
||||
},
|
||||
"/tokens/2fa": {
|
||||
"post": {
|
||||
"$ref": "./paths/tokens/2fa/post.json"
|
||||
}
|
||||
},
|
||||
"/version/check": {
|
||||
"get": {
|
||||
"$ref": "./paths/version/check/get.json"
|
||||
}
|
||||
},
|
||||
"/users": {
|
||||
"get": {
|
||||
"$ref": "./paths/users/get.json"
|
||||
@@ -312,6 +322,27 @@
|
||||
"$ref": "./paths/users/userID/delete.json"
|
||||
}
|
||||
},
|
||||
"/users/{userID}/2fa": {
|
||||
"post": {
|
||||
"$ref": "./paths/users/userID/2fa/post.json"
|
||||
},
|
||||
"get": {
|
||||
"$ref": "./paths/users/userID/2fa/get.json"
|
||||
},
|
||||
"delete": {
|
||||
"$ref": "./paths/users/userID/2fa/delete.json"
|
||||
}
|
||||
},
|
||||
"/users/{userID}/2fa/enable": {
|
||||
"post": {
|
||||
"$ref": "./paths/users/userID/2fa/enable/post.json"
|
||||
}
|
||||
},
|
||||
"/users/{userID}/2fa/backup-codes": {
|
||||
"post": {
|
||||
"$ref": "./paths/users/userID/2fa/backup-codes/post.json"
|
||||
}
|
||||
},
|
||||
"/users/{userID}/auth": {
|
||||
"put": {
|
||||
"$ref": "./paths/users/userID/auth/put.json"
|
||||
|
||||
104
backend/scripts/regenerate-config
Executable file
104
backend/scripts/regenerate-config
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import * as process from "node:process"; // Use the node: protocol for built-ins
|
||||
import internalNginx from "../internal/nginx.js";
|
||||
import { castJsonIfNeed } from "../lib/helpers.js";
|
||||
import { global as logger } from "../logger.js";
|
||||
import deadHostModel from "../models/dead_host.js";
|
||||
import proxyHostModel from "../models/proxy_host.js";
|
||||
import redirectionHostModel from "../models/redirection_host.js";
|
||||
import streamModel from "../models/stream.js";
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const UNATTENDED = args.includes("-y") || args.includes("--yes");
|
||||
if (args.includes("--help")) {
|
||||
console.log("Usage: ./regenerate-config [--help] [-y|--yes]");
|
||||
}
|
||||
|
||||
// ask for the user to confirm the action if not in unattended mode
|
||||
if (!UNATTENDED) {
|
||||
const readline = await import("node:readline");
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
const question = (query) =>
|
||||
new Promise((resolve) => rl.question(query, resolve));
|
||||
|
||||
const answer = await question(
|
||||
"This will iterate over all Hosts and regnerate their Nginx configs.\n\nAre you sure you want to proceed? (y/N) ",
|
||||
);
|
||||
rl.close();
|
||||
|
||||
if (answer.toLowerCase() !== "y") {
|
||||
console.log("Aborting.");
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Let's do it.
|
||||
|
||||
// Proxy hosts
|
||||
const proxyRows = await proxyHostModel
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("enabled", 1)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,access_list,certificate]")
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
for (const row of proxyRows) {
|
||||
logger.info(
|
||||
`Regenerating config for Proxy Host #${row.id}: ${row.domain_names.join(", ")}`,
|
||||
);
|
||||
await internalNginx.configure(proxyHostModel, "proxy_host", row);
|
||||
}
|
||||
|
||||
// Redirection hosts
|
||||
const redirectionRows = await redirectionHostModel
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("enabled", 1)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,access_list,certificate]")
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
for (const row of redirectionRows) {
|
||||
logger.info(
|
||||
`Regenerating config for Redirection Host #${row.id}: ${row.domain_names.join(", ")}`,
|
||||
);
|
||||
await internalNginx.configure(redirectionHostModel, "redirection_host", row);
|
||||
}
|
||||
|
||||
// 404 hosts
|
||||
const deadRows = await deadHostModel
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("enabled", 1)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,access_list,certificate]")
|
||||
.orderBy(castJsonIfNeed("domain_names"), "ASC");
|
||||
|
||||
for (const row of deadRows) {
|
||||
logger.info(
|
||||
`Regenerating config for 404 Host #${row.id}: ${row.domain_names.join(", ")}`,
|
||||
);
|
||||
await internalNginx.configure(deadHostModel, "dead_host", row);
|
||||
}
|
||||
|
||||
// Streams
|
||||
const streamRows = await streamModel
|
||||
.query()
|
||||
.where("is_deleted", 0)
|
||||
.andWhere("enabled", 1)
|
||||
.groupBy("id")
|
||||
.allowGraph("[owner,access_list,certificate]");
|
||||
|
||||
for (const row of streamRows) {
|
||||
logger.info(`Regenerating config for Stream #${row.id}: ${row.incoming_port} -> ${row.forwarding_host}:${row.forwarding_port}`);
|
||||
await internalNginx.configure(deadHostModel, "stream", row);
|
||||
}
|
||||
|
||||
logger.success("Completed");
|
||||
process.exit(0);
|
||||
@@ -1,6 +1,11 @@
|
||||
{% if certificate and certificate_id > 0 -%}
|
||||
{% if ssl_forced == 1 or ssl_forced == true %}
|
||||
# Force SSL
|
||||
{% if trust_forwarded_proto == true %}
|
||||
set $trust_forwarded_proto "T";
|
||||
{% else %}
|
||||
set $trust_forwarded_proto "F";
|
||||
{% endif %}
|
||||
include conf.d/include/force-ssl.conf;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -12,6 +12,9 @@ server {
|
||||
|
||||
proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
|
||||
|
||||
access_log /data/logs/stream-{{ id }}_access.log stream;
|
||||
error_log /data/logs/stream-{{ id }}_error.log warn;
|
||||
|
||||
# Custom
|
||||
include /data/nginx/custom/server_stream[.]conf;
|
||||
include /data/nginx/custom/server_stream_tcp[.]conf;
|
||||
@@ -25,9 +28,12 @@ server {
|
||||
|
||||
proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
|
||||
|
||||
access_log /data/logs/stream-{{ id }}_access.log stream;
|
||||
error_log /data/logs/stream-{{ id }}_error.log warn;
|
||||
|
||||
# Custom
|
||||
include /data/nginx/custom/server_stream[.]conf;
|
||||
include /data/nginx/custom/server_stream_udp[.]conf;
|
||||
}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
1542
backend/yarn.lock
1542
backend/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -24,9 +24,13 @@ services:
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
expose:
|
||||
- "80-81/tcp"
|
||||
- "80/tcp"
|
||||
- "81/tcp"
|
||||
- "443/tcp"
|
||||
- "1500-1503/tcp"
|
||||
- "1500/tcp"
|
||||
- "1501/tcp"
|
||||
- "1502/tcp"
|
||||
- "1503/tcp"
|
||||
networks:
|
||||
fulltest:
|
||||
aliases:
|
||||
@@ -105,7 +109,7 @@ services:
|
||||
- "cypress_logs:/test/results"
|
||||
- "./dev/resolv.conf:/etc/resolv.conf:ro"
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
||||
command: cypress run --browser chrome --config-file=cypress/config/ci.mjs
|
||||
networks:
|
||||
- fulltest
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ services:
|
||||
- "../test/results:/results"
|
||||
- "./dev/resolv.conf:/etc/resolv.conf:ro"
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
||||
command: cypress run --browser chrome --config-file=cypress/config/ci.mjs
|
||||
networks:
|
||||
- nginx_proxy_manager
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ server {
|
||||
set $port "80";
|
||||
|
||||
server_name localhost-nginx-proxy-manager;
|
||||
access_log /data/logs/fallback_access.log standard;
|
||||
error_log /data/logs/fallback_error.log warn;
|
||||
access_log /data/logs/fallback_http_access.log standard;
|
||||
error_log /data/logs/fallback_http_error.log warn;
|
||||
include conf.d/include/assets.conf;
|
||||
include conf.d/include/block-exploits.conf;
|
||||
include conf.d/include/letsencrypt-acme-challenge.conf;
|
||||
@@ -30,7 +30,7 @@ server {
|
||||
set $port "443";
|
||||
|
||||
server_name localhost;
|
||||
access_log /data/logs/fallback_access.log standard;
|
||||
access_log /data/logs/fallback_http_access.log standard;
|
||||
error_log /dev/null crit;
|
||||
include conf.d/include/ssl-ciphers.conf;
|
||||
ssl_reject_handshake on;
|
||||
|
||||
@@ -5,6 +5,28 @@ if ($scheme = "http") {
|
||||
if ($request_uri = /.well-known/acme-challenge/test-challenge) {
|
||||
set $test "${test}T";
|
||||
}
|
||||
|
||||
# Check if the ssl staff has been handled
|
||||
set $test_ssl_handled "";
|
||||
if ($trust_forwarded_proto = "") {
|
||||
set $trust_forwarded_proto "F";
|
||||
}
|
||||
if ($trust_forwarded_proto = "T") {
|
||||
set $test_ssl_handled "${test_ssl_handled}T";
|
||||
}
|
||||
if ($http_x_forwarded_proto = "https") {
|
||||
set $test_ssl_handled "${test_ssl_handled}S";
|
||||
}
|
||||
if ($http_x_forwarded_scheme = "https") {
|
||||
set $test_ssl_handled "${test_ssl_handled}S";
|
||||
}
|
||||
if ($test_ssl_handled = "TSS") {
|
||||
set $test_ssl_handled "TS";
|
||||
}
|
||||
if ($test_ssl_handled = "TS") {
|
||||
set $test "${test}S";
|
||||
}
|
||||
|
||||
if ($test = H) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
|
||||
log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';
|
||||
|
||||
access_log /data/logs/fallback_access.log proxy;
|
||||
access_log /data/logs/fallback_http_access.log proxy;
|
||||
3
docker/rootfs/etc/nginx/conf.d/include/log-stream.conf
Normal file
3
docker/rootfs/etc/nginx/conf.d/include/log-stream.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
log_format stream '[$time_local] [Client $remote_addr:$remote_port] $protocol $status $bytes_sent $bytes_received $session_time [Sent-to $upstream_addr] [Sent $upstream_bytes_sent] [Received $upstream_bytes_received] [Time $upstream_connect_time] $ssl_protocol $ssl_cipher';
|
||||
|
||||
access_log /data/logs/fallback_stream_access.log stream;
|
||||
@@ -1,7 +1,7 @@
|
||||
add_header X-Served-By $host;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Scheme $x_forwarded_scheme;
|
||||
proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_pass $forward_scheme://$server:$port$request_uri;
|
||||
|
||||
@@ -47,16 +47,28 @@ http {
|
||||
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
|
||||
|
||||
# Log format and fallback log file
|
||||
include /etc/nginx/conf.d/include/log.conf;
|
||||
include /etc/nginx/conf.d/include/log-proxy[.]conf;
|
||||
|
||||
# Dynamically generated resolvers file
|
||||
include /etc/nginx/conf.d/include/resolvers.conf;
|
||||
include /etc/nginx/conf.d/include/resolvers[.]conf;
|
||||
|
||||
# Default upstream scheme
|
||||
map $host $forward_scheme {
|
||||
default http;
|
||||
}
|
||||
|
||||
# Handle upstream X-Forwarded-Proto and X-Forwarded-Scheme header
|
||||
map $http_x_forwarded_proto $x_forwarded_proto {
|
||||
"http" "http";
|
||||
"https" "https";
|
||||
default $scheme;
|
||||
}
|
||||
map $http_x_forwarded_scheme $x_forwarded_scheme {
|
||||
"http" "http";
|
||||
"https" "https";
|
||||
default $scheme;
|
||||
}
|
||||
|
||||
# Real IP Determination
|
||||
|
||||
# Local subnets:
|
||||
@@ -64,7 +76,7 @@ http {
|
||||
set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
|
||||
set_real_ip_from 192.168.0.0/16;
|
||||
# NPM generated CDN ip ranges:
|
||||
include conf.d/include/ip_ranges.conf;
|
||||
include conf.d/include/ip_ranges[.]conf;
|
||||
# always put the following 2 lines after ip subnets:
|
||||
real_ip_header X-Real-IP;
|
||||
real_ip_recursive on;
|
||||
@@ -85,6 +97,9 @@ http {
|
||||
}
|
||||
|
||||
stream {
|
||||
# Log format and fallback log file
|
||||
include /etc/nginx/conf.d/include/log-stream[.]conf;
|
||||
|
||||
# Files generated by NPM
|
||||
include /data/nginx/stream/*.conf;
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ log_info 'Dynamic resolvers ...'
|
||||
|
||||
# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
|
||||
# thanks @tfmm
|
||||
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) ipv6=off valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
else
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
if [ "$(is_true "${DISABLE_RESOLVER:-}")" = '0' ]; then
|
||||
if [ "$(is_true "${DISABLE_IPV6:-}")" = '1' ]; then
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) ipv6=off valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
else
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -12,7 +12,7 @@ process_folder () {
|
||||
FILES=$(find "$1" -type f -name "*.conf")
|
||||
SED_REGEX=
|
||||
|
||||
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
|
||||
if [ "$(is_true "${DISABLE_IPV6:-}")" = '1' ]; then
|
||||
# IPV6 is disabled
|
||||
echo "Disabling IPV6 in hosts in: $1"
|
||||
SED_REGEX='s/^([^#]*)listen \[::\]/\1#listen [::]/g'
|
||||
@@ -25,7 +25,13 @@ process_folder () {
|
||||
for FILE in $FILES
|
||||
do
|
||||
echo "- ${FILE}"
|
||||
echo "$(sed -E "$SED_REGEX" "$FILE")" > $FILE
|
||||
TMPFILE="${FILE}.tmp"
|
||||
if sed -E "$SED_REGEX" "$FILE" > "$TMPFILE" && [ -s "$TMPFILE" ]; then
|
||||
mv "$TMPFILE" "$FILE"
|
||||
else
|
||||
echo "WARNING: skipping ${FILE} — sed produced empty output" >&2
|
||||
rm -f "$TMPFILE"
|
||||
fi
|
||||
done
|
||||
|
||||
# ensure the files are still owned by the npm user
|
||||
|
||||
@@ -17,10 +17,6 @@ case $TARGETPLATFORM in
|
||||
S6_ARCH=aarch64
|
||||
;;
|
||||
|
||||
linux/arm/v7)
|
||||
S6_ARCH=armhf
|
||||
;;
|
||||
|
||||
*)
|
||||
S6_ARCH=x86_64
|
||||
;;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"scripts": {
|
||||
"dev": "vitepress dev --host",
|
||||
"build": "vitepress build",
|
||||
"preview": "vitepress preview"
|
||||
"preview": "vitepress preview",
|
||||
"set-version": "./scripts/set-version.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.6.4"
|
||||
|
||||
17
docs/scripts/set-version.sh
Executable file
17
docs/scripts/set-version.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -euf
|
||||
|
||||
# this script accepts a version number as an argument
|
||||
# and replaces {{VERSION}} in src/*.md with the provided version number.
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$DIR/.." || exit 1
|
||||
|
||||
VERSION="$1"
|
||||
# find all .md files in src/ and replace {{VERSION}} with the provided version number
|
||||
find src/ -type f -name "*.md" -exec sed -i "s/{{VERSION}}/$VERSION/g" {} \;
|
||||
@@ -14,7 +14,7 @@ on the `data` and `letsencrypt` folders at startup.
|
||||
```yml
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
environment:
|
||||
PUID: 1000
|
||||
PGID: 1000
|
||||
@@ -101,7 +101,7 @@ secrets:
|
||||
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# Public HTTP Port:
|
||||
@@ -130,18 +130,16 @@ services:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: jc21/mariadb-aria
|
||||
image: 'linuxserver/mariadb'
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# MYSQL_ROOT_PASSWORD: "npm" # use secret instead
|
||||
MYSQL_ROOT_PASSWORD__FILE: /run/secrets/DB_ROOT_PWD
|
||||
MYSQL_DATABASE: "npm"
|
||||
MYSQL_USER: "npm"
|
||||
# MYSQL_PASSWORD: "npm" # use secret instead
|
||||
MYSQL_DATABASE: 'npm'
|
||||
MYSQL_USER: 'npm'
|
||||
MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
|
||||
MARIADB_AUTO_UPGRADE: '1'
|
||||
TZ: 'Australia/Brisbane'
|
||||
volumes:
|
||||
- ./mysql:/var/lib/mysql
|
||||
- ./mariadb:/config
|
||||
secrets:
|
||||
- DB_ROOT_PWD
|
||||
- MYSQL_PWD
|
||||
@@ -233,8 +231,20 @@ load_module /usr/lib/nginx/modules/ngx_stream_geoip2_module.so;
|
||||
|
||||
Setting these environment variables will create the default user on startup, skipping the UI first user setup screen:
|
||||
|
||||
```
|
||||
```yml
|
||||
environment:
|
||||
INITIAL_ADMIN_EMAIL: my@example.com
|
||||
INITIAL_ADMIN_PASSWORD: mypassword1
|
||||
```
|
||||
|
||||
## Disable Nginx Resolver
|
||||
|
||||
On startup, we generate a resolvers directive for Nginx unless this is defined:
|
||||
|
||||
```yml
|
||||
environment:
|
||||
DISABLE_RESOLVER: true
|
||||
```
|
||||
|
||||
In this configuration, all DNS queries performed by Nginx will fall to the `/etc/hosts` file
|
||||
and then the `/etc/resolv.conf`.
|
||||
|
||||
@@ -64,7 +64,7 @@ I won't go in to too much detail here but here are the basics for someone new to
|
||||
```yml
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: "Australia/Brisbane"
|
||||
|
||||
@@ -11,7 +11,7 @@ Create a `docker-compose.yml` file:
|
||||
```yml
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
@@ -45,10 +45,7 @@ docker compose up -d
|
||||
|
||||
## Using MySQL / MariaDB Database
|
||||
|
||||
If you opt for the MySQL configuration you will have to provide the database server yourself. You can also use MariaDB. Here are the minimum supported versions:
|
||||
|
||||
- MySQL v5.7.8+
|
||||
- MariaDB v10.2.7+
|
||||
If you opt for the MySQL configuration you will have to provide the database server yourself.
|
||||
|
||||
It's easy to use another docker container for your database also and link it as part of the docker stack, so that's what the following examples
|
||||
are going to use.
|
||||
@@ -58,7 +55,7 @@ Here is an example of what your `docker-compose.yml` will look like when using a
|
||||
```yml
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# These ports are in format <host-port>:<container-port>
|
||||
@@ -88,31 +85,29 @@ services:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: 'jc21/mariadb-aria:latest'
|
||||
image: 'linuxserver/mariadb'
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 'npm'
|
||||
MYSQL_DATABASE: 'npm'
|
||||
MYSQL_USER: 'npm'
|
||||
MYSQL_PASSWORD: 'npm'
|
||||
MARIADB_AUTO_UPGRADE: '1'
|
||||
TZ: 'Australia/Brisbane'
|
||||
volumes:
|
||||
- ./mysql:/var/lib/mysql
|
||||
- ./mariadb:/config
|
||||
```
|
||||
|
||||
::: warning
|
||||
|
||||
Please note, that `DB_MYSQL_*` environment variables will take precedent over `DB_SQLITE_*` variables. So if you keep the MySQL variables, you will not be able to use SQLite.
|
||||
|
||||
:::
|
||||
|
||||
### Optional: MySQL / MariaDB SSL
|
||||
|
||||
You can enable TLS for the MySQL/MariaDB connection with these environment variables:
|
||||
|
||||
- DB_MYSQL_SSL: Enable SSL when set to true. If unset or false, SSL disabled (previous default behaviour).
|
||||
- DB_MYSQL_SSL_REJECT_UNAUTHORIZED: (default: true) Validate the server certificate chain. Set to false to allow self‑signed/unknown CA.
|
||||
- DB_MYSQL_SSL_VERIFY_IDENTITY: (default: true) Performs host name / identity verification.
|
||||
- `DB_MYSQL_SSL`: Enable SSL when set to true. If unset or false, SSL disabled (previous default behaviour).
|
||||
- `DB_MYSQL_SSL_REJECT_UNAUTHORIZED`: (default: true) Validate the server certificate chain. Set to false to allow self‑signed/unknown CA.
|
||||
- `DB_MYSQL_SSL_VERIFY_IDENTITY`: (default: true) Performs host name / identity verification.
|
||||
|
||||
Enabling SSL using a self-signed cert (not recommended for production).
|
||||
|
||||
@@ -123,7 +118,7 @@ Similar to the MySQL server setup:
|
||||
```yml
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
image: 'jc21/nginx-proxy-manager:{{VERSION}}'
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# These ports are in format <host-port>:<container-port>
|
||||
@@ -169,7 +164,11 @@ Custom Postgres schema is not supported, as such `public` will be used.
|
||||
The docker images support the following architectures:
|
||||
- amd64
|
||||
- arm64
|
||||
- armv7
|
||||
|
||||
::: warning
|
||||
`armv7` is no longer supported in version 2.14+. This is due to Nodejs dropping support for armhf. Please
|
||||
use the `2.13.7` image tag if this applies to you.
|
||||
:::
|
||||
|
||||
The docker images are a manifest of all the architecture docker builds supported, so this means
|
||||
you don't have to worry about doing anything special and you can follow the common instructions above.
|
||||
@@ -181,8 +180,6 @@ for a list of supported architectures and if you want one that doesn't exist,
|
||||
Also, if you don't know how to already, follow [this guide to install docker and docker-compose](https://manre-universe.net/how-to-run-docker-and-docker-compose-on-raspbian/)
|
||||
on Raspbian.
|
||||
|
||||
Please note that the `jc21/mariadb-aria:latest` image might have some problems on some ARM devices, if you want a separate database container, use the `yobasystems/alpine-mariadb:latest` image.
|
||||
|
||||
## Initial Run
|
||||
|
||||
After the app is running for the first time, the following will happen:
|
||||
|
||||
946
docs/yarn.lock
946
docs/yarn.lock
File diff suppressed because it is too large
Load Diff
2
frontend/.gitignore
vendored
2
frontend/.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
src/locale/lang
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.3/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
|
||||
@@ -7,18 +7,30 @@
|
||||
// - Also checks the error messages returned by the backend
|
||||
|
||||
const allLocales = [
|
||||
["en", "en-US"],
|
||||
["es", "es-ES"],
|
||||
["de", "de-DE"],
|
||||
["ru", "ru-RU"],
|
||||
["sk", "sk-SK"],
|
||||
["zh", "zh-CN"],
|
||||
["pl", "pl-PL"],
|
||||
["en", "en-US"],
|
||||
["de", "de-DE"],
|
||||
["pt", "pt-PT"],
|
||||
["es", "es-ES"],
|
||||
["et", "et-EE"],
|
||||
["fr", "fr-FR"],
|
||||
["it", "it-IT"],
|
||||
["ja", "ja-JP"],
|
||||
["nl", "nl-NL"],
|
||||
["pl", "pl-PL"],
|
||||
["ru", "ru-RU"],
|
||||
["sk", "sk-SK"],
|
||||
["cs", "cs-CZ"],
|
||||
["vi", "vi-VN"],
|
||||
["zh", "zh-CN"],
|
||||
["ko", "ko-KR"],
|
||||
["bg", "bg-BG"],
|
||||
["id", "id-ID"],
|
||||
["tr", "tr-TR"],
|
||||
["hu", "hu-HU"],
|
||||
["no", "no-NO"],
|
||||
];
|
||||
|
||||
const ignoreUnused = [
|
||||
/^.*$/,
|
||||
];
|
||||
const ignoreUnused = [/^.*$/];
|
||||
|
||||
const { spawnSync } = require("child_process");
|
||||
const fs = require("fs");
|
||||
@@ -59,105 +71,95 @@ const allWarnings = [];
|
||||
const allKeys = [];
|
||||
|
||||
const checkLangList = (fullCode) => {
|
||||
const key = "locale-" + fullCode;
|
||||
if (typeof langList[key] === "undefined") {
|
||||
allErrors.push(
|
||||
"ERROR: `" + key + "` language does not exist in lang-list.json",
|
||||
);
|
||||
}
|
||||
const key = "locale-" + fullCode;
|
||||
if (typeof langList[key] === "undefined") {
|
||||
allErrors.push("ERROR: `" + key + "` language does not exist in lang-list.json");
|
||||
}
|
||||
};
|
||||
|
||||
const compareLocale = (locale) => {
|
||||
const projectLocaleKeys = Object.keys(allLocalesInProject);
|
||||
// Check that locale contains the items used in the codebase
|
||||
projectLocaleKeys.map((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allErrors.push(
|
||||
"ERROR: `" + locale[0] + "` does not contain item: `" + key + "`",
|
||||
);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
// Check that locale contains all error.* items
|
||||
BACKEND_ERRORS.forEach((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allErrors.push(
|
||||
"ERROR: `" + locale[0] + "` does not contain item: `" + key + "`",
|
||||
);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
const projectLocaleKeys = Object.keys(allLocalesInProject);
|
||||
// Check that locale contains the items used in the codebase
|
||||
projectLocaleKeys.map((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allErrors.push("ERROR: `" + locale[0] + "` does not contain item: `" + key + "`");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
// Check that locale contains all error.* items
|
||||
BACKEND_ERRORS.forEach((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allErrors.push("ERROR: `" + locale[0] + "` does not contain item: `" + key + "`");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
// Check that locale does not contain items not used in the codebase
|
||||
const localeKeys = Object.keys(locale.data);
|
||||
localeKeys.map((key) => {
|
||||
let ignored = false;
|
||||
ignoreUnused.map((regex) => {
|
||||
if (key.match(regex)) {
|
||||
ignored = true;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
// Check that locale does not contain items not used in the codebase
|
||||
const localeKeys = Object.keys(locale.data);
|
||||
localeKeys.map((key) => {
|
||||
let ignored = false;
|
||||
ignoreUnused.map((regex) => {
|
||||
if (key.match(regex)) {
|
||||
ignored = true;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
if (!ignored && typeof allLocalesInProject[key] === "undefined") {
|
||||
// ensure this key doesn't exist in the backend errors either
|
||||
if (!BACKEND_ERRORS.includes(key)) {
|
||||
allErrors.push(
|
||||
"ERROR: `" + locale[0] + "` contains unused item: `" + key + "`",
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!ignored && typeof allLocalesInProject[key] === "undefined") {
|
||||
// ensure this key doesn't exist in the backend errors either
|
||||
if (!BACKEND_ERRORS.includes(key)) {
|
||||
allErrors.push("ERROR: `" + locale[0] + "` contains unused item: `" + key + "`");
|
||||
}
|
||||
}
|
||||
|
||||
// Add this key to allKeys
|
||||
if (allKeys.indexOf(key) === -1) {
|
||||
allKeys.push(key);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
// Add this key to allKeys
|
||||
if (allKeys.indexOf(key) === -1) {
|
||||
allKeys.push(key);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
// Checks for any keys missing from this locale, that
|
||||
// have been defined in any other locales
|
||||
const checkForMissing = (locale) => {
|
||||
allKeys.forEach((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allWarnings.push(
|
||||
"WARN: `" + locale[0] + "` does not contain item: `" + key + "`",
|
||||
);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
allKeys.forEach((key) => {
|
||||
if (typeof locale.data[key] === "undefined") {
|
||||
allWarnings.push("WARN: `" + locale[0] + "` does not contain item: `" + key + "`");
|
||||
}
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
// Local all locale data
|
||||
allLocales.map((locale, idx) => {
|
||||
checkLangList(locale[1]);
|
||||
allLocales[idx].data = require("./src/locale/src/" + locale[0] + ".json");
|
||||
return null;
|
||||
checkLangList(locale[1]);
|
||||
allLocales[idx].data = require("./src/locale/src/" + locale[0] + ".json");
|
||||
return null;
|
||||
});
|
||||
|
||||
// Verify all locale data
|
||||
allLocales.map((locale) => {
|
||||
compareLocale(locale);
|
||||
checkForMissing(locale);
|
||||
return null;
|
||||
compareLocale(locale);
|
||||
checkForMissing(locale);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (allErrors.length) {
|
||||
allErrors.map((err) => {
|
||||
console.log("\x1b[31m%s\x1b[0m", err);
|
||||
return null;
|
||||
});
|
||||
allErrors.map((err) => {
|
||||
console.log("\x1b[31m%s\x1b[0m", err);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
if (allWarnings.length) {
|
||||
allWarnings.map((err) => {
|
||||
console.log("\x1b[33m%s\x1b[0m", err);
|
||||
return null;
|
||||
});
|
||||
allWarnings.map((err) => {
|
||||
console.log("\x1b[33m%s\x1b[0m", err);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
if (allErrors.length) {
|
||||
process.exit(1);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("\x1b[32m%s\x1b[0m", "Locale check passed");
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Nginx Proxy Manager</title>
|
||||
<meta name="description" content="In The Office Planner" />
|
||||
<link rel="preload" href="/images/logo-no-text.svg" as="image" type="image/svg+xml" fetchPriority="high">
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
|
||||
@@ -17,50 +17,50 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tabler/core": "^1.4.0",
|
||||
"@tabler/icons-react": "^3.35.0",
|
||||
"@tanstack/react-query": "^5.90.6",
|
||||
"@tabler/icons-react": "^3.37.1",
|
||||
"@tanstack/react-query": "^5.90.21",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
"@uiw/react-textarea-code-editor": "^3.1.1",
|
||||
"classnames": "^2.5.1",
|
||||
"country-flag-icons": "^1.5.21",
|
||||
"country-flag-icons": "^1.6.14",
|
||||
"date-fns": "^4.1.0",
|
||||
"ez-modal-react": "^1.0.5",
|
||||
"formik": "^2.4.6",
|
||||
"formik": "^2.4.9",
|
||||
"generate-password-browser": "^1.1.0",
|
||||
"humps": "^2.0.1",
|
||||
"query-string": "^9.3.1",
|
||||
"react": "^19.2.0",
|
||||
"react": "^19.2.4",
|
||||
"react-bootstrap": "^2.10.10",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-intl": "^7.1.14",
|
||||
"react-dom": "^19.2.4",
|
||||
"react-intl": "^8.1.3",
|
||||
"react-markdown": "^10.1.0",
|
||||
"react-router-dom": "^7.9.5",
|
||||
"react-router-dom": "^7.13.0",
|
||||
"react-select": "^5.10.2",
|
||||
"react-toastify": "^11.0.5",
|
||||
"rooks": "^9.3.0"
|
||||
"rooks": "^9.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.3.2",
|
||||
"@formatjs/cli": "^6.7.4",
|
||||
"@tanstack/react-query-devtools": "^5.90.2",
|
||||
"@biomejs/biome": "^2.4.3",
|
||||
"@formatjs/cli": "^6.13.0",
|
||||
"@tanstack/react-query-devtools": "^5.91.3",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@types/country-flag-icons": "^1.2.2",
|
||||
"@types/humps": "^2.0.6",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.2",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/react-table": "^7.7.20",
|
||||
"@vitejs/plugin-react": "^5.1.0",
|
||||
"happy-dom": "^20.0.10",
|
||||
"@vitejs/plugin-react": "^5.1.4",
|
||||
"happy-dom": "^20.7.0",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-simple-vars": "^7.0.1",
|
||||
"sass": "^1.93.3",
|
||||
"sass": "^1.97.3",
|
||||
"tmp": "^0.2.5",
|
||||
"typescript": "5.9.3",
|
||||
"vite": "^7.1.12",
|
||||
"vite-plugin-checker": "^0.11.0",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^4.0.6"
|
||||
"vite": "^7.3.1",
|
||||
"vite-plugin-checker": "^0.12.0",
|
||||
"vite-tsconfig-paths": "^6.1.1",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
--tblr-backdrop-opacity: 0.8 !important;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .modal-content {
|
||||
--tblr-modal-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .modal-backdrop {
|
||||
--tblr-backdrop-bg: #000 !important;
|
||||
--tblr-backdrop-opacity: 0.65 !important;
|
||||
}
|
||||
|
||||
.domain-name {
|
||||
font-family: monospace;
|
||||
}
|
||||
@@ -95,3 +104,15 @@ label.row {
|
||||
border-radius: var(--tblr-border-radius) 0 0 var(--tblr-border-radius);
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix for dropdown menus being clipped by table-responsive containers. */
|
||||
.table-responsive .dropdown {
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* Fix for Tabler scrollbar compensation */
|
||||
@media (min-width: 992px) {
|
||||
:host, :root {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,6 @@ export async function del({ url, params }: DeleteArgs, abortController?: AbortCo
|
||||
const method = "DELETE";
|
||||
const headers = {
|
||||
...buildAuthHeader(),
|
||||
[contentTypeHeader]: "application/json",
|
||||
};
|
||||
const signal = abortController?.signal;
|
||||
const response = await fetch(apiUrl, { method, headers, signal });
|
||||
|
||||
8
frontend/src/api/backend/checkVersion.ts
Normal file
8
frontend/src/api/backend/checkVersion.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as api from "./base";
|
||||
import type { VersionCheckResponse } from "./responseTypes";
|
||||
|
||||
export async function checkVersion(): Promise<VersionCheckResponse> {
|
||||
return await api.get({
|
||||
url: "/version/check",
|
||||
});
|
||||
}
|
||||
@@ -1,9 +1,22 @@
|
||||
import * as api from "./base";
|
||||
import type { TokenResponse } from "./responseTypes";
|
||||
import type { TokenResponse, TwoFactorChallengeResponse } from "./responseTypes";
|
||||
|
||||
export async function getToken(identity: string, secret: string): Promise<TokenResponse> {
|
||||
export type LoginResponse = TokenResponse | TwoFactorChallengeResponse;
|
||||
|
||||
export function isTwoFactorChallenge(response: LoginResponse): response is TwoFactorChallengeResponse {
|
||||
return "requires2fa" in response && response.requires2fa === true;
|
||||
}
|
||||
|
||||
export async function getToken(identity: string, secret: string): Promise<LoginResponse> {
|
||||
return await api.post({
|
||||
url: "/tokens",
|
||||
data: { identity, secret },
|
||||
});
|
||||
}
|
||||
|
||||
export async function verify2FA(challengeToken: string, code: string): Promise<TokenResponse> {
|
||||
return await api.post({
|
||||
url: "/tokens/2fa",
|
||||
data: { challengeToken, code },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./checkVersion";
|
||||
export * from "./createAccessList";
|
||||
export * from "./createCertificate";
|
||||
export * from "./createDeadHost";
|
||||
@@ -59,3 +60,4 @@ export * from "./updateStream";
|
||||
export * from "./updateUser";
|
||||
export * from "./uploadCertificate";
|
||||
export * from "./validateCertificate";
|
||||
export * from "./twoFactor";
|
||||
|
||||
@@ -127,6 +127,7 @@ export interface ProxyHost {
|
||||
locations?: ProxyLocation[];
|
||||
hstsEnabled: boolean;
|
||||
hstsSubdomains: boolean;
|
||||
trustForwardedProto: boolean;
|
||||
// Expansions:
|
||||
owner?: User;
|
||||
accessList?: AccessList;
|
||||
|
||||
@@ -19,3 +19,28 @@ export interface ValidatedCertificateResponse {
|
||||
export interface LoginAsTokenResponse extends TokenResponse {
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface VersionCheckResponse {
|
||||
current: string | null;
|
||||
latest: string | null;
|
||||
updateAvailable: boolean;
|
||||
}
|
||||
|
||||
export interface TwoFactorChallengeResponse {
|
||||
requires2fa: boolean;
|
||||
challengeToken: string;
|
||||
}
|
||||
|
||||
export interface TwoFactorStatusResponse {
|
||||
enabled: boolean;
|
||||
backupCodesRemaining: number;
|
||||
}
|
||||
|
||||
export interface TwoFactorSetupResponse {
|
||||
secret: string;
|
||||
otpauthUrl: string;
|
||||
}
|
||||
|
||||
export interface TwoFactorEnableResponse {
|
||||
backupCodes: string[];
|
||||
}
|
||||
|
||||
37
frontend/src/api/backend/twoFactor.ts
Normal file
37
frontend/src/api/backend/twoFactor.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as api from "./base";
|
||||
import type { TwoFactorEnableResponse, TwoFactorSetupResponse, TwoFactorStatusResponse } from "./responseTypes";
|
||||
|
||||
export async function get2FAStatus(userId: number | "me"): Promise<TwoFactorStatusResponse> {
|
||||
return await api.get({
|
||||
url: `/users/${userId}/2fa`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function start2FASetup(userId: number | "me"): Promise<TwoFactorSetupResponse> {
|
||||
return await api.post({
|
||||
url: `/users/${userId}/2fa`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function enable2FA(userId: number | "me", code: string): Promise<TwoFactorEnableResponse> {
|
||||
return await api.post({
|
||||
url: `/users/${userId}/2fa/enable`,
|
||||
data: { code },
|
||||
});
|
||||
}
|
||||
|
||||
export async function disable2FA(userId: number | "me", code: string): Promise<boolean> {
|
||||
return await api.del({
|
||||
url: `/users/${userId}/2fa`,
|
||||
params: {
|
||||
code,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function regenerateBackupCodes(userId: number | "me", code: string): Promise<TwoFactorEnableResponse> {
|
||||
return await api.post({
|
||||
url: `/users/${userId}/2fa/backup-codes`,
|
||||
data: { code },
|
||||
});
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import cn from "classnames";
|
||||
import { useFormikContext } from "formik";
|
||||
import { useState } from "react";
|
||||
import type { AccessListClient } from "src/api/backend";
|
||||
import { T } from "src/locale";
|
||||
import { intl, T } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
initialValues: AccessListClient[];
|
||||
@@ -65,8 +65,8 @@ export function AccessClientFields({ initialValues, name = "clients" }: Props) {
|
||||
value={client.directive}
|
||||
onChange={(e) => handleChange(idx, "directive", e.target.value)}
|
||||
>
|
||||
<option value="allow">Allow</option>
|
||||
<option value="deny">Deny</option>
|
||||
<option value="allow"><T id="action.allow" /></option>
|
||||
<option value="deny"><T id="action.deny" /></option>
|
||||
</select>
|
||||
</span>
|
||||
<input
|
||||
@@ -76,7 +76,7 @@ export function AccessClientFields({ initialValues, name = "clients" }: Props) {
|
||||
autoComplete="off"
|
||||
value={client.address}
|
||||
onChange={(e) => handleChange(idx, "address", e.target.value)}
|
||||
placeholder="192.168.1.100 or 192.168.1.0/24 or 2001:0db8::/32"
|
||||
placeholder={intl.formatMessage({ id: "access-list.rule-source.placeholder" })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,7 +112,7 @@ export function AccessClientFields({ initialValues, name = "clients" }: Props) {
|
||||
value="deny"
|
||||
disabled
|
||||
>
|
||||
<option value="deny">Deny</option>
|
||||
<option value="deny"><T id="action.deny" /></option>
|
||||
</select>
|
||||
</span>
|
||||
<input
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Field, useFormikContext } from "formik";
|
||||
import type { ReactNode } from "react";
|
||||
import Select, { type ActionMeta, components, type OptionProps } from "react-select";
|
||||
import type { AccessList } from "src/api/backend";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { useAccessLists } from "src/hooks";
|
||||
import { formatDateTime, intl, T } from "src/locale";
|
||||
|
||||
@@ -32,6 +33,7 @@ interface Props {
|
||||
label?: string;
|
||||
}
|
||||
export function AccessField({ name = "accessListId", label = "access-list", id = "accessListId" }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
const { isLoading, isError, error, data } = useAccessLists(["owner", "items", "clients"]);
|
||||
const { setFieldValue } = useFormikContext();
|
||||
|
||||
@@ -48,7 +50,7 @@ export function AccessField({ name = "accessListId", label = "access-list", id =
|
||||
{
|
||||
users: item?.items?.length,
|
||||
rules: item?.clients?.length,
|
||||
date: item?.createdOn ? formatDateTime(item?.createdOn) : "N/A",
|
||||
date: item?.createdOn ? formatDateTime(item?.createdOn, locale) : "N/A",
|
||||
},
|
||||
),
|
||||
icon: <IconLock size={14} className="text-lime" />,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useState } from "react";
|
||||
import Select, { type ActionMeta } from "react-select";
|
||||
import type { DNSProvider } from "src/api/backend";
|
||||
import { useDnsProviders } from "src/hooks";
|
||||
import { T } from "src/locale";
|
||||
import { intl, T } from "src/locale";
|
||||
import styles from "./DNSProviderFields.module.css";
|
||||
|
||||
interface DNSProviderOption {
|
||||
@@ -57,7 +57,7 @@ export function DNSProviderFields({ showBoundaryBox = false }: Props) {
|
||||
id="dnsProvider"
|
||||
closeMenuOnSelect={true}
|
||||
isClearable={false}
|
||||
placeholder="Select a Provider..."
|
||||
placeholder={intl.formatMessage({ id: "certificates.dns.provider.placeholder" })}
|
||||
isLoading={isLoading}
|
||||
isSearchable
|
||||
onChange={handleChange}
|
||||
@@ -116,7 +116,7 @@ export function DNSProviderFields({ showBoundaryBox = false }: Props) {
|
||||
type="number"
|
||||
className="form-control"
|
||||
min={0}
|
||||
max={600}
|
||||
max={7200}
|
||||
{...field}
|
||||
/>
|
||||
<small className="text-muted">
|
||||
|
||||
@@ -2,6 +2,7 @@ import { IconShield } from "@tabler/icons-react";
|
||||
import { Field, useFormikContext } from "formik";
|
||||
import Select, { type ActionMeta, components, type OptionProps } from "react-select";
|
||||
import type { Certificate } from "src/api/backend";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { useCertificates } from "src/hooks";
|
||||
import { formatDateTime, intl, T } from "src/locale";
|
||||
|
||||
@@ -41,6 +42,7 @@ export function SSLCertificateField({
|
||||
allowNew,
|
||||
forHttp = true,
|
||||
}: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
const { isLoading, isError, error, data } = useCertificates();
|
||||
const { values, setFieldValue } = useFormikContext();
|
||||
const v: any = values || {};
|
||||
@@ -75,7 +77,7 @@ export function SSLCertificateField({
|
||||
data?.map((cert: Certificate) => ({
|
||||
value: cert.id,
|
||||
label: cert.niceName,
|
||||
subLabel: `${cert.provider === "letsencrypt" ? intl.formatMessage({ id: "lets-encrypt" }) : cert.provider} — ${intl.formatMessage({ id: "expires.on" }, { date: cert.expiresOn ? formatDateTime(cert.expiresOn) : "N/A" })}`,
|
||||
subLabel: `${cert.provider === "letsencrypt" ? intl.formatMessage({ id: "lets-encrypt" }) : cert.provider} — ${intl.formatMessage({ id: "expires.on" }, { date: cert.expiresOn ? formatDateTime(cert.expiresOn, locale) : "N/A" })}`,
|
||||
icon: <IconShield size={14} className="text-pink" />,
|
||||
})) || [];
|
||||
|
||||
|
||||
@@ -5,17 +5,18 @@ import { T } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
forHttp?: boolean; // the sslForced, http2Support, hstsEnabled, hstsSubdomains fields
|
||||
forProxyHost?: boolean; // the advanced fields
|
||||
forceDNSForNew?: boolean;
|
||||
requireDomainNames?: boolean; // used for streams
|
||||
color?: string;
|
||||
}
|
||||
export function SSLOptionsFields({ forHttp = true, forceDNSForNew, requireDomainNames, color = "bg-cyan" }: Props) {
|
||||
export function SSLOptionsFields({ forHttp = true, forProxyHost = false, forceDNSForNew, requireDomainNames, color = "bg-cyan" }: Props) {
|
||||
const { values, setFieldValue } = useFormikContext();
|
||||
const v: any = values || {};
|
||||
|
||||
const newCertificate = v?.certificateId === "new";
|
||||
const hasCertificate = newCertificate || (v?.certificateId && v?.certificateId > 0);
|
||||
const { sslForced, http2Support, hstsEnabled, hstsSubdomains, meta } = v;
|
||||
const { sslForced, http2Support, hstsEnabled, hstsSubdomains, trustForwardedProto, meta } = v;
|
||||
const { dnsChallenge } = meta || {};
|
||||
|
||||
if (forceDNSForNew && newCertificate && !dnsChallenge) {
|
||||
@@ -115,6 +116,34 @@ export function SSLOptionsFields({ forHttp = true, forceDNSForNew, requireDomain
|
||||
</div>
|
||||
);
|
||||
|
||||
const getHttpAdvancedOptions = () =>(
|
||||
<div>
|
||||
<details>
|
||||
<summary className="mb-1"><T id="domains.advanced" /></summary>
|
||||
<div className="row">
|
||||
<div className="col-12">
|
||||
<Field name="trustForwardedProto">
|
||||
{({ field }: any) => (
|
||||
<label className="form-check form-switch mt-1">
|
||||
<input
|
||||
className={trustForwardedProto ? toggleEnabled : toggleClasses}
|
||||
type="checkbox"
|
||||
checked={!!trustForwardedProto}
|
||||
onChange={(e) => handleToggleChange(e, field.name)}
|
||||
disabled={!hasCertificate || !sslForced}
|
||||
/>
|
||||
<span className="form-check-label">
|
||||
<T id="domains.trust-forwarded-proto" />
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{forHttp ? getHttpOptions() : null}
|
||||
@@ -140,6 +169,7 @@ export function SSLOptionsFields({ forHttp = true, forceDNSForNew, requireDomain
|
||||
{dnsChallenge ? <DNSProviderFields showBoundaryBox /> : null}
|
||||
</>
|
||||
) : null}
|
||||
{forProxyHost && forHttp ? getHttpAdvancedOptions() : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,11 @@ import { useTheme } from "src/hooks";
|
||||
import { changeLocale, getFlagCodeForLocale, localeOptions, T } from "src/locale";
|
||||
import styles from "./LocalePicker.module.css";
|
||||
|
||||
function LocalePicker() {
|
||||
interface Props {
|
||||
menuAlign?: "start" | "end";
|
||||
}
|
||||
|
||||
function LocalePicker({ menuAlign = "start" }: Props) {
|
||||
const { locale, setLocale } = useLocaleState();
|
||||
const { getTheme } = useTheme();
|
||||
|
||||
@@ -23,22 +27,24 @@ function LocalePicker() {
|
||||
<button type="button" className={cns} data-bs-toggle="dropdown">
|
||||
<Flag countryCode={getFlagCodeForLocale(locale)} />
|
||||
</button>
|
||||
<div className="dropdown-menu">
|
||||
{localeOptions.map((item) => {
|
||||
return (
|
||||
<a
|
||||
className="dropdown-item"
|
||||
href={`/locale/${item[0]}`}
|
||||
key={`locale-${item[0]}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
changeTo(item[0]);
|
||||
}}
|
||||
>
|
||||
<Flag countryCode={getFlagCodeForLocale(item[0])} /> <T id={`locale-${item[1]}`} />
|
||||
</a>
|
||||
);
|
||||
<div
|
||||
className={cn("dropdown-menu", {
|
||||
"dropdown-menu-end": menuAlign === "end",
|
||||
})}
|
||||
>
|
||||
{localeOptions.map((item: any) => (
|
||||
<a
|
||||
className="dropdown-item"
|
||||
href={`/locale/${item[0]}`}
|
||||
key={`locale-${item[0]}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
changeTo(item[0]);
|
||||
}}
|
||||
>
|
||||
<Flag countryCode={getFlagCodeForLocale(item[0])} /> <T id={`locale-${item[1]}`} />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,5 +2,5 @@ interface Props {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
export function SiteContainer({ children }: Props) {
|
||||
return <div className="container-xl py-3">{children}</div>;
|
||||
return <div className="container-xl py-3 min-w-0 overflow-x-auto">{children}</div>;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useHealth } from "src/hooks";
|
||||
import { useCheckVersion, useHealth } from "src/hooks";
|
||||
import { T } from "src/locale";
|
||||
|
||||
export function SiteFooter() {
|
||||
const health = useHealth();
|
||||
const { data: versionData } = useCheckVersion();
|
||||
|
||||
const getVersion = () => {
|
||||
if (!health.data) {
|
||||
@@ -55,6 +56,19 @@ export function SiteFooter() {
|
||||
{getVersion()}{" "}
|
||||
</a>
|
||||
</li>
|
||||
{versionData?.updateAvailable && versionData?.latest && (
|
||||
<li className="list-inline-item">
|
||||
<a
|
||||
href={`https://github.com/NginxProxyManager/nginx-proxy-manager/releases/tag/${versionData.latest}`}
|
||||
className="link-warning fw-bold"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
title={`New version ${versionData.latest} is available`}
|
||||
>
|
||||
<T id="update-available" data={{ latestVersion: versionData.latest }} />
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IconLock, IconLogout, IconUser } from "@tabler/icons-react";
|
||||
import { IconLock, IconLogout, IconShieldLock, IconUser } from "@tabler/icons-react";
|
||||
import { LocalePicker, NavLink, ThemeSwitcher } from "src/components";
|
||||
import { useAuthState } from "src/context";
|
||||
import { useUser } from "src/hooks";
|
||||
import { T } from "src/locale";
|
||||
import { showChangePasswordModal, showUserModal } from "src/modals";
|
||||
import { showChangePasswordModal, showTwoFactorModal, showUserModal } from "src/modals";
|
||||
import styles from "./SiteHeader.module.css";
|
||||
|
||||
export function SiteHeader() {
|
||||
@@ -25,7 +25,7 @@ export function SiteHeader() {
|
||||
>
|
||||
<span className="navbar-toggler-icon" />
|
||||
</button>
|
||||
<div className="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
|
||||
<div className="navbar-brand navbar-brand-autodark pe-0 pe-md-3">
|
||||
<NavLink to="/">
|
||||
<div className={styles.logo}>
|
||||
<img
|
||||
@@ -48,11 +48,11 @@ export function SiteHeader() {
|
||||
<ThemeSwitcher />
|
||||
</div>
|
||||
</div>
|
||||
<div className="nav-item d-none d-md-flex me-3">
|
||||
<div className="nav-item d-md-flex">
|
||||
<div className="nav-item dropdown">
|
||||
<a
|
||||
href="/"
|
||||
className="nav-link d-flex lh-1 p-0 px-2"
|
||||
className="nav-link d-flex lh-1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-label="Open user menu"
|
||||
>
|
||||
@@ -70,6 +70,22 @@ export function SiteHeader() {
|
||||
</div>
|
||||
</a>
|
||||
<div className="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
|
||||
<div className="d-md-none">
|
||||
{/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: This div is not interactive. */}
|
||||
<div className="p-2 pb-1 pe-1 d-flex align-items-center" onClick={e => e.stopPropagation()}>
|
||||
<div className="ps-2 pe-1 me-auto">
|
||||
<div>{currentUser?.nickname}</div>
|
||||
<div className="mt-1 small text-secondary text-nowrap">
|
||||
<T id={isAdmin ? "role.admin" : "role.standard-user"} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="d-flex align-items-center">
|
||||
<ThemeSwitcher className="me-n2" />
|
||||
<LocalePicker menuAlign="end" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="dropdown-divider" />
|
||||
</div>
|
||||
<a
|
||||
href="?"
|
||||
className="dropdown-item"
|
||||
@@ -92,6 +108,17 @@ export function SiteHeader() {
|
||||
<IconLock width={18} />
|
||||
<T id="user.change-password" />
|
||||
</a>
|
||||
<a
|
||||
href="?"
|
||||
className="dropdown-item"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
showTwoFactorModal("me");
|
||||
}}
|
||||
>
|
||||
<IconShieldLock width={18} />
|
||||
<T id="user.two-factor" />
|
||||
</a>
|
||||
<div className="dropdown-divider" />
|
||||
<a
|
||||
href="?"
|
||||
|
||||
@@ -176,21 +176,17 @@ const getMenuDropown = (item: MenuItem, onClick?: () => void) => {
|
||||
};
|
||||
|
||||
export function SiteMenu() {
|
||||
// This is hacky AF. But that's the price of using a non-react UI kit.
|
||||
const closeMenus = () => {
|
||||
const navMenus = document.querySelectorAll(".nav-item.dropdown");
|
||||
navMenus.forEach((menu) => {
|
||||
menu.classList.remove("show");
|
||||
const dropdown = menu.querySelector(".dropdown-menu");
|
||||
if (dropdown) {
|
||||
dropdown.classList.remove("show");
|
||||
}
|
||||
});
|
||||
};
|
||||
const closeMenu = () => setTimeout(() => {
|
||||
const navbarToggler = document.querySelector<HTMLElement>(".navbar-toggler");
|
||||
const navbarMenu = document.querySelector("#navbar-menu");
|
||||
if (navbarToggler && navbarMenu?.classList.contains("show")) {
|
||||
navbarToggler.click();
|
||||
}
|
||||
}, 300);
|
||||
|
||||
return (
|
||||
<header className="navbar-expand-md">
|
||||
<div className="collapse navbar-collapse" id="navbar-menu">
|
||||
<div className="collapse navbar-collapse" id="navbar-menu">
|
||||
<div className="navbar">
|
||||
<div className="container-xl">
|
||||
<div className="row flex-column flex-md-row flex-fill align-items-center">
|
||||
@@ -198,7 +194,7 @@ export function SiteMenu() {
|
||||
<ul className="navbar-nav">
|
||||
{menuItems.length > 0 &&
|
||||
menuItems.map((item) => {
|
||||
return getMenuItem(item, closeMenus);
|
||||
return getMenuItem(item, closeMenu);
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import cn from "classnames";
|
||||
import { differenceInDays, isPast } from "date-fns";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, parseDate } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
@@ -8,6 +9,7 @@ interface Props {
|
||||
highlistNearlyExpired?: boolean;
|
||||
}
|
||||
export function DateFormatter({ value, highlightPast, highlistNearlyExpired }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
const d = parseDate(value);
|
||||
const dateIsPast = d ? isPast(d) : false;
|
||||
const days = d ? differenceInDays(d, new Date()) : 0;
|
||||
@@ -15,5 +17,5 @@ export function DateFormatter({ value, highlightPast, highlistNearlyExpired }: P
|
||||
"text-danger": highlightPast && dateIsPast,
|
||||
"text-warning": highlistNearlyExpired && !dateIsPast && days <= 30 && days >= 0,
|
||||
});
|
||||
return <span className={cl}>{formatDateTime(value)}</span>;
|
||||
return <span className={cl}>{formatDateTime(value, locale)}</span>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import cn from "classnames";
|
||||
import type { ReactNode } from "react";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, T } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
@@ -10,35 +11,44 @@ interface Props {
|
||||
color?: string;
|
||||
}
|
||||
|
||||
const DomainLink = ({ domain, color }: { domain: string; color?: string }) => {
|
||||
const DomainLink = ({ domain, color }: { domain?: string; color?: string }) => {
|
||||
// when domain contains a wildcard, make the link go nowhere.
|
||||
let onClick: ((e: React.MouseEvent) => void) | undefined;
|
||||
if (domain.includes("*")) {
|
||||
onClick = (e: React.MouseEvent) => e.preventDefault();
|
||||
// Apparently the domain can be null or undefined sometimes.
|
||||
// This try is just a safeguard to prevent the whole formatter from breaking.
|
||||
if (!domain) return null;
|
||||
try {
|
||||
let onClick: ((e: React.MouseEvent) => void) | undefined;
|
||||
if (domain.includes("*")) {
|
||||
onClick = (e: React.MouseEvent) => e.preventDefault();
|
||||
}
|
||||
return (
|
||||
<a
|
||||
key={domain}
|
||||
href={`http://${domain}`}
|
||||
target="_blank"
|
||||
onClick={onClick}
|
||||
className={cn("badge", color ? `bg-${color}-lt` : null, "domain-name", "me-2")}
|
||||
>
|
||||
{domain}
|
||||
</a>
|
||||
);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<a
|
||||
key={domain}
|
||||
href={`http://${domain}`}
|
||||
target="_blank"
|
||||
onClick={onClick}
|
||||
className={cn("badge", color ? `bg-${color}-lt` : null, "domain-name", "me-2")}
|
||||
>
|
||||
{domain}
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
export function DomainsFormatter({ domains, createdOn, niceName, provider, color }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
const elms: ReactNode[] = [];
|
||||
if (domains.length === 0 && !niceName) {
|
||||
|
||||
if ((!domains || domains.length === 0) && !niceName) {
|
||||
elms.push(
|
||||
<span key="nice-name" className="badge bg-danger-lt me-2">
|
||||
Unknown
|
||||
</span>,
|
||||
);
|
||||
}
|
||||
if (niceName && provider !== "letsencrypt") {
|
||||
if (!domains || (niceName && provider !== "letsencrypt")) {
|
||||
elms.push(
|
||||
<span key="nice-name" className="badge bg-info-lt me-2">
|
||||
{niceName}
|
||||
@@ -46,14 +56,16 @@ export function DomainsFormatter({ domains, createdOn, niceName, provider, color
|
||||
);
|
||||
}
|
||||
|
||||
domains.map((domain: string) => elms.push(<DomainLink key={domain} domain={domain} color={color} />));
|
||||
if (domains) {
|
||||
domains.map((domain: string) => elms.push(<DomainLink key={domain} domain={domain} color={color} />));
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">{...elms}</div>
|
||||
{createdOn ? (
|
||||
<div className="text-secondary mt-1">
|
||||
<T id="created-on" data={{ date: formatDateTime(createdOn) }} />
|
||||
<T id="created-on" data={{ date: formatDateTime(createdOn, locale) }} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IconArrowsCross, IconBolt, IconBoltOff, IconDisc, IconLock, IconShield, IconUser } from "@tabler/icons-react";
|
||||
import cn from "classnames";
|
||||
import type { AuditLog } from "src/api/backend";
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, T } from "src/locale";
|
||||
|
||||
const getEventValue = (event: AuditLog) => {
|
||||
@@ -66,6 +67,7 @@ interface Props {
|
||||
row: AuditLog;
|
||||
}
|
||||
export function EventFormatter({ row }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
return (
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">
|
||||
@@ -73,7 +75,7 @@ export function EventFormatter({ row }: Props) {
|
||||
<T id={`object.event.${row.action}`} tData={{ object: row.objectType }} />
|
||||
— <span className="badge">{getEventValue(row)}</span>
|
||||
</div>
|
||||
<div className="text-secondary mt-1">{formatDateTime(row.createdOn)}</div>
|
||||
<div className="text-secondary mt-1">{formatDateTime(row.createdOn, locale)}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useLocaleState } from "src/context";
|
||||
import { formatDateTime, T } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
@@ -6,6 +7,7 @@ interface Props {
|
||||
disabled?: boolean;
|
||||
}
|
||||
export function ValueWithDateFormatter({ value, createdOn, disabled }: Props) {
|
||||
const { locale } = useLocaleState();
|
||||
return (
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">
|
||||
@@ -13,7 +15,7 @@ export function ValueWithDateFormatter({ value, createdOn, disabled }: Props) {
|
||||
</div>
|
||||
{createdOn ? (
|
||||
<div className={`text-secondary mt-1 ${disabled ? "text-red" : ""}`}>
|
||||
<T id={disabled ? "disabled" : "created-on"} data={{ date: formatDateTime(createdOn) }} />
|
||||
<T id={disabled ? "disabled" : "created-on"} data={{ date: formatDateTime(createdOn, locale) }} />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -12,10 +12,12 @@ interface TableLayoutProps<TFields> {
|
||||
function TableLayout<TFields>(props: TableLayoutProps<TFields>) {
|
||||
const hasRows = props.tableInstance.getRowModel().rows.length > 0;
|
||||
return (
|
||||
<table className="table table-vcenter table-selectable mb-0">
|
||||
{hasRows ? <TableHeader tableInstance={props.tableInstance} /> : null}
|
||||
<TableBody {...props} />
|
||||
</table>
|
||||
<div className="table-responsive">
|
||||
<table className="table table-vcenter table-selectable mb-0">
|
||||
{hasRows ? <TableHeader tableInstance={props.tableInstance} /> : null}
|
||||
<TableBody {...props} />
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { createContext, type ReactNode, useContext, useState } from "react";
|
||||
import { useIntervalWhen } from "rooks";
|
||||
import { getToken, loginAsUser, refreshToken, type TokenResponse } from "src/api/backend";
|
||||
import {
|
||||
getToken,
|
||||
isTwoFactorChallenge,
|
||||
loginAsUser,
|
||||
refreshToken,
|
||||
verify2FA,
|
||||
type TokenResponse,
|
||||
} from "src/api/backend";
|
||||
import AuthStore from "src/modules/AuthStore";
|
||||
|
||||
// 2FA challenge state
|
||||
export interface TwoFactorChallenge {
|
||||
challengeToken: string;
|
||||
}
|
||||
|
||||
// Context
|
||||
export interface AuthContextType {
|
||||
authenticated: boolean;
|
||||
twoFactorChallenge: TwoFactorChallenge | null;
|
||||
login: (username: string, password: string) => Promise<void>;
|
||||
verifyTwoFactor: (code: string) => Promise<void>;
|
||||
cancelTwoFactor: () => void;
|
||||
loginAs: (id: number) => Promise<void>;
|
||||
logout: () => void;
|
||||
token?: string;
|
||||
@@ -24,17 +39,35 @@ interface Props {
|
||||
function AuthProvider({ children, tokenRefreshInterval = 5 * 60 * 1000 }: Props) {
|
||||
const queryClient = useQueryClient();
|
||||
const [authenticated, setAuthenticated] = useState(AuthStore.hasActiveToken());
|
||||
const [twoFactorChallenge, setTwoFactorChallenge] = useState<TwoFactorChallenge | null>(null);
|
||||
|
||||
const handleTokenUpdate = (response: TokenResponse) => {
|
||||
AuthStore.set(response);
|
||||
setAuthenticated(true);
|
||||
setTwoFactorChallenge(null);
|
||||
};
|
||||
|
||||
const login = async (identity: string, secret: string) => {
|
||||
const response = await getToken(identity, secret);
|
||||
if (isTwoFactorChallenge(response)) {
|
||||
setTwoFactorChallenge({ challengeToken: response.challengeToken });
|
||||
return;
|
||||
}
|
||||
handleTokenUpdate(response);
|
||||
};
|
||||
|
||||
const verifyTwoFactor = async (code: string) => {
|
||||
if (!twoFactorChallenge) {
|
||||
throw new Error("No 2FA challenge pending");
|
||||
}
|
||||
const response = await verify2FA(twoFactorChallenge.challengeToken, code);
|
||||
handleTokenUpdate(response);
|
||||
};
|
||||
|
||||
const cancelTwoFactor = () => {
|
||||
setTwoFactorChallenge(null);
|
||||
};
|
||||
|
||||
const loginAs = async (id: number) => {
|
||||
const response = await loginAsUser(id);
|
||||
AuthStore.add(response);
|
||||
@@ -69,7 +102,15 @@ function AuthProvider({ children, tokenRefreshInterval = 5 * 60 * 1000 }: Props)
|
||||
true,
|
||||
);
|
||||
|
||||
const value = { authenticated, login, logout, loginAs };
|
||||
const value = {
|
||||
authenticated,
|
||||
twoFactorChallenge,
|
||||
login,
|
||||
verifyTwoFactor,
|
||||
cancelTwoFactor,
|
||||
loginAs,
|
||||
logout,
|
||||
};
|
||||
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ export * from "./useAuditLog";
|
||||
export * from "./useAuditLogs";
|
||||
export * from "./useCertificate";
|
||||
export * from "./useCertificates";
|
||||
export * from "./useCheckVersion";
|
||||
export * from "./useDeadHost";
|
||||
export * from "./useDeadHosts";
|
||||
export * from "./useDnsProviders";
|
||||
|
||||
18
frontend/src/hooks/useCheckVersion.ts
Normal file
18
frontend/src/hooks/useCheckVersion.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { checkVersion, type VersionCheckResponse } from "src/api/backend";
|
||||
|
||||
const fetchVersion = () => checkVersion();
|
||||
|
||||
const useCheckVersion = (options = {}) => {
|
||||
return useQuery<VersionCheckResponse, Error>({
|
||||
queryKey: ["version-check"],
|
||||
queryFn: fetchVersion,
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 5,
|
||||
refetchInterval: 30 * 1000, // 30 seconds
|
||||
staleTime: 5 * 60 * 1000, // 5 mins
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
export { fetchVersion, useCheckVersion };
|
||||
@@ -24,6 +24,7 @@ const fetchProxyHost = (id: number | "new") => {
|
||||
enabled: true,
|
||||
hstsEnabled: false,
|
||||
hstsSubdomains: false,
|
||||
trustForwardedProto: false,
|
||||
} as ProxyHost);
|
||||
}
|
||||
return getProxyHost(id, ["owner"]);
|
||||
|
||||
@@ -1,91 +1,98 @@
|
||||
import { createIntl, createIntlCache } from "react-intl";
|
||||
import langBg from "./lang/bg.json";
|
||||
import langDe from "./lang/de.json";
|
||||
import langPt from "./lang/pt.json";
|
||||
import langEn from "./lang/en.json";
|
||||
import langEs from "./lang/es.json";
|
||||
import langEt from "./lang/et.json";
|
||||
import langFr from "./lang/fr.json";
|
||||
import langGa from "./lang/ga.json";
|
||||
import langId from "./lang/id.json";
|
||||
import langIt from "./lang/it.json";
|
||||
import langJa from "./lang/ja.json";
|
||||
import langList from "./lang/lang-list.json";
|
||||
import langKo from "./lang/ko.json";
|
||||
import langNl from "./lang/nl.json";
|
||||
import langPl from "./lang/pl.json";
|
||||
import langRu from "./lang/ru.json";
|
||||
import langSk from "./lang/sk.json";
|
||||
import langCs from "./lang/cs.json";
|
||||
import langVi from "./lang/vi.json";
|
||||
import langZh from "./lang/zh.json";
|
||||
import langPl from "./lang/pl.json";
|
||||
import langTr from "./lang/tr.json";
|
||||
import langHu from "./lang/hu.json";
|
||||
import langNo from "./lang/no.json";
|
||||
import langList from "./lang/lang-list.json";
|
||||
|
||||
// first item of each array should be the language code,
|
||||
// not the country code
|
||||
// Remember when adding to this list, also update check-locales.js script
|
||||
const localeOptions = [
|
||||
["en", "en-US"],
|
||||
["de", "de-DE"],
|
||||
["es", "es-ES"],
|
||||
["ja", "ja-JP"],
|
||||
["ru", "ru-RU"],
|
||||
["sk", "sk-SK"],
|
||||
["zh", "zh-CN"],
|
||||
["pl", "pl-PL"],
|
||||
["en", "en-US", langEn],
|
||||
["de", "de-DE", langDe],
|
||||
["es", "es-ES", langEs],
|
||||
["et", "et-EE", langEt],
|
||||
["pt", "pt-PT", langPt],
|
||||
["fr", "fr-FR", langFr],
|
||||
["ga", "ga-IE", langGa],
|
||||
["ja", "ja-JP", langJa],
|
||||
["it", "it-IT", langIt],
|
||||
["nl", "nl-NL", langNl],
|
||||
["pl", "pl-PL", langPl],
|
||||
["ru", "ru-RU", langRu],
|
||||
["sk", "sk-SK", langSk],
|
||||
["cs", "cs-CZ", langCs],
|
||||
["vi", "vi-VN", langVi],
|
||||
["zh", "zh-CN", langZh],
|
||||
["ko", "ko-KR", langKo],
|
||||
["bg", "bg-BG", langBg],
|
||||
["id", "id-ID", langId],
|
||||
["tr", "tr-TR", langTr],
|
||||
["hu", "hu-HU", langHu],
|
||||
["no", "no-NO", langNo],
|
||||
];
|
||||
|
||||
const loadMessages = (locale?: string): typeof langList & typeof langEn => {
|
||||
const thisLocale = locale || "en";
|
||||
switch (thisLocale.slice(0, 2)) {
|
||||
case "de":
|
||||
return Object.assign({}, langList, langEn, langDe);
|
||||
case "es":
|
||||
return Object.assign({}, langList, langEn, langEs);
|
||||
case "ja":
|
||||
return Object.assign({}, langList, langEn, langJa);
|
||||
case "ru":
|
||||
return Object.assign({}, langList, langEn, langRu);
|
||||
case "sk":
|
||||
return Object.assign({}, langList, langEn, langSk);
|
||||
case "zh":
|
||||
return Object.assign({}, langList, langEn, langZh);
|
||||
case "pl":
|
||||
return Object.assign({}, langList, langEn, langPl);
|
||||
default:
|
||||
return Object.assign({}, langList, langEn);
|
||||
}
|
||||
const thisLocale = (locale || "en").slice(0, 2);
|
||||
|
||||
// ensure this lang exists in localeOptions above, otherwise fallback to en
|
||||
if (thisLocale === "en" || !localeOptions.some(([code]) => code === thisLocale)) {
|
||||
return Object.assign({}, langList, langEn);
|
||||
}
|
||||
|
||||
return Object.assign({}, langList, langEn, localeOptions.find(([code]) => code === thisLocale)?.[2]);
|
||||
};
|
||||
|
||||
const getFlagCodeForLocale = (locale?: string) => {
|
||||
switch (locale) {
|
||||
case "es-ES":
|
||||
case "es":
|
||||
return "ES";
|
||||
case "de-DE":
|
||||
case "de":
|
||||
return "DE";
|
||||
case "ja-JP":
|
||||
case "ja":
|
||||
return "JP";
|
||||
case "ru-RU":
|
||||
case "ru":
|
||||
return "RU";
|
||||
case "sk-SK":
|
||||
case "sk":
|
||||
return "SK";
|
||||
case "zh":
|
||||
case "zh-CN":
|
||||
return "CN";
|
||||
case "pl":
|
||||
case "pl-PL":
|
||||
return "PL";
|
||||
default:
|
||||
return "EN";
|
||||
}
|
||||
const thisLocale = (locale || "en").slice(0, 2);
|
||||
|
||||
// only add to this if your flag is different from the locale code
|
||||
const specialCases: Record<string, string> = {
|
||||
ja: "jp", // Japan
|
||||
zh: "cn", // China
|
||||
vi: "vn", // Vietnam
|
||||
ko: "kr", // Korea
|
||||
cs: "cz", // Czechia
|
||||
};
|
||||
|
||||
if (specialCases[thisLocale]) {
|
||||
return specialCases[thisLocale].toUpperCase();
|
||||
}
|
||||
return thisLocale.toUpperCase();
|
||||
};
|
||||
|
||||
const getLocale = (short = false) => {
|
||||
let loc = window.localStorage.getItem("locale");
|
||||
if (!loc) {
|
||||
loc = document.documentElement.lang;
|
||||
}
|
||||
if (short) {
|
||||
return loc.slice(0, 2);
|
||||
}
|
||||
// finally, fallback
|
||||
if (!loc) {
|
||||
loc = "en";
|
||||
}
|
||||
return loc;
|
||||
let loc = window.localStorage.getItem("locale");
|
||||
if (!loc) {
|
||||
loc = document.documentElement.lang;
|
||||
}
|
||||
if (short) {
|
||||
return loc.slice(0, 2);
|
||||
}
|
||||
// finally, fallback
|
||||
if (!loc) {
|
||||
loc = "en";
|
||||
}
|
||||
return loc;
|
||||
};
|
||||
|
||||
const cache = createIntlCache();
|
||||
@@ -94,41 +101,43 @@ const initialMessages = loadMessages(getLocale());
|
||||
let intl = createIntl({ locale: getLocale(), messages: initialMessages }, cache);
|
||||
|
||||
const changeLocale = (locale: string): void => {
|
||||
const messages = loadMessages(locale);
|
||||
intl = createIntl({ locale, messages }, cache);
|
||||
window.localStorage.setItem("locale", locale);
|
||||
document.documentElement.lang = locale;
|
||||
const messages = loadMessages(locale);
|
||||
intl = createIntl({ locale, messages }, cache);
|
||||
window.localStorage.setItem("locale", locale);
|
||||
document.documentElement.lang = locale;
|
||||
};
|
||||
|
||||
// This is a translation component that wraps the translation in a span with a data
|
||||
// attribute so devs can inspect the element to see the translation ID
|
||||
const T = ({
|
||||
id,
|
||||
data,
|
||||
tData,
|
||||
id,
|
||||
data,
|
||||
tData,
|
||||
}: {
|
||||
id: string;
|
||||
data?: Record<string, string | number | undefined>;
|
||||
tData?: Record<string, string>;
|
||||
id: string;
|
||||
data?: Record<string, string | number | undefined>;
|
||||
tData?: Record<string, string>;
|
||||
}) => {
|
||||
const translatedData: Record<string, string> = {};
|
||||
if (tData) {
|
||||
// iterate over tData and translate each value
|
||||
Object.entries(tData).forEach(([key, value]) => {
|
||||
translatedData[key] = intl.formatMessage({ id: value });
|
||||
});
|
||||
}
|
||||
return (
|
||||
<span data-translation-id={id}>
|
||||
{intl.formatMessage(
|
||||
{ id },
|
||||
{
|
||||
...data,
|
||||
...translatedData,
|
||||
},
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
const translatedData: Record<string, string> = {};
|
||||
if (tData) {
|
||||
// iterate over tData and translate each value
|
||||
Object.entries(tData).forEach(([key, value]) => {
|
||||
translatedData[key] = intl.formatMessage({ id: value });
|
||||
});
|
||||
}
|
||||
return (
|
||||
<span data-translation-id={id}>
|
||||
{intl.formatMessage(
|
||||
{ id },
|
||||
{
|
||||
...data,
|
||||
...translatedData,
|
||||
},
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
//console.log("L:", localeOptions);
|
||||
|
||||
export { localeOptions, getFlagCodeForLocale, getLocale, createIntl, changeLocale, intl, T };
|
||||
|
||||
@@ -39,8 +39,10 @@ not be complete by the time you're reading this:
|
||||
|
||||
- frontend/src/locale/src/[yourlang].json
|
||||
- frontend/src/locale/src/lang-list.json
|
||||
- frontend/src/locale/src/HelpDoc/*
|
||||
- frontend/src/locale/src/HelpDoc/[yourlang]/*
|
||||
- frontend/src/locale/src/HelpDoc/index.tsx
|
||||
- frontend/src/locale/IntlProvider.tsx
|
||||
- frontend/check-locales.cjs
|
||||
|
||||
|
||||
## Checking for missing translations in languages
|
||||
|
||||
@@ -39,19 +39,19 @@ describe("DateFormatter", () => {
|
||||
it("format date from iso date", () => {
|
||||
const value = "2024-01-01T00:00:00.000Z";
|
||||
const text = formatDateTime(value);
|
||||
expect(text).toBe("Monday, 01/01/2024, 12:00:00 am");
|
||||
expect(text).toBe("1 Jan 2024, 12:00:00 am");
|
||||
});
|
||||
|
||||
it("format date from unix timestamp number", () => {
|
||||
const value = 1762476112;
|
||||
const text = formatDateTime(value);
|
||||
expect(text).toBe("Friday, 07/11/2025, 12:41:52 am");
|
||||
expect(text).toBe("7 Nov 2025, 12:41:52 am");
|
||||
});
|
||||
|
||||
it("format date from unix timestamp string", () => {
|
||||
const value = "1762476112";
|
||||
const text = formatDateTime(value);
|
||||
expect(text).toBe("Friday, 07/11/2025, 12:41:52 am");
|
||||
expect(text).toBe("7 Nov 2025, 12:41:52 am");
|
||||
});
|
||||
|
||||
it("catch bad format from string", () => {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { fromUnixTime, intlFormat, parseISO } from "date-fns";
|
||||
import {
|
||||
fromUnixTime,
|
||||
type IntlFormatFormatOptions,
|
||||
intlFormat,
|
||||
parseISO,
|
||||
} from "date-fns";
|
||||
|
||||
const isUnixTimestamp = (value: unknown): boolean => {
|
||||
if (typeof value !== "number" && typeof value !== "string") return false;
|
||||
@@ -20,20 +25,19 @@ const parseDate = (value: string | number): Date | null => {
|
||||
}
|
||||
};
|
||||
|
||||
const formatDateTime = (value: string | number): string => {
|
||||
const formatDateTime = (value: string | number, locale = "en-US"): string => {
|
||||
const d = parseDate(value);
|
||||
if (!d) return `${value}`;
|
||||
try {
|
||||
return intlFormat(d, {
|
||||
weekday: "long",
|
||||
year: "numeric",
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
second: "numeric",
|
||||
hour12: true,
|
||||
});
|
||||
return intlFormat(
|
||||
d,
|
||||
{
|
||||
dateStyle: "medium",
|
||||
timeStyle: "medium",
|
||||
hourCycle: "h12",
|
||||
} as IntlFormatFormatOptions,
|
||||
{ locale },
|
||||
);
|
||||
} catch {
|
||||
return `${value}`;
|
||||
}
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
{
|
||||
"access-list": "Zugriffsliste",
|
||||
"access-list.access-count": "{count} {count, plural, one {Regel} other {Regeln}}",
|
||||
"access-list.auth-count": "{count} {count, plural, one {User} other {Users}}",
|
||||
"access-list.help-rules-last": "Wenn mindestens eine Regel vorhanden ist, wird diese Regel zum Ablehnen aller Anfragen als letzte hinzugefügt.",
|
||||
"access-list.help.rules-order": "Beachten Sie, dass die Anweisungen „Erlauben“ und „Verbieten“ in der Reihenfolge ihrer Definition angewendet werden.",
|
||||
"access-list.pass-auth": "Authentifizierung an Upstream weiterleiten",
|
||||
"access-list.public": "Öffentlich",
|
||||
"access-list.public.subtitle": "Keine Authentifizierung erforderlich",
|
||||
"access-list.satisfy-any": "Satisfy Any",
|
||||
"access-list.subtitle": "{users} {users, plural, one {User} other {Users}}, {rules} {rules, plural, one {Regel} other {Regeln}} - Erstellt: {date}",
|
||||
"access-lists": "Zugrifflisten",
|
||||
"action.add": "Hinzufügen",
|
||||
"action.add-location": "Pfad Hinzufügen",
|
||||
"action.close": "Schließen",
|
||||
"action.delete": "Löschen",
|
||||
"action.disable": "Deaktivieren",
|
||||
"action.download": "Herunterladen",
|
||||
"action.edit": "Bearbeiten",
|
||||
"action.enable": "Aktivieren",
|
||||
"action.permissions": "Berechtigungen",
|
||||
"action.renew": "Erneuert",
|
||||
"action.view-details": "Details",
|
||||
"auditlogs": "Protokoll",
|
||||
"cancel": "Abbrechen",
|
||||
"certificate": "Zertifikat",
|
||||
"certificate.custom-certificate": "Zertifikat",
|
||||
"certificate.custom-certificate-key": "Privater Schlüssel",
|
||||
"certificate.custom-intermediate": "Zwischen Zertifikat",
|
||||
"certificate.in-use": "In Benutzung",
|
||||
"certificate.none.subtitle": "Kein Zertifikat zugewiesen",
|
||||
"certificate.none.subtitle.for-http": "Dieser Host verwendet kein HTTPS.",
|
||||
"certificate.none.title": "Kein",
|
||||
"certificate.not-in-use": "Nicht in Benutzung",
|
||||
"certificate.renew": "Zertifikat erneuern",
|
||||
"certificates": "Zertifikate",
|
||||
"certificates.custom": "Benutzerdefiniertes Zertifikat",
|
||||
"certificates.custom.warning": "Mit einem Passwort geschützte Schlüsseldateien werden nicht unterstützt.",
|
||||
"certificates.dns.credentials": "Inhalt der Anmeldedaten-Datei",
|
||||
"certificates.dns.credentials-note": "Dieses Plugin erfordert eine Konfigurationsdatei, die einen API-Token oder andere Anmeldedaten für Ihren Anbieter enthält.",
|
||||
"certificates.dns.credentials-warning": "Diese Daten werden als Klartext in der Datenbank und in einer Datei gespeichert!",
|
||||
"certificates.dns.propagation-seconds": "Wartzeit in Sekunden",
|
||||
"certificates.dns.propagation-seconds-note": "Leer lassen um die Standardwartezeit des Plugins zu nutzen",
|
||||
"certificates.dns.provider": "DNS Provider",
|
||||
"certificates.dns.warning": "Dieser Abschnitt erfordert einige Kenntnisse über Certbot und seine DNS-Plugins. Bitte konsultieren Sie die jeweilige Plugin-Dokumentation.",
|
||||
"certificates.http.reachability-404": "Unter dieser Domain wurde ein Server gefunden, aber es scheint sich nicht um Nginx Proxy Manager zu handeln. Bitte stellen Sie sicher, dass Ihre Domain auf die IP-Adresse verweist, unter der Ihre NPM-Instanz ausgeführt wird.",
|
||||
"certificates.http.reachability-failed-to-check": "Die Erreichbarkeit konnte aufgrund eines Kommunikationsfehlers mit site24x7.com nicht überprüft werden.",
|
||||
"certificates.http.reachability-not-resolved": "Unter dieser Domain ist kein Server verfügbar. Bitte stellen Sie sicher, dass Ihre Domain existiert und auf die IP-Adresse verweist, unter der Ihre NPM-Instanz läuft, und dass gegebenenfalls Port 80 in Ihrem Router weitergeleitet wird.",
|
||||
"certificates.http.reachability-ok": "Ihr Server ist erreichbar und die Erstellung von Zertifikaten sollte möglich sein.",
|
||||
"certificates.http.reachability-other": "Unter dieser Domain wurde ein Server gefunden, der jedoch einen unerwarteten Statuscode {code} zurückgegeben hat. Handelt es sich um den NPM-Server? Bitte stellen Sie sicher, dass Ihre Domain auf die IP-Adresse verweist, unter der Ihre NPM-Instanz ausgeführt wird.",
|
||||
"certificates.http.reachability-wrong-data": "Unter dieser Domain wurde ein Server gefunden, der jedoch unerwartete Daten zurückgegeben hat. Handelt es sich um den NPM-Server? Bitte stellen Sie sicher, dass Ihre Domain auf die IP-Adresse verweist, unter der Ihre NPM-Instanz ausgeführt wird.",
|
||||
"certificates.http.test-results": "Test Ergeniss",
|
||||
"certificates.http.warning": "Diese Domänen müssen bereits so konfiguriert sein, dass sie auf diese Installation verweisen.",
|
||||
"certificates.request.subtitle": "Über Let's Encrypt",
|
||||
"certificates.request.title": "Anfordern eines neuen Zertifikates",
|
||||
"column.access": "Zugriff",
|
||||
"column.authorization": "Genehmigung",
|
||||
"column.authorizations": "Genehmigungen",
|
||||
"column.custom-locations": "Benutzerdefinierte Pfad",
|
||||
"column.destination": "Ziel",
|
||||
"column.details": "Details",
|
||||
"column.email": "Email",
|
||||
"column.event": "Ereignis",
|
||||
"column.expires": "Verfällt am",
|
||||
"column.http-code": "HTTP Code",
|
||||
"column.incoming-port": "Eingehender Port",
|
||||
"column.name": "Name",
|
||||
"column.protocol": "Protokoll",
|
||||
"column.provider": "Provider",
|
||||
"column.roles": "Rollen",
|
||||
"column.rules": "Regeln",
|
||||
"column.satisfy": "Satisfy",
|
||||
"column.satisfy-all": "Alle",
|
||||
"column.satisfy-any": "Jeder",
|
||||
"column.scheme": "Schema",
|
||||
"column.source": "Quelle",
|
||||
"column.ssl": "SSL",
|
||||
"column.status": "Status",
|
||||
"created-on": "Erstelldatum: {date}",
|
||||
"dashboard": "Dashboard",
|
||||
"dead-host": "404 Host",
|
||||
"dead-hosts": "404 Hosts",
|
||||
"dead-hosts.count": "{count} {count, plural, one {404 Host} other {404 Hosts}}",
|
||||
"disabled": "Deaktiviert",
|
||||
"domain-names": "Domain Names",
|
||||
"domain-names.max": "{count} Maximale Anzahl von Domainnamen",
|
||||
"domain-names.placeholder": "Eintragen der Domain...",
|
||||
"domain-names.wildcards-not-permitted": "Wildcards sind für diesen Typ nicht zulässig.",
|
||||
"domain-names.wildcards-not-supported": "Wildcards werden für diese Zertifizierungsstelle nicht unterstützt.",
|
||||
"domains.force-ssl": "Erzwinge SSL",
|
||||
"domains.hsts-enabled": "HSTS aktiviert",
|
||||
"domains.hsts-subdomains": "HSTS Sub-domains",
|
||||
"domains.http2-support": "HTTP/2 Support",
|
||||
"domains.use-dns": "Nutze DNS Challenge",
|
||||
"email-address": "Email Addresse",
|
||||
"empty-search": "Keine Ergebnisse gefunden",
|
||||
"empty-subtitle": "Warum erstellen Sie nicht eine?",
|
||||
"enabled": "aktiviert",
|
||||
"error.access.at-least-one": "Entweder eine Genehmigung oder eine Zugriffsregel ist erforderlich.",
|
||||
"error.access.duplicate-usernames": "Autorisierung Benutzernamen müssen eindeutig sein",
|
||||
"error.invalid-auth": "Ungültige E-Mail-Adresse oder Passwort",
|
||||
"error.invalid-domain": "Ungültige Domain: {domain}",
|
||||
"error.invalid-email": "Ungültige E-Mail-Adresse",
|
||||
"error.max-character-length": "Die maximale Länge beträgt {max} Zeichen{max, plural, one {} other {s}}",
|
||||
"error.max-domains": "Zu viele Domains, maximal sind {max}",
|
||||
"error.maximum": "Maximum ist {max}",
|
||||
"error.min-character-length": "Die minimale Länge beträgt {min} Zeichen{min, plural, one {} other {s}}",
|
||||
"error.minimum": "Minimum ist {min}",
|
||||
"error.passwords-must-match": "Passwörter müssen übereinstimmen",
|
||||
"error.required": "Dies ist erforderlich.",
|
||||
"expires.on": "Ablauf am: {date}",
|
||||
"footer.github-fork": "Fork me on Github",
|
||||
"host.flags.block-exploits": "Gängige Exploits blockieren",
|
||||
"host.flags.cache-assets": "Cache Assets",
|
||||
"host.flags.preserve-path": "Pfad beibehalten",
|
||||
"host.flags.protocols": "Protokole",
|
||||
"host.flags.websockets-upgrade": "Websockets Support",
|
||||
"host.forward-port": "Forward Port",
|
||||
"host.forward-scheme": "Schema",
|
||||
"hosts": "Hosts",
|
||||
"http-only": "HTTP Only",
|
||||
"lets-encrypt": "Let's Encrypt",
|
||||
"lets-encrypt-via-dns": "Let's Encrypt via DNS",
|
||||
"lets-encrypt-via-http": "Let's Encrypt via HTTP",
|
||||
"loading": "Laden…",
|
||||
"login.title": "Account Login",
|
||||
"nginx-config.label": "Benutzerdefinierte Nginx Konfiguration",
|
||||
"nginx-config.placeholder": "# Geben Sie hier Ihre benutzerdefinierte Nginx-Konfiguration auf eigene Gefahr ein!",
|
||||
"no-permission-error": "Sie haben keinen Zugriff, um dies anzuzeigen.",
|
||||
"notfound.action": "Take me home",
|
||||
"notfound.content": "We are sorry but the page you are looking for was not found",
|
||||
"notfound.title": "Oops… You just found an error page",
|
||||
"notification.error": "Error",
|
||||
"notification.object-deleted": "{object} wurde gelöscht",
|
||||
"notification.object-disabled": "{object} wurde deaktiviert",
|
||||
"notification.object-enabled": "{object} wurde aktiviert",
|
||||
"notification.object-renewed": "{object} wurde erneuert",
|
||||
"notification.object-saved": "{object} wurde gespeichert",
|
||||
"notification.success": "Erfolgreich",
|
||||
"object.actions-title": "{object} #{id}",
|
||||
"object.add": "{object} hinzufügen",
|
||||
"object.delete": "{object} löschen",
|
||||
"object.delete.content": "{object} wirklich löschen?",
|
||||
"object.edit": "{object} bearbeiten",
|
||||
"object.empty": "Keine {objects} vorhanden",
|
||||
"object.event.created": "{object} erstellt",
|
||||
"object.event.deleted": "{object} gelöscht",
|
||||
"object.event.disabled": "{object} deaktiviert",
|
||||
"object.event.enabled": "{object} aktiviert",
|
||||
"object.event.renewed": "{object} erneuert",
|
||||
"object.event.updated": "{object} aktualisiert",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
"options": "Optionen",
|
||||
"password": "Passwort",
|
||||
"password.generate": "Zufälliges Passwort generieren",
|
||||
"password.hide": "Passwort verstecken",
|
||||
"password.show": "Passwort anzeigen",
|
||||
"permissions.hidden": "Versteckt",
|
||||
"permissions.manage": "Verwalten",
|
||||
"permissions.view": "Nur anzeigen",
|
||||
"permissions.visibility.all": "Alle Elemente",
|
||||
"permissions.visibility.title": "Objekt Sichtbarkeit",
|
||||
"permissions.visibility.user": "Nur erstellte Elemente",
|
||||
"proxy-host": "Proxy Host",
|
||||
"proxy-host.forward-host": "Forward Hostname / IP",
|
||||
"proxy-hosts": "Proxy Hosts",
|
||||
"proxy-hosts.count": "{count} {count, plural, one {Proxy Host} other {Proxy Hosts}}",
|
||||
"public": "Öffentlich",
|
||||
"redirection-host": "Redirection Host",
|
||||
"redirection-host.forward-domain": "Forward Domain",
|
||||
"redirection-host.forward-http-code": "HTTP Code",
|
||||
"redirection-hosts": "Redirection Hosts",
|
||||
"redirection-hosts.count": "{count} {count, plural, one {Redirection Host} other {Redirection Hosts}}",
|
||||
"role.admin": "Administrator",
|
||||
"role.standard-user": "Standard User",
|
||||
"save": "Speichern",
|
||||
"setting": "Einstellung",
|
||||
"settings": "Einstellungen",
|
||||
"settings.default-site": "Standard Seite",
|
||||
"settings.default-site.404": "404 Page",
|
||||
"settings.default-site.444": "No Response (444)",
|
||||
"settings.default-site.congratulations": "Willkommensseite",
|
||||
"settings.default-site.description": "Was angezeigt wird, wenn der Nginx eine unbekannte Webseitenanfrage bekommt",
|
||||
"settings.default-site.html": "Benutzerdefinierte HTML",
|
||||
"settings.default-site.html.placeholder": "<!-- Geben Sie hier Ihren benutzerdefinierten HTML-Inhalt ein. -->",
|
||||
"settings.default-site.redirect": "Weiterleitung",
|
||||
"setup.preamble": "Beginnen Sie mit der Erstellung Ihres Administratorkontos.",
|
||||
"setup.title": "Willkommen!",
|
||||
"sign-in": "Login",
|
||||
"ssl-certificate": "SSL Zertifikate",
|
||||
"stream": "Stream",
|
||||
"stream.forward-host": "Forward Host",
|
||||
"stream.incoming-port": "Incoming Port",
|
||||
"streams": "Streams",
|
||||
"streams.count": "{count} {count, plural, one {Stream} other {Streams}}",
|
||||
"streams.tcp": "TCP",
|
||||
"streams.udp": "UDP",
|
||||
"test": "Test",
|
||||
"user": "User",
|
||||
"user.change-password": "Passwort ändern",
|
||||
"user.confirm-password": "Passwort wiederholen",
|
||||
"user.current-password": "Aktuelles Passwort",
|
||||
"user.edit-profile": "Profil bearbeiten",
|
||||
"user.full-name": "Name",
|
||||
"user.login-as": "Einloggen als {name}",
|
||||
"user.logout": "Ausloggen",
|
||||
"user.new-password": "Neues Password",
|
||||
"user.nickname": "Nickname",
|
||||
"user.set-password": "Passwort setzen",
|
||||
"user.set-permissions": "Berechtigungen für {name} setzen",
|
||||
"user.switch-dark": "Zum Dark Mode wechseln",
|
||||
"user.switch-light": "Zum Light Mode wechslen",
|
||||
"username": "Benutzername",
|
||||
"users": "Benutzer"
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
{
|
||||
"access-list": "Access List",
|
||||
"access-list.access-count": "{count} {count, plural, one {Rule} other {Rules}}",
|
||||
"access-list.auth-count": "{count} {count, plural, one {User} other {Users}}",
|
||||
"access-list.help-rules-last": "When at least 1 rule exists, this deny all rule will be added last",
|
||||
"access-list.help.rules-order": "Note that the allow and deny directives will be applied in the order they are defined.",
|
||||
"access-list.pass-auth": "Pass Auth to Upstream",
|
||||
"access-list.public": "Publicly Accessible",
|
||||
"access-list.public.subtitle": "No basic auth required",
|
||||
"access-list.satisfy-any": "Satisfy Any",
|
||||
"access-list.subtitle": "{users} {users, plural, one {User} other {Users}}, {rules} {rules, plural, one {Rule} other {Rules}} - Created: {date}",
|
||||
"access-lists": "Access Lists",
|
||||
"action.add": "Add",
|
||||
"action.add-location": "Add Location",
|
||||
"action.close": "Close",
|
||||
"action.delete": "Delete",
|
||||
"action.disable": "Disable",
|
||||
"action.download": "Download",
|
||||
"action.edit": "Edit",
|
||||
"action.enable": "Enable",
|
||||
"action.permissions": "Permissions",
|
||||
"action.renew": "Renew",
|
||||
"action.view-details": "View Details",
|
||||
"auditlogs": "Audit Logs",
|
||||
"cancel": "Cancel",
|
||||
"certificate": "Certificate",
|
||||
"certificate.custom-certificate": "Certificate",
|
||||
"certificate.custom-certificate-key": "Certificate Key",
|
||||
"certificate.custom-intermediate": "Intermediate Certificate",
|
||||
"certificate.in-use": "In Use",
|
||||
"certificate.none.subtitle": "No certificate assigned",
|
||||
"certificate.none.subtitle.for-http": "This host will not use HTTPS",
|
||||
"certificate.none.title": "None",
|
||||
"certificate.not-in-use": "Not Used",
|
||||
"certificate.renew": "Renew Certificate",
|
||||
"certificates": "Certificates",
|
||||
"certificates.custom": "Custom Certificate",
|
||||
"certificates.custom.warning": "Key files protected with a passphrase are not supported.",
|
||||
"certificates.dns.credentials": "Credentials File Content",
|
||||
"certificates.dns.credentials-note": "This plugin requires a configuration file containing an API token or other credentials for your provider",
|
||||
"certificates.dns.credentials-warning": "This data will be stored as plaintext in the database and in a file!",
|
||||
"certificates.dns.propagation-seconds": "Propagation Seconds",
|
||||
"certificates.dns.propagation-seconds-note": "Leave empty to use the plugins default value. Number of seconds to wait for DNS propagation.",
|
||||
"certificates.dns.provider": "DNS Provider",
|
||||
"certificates.dns.warning": "This section requires some knowledge about Certbot and its DNS plugins. Please consult the respective plugins documentation.",
|
||||
"certificates.http.reachability-404": "There is a server found at this domain but it does not seem to be Nginx Proxy Manager. Please make sure your domain points to the IP where your NPM instance is running.",
|
||||
"certificates.http.reachability-failed-to-check": "Failed to check the reachability due to a communication error with site24x7.com.",
|
||||
"certificates.http.reachability-not-resolved": "There is no server available at this domain. Please make sure your domain exists and points to the IP where your NPM instance is running and if necessary port 80 is forwarded in your router.",
|
||||
"certificates.http.reachability-ok": "Your server is reachable and creating certificates should be possible.",
|
||||
"certificates.http.reachability-other": "There is a server found at this domain but it returned an unexpected status code {code}. Is it the NPM server? Please make sure your domain points to the IP where your NPM instance is running.",
|
||||
"certificates.http.reachability-wrong-data": "There is a server found at this domain but it returned an unexpected data. Is it the NPM server? Please make sure your domain points to the IP where your NPM instance is running.",
|
||||
"certificates.http.test-results": "Test Results",
|
||||
"certificates.http.warning": "These domains must be already configured to point to this installation.",
|
||||
"certificates.request.subtitle": "with Let's Encrypt",
|
||||
"certificates.request.title": "Request a new Certificate",
|
||||
"column.access": "Access",
|
||||
"column.authorization": "Authorization",
|
||||
"column.authorizations": "Authorizations",
|
||||
"column.custom-locations": "Custom Locations",
|
||||
"column.destination": "Destination",
|
||||
"column.details": "Details",
|
||||
"column.email": "Email",
|
||||
"column.event": "Event",
|
||||
"column.expires": "Expires",
|
||||
"column.http-code": "HTTP Code",
|
||||
"column.incoming-port": "Incoming Port",
|
||||
"column.name": "Name",
|
||||
"column.protocol": "Protocol",
|
||||
"column.provider": "Provider",
|
||||
"column.roles": "Roles",
|
||||
"column.rules": "Rules",
|
||||
"column.satisfy": "Satisfy",
|
||||
"column.satisfy-all": "All",
|
||||
"column.satisfy-any": "Any",
|
||||
"column.scheme": "Scheme",
|
||||
"column.source": "Source",
|
||||
"column.ssl": "SSL",
|
||||
"column.status": "Status",
|
||||
"created-on": "Created: {date}",
|
||||
"dashboard": "Dashboard",
|
||||
"dead-host": "404 Host",
|
||||
"dead-hosts": "404 Hosts",
|
||||
"dead-hosts.count": "{count} {count, plural, one {404 Host} other {404 Hosts}}",
|
||||
"disabled": "Disabled",
|
||||
"domain-names": "Domain Names",
|
||||
"domain-names.max": "{count} domain names maximum",
|
||||
"domain-names.placeholder": "Start typing to add domain...",
|
||||
"domain-names.wildcards-not-permitted": "Wildcards not permitted for this type",
|
||||
"domain-names.wildcards-not-supported": "Wildcards not supported for this CA",
|
||||
"domains.force-ssl": "Force SSL",
|
||||
"domains.hsts-enabled": "HSTS Enabled",
|
||||
"domains.hsts-subdomains": "HSTS Sub-domains",
|
||||
"domains.http2-support": "HTTP/2 Support",
|
||||
"domains.use-dns": "Use DNS Challenge",
|
||||
"email-address": "Email address",
|
||||
"empty-search": "No results found",
|
||||
"empty-subtitle": "Why don't you create one?",
|
||||
"enabled": "Enabled",
|
||||
"error.access.at-least-one": "Either one Authorization or one Access Rule is required",
|
||||
"error.access.duplicate-usernames": "Authorization Usernames must be unique",
|
||||
"error.invalid-auth": "Invalid email or password",
|
||||
"error.invalid-domain": "Invalid domain: {domain}",
|
||||
"error.invalid-email": "Invalid email address",
|
||||
"error.max-character-length": "Maximum length is {max} character{max, plural, one {} other {s}}",
|
||||
"error.max-domains": "Too many domains, max is {max}",
|
||||
"error.maximum": "Maximum is {max}",
|
||||
"error.min-character-length": "Minimum length is {min} character{min, plural, one {} other {s}}",
|
||||
"error.minimum": "Minimum is {min}",
|
||||
"error.passwords-must-match": "Passwords must match",
|
||||
"error.required": "This is required",
|
||||
"expires.on": "Expires: {date}",
|
||||
"footer.github-fork": "Fork me on Github",
|
||||
"host.flags.block-exploits": "Block Common Exploits",
|
||||
"host.flags.cache-assets": "Cache Assets",
|
||||
"host.flags.preserve-path": "Preserve Path",
|
||||
"host.flags.protocols": "Protocols",
|
||||
"host.flags.websockets-upgrade": "Websockets Support",
|
||||
"host.forward-port": "Forward Port",
|
||||
"host.forward-scheme": "Scheme",
|
||||
"hosts": "Hosts",
|
||||
"http-only": "HTTP Only",
|
||||
"lets-encrypt": "Let's Encrypt",
|
||||
"lets-encrypt-via-dns": "Let's Encrypt via DNS",
|
||||
"lets-encrypt-via-http": "Let's Encrypt via HTTP",
|
||||
"loading": "Loading…",
|
||||
"login.title": "Login to your account",
|
||||
"nginx-config.label": "Custom Nginx Configuration",
|
||||
"nginx-config.placeholder": "# Enter your custom Nginx configuration here at your own risk!",
|
||||
"no-permission-error": "You do not have access to view this.",
|
||||
"notfound.action": "Take me home",
|
||||
"notfound.content": "We are sorry but the page you are looking for was not found",
|
||||
"notfound.title": "Oops… You just found an error page",
|
||||
"notification.error": "Error",
|
||||
"notification.object-deleted": "{object} has been deleted",
|
||||
"notification.object-disabled": "{object} has been disabled",
|
||||
"notification.object-enabled": "{object} has been enabled",
|
||||
"notification.object-renewed": "{object} has been renewed",
|
||||
"notification.object-saved": "{object} has been saved",
|
||||
"notification.success": "Success",
|
||||
"object.actions-title": "{object} #{id}",
|
||||
"object.add": "Add {object}",
|
||||
"object.delete": "Delete {object}",
|
||||
"object.delete.content": "Are you sure you want to delete this {object}?",
|
||||
"object.edit": "Edit {object}",
|
||||
"object.empty": "There are no {objects}",
|
||||
"object.event.created": "Created {object}",
|
||||
"object.event.deleted": "Deleted {object}",
|
||||
"object.event.disabled": "Disabled {object}",
|
||||
"object.event.enabled": "Enabled {object}",
|
||||
"object.event.renewed": "Renewed {object}",
|
||||
"object.event.updated": "Updated {object}",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
"options": "Options",
|
||||
"password": "Password",
|
||||
"password.generate": "Generate random password",
|
||||
"password.hide": "Hide Password",
|
||||
"password.show": "Show Password",
|
||||
"permissions.hidden": "Hidden",
|
||||
"permissions.manage": "Manage",
|
||||
"permissions.view": "View Only",
|
||||
"permissions.visibility.all": "All Items",
|
||||
"permissions.visibility.title": "Item Visibility",
|
||||
"permissions.visibility.user": "Created Items Only",
|
||||
"proxy-host": "Proxy Host",
|
||||
"proxy-host.forward-host": "Forward Hostname / IP",
|
||||
"proxy-hosts": "Proxy Hosts",
|
||||
"proxy-hosts.count": "{count} {count, plural, one {Proxy Host} other {Proxy Hosts}}",
|
||||
"public": "Public",
|
||||
"redirection-host": "Redirection Host",
|
||||
"redirection-host.forward-domain": "Forward Domain",
|
||||
"redirection-host.forward-http-code": "HTTP Code",
|
||||
"redirection-hosts": "Redirection Hosts",
|
||||
"redirection-hosts.count": "{count} {count, plural, one {Redirection Host} other {Redirection Hosts}}",
|
||||
"role.admin": "Administrator",
|
||||
"role.standard-user": "Standard User",
|
||||
"save": "Save",
|
||||
"setting": "Setting",
|
||||
"settings": "Settings",
|
||||
"settings.default-site": "Default Site",
|
||||
"settings.default-site.404": "404 Page",
|
||||
"settings.default-site.444": "No Response (444)",
|
||||
"settings.default-site.congratulations": "Congratulations Page",
|
||||
"settings.default-site.description": "What to show when Nginx is hit with an unknown Host",
|
||||
"settings.default-site.html": "Custom HTML",
|
||||
"settings.default-site.html.placeholder": "<!-- Enter your custom HTML content here -->",
|
||||
"settings.default-site.redirect": "Redirect",
|
||||
"setup.preamble": "Get started by creating your admin account.",
|
||||
"setup.title": "Welcome!",
|
||||
"sign-in": "Sign in",
|
||||
"ssl-certificate": "SSL Certificate",
|
||||
"stream": "Stream",
|
||||
"stream.forward-host": "Forward Host",
|
||||
"stream.incoming-port": "Incoming Port",
|
||||
"streams": "Streams",
|
||||
"streams.count": "{count} {count, plural, one {Stream} other {Streams}}",
|
||||
"streams.tcp": "TCP",
|
||||
"streams.udp": "UDP",
|
||||
"test": "Test",
|
||||
"user": "User",
|
||||
"user.change-password": "Change Password",
|
||||
"user.confirm-password": "Confirm Password",
|
||||
"user.current-password": "Current Password",
|
||||
"user.edit-profile": "Edit Profile",
|
||||
"user.full-name": "Full Name",
|
||||
"user.login-as": "Sign in as {name}",
|
||||
"user.logout": "Logout",
|
||||
"user.new-password": "New Password",
|
||||
"user.nickname": "Nickname",
|
||||
"user.set-password": "Set Password",
|
||||
"user.set-permissions": "Set Permissions for {name}",
|
||||
"user.switch-dark": "Switch to Dark mode",
|
||||
"user.switch-light": "Switch to Light mode",
|
||||
"username": "Username",
|
||||
"users": "Users"
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
{
|
||||
"access-list": "Lista de Acceso",
|
||||
"access-list.access-count": "{count} {count, plural, one {Regla} other {Reglas}}",
|
||||
"access-list.auth-count": "{count} {count, plural, one {Usuario} other {Usuarios}}",
|
||||
"access-list.help-rules-last": "Cuando exista al menos 1 regla, esta regla de denegar todo se añadirá al final",
|
||||
"access-list.help.rules-order": "Ten en cuenta que las directivas de permitir y denegar se aplicarán en el orden en que estén definidas.",
|
||||
"access-list.pass-auth": "Pasar Autenticación al Upstream",
|
||||
"access-list.public": "Accesible Públicamente",
|
||||
"access-list.public.subtitle": "No se requiere autenticación básica",
|
||||
"access-list.satisfy-any": "Satisfacer Cualquiera",
|
||||
"access-list.subtitle": "{users} {users, plural, one {Usuario} other {Usuarios}}, {rules} {rules, plural, one {Regla} other {Reglas}} - Creado: {date}",
|
||||
"access-lists": "Listas de Acceso",
|
||||
"action.add": "Añadir",
|
||||
"action.add-location": "Añadir Ubicación",
|
||||
"action.close": "Cerrar",
|
||||
"action.delete": "Eliminar",
|
||||
"action.disable": "Deshabilitar",
|
||||
"action.download": "Descargar",
|
||||
"action.edit": "Editar",
|
||||
"action.enable": "Habilitar",
|
||||
"action.permissions": "Permisos",
|
||||
"action.renew": "Renovar",
|
||||
"action.view-details": "Ver Detalles",
|
||||
"auditlogs": "Registros de Auditoría",
|
||||
"cancel": "Cancelar",
|
||||
"certificate": "Certificado",
|
||||
"certificate.custom-certificate": "Certificado",
|
||||
"certificate.custom-certificate-key": "Clave del Certificado",
|
||||
"certificate.custom-intermediate": "Certificado Intermedio",
|
||||
"certificate.in-use": "En Uso",
|
||||
"certificate.none.subtitle": "Sin certificado asignado",
|
||||
"certificate.none.subtitle.for-http": "Este host no usará HTTPS",
|
||||
"certificate.none.title": "Ninguno",
|
||||
"certificate.not-in-use": "Sin Usar",
|
||||
"certificate.renew": "Renovar Certificado",
|
||||
"certificates": "Certificados",
|
||||
"certificates.custom": "Certificado Personalizado",
|
||||
"certificates.custom.warning": "No se admiten archivos de claves protegidos con contraseña.",
|
||||
"certificates.dns.credentials": "Contenido del Archivo de Credenciales",
|
||||
"certificates.dns.credentials-note": "Este plugin requiere un archivo de configuración que contenga un token de API u otras credenciales para tu proveedor",
|
||||
"certificates.dns.credentials-warning": "¡Estos datos se almacenarán como texto plano en la base de datos y en un archivo!",
|
||||
"certificates.dns.propagation-seconds": "Segundos de Propagación",
|
||||
"certificates.dns.propagation-seconds-note": "Dejar vacío para usar el valor predeterminado del plugin. Número de segundos a esperar para la propagación DNS.",
|
||||
"certificates.dns.provider": "Proveedor DNS",
|
||||
"certificates.dns.warning": "Esta sección requiere algunos conocimientos sobre Certbot y sus plugins DNS. Consulta la documentación de los plugins respectivos.",
|
||||
"certificates.http.reachability-404": "Se encontró un servidor en este dominio pero no parece ser Nginx Proxy Manager. Asegúrate de que tu dominio apunte a la IP donde se está ejecutando tu instancia de NPM.",
|
||||
"certificates.http.reachability-failed-to-check": "No se pudo verificar la accesibilidad debido a un error de comunicación con site24x7.com.",
|
||||
"certificates.http.reachability-not-resolved": "No hay ningún servidor disponible en este dominio. Asegúrate de que tu dominio existe y apunta a la IP donde se está ejecutando tu instancia de NPM y, si es necesario, que el puerto 80 esté redirigido en tu router.",
|
||||
"certificates.http.reachability-ok": "Tu servidor es accesible y debería ser posible crear certificados.",
|
||||
"certificates.http.reachability-other": "Se encontró un servidor en este dominio pero devolvió un código de estado inesperado {code}. ¿Es el servidor NPM? Asegúrate de que tu dominio apunte a la IP donde se está ejecutando tu instancia de NPM.",
|
||||
"certificates.http.reachability-wrong-data": "Se encontró un servidor en este dominio pero devolvió datos inesperados. ¿Es el servidor NPM? Asegúrate de que tu dominio apunte a la IP donde se está ejecutando tu instancia de NPM.",
|
||||
"certificates.http.test-results": "Resultados de la Prueba",
|
||||
"certificates.http.warning": "Estos dominios ya deben estar configurados para apuntar a esta instalación.",
|
||||
"certificates.request.subtitle": "con Let's Encrypt",
|
||||
"certificates.request.title": "Solicitar un nuevo Certificado",
|
||||
"column.access": "Acceso",
|
||||
"column.authorization": "Autorización",
|
||||
"column.authorizations": "Autorizaciones",
|
||||
"column.custom-locations": "Ubicaciones Personalizadas",
|
||||
"column.destination": "Destino",
|
||||
"column.details": "Detalles",
|
||||
"column.email": "Correo Electrónico",
|
||||
"column.event": "Evento",
|
||||
"column.expires": "Expira",
|
||||
"column.http-code": "Código HTTP",
|
||||
"column.incoming-port": "Puerto de Entrada",
|
||||
"column.name": "Nombre",
|
||||
"column.protocol": "Protocolo",
|
||||
"column.provider": "Proveedor",
|
||||
"column.roles": "Roles",
|
||||
"column.rules": "Reglas",
|
||||
"column.satisfy": "Satisfacer",
|
||||
"column.satisfy-all": "Todo",
|
||||
"column.satisfy-any": "Cualquiera",
|
||||
"column.scheme": "Esquema",
|
||||
"column.source": "Origen",
|
||||
"column.ssl": "SSL",
|
||||
"column.status": "Estado",
|
||||
"created-on": "Creado: {date}",
|
||||
"dashboard": "Panel de Control",
|
||||
"dead-host": "Host 404",
|
||||
"dead-hosts": "Hosts 404",
|
||||
"dead-hosts.count": "{count} {count, plural, one {Host 404} other {Hosts 404}}",
|
||||
"disabled": "Deshabilitado",
|
||||
"domain-names": "Nombres de Dominio",
|
||||
"domain-names.max": "{count} nombres de dominio como máximo",
|
||||
"domain-names.placeholder": "Comienza a escribir para añadir dominio...",
|
||||
"domain-names.wildcards-not-permitted": "No se permiten comodines para este tipo",
|
||||
"domain-names.wildcards-not-supported": "No se admiten comodines para esta CA",
|
||||
"domains.force-ssl": "Forzar SSL",
|
||||
"domains.hsts-enabled": "HSTS Habilitado",
|
||||
"domains.hsts-subdomains": "HSTS en Subdominios",
|
||||
"domains.http2-support": "Soporte HTTP/2",
|
||||
"domains.use-dns": "Usar Desafío DNS",
|
||||
"email-address": "Dirección de correo electrónico",
|
||||
"empty-search": "No se encontraron resultados",
|
||||
"empty-subtitle": "¿Por qué no creas uno?",
|
||||
"enabled": "Habilitado",
|
||||
"error.access.at-least-one": "Se requiere al menos una Autorización o una Regla de Acceso",
|
||||
"error.access.duplicate-usernames": "Los nombres de usuario de autorización deben ser únicos",
|
||||
"error.invalid-auth": "Correo electrónico o contraseña no válidos",
|
||||
"error.invalid-domain": "Dominio no válido: {domain}",
|
||||
"error.invalid-email": "Dirección de correo electrónico no válida",
|
||||
"error.max-character-length": "La longitud máxima es {max} caracter{max, plural, one {} other {es}}",
|
||||
"error.max-domains": "Demasiados dominios, el máximo es {max}",
|
||||
"error.maximum": "El máximo es {max}",
|
||||
"error.min-character-length": "La longitud mínima es {min} caracter{min, plural, one {} other {es}}",
|
||||
"error.minimum": "El mínimo es {min}",
|
||||
"error.passwords-must-match": "Las contraseñas deben coincidir",
|
||||
"error.required": "Este campo es obligatorio",
|
||||
"expires.on": "Expira: {date}",
|
||||
"footer.github-fork": "Bifúrcame en Github",
|
||||
"host.flags.block-exploits": "Bloquear Exploits Comunes",
|
||||
"host.flags.cache-assets": "Cachear Recursos",
|
||||
"host.flags.preserve-path": "Preservar Ruta",
|
||||
"host.flags.protocols": "Protocolos",
|
||||
"host.flags.websockets-upgrade": "Soporte de Websockets",
|
||||
"host.forward-port": "Puerto de Reenvío",
|
||||
"host.forward-scheme": "Esquema",
|
||||
"hosts": "Hosts",
|
||||
"http-only": "Solo HTTP",
|
||||
"lets-encrypt": "Let's Encrypt",
|
||||
"lets-encrypt-via-dns": "Let's Encrypt vía DNS",
|
||||
"lets-encrypt-via-http": "Let's Encrypt vía HTTP",
|
||||
"loading": "Cargando…",
|
||||
"login.title": "Inicia sesión en tu cuenta",
|
||||
"nginx-config.label": "Configuración Personalizada de Nginx",
|
||||
"nginx-config.placeholder": "# ¡Introduce aquí tu configuración personalizada de Nginx bajo tu propio riesgo!",
|
||||
"no-permission-error": "No tienes acceso para ver esto.",
|
||||
"notfound.action": "Llévame al inicio",
|
||||
"notfound.content": "Lo sentimos, pero la página que buscas no fue encontrada",
|
||||
"notfound.title": "Ups… Has encontrado una página de error",
|
||||
"notification.error": "Error",
|
||||
"notification.object-deleted": "{object} ha sido eliminado",
|
||||
"notification.object-disabled": "{object} ha sido deshabilitado",
|
||||
"notification.object-enabled": "{object} ha sido habilitado",
|
||||
"notification.object-renewed": "{object} ha sido renovado",
|
||||
"notification.object-saved": "{object} ha sido guardado",
|
||||
"notification.success": "Éxito",
|
||||
"object.actions-title": "{object} #{id}",
|
||||
"object.add": "Añadir {object}",
|
||||
"object.delete": "Eliminar {object}",
|
||||
"object.delete.content": "¿Estás seguro de que quieres eliminar este {object}?",
|
||||
"object.edit": "Editar {object}",
|
||||
"object.empty": "No hay {objects}",
|
||||
"object.event.created": "{object} Creado",
|
||||
"object.event.deleted": "{object} Eliminado",
|
||||
"object.event.disabled": "{object} Deshabilitado",
|
||||
"object.event.enabled": "{object} Habilitado",
|
||||
"object.event.renewed": "{object} Renovado",
|
||||
"object.event.updated": "{object} Actualizado",
|
||||
"offline": "Desconectado",
|
||||
"online": "Conectado",
|
||||
"options": "Opciones",
|
||||
"password": "Contraseña",
|
||||
"password.generate": "Generar contraseña aleatoria",
|
||||
"password.hide": "Ocultar Contraseña",
|
||||
"password.show": "Mostrar Contraseña",
|
||||
"permissions.hidden": "Oculto",
|
||||
"permissions.manage": "Gestionar",
|
||||
"permissions.view": "Solo Ver",
|
||||
"permissions.visibility.all": "Todos los Elementos",
|
||||
"permissions.visibility.title": "Visibilidad de Elementos",
|
||||
"permissions.visibility.user": "Solo Elementos Creados",
|
||||
"proxy-host": "Host Proxy",
|
||||
"proxy-host.forward-host": "Nombre de Host / IP de Reenvío",
|
||||
"proxy-hosts": "Hosts Proxy",
|
||||
"proxy-hosts.count": "{count} {count, plural, one {Host Proxy} other {Hosts Proxy}}",
|
||||
"public": "Público",
|
||||
"redirection-host": "Host de Redirección",
|
||||
"redirection-host.forward-domain": "Dominio de Reenvío",
|
||||
"redirection-host.forward-http-code": "Código HTTP",
|
||||
"redirection-hosts": "Hosts de Redirección",
|
||||
"redirection-hosts.count": "{count} {count, plural, one {Host de Redirección} other {Hosts de Redirección}}",
|
||||
"role.admin": "Administrador",
|
||||
"role.standard-user": "Usuario Estándar",
|
||||
"save": "Guardar",
|
||||
"setting": "Configuración",
|
||||
"settings": "Configuración",
|
||||
"settings.default-site": "Sitio Predeterminado",
|
||||
"settings.default-site.404": "Página 404",
|
||||
"settings.default-site.444": "Sin Respuesta (444)",
|
||||
"settings.default-site.congratulations": "Página de Felicitaciones",
|
||||
"settings.default-site.description": "Qué mostrar cuando Nginx recibe un Host desconocido",
|
||||
"settings.default-site.html": "HTML Personalizado",
|
||||
"settings.default-site.html.placeholder": "<!-- Introduce aquí tu contenido HTML personalizado -->",
|
||||
"settings.default-site.redirect": "Redirigir",
|
||||
"setup.preamble": "Comienza creando tu cuenta de administrador.",
|
||||
"setup.title": "¡Bienvenido!",
|
||||
"sign-in": "Iniciar Sesión",
|
||||
"ssl-certificate": "Certificado SSL",
|
||||
"stream": "Stream",
|
||||
"stream.forward-host": "Host de Reenvío",
|
||||
"stream.incoming-port": "Puerto de Entrada",
|
||||
"streams": "Streams",
|
||||
"streams.count": "{count} {count, plural, one {Stream} other {Streams}}",
|
||||
"streams.tcp": "TCP",
|
||||
"streams.udp": "UDP",
|
||||
"test": "Probar",
|
||||
"user": "Usuario",
|
||||
"user.change-password": "Cambiar Contraseña",
|
||||
"user.confirm-password": "Confirmar Contraseña",
|
||||
"user.current-password": "Contraseña Actual",
|
||||
"user.edit-profile": "Editar Perfil",
|
||||
"user.full-name": "Nombre Completo",
|
||||
"user.login-as": "Iniciar sesión como {name}",
|
||||
"user.logout": "Cerrar Sesión",
|
||||
"user.new-password": "Nueva Contraseña",
|
||||
"user.nickname": "Apodo",
|
||||
"user.set-password": "Establecer Contraseña",
|
||||
"user.set-permissions": "Establecer Permisos para {name}",
|
||||
"user.switch-dark": "Cambiar a modo Oscuro",
|
||||
"user.switch-light": "Cambiar a modo Claro",
|
||||
"username": "Nombre de Usuario",
|
||||
"users": "Usuarios"
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
{
|
||||
"access-list": "アクセスリスト",
|
||||
"access-list.access-count": "{count} ルール",
|
||||
"access-list.auth-count": "{count} ユーザー",
|
||||
"access-list.help-rules-last": "少なくとも 1 つのルールが存在する場合、 他のすべてを拒否するルールが最後に追加されます",
|
||||
"access-list.help.rules-order": "許可コマンドと拒否コマンドは定義された順番で適用されます",
|
||||
"access-list.pass-auth": "認証情報をアップストリームに送信する",
|
||||
"access-list.public": "公開されたアクセス",
|
||||
"access-list.public.subtitle": "ベーシック認証を使用しません",
|
||||
"access-list.satisfy-any": "いずれかを満たす",
|
||||
"access-list.subtitle": "{users} ユーザー, {rules} ルール - 作成日時: {date}",
|
||||
"access-lists": "アクセスリスト",
|
||||
"action.add": "追加",
|
||||
"action.add-location": "場所を追加",
|
||||
"action.close": "閉じる",
|
||||
"action.delete": "削除",
|
||||
"action.disable": "無効化",
|
||||
"action.download": "ダウンロード",
|
||||
"action.edit": "編集",
|
||||
"action.enable": "有効化",
|
||||
"action.permissions": "権限",
|
||||
"action.renew": "更新",
|
||||
"action.view-details": "詳細",
|
||||
"auditlogs": "監査ログ",
|
||||
"cancel": "キャンセル",
|
||||
"certificate": "証明書",
|
||||
"certificate.custom-certificate": "証明書",
|
||||
"certificate.custom-certificate-key": "証明書キー",
|
||||
"certificate.custom-intermediate": "中間証明書",
|
||||
"certificate.in-use": "使用中",
|
||||
"certificate.none.subtitle": "証明書が割り当てられていません",
|
||||
"certificate.none.subtitle.for-http": "このホストはHTTPSを使用しません",
|
||||
"certificate.none.title": "無し",
|
||||
"certificate.not-in-use": "未使用",
|
||||
"certificate.renew": "証明書を更新",
|
||||
"certificates": "証明書",
|
||||
"certificates.custom": "カスタム証明書",
|
||||
"certificates.custom.warning": "パスワードによって保護されたキーファイルはサポートされていません",
|
||||
"certificates.dns.credentials": "資格情報ファイルの内容",
|
||||
"certificates.dns.credentials-note": "このプラグインはプロバイダーのAPIキーか認証情報を含む設定ファイルが必要です",
|
||||
"certificates.dns.credentials-warning": "このデータはファイルとデータベースにプレーンテキストとして保存されます",
|
||||
"certificates.dns.propagation-seconds": "DNS伝播時間(秒)",
|
||||
"certificates.dns.propagation-seconds-note": "DNSの伝搬時間を秒で指定します。空にするとデフォルトの値を使用します。",
|
||||
"certificates.dns.provider": "DNSプロバイダー",
|
||||
"certificates.dns.warning": "このセクションはCertbotとそのDNSプラグインの知識が必要です。各プラグインのドキュメントを参照してください。",
|
||||
"certificates.http.reachability-404": "このドメインはNginx Proxy Managerではないサーバーを指しているようです。ドメインがこのNPMインスタンスを指していることを確認してください。",
|
||||
"certificates.http.reachability-failed-to-check": "site24x7.comへの接続でエラーが発生し、到達性チェックに失敗しました",
|
||||
"certificates.http.reachability-not-resolved": "このドメインには利用可能なサーバーがありません。ドメインが存在し、NPMインスタンスのIPアドレスを指していること、必要に応じてルーターでポート80が転送されていることを確認してください。",
|
||||
"certificates.http.reachability-ok": "サーバーへ到達可能であり、証明書の作成が可能です。",
|
||||
"certificates.http.reachability-other": "このドメインでサーバーが見つかりましたが予期しないステータスコード {code} を返しました. NPMサーバーが動いていますか? ドメインがこのNPMインスタンスを指していることを確認してください。",
|
||||
"certificates.http.reachability-wrong-data": "このドメインでサーバーが見つかりましたが予期しないデータを返しました. NPMサーバーが動いていますか? ドメインがこのNPMインスタンスを指していることを確認してください。",
|
||||
"certificates.http.test-results": "テスト結果",
|
||||
"certificates.http.warning": "これらのドメインは、すでにこのインストール先を指すように設定されている必要がありますあ.",
|
||||
"certificates.request.subtitle": "Let's Encryptを使用する",
|
||||
"certificates.request.title": "新しい証明書を作成",
|
||||
"column.access": "アクセス",
|
||||
"column.authorization": "認証",
|
||||
"column.authorizations": "認証",
|
||||
"column.custom-locations": "カスタムロケーション",
|
||||
"column.destination": "宛先",
|
||||
"column.details": "詳細",
|
||||
"column.email": "Email",
|
||||
"column.event": "イベント",
|
||||
"column.expires": "期限切れ",
|
||||
"column.http-code": "アクセス",
|
||||
"column.incoming-port": "受信ポート",
|
||||
"column.name": "名前",
|
||||
"column.protocol": "プロトコル",
|
||||
"column.provider": "プロバイダー",
|
||||
"column.roles": "Roles",
|
||||
"column.rules": "ルール",
|
||||
"column.satisfy": "Satisfy",
|
||||
"column.satisfy-all": "すべて",
|
||||
"column.satisfy-any": "いずれか",
|
||||
"column.scheme": "スキーム",
|
||||
"column.source": "ソース",
|
||||
"column.ssl": "SSL",
|
||||
"column.status": "ステータス",
|
||||
"created-on": "作成日時: {date}",
|
||||
"dashboard": "ダッシュボード",
|
||||
"dead-host": "404 ホスト",
|
||||
"dead-hosts": "404 ホスト",
|
||||
"dead-hosts.count": "{count} 404 ホスト",
|
||||
"disabled": "無効化",
|
||||
"domain-names": "ドメイン名",
|
||||
"domain-names.max": "{count}のドメイン名が最大です",
|
||||
"domain-names.placeholder": "追加するドメインを入力...",
|
||||
"domain-names.wildcards-not-permitted": "ワイルドカードはこのタイプでは許可されていません",
|
||||
"domain-names.wildcards-not-supported": "ワイルドカードはこのCAではサポートされていません",
|
||||
"domains.force-ssl": "SSLを強制",
|
||||
"domains.hsts-enabled": "HSTSを有効化",
|
||||
"domains.hsts-subdomains": "HSTSサブドメイン",
|
||||
"domains.http2-support": "HTTP/2サポート",
|
||||
"domains.use-dns": "DNSチャレンジを使用",
|
||||
"email-address": "Emailアドレス",
|
||||
"empty-search": "見つかりませんでした",
|
||||
"empty-subtitle": "作ってみましょう",
|
||||
"enabled": "有効",
|
||||
"error.access.at-least-one": "少なくとも一つの認証またはアクセスルールが必要です",
|
||||
"error.access.duplicate-usernames": "認証のユーザー名は他と同じ名前は使用できません",
|
||||
"error.invalid-auth": "無効なemailまたはパスワード",
|
||||
"error.invalid-domain": "無効なドメイン: {domain}",
|
||||
"error.invalid-email": "無効なemailアドレス",
|
||||
"error.max-character-length": "文字数は長くとも{max}文字です",
|
||||
"error.max-domains": "ドメインが多すぎます, 最大値は{max}です",
|
||||
"error.maximum": "最大値は{max}です",
|
||||
"error.min-character-length": "文字数は少なくとも{min}文字です",
|
||||
"error.minimum": "最小値は{min}です",
|
||||
"error.passwords-must-match": "パスワードは一致する必要があります",
|
||||
"error.required": "必須項目です",
|
||||
"expires.on": "有効期限: {date}",
|
||||
"footer.github-fork": "Fork me on Github",
|
||||
"host.flags.block-exploits": "一般的なエクスプロイトをブロックする",
|
||||
"host.flags.cache-assets": "アセットをキャッシュする",
|
||||
"host.flags.preserve-path": "パスワードは一致する必要があります",
|
||||
"host.flags.protocols": "プロトコル",
|
||||
"host.flags.websockets-upgrade": "Websocketsサポート",
|
||||
"host.forward-port": "転送ポート",
|
||||
"host.forward-scheme": "スキーム",
|
||||
"hosts": "ホスト",
|
||||
"http-only": "HTTP Only",
|
||||
"lets-encrypt": "Let's Encrypt",
|
||||
"lets-encrypt-via-dns": "Let's Encrypt via DNS",
|
||||
"lets-encrypt-via-http": "Let's Encrypt via HTTP",
|
||||
"loading": "Loading…",
|
||||
"login.title": "アカウントにログイン",
|
||||
"nginx-config.label": "カスタムNginx設定",
|
||||
"nginx-config.placeholder": "# Enter your custom Nginx configuration here at your own risk!",
|
||||
"no-permission-error": "これを表示する権限がありません",
|
||||
"notfound.action": "ホームに戻る",
|
||||
"notfound.content": "申し訳ありませんが探しているページは見つかりませんでした",
|
||||
"notfound.title": "おっと... エラーページにたどり着いてしまったようです",
|
||||
"notification.error": "エラー",
|
||||
"notification.object-deleted": "{object}は削除されました",
|
||||
"notification.object-disabled": "{object}は無効化されました",
|
||||
"notification.object-enabled": "{object}は有効化されました",
|
||||
"notification.object-renewed": "{object}は再作成されました",
|
||||
"notification.object-saved": "{object}は保存されました",
|
||||
"notification.success": "成功",
|
||||
"object.actions-title": "{object} #{id}",
|
||||
"object.add": "{object}を追加",
|
||||
"object.delete": "{object}を削除",
|
||||
"object.delete.content": "本当に{object}を削除しますか?",
|
||||
"object.edit": "{object}を編集",
|
||||
"object.empty": "{objects}はありません",
|
||||
"object.event.created": "{object}を作成済み",
|
||||
"object.event.deleted": "{object}を削除済み",
|
||||
"object.event.disabled": "{object}を無効化済み",
|
||||
"object.event.enabled": "{object}を有効化済み",
|
||||
"object.event.renewed": "{object}を再作成済み",
|
||||
"object.event.updated": "{object}を更新済み",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
"options": "Options",
|
||||
"password": "パスワード",
|
||||
"password.generate": "ランダムなパスワードを生成",
|
||||
"password.hide": "パスワードを隠す",
|
||||
"password.show": "パスワードを表示する",
|
||||
"permissions.hidden": "非公開",
|
||||
"permissions.manage": "管理",
|
||||
"permissions.view": "表示のみ",
|
||||
"permissions.visibility.all": "すべて",
|
||||
"permissions.visibility.title": "可視性",
|
||||
"permissions.visibility.user": "作成したもののみ",
|
||||
"proxy-host": "プロキシホスト",
|
||||
"proxy-host.forward-host": "転送ホスト名/IP",
|
||||
"proxy-hosts": "プロキシホスト",
|
||||
"proxy-hosts.count": "{count} プロキシホスト",
|
||||
"public": "Public",
|
||||
"redirection-host": "リダイレクトホスト",
|
||||
"redirection-host.forward-domain": "転送ホスト",
|
||||
"redirection-hosts": "リダイレクトホスト",
|
||||
"redirection-hosts.count": "{count} リダイレクトホスト",
|
||||
"role.admin": "管理者",
|
||||
"role.standard-user": "一般ユーザー",
|
||||
"save": "保存",
|
||||
"setting": "設定",
|
||||
"settings": "設定",
|
||||
"settings.default-site": "デフォルトサイト",
|
||||
"settings.default-site.404": "404ページ",
|
||||
"settings.default-site.444": "返答しない (444)",
|
||||
"settings.default-site.congratulations": "設定ページ",
|
||||
"settings.default-site.description": "不明なホストを要求されたときにNginxが何を返すかを設定します",
|
||||
"settings.default-site.html": "カスタムHTML",
|
||||
"settings.default-site.html.placeholder": "<!-- Enter your custom HTML content here -->",
|
||||
"settings.default-site.redirect": "リダイレクト",
|
||||
"setup.preamble": "管理者アカウントを作成して始めましょう",
|
||||
"setup.title": "ようこそ!",
|
||||
"sign-in": "サインイン",
|
||||
"ssl-certificate": "SSL証明書",
|
||||
"stream": "ストリーム",
|
||||
"stream.forward-host": "転送ポート",
|
||||
"stream.incoming-port": "受信ポート",
|
||||
"streams": "ストリーム",
|
||||
"streams.count": "{count} ストリーム",
|
||||
"streams.tcp": "TCP",
|
||||
"streams.udp": "UDP",
|
||||
"test": "テスト",
|
||||
"user": "ユーザー",
|
||||
"user.change-password": "変更するパスワード",
|
||||
"user.confirm-password": "変更するパスワードを確認",
|
||||
"user.current-password": "現在のパスワード",
|
||||
"user.edit-profile": "プロフィールを編集",
|
||||
"user.full-name": "フルネーム",
|
||||
"user.login-as": "{name}としてサインイン",
|
||||
"user.logout": "ログアウト",
|
||||
"user.new-password": "新しいパスワード",
|
||||
"user.nickname": "ニックネーム",
|
||||
"user.set-password": "パスワードを設定",
|
||||
"user.set-permissions": "{name}に権限を設定",
|
||||
"user.switch-dark": "ダークモードに変更",
|
||||
"user.switch-light": "ライトモードに変更",
|
||||
"username": "ユーザー名",
|
||||
"users": "ユーザー"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"locale-de-DE": "German",
|
||||
"locale-en-US": "English",
|
||||
"locale-es-ES": "Español",
|
||||
"locale-ja-JP": "日本語",
|
||||
"locale-pl-PL": "Polski",
|
||||
"locale-ru-RU": "Русский",
|
||||
"locale-sk-SK": "Slovak",
|
||||
"locale-zh-CN": "中文"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user