Forked from walkerjeffd/Synology-Diskstation-Git.md
          
        
    
          Last active
          August 16, 2021 14:00 
        
      - 
      
- 
        Save ngoviet/ff08a7eb9f9da510564d to your computer and use it in GitHub Desktop. 
Revisions
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ git clone ssh://[email protected]:port/volume1/git/<repo-name>.git ``` ## Khởi tạo git trên server ``` cd /volume1/git git --bare init <repo-name>.git ``` ## Đẩy project có sẵn lên git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ vi /etc/passwd - Example Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,12 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example * Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` * become `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,10 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example Edit row. `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become. --* `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ vi /etc/passwd - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example #Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` #become --* `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example #Edit row > `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` #become > `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ vi /etc/passwd - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example Edit row > `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become > `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,11 @@ vi /etc/passwd ``` - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` - Example Edit row `gituser:x:1026:100::/var/services/homes/gituser:/var/packages/Git/target/bin/git-shell` become `gituser:x:1026:100::/var/services/homes/gituser:/bin/sh` ### Cấu hình người dùng và thư mục git - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,7 @@ Cấu hình NAS Synology thành Git Server ------------------------------------ ### Cho phép SSH Edit `etc/passwd` ``` vi /etc/passwd ``` 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 10 additions and 33 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Cấu hình NAS Synology thành Git Server ------------------------------------ ### Cho phép SSH @@ -20,61 +20,38 @@ vi /etc/passwd - Mở truy cập SSH (Control Panel > Terminal & SNMP > Enable SSH Service) ### Configure SSH Access - create `~/.ssh` folder for gituser on server ``` ssh [email protected] mkdir /volume1/homes/gituser/.ssh ``` - copy public rsa key from local computer to gituser account on server copy public key from local computer to `/volume1/homes/gituser/.ssh/authorized_keys` - change permissions while logged in as root ``` cd /volume1/homes/gituser/ chown -R gituser:users .ssh chmod 700 .ssh chmod 644 .ssh/authorized_keys ``` - Config for gituser can SSH via rsa key ``` cd /var/services/homes/ chown gituser chmod 755 gituser ``` ### Set Up New Repo on NAS - create bare repo as root ``` ssh [email protected] cd /volume1/git/ git --bare init <repo-name>.git chown -R gituser:users <repo-name>.git ``` ### Add NAS as Remote for Local Repo - Clone repo from NAS ``` git clone ssh://[email protected]:port/volume1/git/<repo-name>.git ``` ## Khởi tạo git trên server ``` 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` `vara:x:1026:100::/var/services/homes/vara:/var/packages/Git/target/bin/git-shell` ###--------------> `vara:x:1026:100::/var/services/homes/vara:/bin/sh` ### Cấu hình người dùng và thư mục git 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,13 +11,13 @@ vi /etc/passwd `vara:x:1026:100::/var/services/homes/vara:/var/packages/Git/target/bin/git-shell` --------------> `vara:x:1026:100::/var/services/homes/vara:/bin/sh` ### Cấu hình người dùng và thư mục git - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages - Thêm thư mục mới `git` (ở `/volume1/git`) với quyền read/write cho `gituser` and `admin`. Đây là thư mục chứa các repos. - Cài đặt gói `Git Server` - Mở `Git Server` và cấp quyền cho `gituser` - Mở truy cập SSH (Control Panel > Terminal & SNMP > Enable SSH Service) ### Configure SSH Access 
- 
        ngoviet revised this gist Oct 23, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,8 +13,8 @@ vi /etc/passwd `vara:x:1026:100::/var/services/homes/vara:/bin/sh` ### Set Up User and Folder - Tạo người dùng `gituser` cùng với File Station và WebDAV privilages - Thêm thư mục mới `git` (ở `/volume1/git`) với quyền read/write cho `gituser` and `admin`. Đây là thư mục chứa các repos. - Install Git Server package via Diskstation - Open Git Server and allow `gituser` permissions - Enable SSH access on Diskstation (Control Panel > Terminal & SNMP > Enable SSH Service) 
- 
        ngoviet revised this gist Oct 20, 2015 . No changes.There are no files selected for viewing
- 
        ngoviet revised this gist Oct 19, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ vi /etc/passwd - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` `vara:x:1026:100::/var/services/homes/vara:/var/packages/Git/target/bin/git-shell` --------------> `vara:x:1026:100::/var/services/homes/vara:/bin/sh` ### Set Up User and Folder 
- 
        ngoviet revised this gist Oct 19, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,9 @@ vi /etc/passwd ``` - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` `vara:x:1026:100::/var/services/homes/vara:/var/packages/Git/target/bin/git-shell` đổi thành: `vara:x:1026:100::/var/services/homes/vara:/bin/sh` ### Set Up User and Folder - Create user `gituser` via Diskstation interface (with File Station and WebDAV privilages) 
- 
        ngoviet revised this gist Oct 19, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,8 @@ sửa ``` vi /etc/passwd ``` - Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH - Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` ### Set Up User and Folder - Create user `gituser` via Diskstation interface (with File Station and WebDAV privilages) 
- 
        ngoviet revised this gist Oct 19, 2015 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,13 @@ Configure Synology NAS as Git Server ------------------------------------ ### Cho phép SSH sửa ``` vi /etc/passwd ``` Người dùng có shell: `/sbin/nologin` không thể đăng nhập qua SSH Để có thể SSH thay đổi dòng cấu hình user giống với root và admin, thường là `/bin/sh` ### Set Up User and Folder - Create user `gituser` via Diskstation interface (with File Station and WebDAV privilages) 
- 
        ngoviet revised this gist Sep 27, 2015 . No changes.There are no files selected for viewing
- 
        ngoviet revised this gist Sep 27, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -91,7 +91,9 @@ echo libs >> .gitignore ## Xử lý lỗi Cập nhật .gitignore mà tracking vẫn không update Xóa cache của git ``` git rm -r --cached . git add . git commit -m "fixed untracked files" ``` ## References 
- 
        ngoviet renamed this gist Sep 27, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        ngoviet revised this gist Sep 27, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,6 +81,13 @@ git commit -m "Khoi tao" git remote add origin ssh://[email protected]:2222/volume1/git/<repo-name>.git git push origin master ``` ## Tạo file .gitignore và cập nhật ``` type NUL > .gitignore echo bower_components > .gitignore echo node_modules >> .gitignore echo libs >> .gitignore ``` ## Xử lý lỗi Cập nhật .gitignore mà tracking vẫn không update Xóa cache của git ``` 
- 
        ngoviet revised this gist Sep 27, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,6 +81,11 @@ git commit -m "Khoi tao" git remote add origin ssh://[email protected]:2222/volume1/git/<repo-name>.git git push origin master ``` ## Xử lý lỗi Cập nhật .gitignore mà tracking vẫn không update Xóa cache của git ``` git rm -r --cached ``` ## References http://blog.osdev.org/git/2014/02/13/using-git-on-a-synology-nas.html 
- 
        ngoviet revised this gist Sep 27, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,6 +68,11 @@ thử: ``` git clone ssh://[email protected]:5006/git/<repo-name>.git ``` ## Khởi tạo git trên server ``` cd volume1/git git --bare init <repo-name>.git ``` ## Đẩy project có sẵn lên git ``` git init 
- 
        ngoviet revised this gist Sep 27, 2015 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,6 +68,14 @@ thử: ``` git clone ssh://[email protected]:5006/git/<repo-name>.git ``` ## Đẩy project có sẵn lên git ``` git init git add * git commit -m "Khoi tao" git remote add origin ssh://[email protected]:2222/volume1/git/<repo-name>.git git push origin master ``` ## References http://blog.osdev.org/git/2014/02/13/using-git-on-a-synology-nas.html 
- 
        ngoviet revised this gist Sep 23, 2015 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -64,8 +64,10 @@ NOTE: I'm not entirely sure if `git update-server-info` must be run for each rep ``` git clone ssh://[email protected]/volume1/git/<repo-name>.git ``` thử: ``` git clone ssh://[email protected]:5006/git/<repo-name>.git ``` ## References http://blog.osdev.org/git/2014/02/13/using-git-on-a-synology-nas.html 
- 
        ngoviet revised this gist Sep 22, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -64,7 +64,7 @@ NOTE: I'm not entirely sure if `git update-server-info` must be run for each rep ``` git clone ssh://[email protected]/volume1/git/<repo-name>.git ``` thử clone ssh://[email protected]:5006/git/<repo-name>.git ## References 
- 
        walkerjeffd revised this gist Jul 17, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Configure Synology NAS as Git Server ------------------------------------ Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0. ### Set Up User and Folder 
NewerOlder