locally hosted version control system - CORE jails for e.g. SVN, GitLab?

flashdrive

Patron
Joined
Apr 2, 2021
Messages
264
Hello,

I want to have a locally hosted version control system (no GitHub, since the free version seems to require public access of the data).

The feature set I am looking for is:

  • I am the owner of the data
  • no internet access
  • I just want to store source code, which will be changed and therefor need a versioning
  • free software:
  • client OSs: Windows, macOS
 

flashdrive

Patron
Joined
Apr 2, 2021
Messages
264
for later reference:

Docker


SVN

 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I run Gitea in a jail. Works great.
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
I run Gitea in a jail. Works great.
Do you have a tutorial on how to set it up?

I am very new to TrueNas?

I get the following error:
gitteaerror.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I don't use the plugins, don't know how this is supposed to work, sorry.

I created a standard base jail
enabled SSH
logged in
pkg install gitea
then worked from the gitea documentation: https://docs.gitea.io/en-us/install-from-package/#freebsd

You will need basic system administration skills.

Kimd regards,
Patrick
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Thanks, I am very new, so please excuse my questions.

I created a Jail and enabled ssh using "Services". Then using the "Shell" I typed pkg install gitea.

It has been installed, but how can I verify that it has been installed correctly?

When I go to the IP address, I was expecting to see a git page, but I get

Hmmm… can't reach this page​

192.168.1.198 refused to connect.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
192.168.1.198 refused to connect.
Did you enable and start the gitea service, as the docs that Patrick linked tell you (and tell you how) to do?
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
I am also getting the following , if it gives any indication what could be the problem

1639008357188.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Do i need to go to certain port with gitea?
Looks like it:
Code:
root@gitea:~ # sockstat -l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
git      gitea      14474 12 tcp4   127.0.0.1:3000        *:*
root     syslogd    14004 5  dgram  /var/run/log
root     syslogd    14004 6  dgram  /var/run/logpriv

Also looks like it's only listening on 127.0.0.1, so you'll need to edit its config file (in /usr/local/etc/gitea/conf/app.ini) to listen on your jail's IP address.
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Yes, i see the same output.

Once again, sorry for my trivial questions, but how do i get to this file to edit in TrueNas?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You use an ssh client to log into the jail and a text based editor. If you don't know vi, you can use e.g. nano:
Code:
pkg install nano
rehash
nano /usr/local/etc/gitea/conf/app.ini
service gitea restart
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Ok, when I use SSH, am i login to IP address of TrueNas, Jail IP adddress or 127.0.0.1?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can use NAS IP address and user, become root (SSH can be enabled in the UI), then use
Code:
iocage console <jailname>

to become root inside the jail.

Or you enable SSH inside the jail and use the jail IP address.

Same iocage console ... as above to get inside the jail, then
Code:
sysrc sshd_enable=YES
service sshd start
adduser

to start sshd and add a user. The user needs to be a member of the "wheel" group to be able to use "su" to become root.
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Ok, I have manged to get something working with SSH and Putty. This is what I am seeing on SSH. There seems to be two IP address one for the server and one for the database. If i am correct i need to change the HTTP_ADDR only?

1639055472708.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Thanks

So ROOT_URL should be 192.168.1.249 and not local host?

What about the SQL database IP address should it also be 192.168.1.249?

1639057362006.png
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Yes the ROOT_URL should match the IP address you use to communicate with gitea. Or better the hostname. If you run some internal DNS, you can create a hostname for that IP address there. Or you can install ahavi-app inside your jail and use gitea.local as the hostname. So whatever needs to be in your browser's address bar to access gitea - that's the root URL.

When you put 0.0.0.0 into the HTTP_ADDR gitea will be reachable by whatever IP address the jail has so you don't need to maintain that in two places.

The SQL database IP address is the address of your SQL server as used by gitea. Nothing else is accessing that database. So 127.0.0.1 is perfectly fine if the SQL server is in the same jail as gitea itself.

HTH,
Patrick

P.S. The idea with putty etc. is that you can copy and paste the text instead of a large screenshot. Please try to do that for future posts.
 
Top