From 3f5ac9336bdc19e17f9511626ce1e3bc83edbc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=8BAndrzej=20Ressel?= Date: Tue, 17 May 2022 02:58:27 +0200 Subject: [PATCH] Finish README --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6a7de1..7c016b7 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,34 @@ ## Quick start ```yaml +# docker-compose.yml version: "3.9" services: onedrive_exporter: - image: "onedrive-exporter" + image: ghcr.io/andrzejressel/onedrive-exporter:VERSION environment: - ONEDRIVE_CLIENT_ID=CLIENT_ID - ONEDRIVE_REDIRECT=http://localhost:8080/ - ONEDRIVE_CLIENT_SECRET=CLIENT_SECRET + volumes: + - onedrivedata:/data ports: - "8080:8080" ``` +```yaml +# prometheus.yaml +- job_name: 'onedrive' + scheme: https + metrics_path: /q + static_configs: + - targets: ['http://localhost:8080/'] +``` + ### Getting your own Client ID and Secret 1. Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click `New registration`. -2. Enter a name for your app, choose account type `Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)`, select `Web` in `Redirect URI`, then type (be careful when copying and pasting) `http://localhost:8080/` (or your custom url where collector will be available) and click Register. Copy and keep the `Application (client) ID` - this is your `CLIENT_ID`. +2. Enter a name for your app, choose account type `Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)`, select `Web` in `Redirect URI`, then type (be careful when copying and pasting) `http://localhost:8080/onedrive` (or your custom url where collector will be available + `/onedrive` suffix) and click Register. Copy and keep the `Application (client) ID` - this is your `CLIENT_ID`. 3. Under `manage` select `Certificates & secrets`, click `New client secret`. Enter a description (can be anything) and set `Expires` to 24 months. Copy and keep that secret _Value_ - this is your `CLIENT_SECRET`. 4. Under `manage` select `API permissions`, click `Add a permission` and select `Microsoft Graph` then select `delegated permissions`. 5. Search and select the following permissions: `Files.Read`, `offline_access` and `User.Read`. Once selected click `Add permissions` at the bottom.