This code is not written with security in mind, do NOT run it on a repository that can contain mailicious page titles.
- Install requirements:
pip3 install -r requirements.txt
- Update cookies.json
- Run the script:
python3.9 confluence-markdown-export.py gitlab_wikis_path url space_key out_dir
providing URL e.g. https://YOUR_PROJECT.atlassian.net, path to gitlab wikis, space to import, and output directory, e.g. ./output_dir
The secret token can be generated under Profile -> Security -> Manage API Tokens
Due to using LDAP auth in confluence server it was decided to use cookies as authentication method for interacting with Confluence REST API
For getting JSESSIONID
value:
- Authorize in Confluence server via LDAP
- Make GET request https://YOUR_PROJECT.atlassian.net/wiki/rest/api/space and check Cookies