How do I disable all access to Bitbucket but leave it running?

Mike Quentel
Contributor
May 28, 2024

TL;DR: please, could you tell me a relatively quick, easy way to set Bitbucket (Server  v5.13.0) to either be completely inaccessible, or to be read-only mode, for all Bitbucket users, but without shutting down the Bitbucket instance?

This question is similar to How to switch Bitbucket to read-only mode (posted back in 2020). That post includes a link to this Read only tool but I am not clear as to whether this tool will accomplish what I need.

Why: I am performing a simultaneous migration and upgrade of Bitbucket (going from one Linux server environment to another Linux server environment, and from Server version to Data Center version). Additionally, in case this might be relevant, this will also be a migration from a systemd deployment to a Docker container deployment.

During this migration and upgrade, I would like to immediately stop anyone from writing or modifying anything in Bitbucket on the old instance. Our Bitbucket is hosting over 1000 repos. I would like the Bitbucket instance to continue running during the migration.

The solution could be either preventing all access to all users, or forcing all users to be read-only access mode.

Perhaps controlling by IP address, like this article Control access to your private content

Eventually, I would like to have all users only be able to do read-access on the old server. But for now, during the migration, I want to ensure nobody updates or adds to any repo on the old server.

Many thanks.

1 answer

1 accepted

1 vote
Answer accepted
Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
May 28, 2024

Hi @Mike Quentel 

The Python script does exactly what I was going to suggest.

Locking BBServer

  1. Read branch permission of repo and log it to a file
  2. Set branch permissions in all repos to read_only

Unlocking BBServer

  1. Read permissions log file
  2. Apply permissions.

Note that as far as my limited understanding of Python goes, the script does not handle project wide branch permissions that are inherited by repos.

Mike Quentel
Contributor
June 13, 2024

thank you

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events