UNPKG

asciidoctor-external-callout

Version:

Asciidoctor extension that adds support for callouts added outside the listing block.

274 lines (273 loc) 10.2 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="Asciidoctor 2.0.17"> <title>Test with tabs</title> <style> @import url(asciidoctor.css); div.external-callout-block i.conum { margin-left: 10px; margin-right: 10px; } </style> </head> <body class="article"> <div id="header"> <h1>Test with tabs</h1> </div> <div id="content"> <div class="exampleblock"> <div class="content"> <div class="dlist"> <dl> <dt class="hdlist1">AWS / Azure</dt> <dd> <div class="openblock"> <div class="content"> <div class="paragraph"> <p>The fields are as follows:</p> </div> <div class="ulist"> <ul> <li> <p><strong>Staging Directory</strong>. A directory on the local file system that is large enough to accommodate approximately 10% of the data set that is to be backed up. A minimum of 50 GB is recommended. The pathname of the location must be accessible to all nodes in the cluster that are running the Backup Service, but the location itself must <em>not</em> be shared by NFS or any equivalent protocol. Instead, the location must be a non-shared directory on the local file system for the node.</p> </li> <li> <p><strong>Provider</strong>. To use either S3 or S3-compatible storage, select <strong>AWS</strong>.</p> </li> <li> <p><strong>Cloud Bucket</strong>. The bucket in the cloud to which data will be backed up.</p> </li> <li> <p><strong>Path Prefix</strong>. The path of the archive, within the cloud bucket. This should take the form <code>/path/inside/the/bucket</code>.</p> </li> <li> <p><strong>Cloud Auth Type</strong> The type of authentication to be used when communicating with the cloud provider. The options are <strong>ID and key</strong> (which means that an ID and key will indeed be required for communication to be successful) and <strong>Instance metadata service</strong> (which means that credentials will be sought from the metadata service running in the node&#8217;s virtual machine). Each option assumes that appropriate configuration procedures for the cloud environment have been followed.</p> </li> <li> <p><strong>Credential ID</strong>. The credential ID for the store. For AWS, this is the <em>access key id</em>. If <strong>Instance metadata service</strong> has been specified as the value for <strong>Cloud Auth Type</strong>, this field is inapplicable, and is no longer displayed.</p> </li> <li> <p><strong>Credential Key</strong>. The secret key for the store. For AWS, this is the <em>AWS secret access key</em>. If <strong>Instance metadata service</strong> has been specified as the value for <strong>Cloud Auth Type</strong>, this field is inapplicable, and is no longer displayed.</p> </li> <li> <p><strong>Region</strong>. The AWS Region for the repository. For example, <code>us-east-1</code>, <code>us-west-2</code>.</p> </li> </ul> </div> <div class="paragraph"> <p>Under <strong>Advanced cloud options</strong>, the <strong>Endpoint</strong> field accepts an optional endpoint, used to connect to AWS; and overriding the endpoint used by the cloud-provider.</p> </div> <div class="paragraph"> <p>If checked, the <strong>S3 Force path style</strong> checkbox ensures that the AWS path style used is the earlier (rather than the more recent, which is not supported by all S3 compatible object stores).</p> </div> </div> </div> </dd> <dt class="hdlist1">GCP</dt> <dd> <div class="openblock"> <div class="content"> <div class="paragraph"> <p>Before setting up the GCP cloud backup, you will first need to get an Oauth token and a <code>refresh</code> token associated with your GCP service. To do this, follow these steps.</p> </div> <div class="olist arabic"> <ol class="arabic"> <li> <p><strong id="retrieve-client-id-and-client-secret">Retrieve the client id and the client secret.</strong></p> <div class="olist upperroman"> <ol class="upperroman" type="I"> <li> <p>Access the console under your GCP account, select menu:API &amp; Services[Credentials]</p> </li> <li> <p>Create an`Oauth` token for use with the Couchbase backup service.</p> </li> <li> <p>Create a service account for use with the Couchbase backup service.</p> </li> <li> <p>Select the Oauth Client ID you wish to use and click the btn:[Download] link. From the resulting dialog, download the JSON file which contains the client ID and the client secret. The file contains the client information you will need for the next step:</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-json" data-lang="json">{ "installed": { "client_id": "<strong>&lt;client_id&gt;</strong>", "project_id": "&lt;project_id&gt;", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "<strong>&lt;client_secret&gt;</strong>", "redirect_uris": [ "http://localhost" ] } }</code></pre> </div> </div> </li> <li> <p>This is line @2</p> </li> <li> <p>This is line @3</p> </li> </ol> </div> </li> <li> <p><strong id="retrieve-oauth-credentials">Retrieve the <code>OAUTH</code> credentials.</strong></p> <div class="paragraph"> <p>Use the <code>client_id</code> and the <code>client_secret</code> obtained in the previous section as parameters in a shell command that will return the refresh token for the backup service. This involves interrogating the GCP service to extract a refresh token for your OAuth client ID.</p> </div> <div class="olist upperroman"> <ol class="upperroman" type="I"> <li> <p>Create a shell script containing the following commands:</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-shell" data-lang="shell">CLIENT_ID= "<strong>&lt;client_id&gt;</strong>" CLIENT_SECRET="<strong>&lt;client_secret&gt;</strong>" SCOPE="https://www.googleapis.com/auth/devstorage.read_write" ENDPOINT="https://accounts.google.com/o/oauth2/v2/auth" URL="$ENDPOINT?client_id=$CLIENT_ID&amp;response_type=code&amp;scope=$SCOPE&amp;access_type=offline&amp;redirect_uri=http://localhost:12345" open $URL</code></pre> </div> </div> </li> <li> <p>Save the script with a <code>.sh</code> extension (e.g., <code>oauth.sh</code>)</p> </li> <li> <p>Execute the <code>chmod</code> command to make the script executable.</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">chmod u+x ./oauth.sh</code></pre> </div> </div> </li> <li> <p>Now execute the script.</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">./oauth.sh</code></pre> </div> </div> <div class="paragraph"> <p>The script will open your default browser; you can copy the <code>oauth</code> credential from the string in the browser URL input field.</p> </div> <div class="admonitionblock tip"> <table> <tr> <td class="icon"> <div class="title">Tip</div> </td> <td class="content"> You may need to click through a few pages, until you see <code>https:localhost:12345</code> in the URL field. </td> </tr> </table> </div> <div class="paragraph"> <p>Copy the string denoted by the <code>code</code> field for use in the next section.</p> </div> </li> </ol> </div> </li> <li> <p><strong id="generate-refresh-token">Generate the Refresh Token</strong></p> </li> </ol> </div> <div class="paragraph"> <p>Now, you will create a short shell script, using te oauth credentials you retrieved in the previous section.</p> </div> <div class="olist upperroman"> <ol class="upperroman" type="I"> <li> <p>Create a new shell script for generating the refresh token.</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-shell" data-lang="shell">CLIENT_ID= "<strong>&lt;client_id&gt;</strong>" CLIENT_SECRET= "<strong>&lt;client_secret&gt;</strong>" AUTH_CODE= "<strong>&lt;oauth_code&gt;</strong>" curl -s -X POST https://www.googleapis.com/oauth2/v4/token --data-urlencode "client_id=$CLIENT_ID" --data-urlencode "client_secret=$CLIENT_SECRET" --data-urlencode "code=$AUTH_CODE" --data-urlencode "redirect_uri=http://localhost:12345" --data-urlencode "grant_type=authorization_code"</code></pre> </div> </div> <div class="paragraph"> <p>Fill in the <code>client_id</code> and the the <code>client_secret</code> you retrieved from this section, and the <code>oauth</code> token you generated here.</p> </div> </li> <li> <p>Save the script with an <code>.sh</code> extension (e.g., <code>refresh.sh</code>).</p> </li> <li> <p>Execute the <code>chmod</code> command to make the script executable.</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">chmod u+x ./refresh.sh</code></pre> </div> </div> </li> <li> <p>Execute the script.</p> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">./refresh.sh</code></pre> </div> </div> <div class="paragraph"> <p>You will receive a response written to the console that contains the refresh token. Make a note of the refresh token.</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-json" data-lang="json">{ "access_token": "ya29.a0AXooCgu19SsugltQz_x46dK347ZBCUMW4n4N9YKFbQVD5kNWWpSyOSCMWjW6KAksa6rwaM8Dra9wH_jvzYG9TeLn4RCfICXwRD5U3WNNCWqy0lRiXPgjEQnXO9S-PnxGBe7hSsriKBpeZzWRXKVlnK56vDrzFcdY0DwRaCgYKAQESARISFQHGX2Mi0WeT_pBPR_RVpwOqCQg4gw0171", "expires_in": 3599, "refresh_token": "1//03Dd3-R0ojbfWCgYIARAAGAMSNwF-L9Ir0ei97UZf5kLz4pWXxNRB3mljmS0Kfz1ykzJe7_UYKqVieI6dBb3o66CeNQGtq9HleFo", "scope": "https://www.googleapis.com/auth/devstorage.read_write", "token_type": "Bearer" }</code></pre> </div> </div> </li> </ol> </div> </div> </div> </dd> </dl> </div> </div> </div> </div> <div id="footer"> <div id="footer-text"> Last updated 2024-07-22 08:34:04 +0100 </div> </div> </body> </html>