mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-17 19:16:32 +02:00
Merge branch 'dev' into local-connection
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ var redisFlag *bool
|
|||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
crowdsecFlag := flag.Bool("crowdsec", false, "Enable the CrowdSec installation prompt")
|
crowdsecFlag := flag.Bool("crowdsec", false, "Enable the CrowdSec installation prompt")
|
||||||
redisFlag = flag.Bool("redis", false, "Install Redis as cacheing solution. Required for HA. Not required for the Enterprise version.")
|
redisFlag = flag.Bool("redis", false, "Install Redis as caching solution. Required for HA. Not required for the Enterprise version.")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// print a banner about prerequisites - opening port 80, 443, 51820, and 21820 on the VPS and firewall and pointing your domain to the VPS IP with a records. Docs are at http://localhost:3000/Getting%20Started/dns-networking
|
// print a banner about prerequisites - opening port 80, 443, 51820, and 21820 on the VPS and firewall and pointing your domain to the VPS IP with a records. Docs are at http://localhost:3000/Getting%20Started/dns-networking
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Списък с покани",
|
"actionListInvitations": "Списък с покани",
|
||||||
"actionExportLogs": "Експортиране на дневници",
|
"actionExportLogs": "Експортиране на дневници",
|
||||||
"actionViewLogs": "Преглед на дневници",
|
"actionViewLogs": "Преглед на дневници",
|
||||||
|
"actionCreateSiteProvisioningKey": "Създаване на ключ за предоставяне на сайт",
|
||||||
|
"actionListSiteProvisioningKeys": "Списък на ключовете за предоставяне на сайт",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Актуализиране на ключ за предоставяне на сайт",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Изтриване на ключ за предоставяне на сайт",
|
||||||
"noneSelected": "Нищо не е избрано",
|
"noneSelected": "Нищо не е избрано",
|
||||||
"orgNotFound2": "Няма намерени организации.",
|
"orgNotFound2": "Няма намерени организации.",
|
||||||
"search": "Търси…",
|
"search": "Търси…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Качването неуспешно",
|
"rdpUploadFailed": "Качването неуспешно",
|
||||||
"rdpUnicodeKeyboardMode": "Режим на unicode клавиатура",
|
"rdpUnicodeKeyboardMode": "Режим на unicode клавиатура",
|
||||||
"sessionToolbarShow": "Показване на лентата с инструменти",
|
"sessionToolbarShow": "Показване на лентата с инструменти",
|
||||||
"sessionToolbarHide": "Скриване на лентата с инструменти"
|
"sessionToolbarHide": "Скриване на лентата с инструменти",
|
||||||
|
"actionUpdateSiteApprovals": "Обновяване на одобренията на сайта"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Seznam pozvánek",
|
"actionListInvitations": "Seznam pozvánek",
|
||||||
"actionExportLogs": "Exportovat protokoly",
|
"actionExportLogs": "Exportovat protokoly",
|
||||||
"actionViewLogs": "Zobrazit logy",
|
"actionViewLogs": "Zobrazit logy",
|
||||||
|
"actionCreateSiteProvisioningKey": "Vytvořit klíč pro zřízení webu",
|
||||||
|
"actionListSiteProvisioningKeys": "Seznam klíčů pro zřízení webu",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Aktualizovat klíč pro zřízení webu",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Smazat klíč pro zřízení webu",
|
||||||
"noneSelected": "Není vybráno",
|
"noneSelected": "Není vybráno",
|
||||||
"orgNotFound2": "Nebyly nalezeny žádné organizace.",
|
"orgNotFound2": "Nebyly nalezeny žádné organizace.",
|
||||||
"search": "Vyhledávání…",
|
"search": "Vyhledávání…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Nahrání selhalo",
|
"rdpUploadFailed": "Nahrání selhalo",
|
||||||
"rdpUnicodeKeyboardMode": "Režim Unicode klávesnice",
|
"rdpUnicodeKeyboardMode": "Režim Unicode klávesnice",
|
||||||
"sessionToolbarShow": "Zobrazit panel nástrojů",
|
"sessionToolbarShow": "Zobrazit panel nástrojů",
|
||||||
"sessionToolbarHide": "Skrýt panel nástrojů"
|
"sessionToolbarHide": "Skrýt panel nástrojů",
|
||||||
|
"actionUpdateSiteApprovals": "Aktualizovat schválení webu"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Vis invitationer",
|
"actionListInvitations": "Vis invitationer",
|
||||||
"actionExportLogs": "Eksportér logs",
|
"actionExportLogs": "Eksportér logs",
|
||||||
"actionViewLogs": "Vis logs",
|
"actionViewLogs": "Vis logs",
|
||||||
|
"actionCreateSiteProvisioningKey": "Opret provisioneringsnøgle til site",
|
||||||
|
"actionListSiteProvisioningKeys": "Vis provisioneringsnøgler til site",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Opdater provisioneringsnøgle til site",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Slet provisioneringsnøgle til site",
|
||||||
"noneSelected": "Ingen valgt",
|
"noneSelected": "Ingen valgt",
|
||||||
"orgNotFound2": "Ingen organisationer fundet.",
|
"orgNotFound2": "Ingen organisationer fundet.",
|
||||||
"search": "Søg…",
|
"search": "Søg…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Uploaden mislykkedes",
|
"rdpUploadFailed": "Uploaden mislykkedes",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode tastaturtilstand",
|
"rdpUnicodeKeyboardMode": "Unicode tastaturtilstand",
|
||||||
"sessionToolbarShow": "Vis værktøjslinje",
|
"sessionToolbarShow": "Vis værktøjslinje",
|
||||||
"sessionToolbarHide": "Skjul værktøjslinje"
|
"sessionToolbarHide": "Skjul værktøjslinje",
|
||||||
|
"actionUpdateSiteApprovals": "Opdater godkendelser på site"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Einladungen auflisten",
|
"actionListInvitations": "Einladungen auflisten",
|
||||||
"actionExportLogs": "Logs exportieren",
|
"actionExportLogs": "Logs exportieren",
|
||||||
"actionViewLogs": "Logs anzeigen",
|
"actionViewLogs": "Logs anzeigen",
|
||||||
|
"actionCreateSiteProvisioningKey": "Bereitstellungsschlüssel für Standort erstellen",
|
||||||
|
"actionListSiteProvisioningKeys": "Liste der Bereitstellungsschlüssel für Standorte",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Bereitstellungsschlüssel für Standort aktualisieren",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Bereitstellungsschlüssel für Standort löschen",
|
||||||
"noneSelected": "Keine ausgewählt",
|
"noneSelected": "Keine ausgewählt",
|
||||||
"orgNotFound2": "Keine Organisationen gefunden.",
|
"orgNotFound2": "Keine Organisationen gefunden.",
|
||||||
"search": "Suche…",
|
"search": "Suche…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Upload fehlgeschlagen",
|
"rdpUploadFailed": "Upload fehlgeschlagen",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode-Tastaturmodus",
|
"rdpUnicodeKeyboardMode": "Unicode-Tastaturmodus",
|
||||||
"sessionToolbarShow": "Werkzeugleiste zeigen",
|
"sessionToolbarShow": "Werkzeugleiste zeigen",
|
||||||
"sessionToolbarHide": "Werkzeugleiste ausblenden"
|
"sessionToolbarHide": "Werkzeugleiste ausblenden",
|
||||||
|
"actionUpdateSiteApprovals": "Standortgenehmigungen aktualisieren"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "List Invitations",
|
"actionListInvitations": "List Invitations",
|
||||||
"actionExportLogs": "Export Logs",
|
"actionExportLogs": "Export Logs",
|
||||||
"actionViewLogs": "View Logs",
|
"actionViewLogs": "View Logs",
|
||||||
|
"actionCreateSiteProvisioningKey": "Create Site Provisioning Key",
|
||||||
|
"actionListSiteProvisioningKeys": "List Site Provisioning Keys",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Update Site Provisioning Key",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Delete Site Provisioning Key",
|
||||||
"noneSelected": "None selected",
|
"noneSelected": "None selected",
|
||||||
"orgNotFound2": "No organizations found.",
|
"orgNotFound2": "No organizations found.",
|
||||||
"search": "Search…",
|
"search": "Search…",
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Listar invitaciones",
|
"actionListInvitations": "Listar invitaciones",
|
||||||
"actionExportLogs": "Exportar registros",
|
"actionExportLogs": "Exportar registros",
|
||||||
"actionViewLogs": "Ver registros",
|
"actionViewLogs": "Ver registros",
|
||||||
|
"actionCreateSiteProvisioningKey": "Crear clave de aprovisionamiento del sitio",
|
||||||
|
"actionListSiteProvisioningKeys": "Listado de claves de aprovisionamiento del sitio",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Actualizar clave de aprovisionamiento del sitio",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Eliminar clave de aprovisionamiento del sitio",
|
||||||
"noneSelected": "Ninguno seleccionado",
|
"noneSelected": "Ninguno seleccionado",
|
||||||
"orgNotFound2": "No se encontraron organizaciones.",
|
"orgNotFound2": "No se encontraron organizaciones.",
|
||||||
"search": "Buscar…",
|
"search": "Buscar…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Error de subida",
|
"rdpUploadFailed": "Error de subida",
|
||||||
"rdpUnicodeKeyboardMode": "Modo teclado Unicode",
|
"rdpUnicodeKeyboardMode": "Modo teclado Unicode",
|
||||||
"sessionToolbarShow": "Mostrar barra de herramientas",
|
"sessionToolbarShow": "Mostrar barra de herramientas",
|
||||||
"sessionToolbarHide": "Ocultar barra de herramientas"
|
"sessionToolbarHide": "Ocultar barra de herramientas",
|
||||||
|
"actionUpdateSiteApprovals": "Actualizar aprobaciones del sitio"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Lister les invitations",
|
"actionListInvitations": "Lister les invitations",
|
||||||
"actionExportLogs": "Exporter les journaux",
|
"actionExportLogs": "Exporter les journaux",
|
||||||
"actionViewLogs": "Voir les logs",
|
"actionViewLogs": "Voir les logs",
|
||||||
|
"actionCreateSiteProvisioningKey": "Créer une clé de provisionnement de site",
|
||||||
|
"actionListSiteProvisioningKeys": "Lister les clés de provisionnement de site",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Mettre à jour la clé de provisionnement de site",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Supprimer la clé de provisionnement de site",
|
||||||
"noneSelected": "Aucune sélection",
|
"noneSelected": "Aucune sélection",
|
||||||
"orgNotFound2": "Aucune organisation trouvée.",
|
"orgNotFound2": "Aucune organisation trouvée.",
|
||||||
"search": "Rechercher…",
|
"search": "Rechercher…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Échec du téléchargement",
|
"rdpUploadFailed": "Échec du téléchargement",
|
||||||
"rdpUnicodeKeyboardMode": "Mode clavier Unicode",
|
"rdpUnicodeKeyboardMode": "Mode clavier Unicode",
|
||||||
"sessionToolbarShow": "Afficher la barre d'outils",
|
"sessionToolbarShow": "Afficher la barre d'outils",
|
||||||
"sessionToolbarHide": "Masquer la barre d'outils"
|
"sessionToolbarHide": "Masquer la barre d'outils",
|
||||||
|
"actionUpdateSiteApprovals": "Mettre à jour les approbations de site"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Elenco Inviti",
|
"actionListInvitations": "Elenco Inviti",
|
||||||
"actionExportLogs": "Esporta Log",
|
"actionExportLogs": "Esporta Log",
|
||||||
"actionViewLogs": "Visualizza Log",
|
"actionViewLogs": "Visualizza Log",
|
||||||
|
"actionCreateSiteProvisioningKey": "Crea Chiave di Provisioning del Sito",
|
||||||
|
"actionListSiteProvisioningKeys": "Elenca Chiavi di Provisioning del Sito",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Aggiorna Chiave di Provisioning del Sito",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Elimina Chiave di Provisioning del Sito",
|
||||||
"noneSelected": "Nessuna selezione",
|
"noneSelected": "Nessuna selezione",
|
||||||
"orgNotFound2": "Nessuna organizzazione trovata.",
|
"orgNotFound2": "Nessuna organizzazione trovata.",
|
||||||
"search": "Cerca…",
|
"search": "Cerca…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Caricamento fallito",
|
"rdpUploadFailed": "Caricamento fallito",
|
||||||
"rdpUnicodeKeyboardMode": "Modalità tastiera Unicode",
|
"rdpUnicodeKeyboardMode": "Modalità tastiera Unicode",
|
||||||
"sessionToolbarShow": "Mostra barra degli strumenti",
|
"sessionToolbarShow": "Mostra barra degli strumenti",
|
||||||
"sessionToolbarHide": "Nascondi barra degli strumenti"
|
"sessionToolbarHide": "Nascondi barra degli strumenti",
|
||||||
|
"actionUpdateSiteApprovals": "Aggiorna Approvazioni del Sito"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "초대 목록",
|
"actionListInvitations": "초대 목록",
|
||||||
"actionExportLogs": "로그 내보내기",
|
"actionExportLogs": "로그 내보내기",
|
||||||
"actionViewLogs": "로그 보기",
|
"actionViewLogs": "로그 보기",
|
||||||
|
"actionCreateSiteProvisioningKey": "사이트 프로비저닝 키 생성",
|
||||||
|
"actionListSiteProvisioningKeys": "사이트 프로비저닝 키 목록",
|
||||||
|
"actionUpdateSiteProvisioningKey": "사이트 프로비저닝 키 업데이트",
|
||||||
|
"actionDeleteSiteProvisioningKey": "사이트 프로비저닝 키 삭제",
|
||||||
"noneSelected": "선택된 항목 없음",
|
"noneSelected": "선택된 항목 없음",
|
||||||
"orgNotFound2": "조직이 없습니다.",
|
"orgNotFound2": "조직이 없습니다.",
|
||||||
"search": "검색…",
|
"search": "검색…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "업로드 실패",
|
"rdpUploadFailed": "업로드 실패",
|
||||||
"rdpUnicodeKeyboardMode": "유니코드 키보드 모드",
|
"rdpUnicodeKeyboardMode": "유니코드 키보드 모드",
|
||||||
"sessionToolbarShow": "툴바 보기",
|
"sessionToolbarShow": "툴바 보기",
|
||||||
"sessionToolbarHide": "툴바 숨기기"
|
"sessionToolbarHide": "툴바 숨기기",
|
||||||
|
"actionUpdateSiteApprovals": "사이트 승인 업데이트"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Liste invitasjoner",
|
"actionListInvitations": "Liste invitasjoner",
|
||||||
"actionExportLogs": "Eksportlogger",
|
"actionExportLogs": "Eksportlogger",
|
||||||
"actionViewLogs": "Vis logger",
|
"actionViewLogs": "Vis logger",
|
||||||
|
"actionCreateSiteProvisioningKey": "Opprett Klargjøringsnøkkel for Sted",
|
||||||
|
"actionListSiteProvisioningKeys": "List Klargjøringsnøkler for Sted",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Oppdater Klargjøringsnøkkel for Sted",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Slett Klargjøringsnøkkel for Sted",
|
||||||
"noneSelected": "Ingen valgt",
|
"noneSelected": "Ingen valgt",
|
||||||
"orgNotFound2": "Ingen organisasjoner funnet.",
|
"orgNotFound2": "Ingen organisasjoner funnet.",
|
||||||
"search": "Søk…",
|
"search": "Søk…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Opplastningen mislyktes",
|
"rdpUploadFailed": "Opplastningen mislyktes",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode tastaturmodus",
|
"rdpUnicodeKeyboardMode": "Unicode tastaturmodus",
|
||||||
"sessionToolbarShow": "Vis verktøylinje",
|
"sessionToolbarShow": "Vis verktøylinje",
|
||||||
"sessionToolbarHide": "Skjul verktøylinje"
|
"sessionToolbarHide": "Skjul verktøylinje",
|
||||||
|
"actionUpdateSiteApprovals": "Oppdater Stedsgodkjenninger"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Toon uitnodigingen",
|
"actionListInvitations": "Toon uitnodigingen",
|
||||||
"actionExportLogs": "Logboeken exporteren",
|
"actionExportLogs": "Logboeken exporteren",
|
||||||
"actionViewLogs": "Logboeken bekijken",
|
"actionViewLogs": "Logboeken bekijken",
|
||||||
|
"actionCreateSiteProvisioningKey": "Een sitevoorzie-ningssleutel aanmaken",
|
||||||
|
"actionListSiteProvisioningKeys": "Sitevoorzie-ningssleutels weergeven",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Sitevoorzie-ningssleutel bijwerken",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Sitevoorzie-ningssleutel verwijderen",
|
||||||
"noneSelected": "Niet geselecteerd",
|
"noneSelected": "Niet geselecteerd",
|
||||||
"orgNotFound2": "Geen organisaties gevonden.",
|
"orgNotFound2": "Geen organisaties gevonden.",
|
||||||
"search": "Zoeken…",
|
"search": "Zoeken…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Upload mislukt",
|
"rdpUploadFailed": "Upload mislukt",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode toetsenbordmodus",
|
"rdpUnicodeKeyboardMode": "Unicode toetsenbordmodus",
|
||||||
"sessionToolbarShow": "Toon werkbalk",
|
"sessionToolbarShow": "Toon werkbalk",
|
||||||
"sessionToolbarHide": "Verberg werkbalk"
|
"sessionToolbarHide": "Verberg werkbalk",
|
||||||
|
"actionUpdateSiteApprovals": "Sitegoedkeuringen bijwerken"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Lista zaproszeń",
|
"actionListInvitations": "Lista zaproszeń",
|
||||||
"actionExportLogs": "Eksportuj dzienniki",
|
"actionExportLogs": "Eksportuj dzienniki",
|
||||||
"actionViewLogs": "Zobacz dzienniki",
|
"actionViewLogs": "Zobacz dzienniki",
|
||||||
|
"actionCreateSiteProvisioningKey": "Utwórz klucz konfiguracji strony",
|
||||||
|
"actionListSiteProvisioningKeys": "Lista kluczy konfiguracji strony",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Zaktualizuj klucz konfiguracji strony",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Usuń klucz konfiguracji strony",
|
||||||
"noneSelected": "Nie wybrano",
|
"noneSelected": "Nie wybrano",
|
||||||
"orgNotFound2": "Nie znaleziono organizacji.",
|
"orgNotFound2": "Nie znaleziono organizacji.",
|
||||||
"search": "Szukaj…",
|
"search": "Szukaj…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Niepowodzenie przesyłania",
|
"rdpUploadFailed": "Niepowodzenie przesyłania",
|
||||||
"rdpUnicodeKeyboardMode": "Tryb klawiatury Unicode",
|
"rdpUnicodeKeyboardMode": "Tryb klawiatury Unicode",
|
||||||
"sessionToolbarShow": "Pokaż pasek narzędzi",
|
"sessionToolbarShow": "Pokaż pasek narzędzi",
|
||||||
"sessionToolbarHide": "Ukryj pasek narzędzi"
|
"sessionToolbarHide": "Ukryj pasek narzędzi",
|
||||||
|
"actionUpdateSiteApprovals": "Zaktualizuj zgody na stronę"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Listar Convites",
|
"actionListInvitations": "Listar Convites",
|
||||||
"actionExportLogs": "Exportar logs",
|
"actionExportLogs": "Exportar logs",
|
||||||
"actionViewLogs": "Visualizar registros",
|
"actionViewLogs": "Visualizar registros",
|
||||||
|
"actionCreateSiteProvisioningKey": "Criar Chave de Provisionamento do Site",
|
||||||
|
"actionListSiteProvisioningKeys": "Listar Chaves de Provisionamento do Site",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Atualizar Chave de Provisionamento do Site",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Excluir Chave de Provisionamento do Site",
|
||||||
"noneSelected": "Nenhum selecionado",
|
"noneSelected": "Nenhum selecionado",
|
||||||
"orgNotFound2": "Nenhuma organização encontrada.",
|
"orgNotFound2": "Nenhuma organização encontrada.",
|
||||||
"search": "Pesquisar…",
|
"search": "Pesquisar…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Falha no upload",
|
"rdpUploadFailed": "Falha no upload",
|
||||||
"rdpUnicodeKeyboardMode": "Modo de teclado Unicode",
|
"rdpUnicodeKeyboardMode": "Modo de teclado Unicode",
|
||||||
"sessionToolbarShow": "Mostrar barra de ferramentas",
|
"sessionToolbarShow": "Mostrar barra de ferramentas",
|
||||||
"sessionToolbarHide": "Ocultar barra de ferramentas"
|
"sessionToolbarHide": "Ocultar barra de ferramentas",
|
||||||
|
"actionUpdateSiteApprovals": "Atualizar Aprovações do Site"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Список приглашений",
|
"actionListInvitations": "Список приглашений",
|
||||||
"actionExportLogs": "Экспорт журналов",
|
"actionExportLogs": "Экспорт журналов",
|
||||||
"actionViewLogs": "Просмотр журналов",
|
"actionViewLogs": "Просмотр журналов",
|
||||||
|
"actionCreateSiteProvisioningKey": "Создать ключ конфигурации сайта",
|
||||||
|
"actionListSiteProvisioningKeys": "Список ключей конфигурации сайтов",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Обновить ключ конфигурации сайта",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Удалить ключ конфигурации сайта",
|
||||||
"noneSelected": "Ничего не выбрано",
|
"noneSelected": "Ничего не выбрано",
|
||||||
"orgNotFound2": "Организации не найдены.",
|
"orgNotFound2": "Организации не найдены.",
|
||||||
"search": "Поиск…",
|
"search": "Поиск…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Ошибка загрузки",
|
"rdpUploadFailed": "Ошибка загрузки",
|
||||||
"rdpUnicodeKeyboardMode": "Режим клавиатуры Unicode",
|
"rdpUnicodeKeyboardMode": "Режим клавиатуры Unicode",
|
||||||
"sessionToolbarShow": "Показать панель инструментов",
|
"sessionToolbarShow": "Показать панель инструментов",
|
||||||
"sessionToolbarHide": "Скрыть панель инструментов"
|
"sessionToolbarHide": "Скрыть панель инструментов",
|
||||||
|
"actionUpdateSiteApprovals": "Обновить утверждения сайта"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "Davetiyeleri Listele",
|
"actionListInvitations": "Davetiyeleri Listele",
|
||||||
"actionExportLogs": "Kayıtları Dışa Aktar",
|
"actionExportLogs": "Kayıtları Dışa Aktar",
|
||||||
"actionViewLogs": "Kayıtları Görüntüle",
|
"actionViewLogs": "Kayıtları Görüntüle",
|
||||||
|
"actionCreateSiteProvisioningKey": "Site Sağlama Anahtarı Oluştur",
|
||||||
|
"actionListSiteProvisioningKeys": "Site Sağlama Anahtarlarını Listele",
|
||||||
|
"actionUpdateSiteProvisioningKey": "Site Sağlama Anahtarını Güncelle",
|
||||||
|
"actionDeleteSiteProvisioningKey": "Site Sağlama Anahtarını Sil",
|
||||||
"noneSelected": "Hiçbiri seçili değil",
|
"noneSelected": "Hiçbiri seçili değil",
|
||||||
"orgNotFound2": "Hiçbir organizasyon bulunamadı.",
|
"orgNotFound2": "Hiçbir organizasyon bulunamadı.",
|
||||||
"search": "Ara…",
|
"search": "Ara…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "Yükleme başarısız",
|
"rdpUploadFailed": "Yükleme başarısız",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode klavye modu",
|
"rdpUnicodeKeyboardMode": "Unicode klavye modu",
|
||||||
"sessionToolbarShow": "Araç çubuğunu göster",
|
"sessionToolbarShow": "Araç çubuğunu göster",
|
||||||
"sessionToolbarHide": "Araç çubuğunu gizle"
|
"sessionToolbarHide": "Araç çubuğunu gizle",
|
||||||
|
"actionUpdateSiteApprovals": "Site Onaylarını Güncelle"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1511,6 +1511,10 @@
|
|||||||
"actionListInvitations": "邀请列表",
|
"actionListInvitations": "邀请列表",
|
||||||
"actionExportLogs": "导出日志",
|
"actionExportLogs": "导出日志",
|
||||||
"actionViewLogs": "查看日志",
|
"actionViewLogs": "查看日志",
|
||||||
|
"actionCreateSiteProvisioningKey": "创建站点预配密钥",
|
||||||
|
"actionListSiteProvisioningKeys": "列出站点预配密钥",
|
||||||
|
"actionUpdateSiteProvisioningKey": "更新站点预配密钥",
|
||||||
|
"actionDeleteSiteProvisioningKey": "删除站点预配密钥",
|
||||||
"noneSelected": "未选择",
|
"noneSelected": "未选择",
|
||||||
"orgNotFound2": "未找到组织。",
|
"orgNotFound2": "未找到组织。",
|
||||||
"search": "搜索…",
|
"search": "搜索…",
|
||||||
@@ -3811,5 +3815,6 @@
|
|||||||
"rdpUploadFailed": "上传失败",
|
"rdpUploadFailed": "上传失败",
|
||||||
"rdpUnicodeKeyboardMode": "Unicode 键盘模式",
|
"rdpUnicodeKeyboardMode": "Unicode 键盘模式",
|
||||||
"sessionToolbarShow": "显示工具栏",
|
"sessionToolbarShow": "显示工具栏",
|
||||||
"sessionToolbarHide": "隐藏工具栏"
|
"sessionToolbarHide": "隐藏工具栏",
|
||||||
|
"actionUpdateSiteApprovals": "更新站点审批"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ export * from "./verifyApiKeySiteResourceAccess";
|
|||||||
export * from "./verifyApiKeyIdpAccess";
|
export * from "./verifyApiKeyIdpAccess";
|
||||||
export * from "./verifyApiKeyDomainAccess";
|
export * from "./verifyApiKeyDomainAccess";
|
||||||
export * from "./verifyApiKeyResourcePolicyAccess";
|
export * from "./verifyApiKeyResourcePolicyAccess";
|
||||||
|
export * from "./verifyApiKeySiteProvisioningKeyAccess";
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
import { Request, Response, NextFunction } from "express";
|
||||||
|
import {
|
||||||
|
db,
|
||||||
|
siteProvisioningKeys,
|
||||||
|
siteProvisioningKeyOrg,
|
||||||
|
apiKeyOrg
|
||||||
|
} from "@server/db";
|
||||||
|
import { and, eq } from "drizzle-orm";
|
||||||
|
import createHttpError from "http-errors";
|
||||||
|
import HttpCode from "@server/types/HttpCode";
|
||||||
|
import { getFirstString } from "@server/lib/requestParams";
|
||||||
|
|
||||||
|
export async function verifyApiKeySiteProvisioningKeyAccess(
|
||||||
|
req: Request,
|
||||||
|
res: Response,
|
||||||
|
next: NextFunction
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
const apiKey = req.apiKey;
|
||||||
|
const siteProvisioningKeyId =
|
||||||
|
getFirstString(req.params.siteProvisioningKeyId) ||
|
||||||
|
getFirstString(req.body.siteProvisioningKeyId) ||
|
||||||
|
getFirstString(req.query.siteProvisioningKeyId);
|
||||||
|
const orgId = getFirstString(req.params.orgId);
|
||||||
|
|
||||||
|
if (!apiKey) {
|
||||||
|
return next(
|
||||||
|
createHttpError(HttpCode.UNAUTHORIZED, "Key not authenticated")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!orgId) {
|
||||||
|
return next(
|
||||||
|
createHttpError(HttpCode.BAD_REQUEST, "Invalid organization ID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!siteProvisioningKeyId) {
|
||||||
|
return next(
|
||||||
|
createHttpError(HttpCode.BAD_REQUEST, "Invalid key ID")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (apiKey.isRoot) {
|
||||||
|
// Root keys can access any site provisioning key in any org
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
const [row] = await db
|
||||||
|
.select()
|
||||||
|
.from(siteProvisioningKeys)
|
||||||
|
.innerJoin(
|
||||||
|
siteProvisioningKeyOrg,
|
||||||
|
and(
|
||||||
|
eq(
|
||||||
|
siteProvisioningKeys.siteProvisioningKeyId,
|
||||||
|
siteProvisioningKeyOrg.siteProvisioningKeyId
|
||||||
|
),
|
||||||
|
eq(siteProvisioningKeyOrg.orgId, orgId)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.where(
|
||||||
|
eq(
|
||||||
|
siteProvisioningKeys.siteProvisioningKeyId,
|
||||||
|
siteProvisioningKeyId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.limit(1);
|
||||||
|
|
||||||
|
if (!row?.siteProvisioningKeys || !row.siteProvisioningKeyOrg) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.NOT_FOUND,
|
||||||
|
`Site provisioning key with ID ${siteProvisioningKeyId} not found for organization ${orgId}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!req.apiKeyOrg) {
|
||||||
|
const apiKeyOrgRes = await db
|
||||||
|
.select()
|
||||||
|
.from(apiKeyOrg)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(apiKeyOrg.apiKeyId, apiKey.apiKeyId),
|
||||||
|
eq(apiKeyOrg.orgId, row.siteProvisioningKeyOrg.orgId)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.limit(1);
|
||||||
|
req.apiKeyOrg = apiKeyOrgRes[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!req.apiKeyOrg) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.FORBIDDEN,
|
||||||
|
"Key does not have access to this organization"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return next();
|
||||||
|
} catch (error) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.INTERNAL_SERVER_ERROR,
|
||||||
|
"Error verifying site provisioning key access"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ export enum OpenAPITags {
|
|||||||
OrgIdp = "Identity Provider (Organization Only)",
|
OrgIdp = "Identity Provider (Organization Only)",
|
||||||
Client = "Client",
|
Client = "Client",
|
||||||
ApiKey = "API Key",
|
ApiKey = "API Key",
|
||||||
|
SiteProvisioningKey = "Site Provisioning Key",
|
||||||
Domain = "Domain",
|
Domain = "Domain",
|
||||||
Blueprint = "Blueprint",
|
Blueprint = "Blueprint",
|
||||||
Ssh = "SSH",
|
Ssh = "SSH",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import * as org from "#private/routers/org";
|
|||||||
import * as logs from "#private/routers/auditLogs";
|
import * as logs from "#private/routers/auditLogs";
|
||||||
import * as alertEvents from "#private/routers/alertEvents";
|
import * as alertEvents from "#private/routers/alertEvents";
|
||||||
import * as certificates from "#private/routers/certificates";
|
import * as certificates from "#private/routers/certificates";
|
||||||
|
import * as siteProvisioning from "#private/routers/siteProvisioning";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
verifyApiKeyHasAction,
|
verifyApiKeyHasAction,
|
||||||
@@ -24,6 +25,7 @@ import {
|
|||||||
verifyApiKeyIdpAccess,
|
verifyApiKeyIdpAccess,
|
||||||
verifyApiKeyRoleAccess,
|
verifyApiKeyRoleAccess,
|
||||||
verifyApiKeyUserAccess,
|
verifyApiKeyUserAccess,
|
||||||
|
verifyApiKeySiteProvisioningKeyAccess,
|
||||||
verifyLimits
|
verifyLimits
|
||||||
} from "@server/middlewares";
|
} from "@server/middlewares";
|
||||||
import * as user from "#private/routers/user";
|
import * as user from "#private/routers/user";
|
||||||
@@ -215,3 +217,45 @@ authenticated.delete(
|
|||||||
logActionAudit(ActionsEnum.removeUserRole),
|
logActionAudit(ActionsEnum.removeUserRole),
|
||||||
user.removeUserRole
|
user.removeUserRole
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.put(
|
||||||
|
"/org/:orgId/site-provisioning-key",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription(tierMatrix.siteProvisioningKeys),
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyLimits,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.createSiteProvisioningKey),
|
||||||
|
logActionAudit(ActionsEnum.createSiteProvisioningKey),
|
||||||
|
siteProvisioning.createSiteProvisioningKey
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/org/:orgId/site-provisioning-keys",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription(tierMatrix.siteProvisioningKeys),
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.listSiteProvisioningKeys),
|
||||||
|
siteProvisioning.listSiteProvisioningKeys
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.delete(
|
||||||
|
"/org/:orgId/site-provisioning-key/:siteProvisioningKeyId",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription(tierMatrix.siteProvisioningKeys),
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeySiteProvisioningKeyAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.deleteSiteProvisioningKey),
|
||||||
|
logActionAudit(ActionsEnum.deleteSiteProvisioningKey),
|
||||||
|
siteProvisioning.deleteSiteProvisioningKey
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.patch(
|
||||||
|
"/org/:orgId/site-provisioning-key/:siteProvisioningKeyId",
|
||||||
|
verifyValidLicense,
|
||||||
|
verifyValidSubscription(tierMatrix.siteProvisioningKeys),
|
||||||
|
verifyApiKeyOrgAccess,
|
||||||
|
verifyApiKeySiteProvisioningKeyAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.updateSiteProvisioningKey),
|
||||||
|
logActionAudit(ActionsEnum.updateSiteProvisioningKey),
|
||||||
|
siteProvisioning.updateSiteProvisioningKey
|
||||||
|
);
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import {
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { hashPassword } from "@server/auth/password";
|
import { hashPassword } from "@server/auth/password";
|
||||||
import type { CreateSiteProvisioningKeyResponse } from "@server/routers/siteProvisioning/types";
|
import type { CreateSiteProvisioningKeyResponse } from "@server/routers/siteProvisioning/types";
|
||||||
|
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const paramsSchema = z.object({
|
const paramsSchema = z.object({
|
||||||
orgId: z.string().nonempty()
|
orgId: z.string().nonempty()
|
||||||
@@ -34,10 +36,17 @@ const paramsSchema = z.object({
|
|||||||
const bodySchema = z
|
const bodySchema = z
|
||||||
.strictObject({
|
.strictObject({
|
||||||
name: z.string().min(1).max(255),
|
name: z.string().min(1).max(255),
|
||||||
maxBatchSize: z.union([
|
maxBatchSize: z
|
||||||
z.null(),
|
.union([
|
||||||
z.coerce.number().int().positive().max(1_000_000)
|
z.null(),
|
||||||
]),
|
z.coerce.number().int().positive().max(1_000_000)
|
||||||
|
])
|
||||||
|
.openapi({
|
||||||
|
type: "number",
|
||||||
|
default: null,
|
||||||
|
description:
|
||||||
|
"Maximum number of sites that can be provisioned in a single batch. If null, there is no limit."
|
||||||
|
}),
|
||||||
validUntil: z.string().max(255).optional(),
|
validUntil: z.string().max(255).optional(),
|
||||||
approveNewSites: z.boolean().optional().default(true)
|
approveNewSites: z.boolean().optional().default(true)
|
||||||
})
|
})
|
||||||
@@ -57,6 +66,49 @@ const bodySchema = z
|
|||||||
|
|
||||||
export type CreateSiteProvisioningKeyBody = z.infer<typeof bodySchema>;
|
export type CreateSiteProvisioningKeyBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
|
const CreateSiteProvisioningKeyResponseDataSchema = z.object({
|
||||||
|
siteProvisioningKeyId: z.string(),
|
||||||
|
orgId: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
siteProvisioningKey: z.string(),
|
||||||
|
lastChars: z.string(),
|
||||||
|
createdAt: z.string(),
|
||||||
|
lastUsed: z.string().nullable(),
|
||||||
|
maxBatchSize: z.number().nullable(),
|
||||||
|
numUsed: z.number(),
|
||||||
|
validUntil: z.string().nullable(),
|
||||||
|
approveNewSites: z.boolean()
|
||||||
|
});
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "put",
|
||||||
|
path: "/org/{orgId}/site-provisioning-key",
|
||||||
|
description: "Create a new site provisioning key for the organization.",
|
||||||
|
tags: [OpenAPITags.SiteProvisioningKey],
|
||||||
|
request: {
|
||||||
|
params: paramsSchema,
|
||||||
|
body: {
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: bodySchema
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
responses: {
|
||||||
|
201: {
|
||||||
|
description: "Successful response",
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: createApiResponseSchema(
|
||||||
|
CreateSiteProvisioningKeyResponseDataSchema
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export async function createSiteProvisioningKey(
|
export async function createSiteProvisioningKey(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -13,23 +13,46 @@
|
|||||||
|
|
||||||
import { Request, Response, NextFunction } from "express";
|
import { Request, Response, NextFunction } from "express";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import {
|
import { db, siteProvisioningKeyOrg, siteProvisioningKeys } from "@server/db";
|
||||||
db,
|
|
||||||
siteProvisioningKeyOrg,
|
|
||||||
siteProvisioningKeys
|
|
||||||
} from "@server/db";
|
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import response from "@server/lib/response";
|
import response from "@server/lib/response";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const paramsSchema = z.object({
|
const paramsSchema = z.object({
|
||||||
siteProvisioningKeyId: z.string().nonempty(),
|
siteProvisioningKeyId: z.string().nonempty(),
|
||||||
orgId: z.string().nonempty()
|
orgId: z.string().nonempty()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "delete",
|
||||||
|
path: "/org/{orgId}/site-provisioning-key/{siteProvisioningKeyId}",
|
||||||
|
description: "Delete a site provisioning key.",
|
||||||
|
tags: [OpenAPITags.SiteProvisioningKey],
|
||||||
|
request: {
|
||||||
|
params: paramsSchema
|
||||||
|
},
|
||||||
|
responses: {
|
||||||
|
200: {
|
||||||
|
description: "Successful response",
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: z.object({
|
||||||
|
data: z.record(z.string(), z.any()).nullable(),
|
||||||
|
success: z.boolean(),
|
||||||
|
error: z.boolean(),
|
||||||
|
message: z.string(),
|
||||||
|
status: z.number()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export async function deleteSiteProvisioningKey(
|
export async function deleteSiteProvisioningKey(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -11,11 +11,7 @@
|
|||||||
* This file is not licensed under the AGPLv3.
|
* This file is not licensed under the AGPLv3.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { db, siteProvisioningKeyOrg, siteProvisioningKeys } from "@server/db";
|
||||||
db,
|
|
||||||
siteProvisioningKeyOrg,
|
|
||||||
siteProvisioningKeys
|
|
||||||
} from "@server/db";
|
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
import response from "@server/lib/response";
|
import response from "@server/lib/response";
|
||||||
@@ -25,6 +21,8 @@ import { z } from "zod";
|
|||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import type { ListSiteProvisioningKeysResponse } from "@server/routers/siteProvisioning/types";
|
import type { ListSiteProvisioningKeysResponse } from "@server/routers/siteProvisioning/types";
|
||||||
|
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const paramsSchema = z.object({
|
const paramsSchema = z.object({
|
||||||
orgId: z.string().nonempty()
|
orgId: z.string().nonempty()
|
||||||
@@ -45,11 +43,55 @@ const querySchema = z.object({
|
|||||||
.pipe(z.int().nonnegative())
|
.pipe(z.int().nonnegative())
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ListSiteProvisioningKeysResponseDataSchema = z.object({
|
||||||
|
siteProvisioningKeys: z.array(
|
||||||
|
z.object({
|
||||||
|
siteProvisioningKeyId: z.string(),
|
||||||
|
orgId: z.string(),
|
||||||
|
lastChars: z.string(),
|
||||||
|
createdAt: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
lastUsed: z.string().nullable(),
|
||||||
|
maxBatchSize: z.number().nullable(),
|
||||||
|
numUsed: z.number(),
|
||||||
|
validUntil: z.string().nullable(),
|
||||||
|
approveNewSites: z.boolean()
|
||||||
|
})
|
||||||
|
),
|
||||||
|
pagination: z.object({
|
||||||
|
total: z.number(),
|
||||||
|
limit: z.number(),
|
||||||
|
offset: z.number()
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "get",
|
||||||
|
path: "/org/{orgId}/site-provisioning-keys",
|
||||||
|
description: "List all site provisioning keys for an organization.",
|
||||||
|
tags: [OpenAPITags.SiteProvisioningKey],
|
||||||
|
request: {
|
||||||
|
params: paramsSchema,
|
||||||
|
query: querySchema
|
||||||
|
},
|
||||||
|
responses: {
|
||||||
|
200: {
|
||||||
|
description: "Successful response",
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: createApiResponseSchema(
|
||||||
|
ListSiteProvisioningKeysResponseDataSchema
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function querySiteProvisioningKeys(orgId: string) {
|
function querySiteProvisioningKeys(orgId: string) {
|
||||||
return db
|
return db
|
||||||
.select({
|
.select({
|
||||||
siteProvisioningKeyId:
|
siteProvisioningKeyId: siteProvisioningKeys.siteProvisioningKeyId,
|
||||||
siteProvisioningKeys.siteProvisioningKeyId,
|
|
||||||
orgId: siteProvisioningKeyOrg.orgId,
|
orgId: siteProvisioningKeyOrg.orgId,
|
||||||
lastChars: siteProvisioningKeys.lastChars,
|
lastChars: siteProvisioningKeys.lastChars,
|
||||||
createdAt: siteProvisioningKeys.createdAt,
|
createdAt: siteProvisioningKeys.createdAt,
|
||||||
|
|||||||
@@ -13,11 +13,7 @@
|
|||||||
|
|
||||||
import { Request, Response, NextFunction } from "express";
|
import { Request, Response, NextFunction } from "express";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import {
|
import { db, siteProvisioningKeyOrg, siteProvisioningKeys } from "@server/db";
|
||||||
db,
|
|
||||||
siteProvisioningKeyOrg,
|
|
||||||
siteProvisioningKeys
|
|
||||||
} from "@server/db";
|
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import response from "@server/lib/response";
|
import response from "@server/lib/response";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
@@ -25,6 +21,8 @@ import createHttpError from "http-errors";
|
|||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import type { UpdateSiteProvisioningKeyResponse } from "@server/routers/siteProvisioning/types";
|
import type { UpdateSiteProvisioningKeyResponse } from "@server/routers/siteProvisioning/types";
|
||||||
|
import { createApiResponseSchema } from "@server/lib/openapi/createApiResponseSchema";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const paramsSchema = z.object({
|
const paramsSchema = z.object({
|
||||||
siteProvisioningKeyId: z.string().nonempty(),
|
siteProvisioningKeyId: z.string().nonempty(),
|
||||||
@@ -38,7 +36,13 @@ const bodySchema = z
|
|||||||
z.null(),
|
z.null(),
|
||||||
z.coerce.number().int().positive().max(1_000_000)
|
z.coerce.number().int().positive().max(1_000_000)
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional()
|
||||||
|
.openapi({
|
||||||
|
type: "number",
|
||||||
|
default: null,
|
||||||
|
description:
|
||||||
|
"Maximum number of sites that can be provisioned in a single batch. If null, there is no limit."
|
||||||
|
}),
|
||||||
validUntil: z.string().max(255).optional(),
|
validUntil: z.string().max(255).optional(),
|
||||||
approveNewSites: z.boolean().optional()
|
approveNewSites: z.boolean().optional()
|
||||||
})
|
})
|
||||||
@@ -50,7 +54,8 @@ const bodySchema = z
|
|||||||
) {
|
) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: "custom",
|
code: "custom",
|
||||||
message: "Provide maxBatchSize and/or validUntil and/or approveNewSites",
|
message:
|
||||||
|
"Provide maxBatchSize and/or validUntil and/or approveNewSites",
|
||||||
path: ["maxBatchSize"]
|
path: ["maxBatchSize"]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -69,6 +74,48 @@ const bodySchema = z
|
|||||||
|
|
||||||
export type UpdateSiteProvisioningKeyBody = z.infer<typeof bodySchema>;
|
export type UpdateSiteProvisioningKeyBody = z.infer<typeof bodySchema>;
|
||||||
|
|
||||||
|
const UpdateSiteProvisioningKeyResponseDataSchema = z.object({
|
||||||
|
siteProvisioningKeyId: z.string(),
|
||||||
|
orgId: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
lastChars: z.string(),
|
||||||
|
createdAt: z.string(),
|
||||||
|
lastUsed: z.string().nullable(),
|
||||||
|
maxBatchSize: z.number().nullable(),
|
||||||
|
numUsed: z.number(),
|
||||||
|
validUntil: z.string().nullable(),
|
||||||
|
approveNewSites: z.boolean()
|
||||||
|
});
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "patch",
|
||||||
|
path: "/org/{orgId}/site-provisioning-key/{siteProvisioningKeyId}",
|
||||||
|
description: "Update a site provisioning key.",
|
||||||
|
tags: [OpenAPITags.SiteProvisioningKey],
|
||||||
|
request: {
|
||||||
|
params: paramsSchema,
|
||||||
|
body: {
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: bodySchema
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
responses: {
|
||||||
|
200: {
|
||||||
|
description: "Successful response",
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: createApiResponseSchema(
|
||||||
|
UpdateSiteProvisioningKeyResponseDataSchema
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export async function updateSiteProvisioningKey(
|
export async function updateSiteProvisioningKey(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|||||||
@@ -16,18 +16,26 @@ export async function logout(
|
|||||||
next: NextFunction
|
next: NextFunction
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const { user, session } = await verifySession(req);
|
const { user, session } = await verifySession(req);
|
||||||
|
const isSecure = req.protocol === "https";
|
||||||
|
|
||||||
|
// Always clear the session cookie so logout is idempotent, even when
|
||||||
|
// the session is already missing or invalid
|
||||||
|
res.setHeader("Set-Cookie", createBlankSessionTokenCookie(isSecure));
|
||||||
|
|
||||||
if (!user || !session) {
|
if (!user || !session) {
|
||||||
if (config.getRawConfig().app.log_failed_attempts) {
|
if (config.getRawConfig().app.log_failed_attempts) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Log out failed because missing or invalid session. IP: ${req.ip}.`
|
`Log out with missing or invalid session. IP: ${req.ip}.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return next(
|
|
||||||
createHttpError(
|
return response<null>(res, {
|
||||||
HttpCode.BAD_REQUEST,
|
data: null,
|
||||||
"You must be logged in to sign out"
|
success: true,
|
||||||
)
|
error: false,
|
||||||
);
|
message: "Logged out successfully",
|
||||||
|
status: HttpCode.OK
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -37,9 +45,6 @@ export async function logout(
|
|||||||
logger.error("Failed to invalidate session", error);
|
logger.error("Failed to invalidate session", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSecure = req.protocol === "https";
|
|
||||||
res.setHeader("Set-Cookie", createBlankSessionTokenCookie(isSecure));
|
|
||||||
|
|
||||||
return response<null>(res, {
|
return response<null>(res, {
|
||||||
data: null,
|
data: null,
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export async function requestPasswordReset(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${config.getRawConfig().app.dashboard_url}/auth/reset-password?email=${email}&token=${token}`;
|
const url = `${config.getRawConfig().app.dashboard_url}/auth/reset-password?email=${encodeURIComponent(email)}&token=${token}`;
|
||||||
|
|
||||||
if (!config.getRawConfig().email) {
|
if (!config.getRawConfig().email) {
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export async function adminGeneratePasswordResetCode(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${config.getRawConfig().app.dashboard_url}/auth/reset-password?email=${existingUser[0].email}&token=${token}`;
|
const url = `${config.getRawConfig().app.dashboard_url}/auth/reset-password?email=${encodeURIComponent(existingUser[0].email!)}&token=${token}`;
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`Admin generated password reset code for user ${existingUser[0].email} (${userId})`
|
`Admin generated password reset code for user ${existingUser[0].email} (${userId})`
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ export async function inviteUser(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const inviteLink = `${config.getRawConfig().app.dashboard_url}/invite?token=${inviteId}-${token}&email=${email}`;
|
const inviteLink = `${config.getRawConfig().app.dashboard_url}/invite?token=${inviteId}-${token}&email=${encodeURIComponent(email)}`;
|
||||||
|
|
||||||
if (doEmail) {
|
if (doEmail) {
|
||||||
await sendEmail(
|
await sendEmail(
|
||||||
@@ -341,7 +341,7 @@ export async function inviteUser(
|
|||||||
.values(uniqueRoleIds.map((roleId) => ({ inviteId, roleId })));
|
.values(uniqueRoleIds.map((roleId) => ({ inviteId, roleId })));
|
||||||
});
|
});
|
||||||
|
|
||||||
const inviteLink = `${config.getRawConfig().app.dashboard_url}/invite?token=${inviteId}-${token}&email=${email}`;
|
const inviteLink = `${config.getRawConfig().app.dashboard_url}/invite?token=${inviteId}-${token}&email=${encodeURIComponent(email)}`;
|
||||||
|
|
||||||
if (doEmail) {
|
if (doEmail) {
|
||||||
await sendEmail(
|
await sendEmail(
|
||||||
|
|||||||
@@ -248,6 +248,39 @@ export async function loginProxy(
|
|||||||
return await makeApiRequest<LoginResponse>(url, "POST", request);
|
return await makeApiRequest<LoginResponse>(url, "POST", request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function logoutProxy(): Promise<ResponseT<null>> {
|
||||||
|
const env = pullEnv();
|
||||||
|
const serverPort = process.env.SERVER_EXTERNAL_PORT;
|
||||||
|
const url = `http://localhost:${serverPort}/api/v1/auth/logout`;
|
||||||
|
|
||||||
|
const result = await makeApiRequest<null>(url, "POST");
|
||||||
|
|
||||||
|
try {
|
||||||
|
const headersList = await reqHeaders();
|
||||||
|
const host = headersList.get("host")?.split(":")[0];
|
||||||
|
const allCookies = await cookies();
|
||||||
|
const clearOptions = {
|
||||||
|
httpOnly: true,
|
||||||
|
secure: true,
|
||||||
|
sameSite: "lax" as const,
|
||||||
|
path: "/",
|
||||||
|
maxAge: 0
|
||||||
|
};
|
||||||
|
// Clear both host-only and domain-scoped variants.
|
||||||
|
allCookies.set(env.server.sessionCookieName, "", clearOptions);
|
||||||
|
if (host) {
|
||||||
|
allCookies.set(env.server.sessionCookieName, "", {
|
||||||
|
...clearOptions,
|
||||||
|
domain: host
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (cookieError) {
|
||||||
|
console.error("Failed to clear session cookie:", cookieError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
export async function securityKeyStartProxy(
|
export async function securityKeyStartProxy(
|
||||||
request: SecurityKeyStartRequest,
|
request: SecurityKeyStartRequest,
|
||||||
forceLogin?: boolean
|
forceLogin?: boolean
|
||||||
|
|||||||
@@ -93,14 +93,20 @@ export default function InviteStatusCard({
|
|||||||
setType(type);
|
setType(type);
|
||||||
|
|
||||||
if (!user && type === "user_does_not_exist") {
|
if (!user && type === "user_does_not_exist") {
|
||||||
|
const inviteRedirect = encodeURIComponent(
|
||||||
|
`/invite?token=${tokenParam}`
|
||||||
|
);
|
||||||
const redirectUrl = email
|
const redirectUrl = email
|
||||||
? `/auth/signup?redirect=/invite?token=${tokenParam}&email=${email}`
|
? `/auth/signup?redirect=${inviteRedirect}&email=${encodeURIComponent(email)}`
|
||||||
: `/auth/signup?redirect=/invite?token=${tokenParam}`;
|
: `/auth/signup?redirect=${inviteRedirect}`;
|
||||||
router.push(redirectUrl);
|
router.push(redirectUrl);
|
||||||
} else if (!user && type === "not_logged_in") {
|
} else if (!user && type === "not_logged_in") {
|
||||||
|
const inviteRedirect = encodeURIComponent(
|
||||||
|
`/invite?token=${tokenParam}`
|
||||||
|
);
|
||||||
const redirectUrl = email
|
const redirectUrl = email
|
||||||
? `/auth/login?redirect=/invite?token=${tokenParam}&user=${email}`
|
? `/auth/login?redirect=${inviteRedirect}&user=${encodeURIComponent(email)}`
|
||||||
: `/auth/login?redirect=/invite?token=${tokenParam}`;
|
: `/auth/login?redirect=${inviteRedirect}`;
|
||||||
router.push(redirectUrl);
|
router.push(redirectUrl);
|
||||||
} else {
|
} else {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -112,17 +118,23 @@ export default function InviteStatusCard({
|
|||||||
|
|
||||||
async function goToLogin() {
|
async function goToLogin() {
|
||||||
await api.post("/auth/logout", {});
|
await api.post("/auth/logout", {});
|
||||||
|
const inviteRedirect = encodeURIComponent(
|
||||||
|
`/invite?token=${tokenParam}`
|
||||||
|
);
|
||||||
const redirectUrl = email
|
const redirectUrl = email
|
||||||
? `/auth/login?redirect=/invite?token=${tokenParam}&user=${email}`
|
? `/auth/login?redirect=${inviteRedirect}&user=${encodeURIComponent(email)}`
|
||||||
: `/auth/login?redirect=/invite?token=${tokenParam}`;
|
: `/auth/login?redirect=${inviteRedirect}`;
|
||||||
router.push(redirectUrl);
|
router.push(redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function goToSignup() {
|
async function goToSignup() {
|
||||||
await api.post("/auth/logout", {});
|
await api.post("/auth/logout", {});
|
||||||
|
const inviteRedirect = encodeURIComponent(
|
||||||
|
`/invite?token=${tokenParam}`
|
||||||
|
);
|
||||||
const redirectUrl = email
|
const redirectUrl = email
|
||||||
? `/auth/signup?redirect=/invite?token=${tokenParam}&email=${email}`
|
? `/auth/signup?redirect=${inviteRedirect}&email=${encodeURIComponent(email)}`
|
||||||
: `/auth/signup?redirect=/invite?token=${tokenParam}`;
|
: `/auth/signup?redirect=${inviteRedirect}`;
|
||||||
router.push(redirectUrl);
|
router.push(redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import { Shield, ArrowRight } from "lucide-react";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { createApiClient } from "@app/lib/api";
|
import { useState } from "react";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { logoutProxy } from "@app/actions/server";
|
||||||
|
|
||||||
type OrgPolicyRequiredProps = {
|
type OrgPolicyRequiredProps = {
|
||||||
orgId: string;
|
orgId: string;
|
||||||
@@ -40,21 +40,23 @@ export default function OrgPolicyRequired({
|
|||||||
}: OrgPolicyRequiredProps) {
|
}: OrgPolicyRequiredProps) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
const api = createApiClient(useEnvContext());
|
|
||||||
|
|
||||||
const sessionExpired =
|
const sessionExpired =
|
||||||
policies?.maxSessionLength &&
|
policies?.maxSessionLength &&
|
||||||
policies.maxSessionLength.compliant === false;
|
policies.maxSessionLength.compliant === false;
|
||||||
|
|
||||||
function reauthenticate() {
|
async function reauthenticate() {
|
||||||
api.post("/auth/logout")
|
setLoading(true);
|
||||||
.catch(() => {})
|
try {
|
||||||
.then(() => {
|
await logoutProxy();
|
||||||
const destination = redirectAfterAuth ?? `/${orgId}`;
|
} catch (error) {
|
||||||
router.push(destination);
|
console.error("Error during logout:", error);
|
||||||
router.refresh();
|
} finally {
|
||||||
});
|
const destination = redirectAfterAuth ?? `/${orgId}`;
|
||||||
|
router.push(destination);
|
||||||
|
router.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sessionExpired) {
|
if (sessionExpired) {
|
||||||
@@ -76,6 +78,7 @@ export default function OrgPolicyRequired({
|
|||||||
<Button
|
<Button
|
||||||
className="w-full"
|
className="w-full"
|
||||||
onClick={reauthenticate}
|
onClick={reauthenticate}
|
||||||
|
loading={loading}
|
||||||
>
|
>
|
||||||
{t("reauthenticate")}
|
{t("reauthenticate")}
|
||||||
<ArrowRight className="ml-2 h-4 w-4" />
|
<ArrowRight className="ml-2 h-4 w-4" />
|
||||||
|
|||||||
@@ -143,6 +143,13 @@ function getActionsCategories(root: boolean) {
|
|||||||
Logs: {
|
Logs: {
|
||||||
[t("actionExportLogs")]: "exportLogs",
|
[t("actionExportLogs")]: "exportLogs",
|
||||||
[t("actionViewLogs")]: "viewLogs"
|
[t("actionViewLogs")]: "viewLogs"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Site Provisioning Key": {
|
||||||
|
[t("actionCreateSiteProvisioningKey")]: "createSiteProvisioningKey",
|
||||||
|
[t("actionListSiteProvisioningKeys")]: "listSiteProvisioningKeys",
|
||||||
|
[t("actionUpdateSiteProvisioningKey")]: "updateSiteProvisioningKey",
|
||||||
|
[t("actionDeleteSiteProvisioningKey")]: "deleteSiteProvisioningKey"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user