From e2748fc46cbbae0ee7caf84d92b4a84a23f5783f Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 26 Mar 2019 17:12:51 +0000 Subject: [docutmentation] Add german language support (wip) --- documentation/.vuepress/config.js | 83 ++++++++++++++++----- .../.vuepress/public/img/de/bss_screenshot.PNG | Bin 0 -> 85869 bytes documentation/README.md | 10 +-- documentation/api/README.md | 4 +- documentation/api/collections.md | 4 +- documentation/de/README.md | 22 ++++++ documentation/de/api/README.md | 57 ++++++++++++++ documentation/de/api/collections.md | 2 + documentation/de/installation/README.md | 50 +++++++++++++ documentation/de/webapp/README.md | 3 + documentation/de/webapp/modules.md | 9 +++ 11 files changed, 215 insertions(+), 29 deletions(-) create mode 100644 documentation/.vuepress/public/img/de/bss_screenshot.PNG create mode 100644 documentation/de/README.md create mode 100644 documentation/de/api/README.md create mode 100644 documentation/de/api/collections.md create mode 100644 documentation/de/installation/README.md create mode 100644 documentation/de/webapp/README.md create mode 100644 documentation/de/webapp/modules.md (limited to 'documentation') diff --git a/documentation/.vuepress/config.js b/documentation/.vuepress/config.js index 0a8f1b3..5a76b61 100644 --- a/documentation/.vuepress/config.js +++ b/documentation/.vuepress/config.js @@ -3,25 +3,68 @@ module.exports = { description: 'Boot Auswahl Server', themeConfig: { logo: '/img/logo-light.svg', - nav: [ - { text: 'Home', link: '/' }, - { text: 'Installation', link: '/installation/' }, - { text: 'API', link: '/api/' }, - { text: 'Webapp', link: '/webapp/' } - ], - sidebar: { - '/installation/': [ - '' - ], - '/api/': [ - '', - 'collections' - ], - '/webapp/': [ - '', - 'modules' - ] - }, - sidebarDepth: 1 + sidebarDepth: 1, + locales: { + '/': { + selectText: 'Languages', + label: 'English', + nav: [ + { text: 'Home', link: '/' }, + { text: 'Webapp', link: '/webapp/' }, + { text: 'API', link: '/api/' }, + { text: 'Installation', link: '/installation/' } + ], + sidebar: { + '/webapp/': [ + '', + 'modules' + ], + '/api/': [ + '', + 'collections' + ], + '/installation/': [ + '' + ] + }, + }, + '/de/': { + selectText: 'Sprachen', + label: 'Deutsch', + nav: [ + { text: 'Startseite', link: '/de/' }, + { text: 'Webapp', link: '/de/webapp/' }, + { text: 'API', link: '/de/api/' }, + { text: 'Installation', link: '/de/installation/' } + ], + sidebar: { + '/de/webapp/': [ + '', + 'modules' + ], + '/de/api/': [ + '', + 'collections' + ], + '/de/installation/': [ + '' + ] + }, + } + } }, + locales: { + // The key is the path for the locale to be nested under. + // As a special case, the default locale can use '/' as its path. + '/': { + lang: 'en-US', // this will be set as the lang attribute on + title: 'BAS Documentation', + description: 'Boot Auswahl Server' + }, + '/de/': { + lang: 'de-DE', + title: 'BAS Dokumentation', + description: 'Boot Auswahl Server ' + } + } } \ No newline at end of file diff --git a/documentation/.vuepress/public/img/de/bss_screenshot.PNG b/documentation/.vuepress/public/img/de/bss_screenshot.PNG new file mode 100644 index 0000000..2fb8504 Binary files /dev/null and b/documentation/.vuepress/public/img/de/bss_screenshot.PNG differ diff --git a/documentation/README.md b/documentation/README.md index 71fd20a..3283f78 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -2,21 +2,21 @@ home: true heroImage: /img/logo-light.svg actionText: Get Started → -actionLink: /api/ +actionLink: /webapp/ footer: Albert-Ludwigs-Universität Freiburg | Copyright © 2019 ---
-

Installation

-

A guide on how to install and run the BAS.

+

Webapp

+

Picture guided instructions on how the webapp works.

API

Documentation of the API and instructions on how to use it.

-

Webapp

-

Picture guided instructions on how the webapp works.

+

Installation

+

A guide on how to install and run the BAS.

\ No newline at end of file diff --git a/documentation/api/README.md b/documentation/api/README.md index f84cdf5..7f6dc66 100644 --- a/documentation/api/README.md +++ b/documentation/api/README.md @@ -38,7 +38,7 @@ If a request is not successfull it will set a html status code and return a json } ``` * [400 - Bad Request](https://httpstatuses.com/400)\ -The request sent to the server was incorrect. (Parameter missing, ...) +The request sent to the server was invalid. (Parameter missing, ...) * [401 - Unauthorized](https://httpstatuses.com/401)\ The client which sent the request to the server wasn't authorized enough. (Invalid token, token missing, ...) * [403 - Forbidden](https://httpstatuses.com/403)\ @@ -50,7 +50,7 @@ Server side error. (Hash errors, ...) * [501 - Not Implemented](https://httpstatuses.com/501)\ The resource doesn't have the requested methods. (Backend doesn't have the method implemented) -If an authenticated request doesn't pass the middleware one of the following error can occur +If a request that requires authentication isn't properly authenticated one of the following erros can occur * **401 - Unauthorized** * TOKEN\_INVALID - The provided token is invalid. * TOKEN\_INVALID - The token is from an invalid userid. diff --git a/documentation/api/collections.md b/documentation/api/collections.md index b1e85b8..ebfed8c 100644 --- a/documentation/api/collections.md +++ b/documentation/api/collections.md @@ -1,7 +1,7 @@ # Collections -Collections can be called with the api url append with the resource name. +Collections can be called with the api url appended with the collection and resource name. ``` -https:///api// +https:///api// ``` ``` https:///api//:id/ diff --git a/documentation/de/README.md b/documentation/de/README.md new file mode 100644 index 0000000..fa47aad --- /dev/null +++ b/documentation/de/README.md @@ -0,0 +1,22 @@ +--- +home: true +heroImage: /img/logo-light.svg +actionText: Los geht's → +actionLink: /de/webapp/ +footer: Albert-Ludwigs-Universität Freiburg | Copyright © 2019 +--- + +
+
+

Webapp

+

Bildgeführte Anleitungen zur Funktionsweise der Webapp.

+
+
+

API

+

Dokumentation der API und Anleitung zur Verwendung.

+
+
+

Installation

+

Eine Anleitung zum Installieren und Ausführen des BAS.

+
+
\ No newline at end of file diff --git a/documentation/de/api/README.md b/documentation/de/api/README.md new file mode 100644 index 0000000..cda83b4 --- /dev/null +++ b/documentation/de/api/README.md @@ -0,0 +1,57 @@ +# Erste Schritte +Die API kann unter folgender Adresse aufgerufen werden: +``` +https:///api/ +``` +Die Sammlungen und Ressourcen werden im Abschnitt [Sammlungen](/de/api/collections.md) beschrieben. + +## Autorisierung +Einige Sammlungen benötigen eine Authentifizierung, während andere ohne aufgerufen werden können. +Um eine Anfrage zu authentifizieren, müssen Sie den Json-Web-Token an das Backend senden. +Es gibt zwei Möglichkeiten, dies zu tun +* **Authorization Header**\ +Durch setzen des *Bearer* token im *Authorization* header. +``` +Authorization: Bearer +``` + +> **\** - Vollständiger json web token in der Form: header.payload.signature. + +* **Cookies**\ +Um zu verhindern, dass der Javascript-Code der Website Zugriff auf den vollständige Jwt hat, wird der Token in zwei separate Cookies aufgeteilt + * jwt\_hp - Normaler Cookie mit dem Header und Payload des Jwt als Wert. + * jwt\_s - HTTP-only Cookie mit der Signature als Wert. + +Um den Token zu erhalten, verwenden Sie die Anmeldemethode aus der [API/Authentifizierung](/de/api/collections.html#authentication). + +## Rückgabewerte +Die API gibt Daten immer im JSON-Format zurück. +Wenn die Anforderung erfolgreich war, wird der Statuscode 200 und die angeforderten Daten zurückgegeben. +* [200 - OK](https://httpstatuses.com/200)\ +Die Anfrage war erfolgreich. Optional enthält die Antwort ein Json-Objekt mit den enthaltenen Daten. + +Wenn eine Anforderung nicht erfolgreich ist, setzt sie einen HTML-Statuscode und gibt ein Json-Objekt mit einem Status und einer Fehlernachricht zurück. +```json +{ + "error": "", + "message": "" +} +``` +* [400 - Bad Request](https://httpstatuses.com/400)\ +Die an den Server gesendete Anfrage war ungültig. (Parameter fehlt, ...) +* [401 - Unauthorized](https://httpstatuses.com/401)\ +Der Client, der die Anfrage an den Server gesendet hat, war nicht ausreichend autorisiert. (Ungültiger Token, Token fehlt, ...) +* [403 - Forbidden](https://httpstatuses.com/403)\ +Der autorisierte Client verfügt nicht über ausreichende Berechtigungen. +* [404 - Not Found](https://httpstatuses.com/404)\ +Die angeforderte Ressource wurde nicht gefunden. (Benutzer wurde nicht gefunden, ...) +* [500 - Internal Server Error](https://httpstatuses.com/500)\ +Serverseitiger Fehler. (Hash-Fehler, ...) +* [501 - Not Implemented](https://httpstatuses.com/501)\ +Die Ressource verfügt nicht über die angeforderten Methoden. (Das Backend hat die Methode nicht implementiert) + +Wenn eine Anfrage, die eine Authentifizierung benötigt, nicht hinreichend Authentifiziert ist, können folgende Fehler auftreten +* **401 - Unauthorized** + * TOKEN\_INVALID - Der angegebene Token ist ungültig. + * TOKEN\_INVALID - Der Token stammt von einer ungültigen Benutzer-ID. + * TOKEN\_MISSING - Dieser Dienst erfordert einen Token. diff --git a/documentation/de/api/collections.md b/documentation/de/api/collections.md new file mode 100644 index 0000000..3fb32cb --- /dev/null +++ b/documentation/de/api/collections.md @@ -0,0 +1,2 @@ +# Sammlungen +Todo \ No newline at end of file diff --git a/documentation/de/installation/README.md b/documentation/de/installation/README.md new file mode 100644 index 0000000..a796ed8 --- /dev/null +++ b/documentation/de/installation/README.md @@ -0,0 +1,50 @@ +# Installation + + + + +## Installation der benötigten Packete +```bash +sudo apt-get install git +sudo apt-get install curl software-properties-common +curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - +sudo apt-get install nodejs +``` + +## Installation des node.js Servers +```bash +git clone http://git.ks.uni-freiburg.de/lsfks/projekte/bas.git +cd bas/server +npm install +``` + +## Kopiere Zertifikate +```bash +scp privkey.pem user@host:path/privkey.pem +scp fullchain.pem user@host:path/fullchain.pem +``` + +## Einrichten der Konfigurationsdateien +```bash +cd bas/server/config +cp authentication.template.json authentication.json +cp database.template.json database.json +cp config.template.json config.json +``` + +## Installation der webapp +```bash +cd bas/webapp +npm install +npm run build +``` + +## Ausführen des node.js Server +```bash +cd bas/server +npm start +``` + +## Standart Ports +* Server: 3000 +* tftp: Serverport + 1 (3001) diff --git a/documentation/de/webapp/README.md b/documentation/de/webapp/README.md new file mode 100644 index 0000000..66eeb4e --- /dev/null +++ b/documentation/de/webapp/README.md @@ -0,0 +1,3 @@ +# Webapplikation + +![BSS Screenshot](/img/de/bss_screenshot.PNG) diff --git a/documentation/de/webapp/modules.md b/documentation/de/webapp/modules.md new file mode 100644 index 0000000..fa01182 --- /dev/null +++ b/documentation/de/webapp/modules.md @@ -0,0 +1,9 @@ +# Module + +## Gruppen / Clients +## iPXE Konfigurator +## Client Registrierung +## Externe Backends +## Rechtemanager +## iPXE Builder +## Nutzermanagement \ No newline at end of file -- cgit v1.2.3-55-g7522