Git Server - Migration from Synology  [Accepted]

Tell us what new features you'd love to see or any upgrades you think we should make!
Post Reply
User avatar
lsoto
Posts: 12
Joined: 19 May 2023, 18:54

Git Server - Migration from Synology

Post by lsoto »

Hello.
I am going to migrate my old Synology DS920+ to a brand new F4-424 Pro bought in Amazon at the Black Friday.
I do not miss most of the features that I use at the Synology, but the GIT server that is not available. I could not found any app/instructions (a couple of them are from 2023 referring a Medium blog not available anymore) regarding the setup of a Git Server.
I would like to run it natively, not under an emulated docker image whith a share FS.

I know that TOS 6 has an Ubuntu under the hood, but it is supposed we should not touch it (update, install new packages, modify configuration), so I am wondering how to proceed.

Any guidance would be appreciated.
IT Infrastructure/SRE
XT9 Mesh, HomeLab, Syn DS920+, Terramaster T6-423,F4-424Pro, MacBook, HyperOptic 1Gb ipv6.
User avatar
Maniform
Posts: 16
Joined: 25 Nov 2025, 00:17
Canada

Re: Git Server - Migration from Synology

Post by Maniform »

Hi !

I'm interested too by configuring a git server. I tried GitBucket from community but it's not compatible with TOS 6 it seems.
https://tmnascommunity.eu/download/gitbucket/
User avatar
Maniform
Posts: 16
Joined: 25 Nov 2025, 00:17
Canada

Re: Git Server - Migration from Synology

Post by Maniform »

I may have found a way to make it work : https://tmnascommunity.eu/download/modbase1/
ModBase1 contains git. If it works as expected, you could create a git server by
  1. Create a "git" shared folder.
  2. Create a project from the NAS

    Code: Select all

    cd Volume1/git
    mkdir YourProject.git
    cd YourProject.git
    git init --bare
    git symbolic-ref HEAD refs/heads/main
    
    The last command may be optional and is to set the main branch name to "main".
  3. Clone and use your git project from your computer

Code: Select all

git clone ssh://[email protected]:9222/Volume1/git/YourProject.git
And that should work !

From my side, I can't try this solution yet, I need to wait 2 more days because it seems we are limited to 5 downloads in community apps per week.
I managed to create a git folder and use a Raspberry Pi 5 as a git interface to do it. It works well but I would prefer to keep everything in the NAS.

I hope this will help you ! :D
User avatar
Maniform
Posts: 16
Joined: 25 Nov 2025, 00:17
Canada

Re: Git Server - Migration from Synology

Post by Maniform »

Update: I tried it but as always, cloning a git project through SSH doesn't work because of

Code: Select all

bash: line 1: git-upload-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
For some reason, the PATH isn't initialized the same way when you use SSH login and git commands.
When I log with SSH, I can use

Code: Select all

git-upload-pack
without any other configuration requirements but

Code: Select all

git clone ssh://[email protected]:9222/path/to/my/project.git
doesn't have the same PATH. :cry:
User avatar
TMzethar
TM Support
Posts: 2819
Joined: 27 Oct 2020, 16:43

Re: Git Server - Migration from Synology

Post by TMzethar »

To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
lsoto
Posts: 12
Joined: 19 May 2023, 18:54

Re: Git Server - Migration from Synology  [Accepted]

Post by lsoto »

Ok, I managed to do it, always that you use the syntax git://server/repo.git
This does not work with SSH for several reasons. No fancy UI, etc. Just bare git server.

(There could be a way to enable the ssh and thus the user control using the ssh keys, but it involve touching a TOS modified/customized file and I am not going to disclose it here: ssh_prepare)

It is an open server. So far I did not found the way to restrict the access to it. It is listening at port TCP:9418 (if you want to create a FW rule)

TL;DR
#Create at the UI the group git, the user git-daemon or whatever you want (the UI does not allows you to create the user git ??). Create the volume for your git repository and assign the rights to the user git-daemon

# on the CLI, convert to
# Install git package
apt update && apt install git git-daemon-sysvinit
(it is going to tell you modifying the OS should not be done and if you are sure about that)

#modify the user git-daemon with the bash shell (instead of no shell) to allow create repos later
chsh git-daemon -s /bin/bash

#create/modify the /etc/default/git-daemon to your taste
---------------------
# Defaults for git-daemon initscript
# sourced by /etc/init.d/git-daemon
# installed at /etc/default/git-daemon by the maintainer scripts

GIT_DAEMON_ENABLE=true
GIT_DAEMON_USER=git-daemon
### This is "Git root"
GIT_DAEMON_DIRECTORY=/Volume1/git
### Remap all the path requests as relative to the given path.
### So instead of git://server/Volume1/git/myrepo we could use git://server/myrepo
GIT_DAEMON_BASE_PATH=/Volume1/git
# other options. Check man page (internet) of git-daemon
GIT_DAEMON_OPTIONS=" --export-all --syslog --informative-errors"
---------------------
# ping systemctl to reload changes
systemctl daemon-reload
# enable and start the service
systemctl enable --now git-daemon.service
#check that it is running
systemctl status git-daemon.service

********

### Create a repo
su - git-daemon
cd /Volume1/git
mkdir test.git && cd test.git
git init --bare .

**** on your workstation
git clone git://server/test.git
IT Infrastructure/SRE
XT9 Mesh, HomeLab, Syn DS920+, Terramaster T6-423,F4-424Pro, MacBook, HyperOptic 1Gb ipv6.
Post Reply

Return to “New Requests & Proposals”