Advanced Codeblocks Multi Remote

Learn about the special features of the Advanced Codeblocks Multi Remote and get inspiration from specific examples.

The Advanced Codeblocks Multi Remote is used for inserting the config-block directly in Confluence but the template from any source.

Parameters

Title

Define the title of your codebox.

Config

Paste the config-block for your remote-file here.

Expand first codeblock

Select the first codeblock of your codebox expanded.

URL to remote file

Enter the URL of your template.

HTTP username

This is optional. If you use Basic-Auth for your remote file enter your username.

HTTP password

This is optional. If you use Basic-Auth for your remote file enter your password.

Theme

Select your theme from 4 themes.

Programming language

Select your language from over 150 programming languages or let your language detect automatically.

Please note: For the URL you enter we will perform DNS resolving to prevent SSRF (Server Side Request Forgery). URLs that point to 127.0.01 and other blocklisted IP adresses of internal Atlassian infrastructrue are not allowed.

User Interface

The user interface on your Confluence page will look like the example below. You can collapse and expand the codeblocks at any time to save space or to show the code when you need it.

Download Feature

The Download Feature provides you different options to directly download your configuration in the setting you need. You only have to click the respective Button. Don't forget to enable Show download links in your parameters to use this function.

  • Download codeblock: download the code of your template with replaced variables of the specific codeblock. The link is located on the right side of the header of each codeblock.

  • Download raw: download the raw code of your template with your defined variables accordingly without replacements. The link is located in the menu in the upper right corner of the outer box.

Note for using the Download Feature

The Download link only works in the browser (javascript). You can not copy a download link to be used by an external tool.

Examples

Example 1: Simple substitution

Title

MyTestFile

Config

[foobar]
moo=wuff

Template URL

https://codeclou.io/test-advanced-codeblock-macro/v2.3/public/testfile.foo

HTTP username

-

HTTP password

-

programming language

-

theme

-

Example 2: Python

Title

MyPythonExample

Config

[server1]
backup.from.dir = /var/lib
backup.to.dir = /media/usb1

[server2]
backup.from.dir = /opt
backup.to.dir = /media/usb2

Template URL

https://codeclou.io/test-advanced-codeblock-macro/v2.3/public/backup.py

HTTP username

-

HTTP password

-

programming language

python

theme

-

Example 3: RAW File from Bitbucket Data Center

Title

Bitbucket

Config

[server1]
backup.from.dir = /var/lib
backup.to.dir = /media/usb1

[server2]
backup.from.dir = /opt
backup.to.dir = /media/usb2

Template URL

https://localhost:7990/projects/TEST/repos/test/raw/test.txt

HTTP username

your Bitbucket username

HTTP password

personal access token or password

Troubleshooting

Use the Bitbucket RAW Url which returns a correct Content-Length header: /projects/{project}/repos/{repo}/raw/{filename}

If you enter a wrong password, the HTML login page will be displayed with HTTP 200 instead. The App then displays a a Content-Length header error - this is due to the behaviour of Bitbucket not the App itself.

If you are seeing Content-Length header errors then:

  1. Check if your Bitbucket account was locked and needs to solve a captcha.

  2. Check if your username and password is correct.

  3. Check if the RAW url is correct and the file exists.

Due to a Bug Bitbucket RAW URLs are only supported with App version 3.6.0+ with a with disabling the HTTP HEAD filesize check under global app settings.

Example 4: RAW File from GitHub

Title

Bash GitHub Example

Config

[demo]

Template URL

https://raw.githubusercontent.com/clouless/test2/main/foo.sh

HTTP username

-

HTTP password

-

programming language

bash

theme

-