0

I have 3 networks (network_1, network_2 and network_3). The three networks are airgapped.

On network_1 I have a Gitlab instance.

I want to host an instance of Gitlab on network_2 and on network_3. Which should be mirrors of the Gitlab instance from network_1.

I have a 4th network (network_4) where I can store files from network_1 and download these files from network_2 and from network_3. Tunneling or proxying does not work through network_4.

One option I found is:

  • Export repository/repositories on Gitlab instance on network_1.
  • Transfer export file (through network_4) to network_2 and network_3.
  • Import the export file on network_2 and network_3.

Downside is:

  • Kinda slow. (Exporting takes times, transferring takes times, importing takes time).
  • Cannot import if the project already exists, so every time I want to import the export file I need to delete the project first.
  • Cannot import changes only, so every time I need to import the whole repository.

Any other options/solutions?

1
  • I’m voting to close this question because a solution has been found and this is unlikely to help anyone else Commented Nov 23, 2023 at 2:23

1 Answer 1

1

I found a solution.

On network_1:

Create Git repository from Gitlab project:

git clone /var/opt/gitlab/git-data/<path to project>.git /tmp/repository_name.git

Create Git bundle from Git repository:

cd /tmp/repository_name.git
git bundle create /tmp/repository_name.bundle --all

Transfer /tmp/repository_name.bundle to network_2/3.

On network_2/3:

Create Git repository from Git bundle:

git clone --bare /tmp/repository_name.bundle /tmp/repository_name.git

Set origin URL:

cd /tmp/repository_name.git
git remote set-url origin https://url-to-gitlab-on-network2-3/group/project.git

Push changes/content to Gitlab:

git push --mirror

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .