Show an ADO repository in the wiki for the first time
This walkthrough takes one repository from Azure DevOps from nothing to a visible file on a wiki page. Seven sections follow the order in which you work; the last one is optional.
The values in the examples come from this installation. Replace them with your own.
| What | Value in this example |
|---|---|
| key of the DWDO project | dwplugins |
| namespace of the project | en:projects:dwplugins |
| key of the connection | wvds |
| base address of the ADO server | https://devops.wvds.it/Me |
| project in Azure DevOps | DokuWiki-Plugins |
| repository | wkdoadogit |
| namespace of the mount | code:dokuwiki-plugins:wkdoadogit |
Prerequisites
- For the connection you need the
managerole in the DWDO project. A reader may see the list of connections but cannot create one. - For the mount you need administrator rights, because a mount writes site-wide permissions.
wkcore,wkdocore,wkdostorage,wkdoadoandwkdoadogitmust be installed and enabled. Withoutwksourceviewfiles do not open in the drawer.- The DWDO project must exist twice: as a namespace below the project root (here
{lang}:projects:) and as a record in DWDO storage. Without the record the connection cannot be saved. - In the settings of
wkdoadothe name of the ADO server must appear inado_host_allow. An empty list refuses every call. - The secret (PAT) must live outside the database, as a
vault:,file:,env:orenc:reference. - The PHP extension
curlmust be available on the server. Without it the browser does not load and the git proxy fails.
conf/acl.auth.php before your first mount: a mount writes into it. This wiki allows * @ALL 1 site-wide, so a mount is protected only once its tier has written the rules — private sets @ALL 0.
Connecting to Azure DevOps
The connection describes the ADO server and belongs to exactly one DWDO project. It is not set up in the admin area but on a project page.
- Open any page of the project and append the action
do=wkdoado, for example/doku.php?id=en:projects:dwplugins:start&do=wkdoado. The command palette opens the same screen through the entry Manage ADO connections. - If the connection is already in the list, note its key and move on to the next section.
- Fill in the form for a new connection: Key (
wvds; permitted characters[A-Za-z0-9_-], at most 64), Title, Deployment (servicesfor thedev.azure.comservice orserverfor an installation of your own), Base URL, if needed Organization (services) and Collection (server), and API version (default7.0). - Choose Add.
- In the connection's row choose the secret mode (
vault:,file:,env:orenc:), enter the value and save. Invault:mode the value is the id of an entry inwkvault, on this installationadogit-service-pat. - Choose Test and wait for the outcome. The test distinguishes four causes: a forbidden server, an unreachable target, a certificate failure and an authentication failure.
Continue only once the test succeeds.
server deployment the collection is already part of the base address (https://devops.wvds.it/Me). If you also fill in the Collection (server) field, the collection is appended a second time and every REST call ends in HTTP 404. Name the collection in one place only.
Mounting the repository
The mount binds the repository to a wiki namespace and writes the permissions for it.
- Open Admin > ADO-Git Repo Mounts, directly
/doku.php?do=admin&page=wkdoadogit_mounts. - Expand Register a mount.
- On the 1. Connection screen choose the connection. The list shows it as
project / key, for exampledwplugins / wvds. Choose Next. - On the 2. ADO project screen choose the project, for example
DokuWiki-Plugins. The connection supplies the list; when the server does not answer, the screen says so and offers a free-text field. - On the 3. Repositories screen tick one or more repositories, for example
wkdoadogit. Adjust the Namespace template field if needed, choose the visibility tier, then choose Preview. - Read the 4. Preview screen. It shows what the tier grants, which namespace will be created, and every permission line that will be written. It also warns when the namespace already holds wiki pages.
- Choose Register.
The mount is written first, the permissions second. If writing the permissions fails, the screen tells you; there is no silent intermediate state.
The namespace template defaults to code:{project}:{repo}. The placeholders {project} and {repo} are replaced with the names from Azure DevOps; any {lang} stays put and expands per language only when the permissions are written.
Visibility tier
The tier is the only place where visibility is governed. Permissions are read on every request, so a change takes effect immediately.
| Tier | Who gets how much | What that means |
|---|---|---|
private | @ALL 0, @wvdse 8 | visible to editors and administrators only |
readonly | @ALL 0, @user 2, @wvds 2, @wvdse 8 | signed-in users read and clone, anonymous visitors see nothing |
public | @ALL 2, @wvdse 8 | anyone reads and clones |
team | @ALL 0, project role groups (readers 1, contributors 2, maintainers 8), @wvdse 8 | visible to this project's team only |
What each number means in the wiki and in this plugin is explained in the technical reference.
public tier grants the @ALL group grade 2. DokuWiki reads the same number as the right to edit an existing page. On an empty namespace that is immaterial; on a namespace holding wiki pages it opens the editor to every visitor.
The permissions live in a managed block of conf/acl.auth.php, between the lines # BEGIN wkdoadogit-managed and # END wkdoadogit-managed. Do not edit that block by hand – set the tier of the mount instead.
The mount namespace
After registration the repository appears in the mount list with its namespace:
code:dokuwiki-plugins:wkdoadogit
The Rules column says whether the written permissions match the tier (written), are missing (NOT written) or diverge. At tier public four lines appear in conf/acl.auth.php:
# mount: code:dokuwiki-plugins:wkdoadogit (public) code:dokuwiki-plugins:wkdoadogit @ALL 2 code:dokuwiki-plugins:wkdoadogit:* @ALL 2 code:dokuwiki-plugins:wkdoadogit @wvdse 8 code:dokuwiki-plugins:wkdoadogit:* @wvdse 8
/doku.php?id=code:dokuwiki-plugins:wkdoadogit and you will see an empty page. That is not a fault – the repository is shown by the next section.
The page that shows the browser
A repository is drawn where an author places the markup. It works only on a page inside the DWDO project, because the browser looks up the connection through that page's project.
- Open the repos page of your project in the editor:
/doku.php?id=en:projects:dwplugins:repos&do=edit. - Insert the markup
{{wk:adogit>wvds:DokuWiki-Plugins:wkdoadogit}}. - Save the page.
The header with the repository name, the tier badge and the branch name now appears, along with the tree of the root folder.
The grammar of the markup is {{wk:adogit>connection:project:repo[:ref[:path]]}}:
| Field | Meaning | If you omit it |
|---|---|---|
connection | the key of the connection (wvds), not its number | mandatory |
project | the name of the project in Azure DevOps | mandatory |
repo | the name of the repository | mandatory |
ref | branch, tag or commit | the repository's default branch applies |
path | the folder the tree starts from | the root of the repository applies |
To place the browser in a side region of the shell, append region=toc: {{wk:adogit>wvds:DokuWiki-Plugins:wkdoadogit region=toc}}.
The Branches and Tags tabs in the header are visible but inactive. You choose the branch on display in the markup, not in the interface.
Opening a folder and a file
Open a folder in the tree by selecting it. Its content loads only when opened, and the permission is checked again at that moment, so the tree never comes from the shared page cache.
You can also set the folder in advance, through the fifth field of the markup:
{{wk:adogit>wvds:DokuWiki-Plugins:wkdoadogit:main:/Domain}}
Open a file by selecting it. The drawer of wksourceview appears and the file is drawn with syntax highlighting. Without that plugin there is no drawer; the tree remains.
Users with write permission also find a button beside every file and, in the header, the button New branch/tag. The procedure is described in editing a file and committing from the wiki.
Above the tree sits the collapsible panel Get this repository, carrying the address for clone, the ZIP download and a link to the personal tokens. It appears only for level 2 or more; see cloning a repository.
Embedding source code
This section is optional. You can also draw a single file directly on the page, without the browser:
{{source>ado:wvds:DokuWiki-Plugins:wkdoadogit:main:/Domain/MountAclGate.php#L141-L146}}
The difference between the two markups, the display options and the limits are described in showing source code on a wiki page.
Expected result
- The page
en:projects:dwplugins:reposshows the header of thewkdoadogitrepository with the tier badge and the branch name. - Folders open, and files appear in the source drawer.
- A reader without read permission on
code:dokuwiki-plugins:wkdoadogitsees neither the tree nor the repository name on that same page, only a state card. - Four lines for this mount stand inside the managed block of
conf/acl.auth.php.
When no personal token is needed
The personal token is a token for git clients, not for the wiki. Inside the wiki it is never needed.
| Act | Personal token | What applies instead |
|---|---|---|
| browsing the tree | no | read permission (level 1 or more) on the mount namespace |
opening a file and embedding with {{source>ado:…}} | no | the same read permission |
| editing and committing from the wiki | no | write permission (level 8) on the mount namespace |
| ZIP download | no | level 2 or more |
git clone or git pull outside the wiki | yes | level 2 or more and a valid token |
git push outside the wiki | yes | level 4 or more and a valid token |
The service account signs in to Azure DevOps in every case. The personal token only says who in the wiki is asking.
If something does not work
| What you see | Most likely cause |
|---|---|
| “This repository is not connected to this wiki.” | the markup names a wrong connection key, a wrong project or repository name — or the mount is not registered |
| “You have no read permission on this repository.” | the mount exists, the tier does not cover you |
| “The ADO source service is unavailable.” | the connection, the allowed-hosts list, the secret, or a missing curl |
| “The repository could not be loaded.” | the markup could not be parsed, or the branch named does not exist |
| the page shows the markup as plain text | the page lies outside the project root, or the plugin is not enabled |
The full diagnostics with procedures are in Diagnostics.
Next steps
- Show source code on a wiki page – show source code on a wiki page
- Edit a file and commit from the wiki – edit a file and commit from the wiki
- Concepts – visibility tier, permissions and limits