private-git-server public repository public_html / e0f3102
add new files Shakiba Moshiri 11 months ago
4 changed file(s) with 256 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 <div id="workflow" class="">
1 <div class="content-r">
2 <h1 class="sub-title">architecture</h1>
3 <hr>
4 <p>Here is the top level architecture for our private git server.</p>
5 <ul>
6 <li><strong>end users</strong>: our customers, etc</li>
7 <li><strong>PS</strong>: Production Server</li>
8 <li><strong>PGS</strong>: Private Git Server</li>
9 <li><strong>CIS</strong>: Continuous Integration Server</li>
10 <li><strong>githb</strong>: Git Server for free public repositories</li>
11 <li><strong>gitlab</strong>: Git Server for free public and private repository</li>
12 <li><strong>dev team</strong>: the developers who code</li>
13 <li><strong>other</strong>: any other contributors to our public repositories</li>
14 </ul>
15 <p><strong>Node</strong> that in this architecture using <strong>gitlab</strong> or <strong>github</strong> are completely optional. We do not have to use them because we do have shared repositories on our private git server.</p>
16 <p>The usage of gitlab. github, others services is for their rich <strong>Web Interface</strong> they provide for code, commit, issue review, etc.</p>
17 <p><button id="toggle-optional-parts">toggle optional parts</button></p>
18 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -250 700 950" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" font-family="'Montserrat', sans-serif">
19 <title>Private Git Server Animation</title>
20 <desc>Author: Shakiba Moshiri</desc>
21 <g id="end_users_1" transform="translate(150,-240)">
22 <rect x="0" y="0" width="100" height="100" rx="50" fill="#000"></rect>
23 <text x="30" y="40" fill="#fff" font-size="20">end</text>
24 <text x="25" y="70" fill="#fff" font-size="20">users</text>
25 <path id="move_stroke" d="M70,110 l90,100" stroke-dasharray="10" stroke-dashoffset="-20" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
26 </g>
27 <g id="end_users_2" transform="translate(300,-240)">
28 <rect x="0" y="0" width="100" height="100" rx="50" fill="#000"></rect>
29 <text x="30" y="40" fill="#fff" font-size="20">end</text>
30 <text x="25" y="70" fill="#fff" font-size="20">users</text>
31 <path id="move_stroke" d="M50,110 v100" stroke-dasharray="10" stroke-dashoffset="-20" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
32 </g>
33 <g id="end_users_3" transform="translate(450,-240)">
34 <rect x="0" y="0" width="100" height="100" rx="50" fill="#000"></rect>
35 <text x="30" y="40" fill="#fff" font-size="20">end</text>
36 <text x="25" y="70" fill="#fff" font-size="20">users</text>
37 <path id="move_stroke" d="M30,110 l-90,100" stroke-dasharray="10" stroke-dashoffset="-20" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
38 </g>
39 <g id="production_server" transform="translate(300,10)">
40 <rect x="0" y="0" width="100" height="100" rx="50" fill="#000"></rect>
41 <circle cx="50" cy="50" r="59" fill="none" stroke="#000" stroke-width="3"></circle>
42 <text x="30" y="60" fill="#fff" font-size="30">PS</text>
43 <text x="130" y="40" fill="#000" font-size="20">production</text>
44 <text x="130" y="60" fill="#000" font-size="20">server</text>
45 <text x="-100" y="170" fill="#000" font-size="20">change</text>
46 <text x="-100" y="190" fill="#000" font-size="20">notification</text>
47 <text x="100" y="170" fill="#000" font-size="20">pull</text>
48 <text x="100" y="190" fill="#000" font-size="20">clone</text>
49 <!-- <text x="100" y="230" fill="#000" font-size="30">pull</text>-->
50 <path id="move_stroke" d="M25,270 v-140" stroke-dasharray="20" stroke-dashoffset="-20" fill="none" stroke="#00c800" stroke-width="5" marker-end="url(#arrow_green)"></path>
51 <path id="move_stroke" d="M80,270 v-140" stroke-dasharray="20" stroke-dashoffset="-20" fill="none" stroke="#00c800" stroke-width="5" marker-end="url(#arrow_green)"></path>
52 </g>
53 <g id="private_git_server" transform="translate(300,300)">
54 <rect x="0" y="0" width="100" height="100" rx="10" fill="#000"></rect>
55 <rect x="-5" y="-5" width="110" height="110" rx="10" fill="none" stroke="#000" stroke-width="3"></rect>
56 <text x="20" y="40" fill="#fff" font-size="30">PGS</text>
57 <text x="25" y="80" fill="#fff" font-size="30">CIS</text>
58 <!-- <text x="-290" y="-150" fill="#000" font-size="20">Private Git Server, or could be</text>-->
59 <!-- <text x="-290" y="-130" fill="#000" font-size="20">Continuous Integration Server</text>-->
60 <!-- <path id="" d="M-200,-120 q0,50 50,50 h130 q40,0 40,40" fill="none" stroke="#000" stroke-width="3" marker-end="url(#arrow)"></path>-->
61 </g>
62
63 <g id="developer_team" transform="translate(300,590)">
64 <rect x="0" y="0" width="100" height="100" rx="50%" fill="#000"></rect>
65 <circle cx="50" cy="50" r="59" fill="none" stroke="#000" stroke-width="3"></circle>
66 <text x="30" y="40" fill="#fff" font-size="20">dev</text>
67 <text x="25" y="70" fill="#fff" font-size="20">team</text>
68 <text x="-60" y="-60" fill="#000" font-size="30">push</text>
69 <text x="100" y="-60" fill="#000" font-size="20">pull, clone</text>
70 <text x="100" y="-40" fill="#000" font-size="20">email, sms</text>
71 <path id="move_stroke" d="M25,-20 v-140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
72 <path id="move_stroke" d="M80,-170 v140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
73 </g>
74
75 <g id="others_public" transform="translate(590,590)">
76 <rect x="0" y="0" width="100" height="100" rx="50%" fill="#000"></rect>
77 <text x="20" y="55" fill="#fff" font-size="20">others</text>
78 <text x="-40" y="-100" fill="#000" font-size="20">clone</text>
79 <text x="-40" y="-80" fill="#000" font-size="20">pull</text>
80 <text x="-40" y="-60" fill="#000" font-size="20">push</text>
81 <path id="move_stroke" d="M25,-20 v-140" stroke-dasharray="50" stroke-dashoffset="-40" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
82 <path id="move_stroke" d="M80,-170 v140" stroke-dasharray="50" stroke-dashoffset="-40" fill="none" stroke="#000" stroke-width="5" marker-end="url(#arrow)"></path>
83 </g>
84
85 <g id="ci_cd" transform="translate(10,590)">
86 <text x="20" y="0" fill="#000" font-size="20">Continuous Integration</text>
87 <text x="20" y="20" fill="#000" font-size="20">Continuous Deployment</text>
88 <path d="M30,-30 v-40 q0,-50 50,-50 h260 " fill="none" stroke="#000" stroke-width="2" marker-end="url(#ballet)" marker-start="url(#ballet)"></path>
89 </g>
90
91 <g id="delivery" transform="translate(10,50)">
92 <text x="20" y="20" fill="#000" font-size="20">Continuous Delivery</text>
93 <path d="M30,30 v100 q0,50 50,50 h260" fill="none" stroke="#000" stroke-width="2" marker-end="url(#ballet)" marker-start="url(#ballet)"></path>
94 </g>
95
96 <g id="delivery" transform="translate(450,100)" fill="#c80000">
97 <text x="20" y="0" font-size="20">Private Git Server</text>
98 <text x="20" y="20" font-size="20">CI Server</text>
99 <path d="M70,30 v170 q0,50 -50,50 h-120" fill="none" stroke="#c80000" stroke-width="2" marker-end="url(#ballet_red)" marker-start="url(#ballet_red)"></path>
100 </g>
101
102 <g id="github" transform="translate(590,300)">
103 <rect x="0" y="0" width="100" height="100" rx="50" fill="#f80"></rect>
104 <circle cx="50" cy="50" r="59" fill="none" stroke="#f80" stroke-width="3"></circle>
105 <text x="15" y="-20" fill="#000" font-size="25">github</text>
106 <text x="15" y="56" fill="#fff" font-size="25">public</text>
107 <text x="-150" y="0" fill="#000" font-size="30">push</text>
108 <text x="-150" y="110" fill="#000" font-size="20">web-hook</text>
109 <text x="-150" y="130" fill="#000" font-size="20">notification</text>
110 <path id="move_stroke" d="M-20,70 h-140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#f80" stroke-width="5" marker-end="url(#arrow_orange)"></path>
111 <path id="move_stroke" d="M-170,20 h140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#f80" stroke-width="5" marker-end="url(#arrow_orange)"></path>
112 </g>
113
114 <g id="gitlab" transform="translate(10,300)">
115 <rect x="0" y="0" width="100" height="100" rx="50" fill="#f80"></rect>
116 <circle cx="50" cy="50" r="59" fill="none" stroke="#f80" stroke-width="3"></circle>
117 <text x="15" y="-20" fill="#000" font-size="25">gitlab</text>
118 <text x="10" y="56" fill="#fff" font-size="25">private</text>
119 <text x="200" y="0" fill="#000" font-size="30">push</text>
120 <text x="150" y="110" fill="#000" font-size="20">web-hook</text>
121 <text x="150" y="130" fill="#000" font-size="20">notification</text>
122 <path id="move_stroke" d="M120,70 h140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#f80" stroke-width="5" marker-end="url(#arrow_orange)"></path>
123 <path id="move_stroke" d="M270,20 h-140" stroke-dasharray="10" stroke-dashoffset="0" fill="none" stroke="#f80" stroke-width="5" marker-end="url(#arrow_orange)"></path>
124 </g>
125
126 <defs>
127 <marker id="arrow" markerWidth="5" markerHeight="5" refX="0" refY="2.5" orient="auto">
128 <polygon fill="#000" points="0 0, 4 2.5, 0 5" />
129 </marker>
130 <marker id="arrow_orange" markerWidth="5" markerHeight="5" refX="0" refY="2.5" orient="auto">
131 <polygon fill="#f80" points="0 0, 4 2.5, 0 5" />
132 </marker>
133 <marker id="arrow_green" markerWidth="5" markerHeight="5" refX="0" refY="2.5" orient="auto">
134 <polygon fill="#00c800" points="0 0, 4 2.5, 0 5" />
135 </marker>
136 <marker id="ballet" markerWidth="12" markerHeight="12" refX="6" refY="6">
137 <circle fill="#000" cx="6" cy="6" r="2" stroke="context-stroke" stroke-width="2" />
138 </marker>
139 <marker id="ballet_red" markerWidth="12" markerHeight="12" refX="6" refY="6">
140 <circle fill="#c80000" cx="6" cy="6" r="2" stroke="context-stroke" stroke-width="2" />
141 </marker>
142 </defs>
143
144 <!--
145 <defs>
146 <pattern id="first" x="0" y="0" width="5%" height="5%">
147 <path fill="none" stroke="#000" stroke-width="0.5" d="M0,25 25,25 25,0" />
148 </pattern>
149 </defs>
150 <defs>
151 <pattern id="second" x="0" y="0" width="10%" height="10%">
152 <path fill="none" stroke="#F00" stroke-width="1" d="M0,50 50,50 50,0" />
153 </pattern>
154 </defs>
155 <rect x="0" y="0" width="500" height="599" fill="url(#first)"></rect>
156 <rect x="0" y="0" width="500" height="500" fill="url(second)"></rect>
157 <circle cx="250" cy="225" r="0"></circle>
158 -->
159 <defs>
160 <style type="text/css"><![CDATA[
161 @-webkit-keyframes stroke_forward {
162 100% { stroke-dashoffset: -140; } }
163 @keyframes stroke_forward {
164 100% { stroke-dashoffset: -140; }
165 }
166 path#move_stroke {
167 animation-name: stroke_forward;
168 animation-duration: 5s;
169 animation-timing-function: linear;
170 animation-iteration-count: infinite;
171 }
172 ]]></style>
173 </defs>
174 <text x="10" y="690" fill="#000" font-size="10">Creator &amp; Designer: Shakiba Moshiri 2019 All Right Reserved</text>
175 </svg>
176
177 <script>
178 var button = document.getElementById( "toggle-optional-parts" );
179 button.onclick = function(){
180 var items = [ "others_public", "gitlab", "github" ];
181 var index = items.length;
182 while( index-- ){
183 var item = document.getElementById( items[ index ] );
184 item.style.display = item.style.display === "none" && "block" || "none";
185 }
186 }
187 </script>
188 </div>
189 </div>
22 <h3 class="sub-title">Github</h3>
33 <p>Github is a company that runs servers to manage software source code using <strong>git</strong> tool.</p>
44 <p>It has <strong>free</strong> public repositories and <strong>non-free</strong> private repositories.</p>
5 <p>With github we do this where the server is <strong>github.com</strong>:</p>
5 <p>With github we do this where the domain name is <strong>github.com</strong>:</p>
66 <pre><code class="language-javascript">// clone a repository
77 git clone [email protected]/k-five/private-git-server
88 // or
1717 origin [email protected]/k-five/private-git-server.git (push)</code></pre>
1818
1919 <h3 class="sub-title">Gitlab</h3>
20 <p>Gitlab is the same somehow, but has free private repositories.</p>
20 <p>Gitlab is the same somehow.</p>
2121 <p>It offers both <strong>public</strong> and <strong>private</strong> repositories for free.</p>
22 <p>With gitlab we do this where the server is <strong>gitlab.com</strong></p>
22 <p>With gitlab we do this where the domain name is <strong>gitlab.com</strong></p>
2323 <pre><code class="language-javascript">// clone a repository
2424 git clone [email protected]/k-five/private-git-server
2525 // or
3535 <h3 class="sub-title">Private Git Server</h3>
3636 <p>Private git server will be our own server that uses <strong>git</strong> tool as our version control system.</p>
3737 <p>Although it is possible to have <a target="_blank" href="http://private-git-server.ir/code/">public repositories with a private-git-server</a>, but the main purpose is to have private repositories.</p>
38 <p>With our server we do this where the server is our own at <strong>private-git-server.ir</strong></p>
38 <p>With our server we do this where the domain name is our own at <strong>private-git-server.ir</strong></p>
3939 <pre><code class="language-javascript">// clone a repository
4040 git clone [email protected]:private-git-server.git
4141 // or
4545 git push -u origin master
4646
4747 // git remote -v
48 // for our private git server
4849 origin [email protected]:private-git-server.git (fetch)
4950 origin [email protected]:private-git-server.git (push)</code></pre>
51
52 <p>It is not accessible to outside world unless we have access to the server using SSH.</p>
53 <p>But for testing purposes your can clone it using <strong>git</strong> protocol.</p>
54 <pre><code class="language-javascript">// test if the repository is available
55 git ls-remote git://95.216.12.6/private-git-server
56 5050fde5f52330592fc6a84c83b0fa6149b02026 HEAD
57 5050fde5f52330592fc6a84c83b0fa6149b02026 refs/heads/master
58
59 // clone the repository
60 // this is publicly available just for TEST
61 git clone git://95.216.12.6/private-git-server
62 Cloning into 'private-git-server'...
63 remote: Counting objects: 112, done.
64 remote: Compressing objects: 100% (103/103), done.
65 remote: Total 112 (delta 31), reused 0 (delta 0)
66 Receiving objects: 100% (112/112), 218.64 KiB | 387.00 KiB/s, done.
67 Resolving deltas: 100% (31/31), done.
68 Checking connectivity... done.
69 </pre></code>
5070 </div>
5171 </div>
0 <div id="workflow" class="">
1 <div class="content-r">
2 <h1 id="use-case" class="sub-title">use case</h1>
3 <hr>
4 <p>The best use case for this architecture is for countries e.g. <strong>Iran</strong> that have been blocked by gitlab, etc and developers in these countries have to use a VPN, or setup a proxy for git, or other dirty solutions.</p>
5 <p>None of the solutions I have tired myself and have seen that others tired are the correct and the right ones.</p>
6 <p>Sp I came up with this idea of having a <strong>Private Git Sever</strong> outside of a blocked country, like me, since I live in Iran.</p>
7 <p>If you wanted a fully automated pipeline and solve the problem of your access to gitlab, in the right way, notify me via:</p>
8 <ul>
9 <li>email me: [email protected]</li>
10 <li>text me: +98 937 094 7008</li>
11 </ul>
12 <p>to schedule a conversion over Skype. If you already have Skype, you can find me with Name / ID:</p>
13 <ul>
14 <li>Name: "Shakiba Moshiri"</li>
15 <li>ID: +98 930 781 8080</li>
16 </ul>
17 <p>on Skype. Also if you had any others questions or good idea feel free to tell them to me :).</p>
18
19 <h3 class="sub-title">NOTE</h3>
20 <p>This homepage source code as a repository for test is available on:</p>
21 <ul>
22 <li>github public repository at: <a href="https://github.com/k-five/private-git-server">https://github.com/k-five/private-git-server</a></li>
23 <li>gitlab private repository at: <a href="https://gitlab.com/k-five/private-git-server">https://gitlab.com/k-five/private-git-server</a></li>
24 </ul>
25 <p>For testing purpose you can contribute if you liked; and just notify me.</p>
26 </div>
27 </div>
0 <div id="workflow" class="">
1 <div class="content-r">
2 <h1 class="sub-title" id="workflow">workflow</h1>
3 <hr>
4 <ol>
5 <li>Our teams, developers code, commit new code and push to the private git server.</p>
6 <li>Private git server receives new code and does a git merge for new code into old one.</p>
7 <li>If merge succeeded, it will be pushed to gitlab (private) repository, or github (public) repository.</p>
8 <li>After successful merge, if there is a test, it cab be run.</p>
9 <li>After successful merge, if there is a build, it cab be run.</p>
10 <li>Finally when there is no error, a change notification is delivered to production server to tell, to synchronize itself with last changes.</p>
11 </ol>
12 </div>
13 </div>