Table of Contents | ||||
---|---|---|---|---|
|
...
Host HTML pages right on your server instance – supports Javascript, and serves unique pages on a repository basis.
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Excerpt |
---|
Pages for Bitbucket provides a simple way to publish web pages in Bitbucket Server. It allows repository administrators to enable serving of static web pages for any existing branch or tag. Once enabled, users will be able to view View HTML files of this branch or tag files directly in Bitbucket. It's also possible to Using relative links, you can also link to other HTML files or resources like CSS, JavaScript, or images by using relative links. Pages for Bitbucket allows you to host HTML pages right on your Bitbucket instance and supports Javascript and serves unique pages on a repository basis. Feature Highlights
|
How it works
Repository administrators You can enable the serving of static web pages for any existing branch or tag in the repository settings screen. Once enabled, the base URL for pages in this branch or tag is being displayed next to the branch or tag name.
Web pages are available under the following URL: /pages/<PROJECT>/<REPOSITORY>/<BRANCH-OR-TAG>
If there is no index.html
file available in the root level of a branch or tag, you need to link to the page directly by appending the file path to the URL. Example: /pages/<PROJECT>/<REPOSITORY>/<BRANCH-OR-TAG>/browse/<PATH>/<TO>/<FILE>.html
Once pages have been enabled for a branch or a tag, users will be able to you can view HTML files of this branch or tag directly in Bitbucket. When clicking on open Click Open in the file browser of this branch or tag , to render the page will be rendered full screen, without the Bitbucket layout. It's also possible to link to other HTML files or resources like CSS, JavaScript, or images by using relative links. You can even link to files stored in Git LFS.
Of course by hosting Hosting your web pages directly in Bitbucket Server, also gives you also get automatic version control by Git.
Security
Access to web pages is based on repository permissions. Users need at least read access to the repository to view web pages in Bitbucket. For security reasons, by default, pages are not available unavailable for branches or tags in personal repositories by default. But in the plugin settings, you can configure which groups are allowed to can enable pages in personal repositories.
XSS Attacks
For users who want to still use the plugin and are worried about potentially malicious content in git repositories, weWe've added an option to disable JavaScript on rendered pages to reduce the risk of allowing potentially malicious content in git repositories. You can disable JavaScript either on a global level or a repository level. Another way to host malicious safely is to configure an external domain.
Configuration
You can change Web Pages plugin options in a separate configuration tab of Repository Settings page
...
Security level
You can select one of the following web page content protection levels:
Allow all insecure content: support both Javascript and CSS on the page, use only with private or fully trusted repositories!
Allow CSS only: support CSS styling of pages, but wipe out Javascript code from pages
Disable all insecure content: render text content only, wipe out CSS and Javascript code
Sub-folder to serve
Path to be used as root of web server. Files outside selected folder will not be accessible
Enable branches
Automatically enable pages for new branches in this repository: If this option is enabled, web page link will be enabled for all newly created branches.
Also, you can manually enable or disable particular branches or tags.
Web Page navigation link
If branch link is enabled, you can select it to be used with Web Page button in left navigation bar:
only one branch can be selected, tags not used
default branch is selected by default
if you you turn off branch link, Web Page button will be hidden
Pages for Bitbucket Server vs. websites on Bitbucket Cloud
The main difference between Pages for Bitbucket Server and the websites feature of Bitbucket Cloud is that we support websites on a repository level, not just on the account level. This brings the following advantages:
...
Websites on Bitbucket Cloud
...
Pages for Bitbucket Server
...
On Bitbucket Cloud you can only publish one repository per user.
...
With the Pages add-on you can publish as many repositories as you want.
...
On Bitbucket Cloud you can only publish a single branch of the repository.
...
With the Pages add-on you can serve static web pages from any branch or tag you like.
...
On Bitbucket Cloud the website is public on the internet. Anyone with the URL can access it.
...
The Pages add-on uses the permissions of the underlying repository, which allows you to control specifically who can access the pages and who not.
...
Bitbucket Cloud can only serve a website when the site's URL is <username>.bitbucket.org.
...
Another method for reducing the risk of XSS vulnerability is to configure an external domain.