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

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...and just as a side note, with Windows 10 (and I assume Win11), you don't need PuTTY as a SSH client any more; there's one built in. Just start a PowerShell window and run ssh user@host.
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Hi Thank You for your help

SQL is set back to 127.0.0.1

In regards root URL, should this be the same as JAIL IP address.

I aim to set HTTP_ADDR to 0,0,0,0, so what every my JAIL IP ADDRESS is , that should be my GIT server. So do i need to set ROOT_URL back to localhost?

Does this look correct?

1639057934871.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Root URL = jail IP address, if you want to put an IP address in your browser instead of a hostname.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Please don't post pictures of your putty. Copy & paste the text inside the terminal window enclosed in code tags.

Your question: what does service gitea status say? Did you do a service gitea restart after you edited the configuration?
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Sorry,

This is what is outputted in putty


Code:
root@Git:~ # root@Git:~ # service gitea status
root@Git:~: Command not found.
root@Git:~ # Cannot 'status' gitea. Set gitea_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'.
Cannot: Command not found.
root@Git:~ # root@Git:~ #
root@Git:~: Command not found.
root@Git:~ #
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is the jail called Gitea or Git? Last night it was Gitea; today it's apparently Git. And if you've destroyed and recreated the jail (with a different name this time), did you run sysrc gitea_enable=YES after the new installation?
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Set gitea_enable to YES in /etc/rc.conf
There's the solution: edit /etc/rc.conf and set the variable accordingly or use sysrc:
Code:
sysrc gitea_enable="YES"
service gitea start
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Thank You Very much for all your help and advice, I got it working.

With the following code
Code:
sysrc gitea_enable="YES"
service gitea start


Yes the original jail was called Gitea, I delete it and created a new one called Git.

Just out curiosity, should all my data files be stored in a Jail or should it go into a folder directly in its own Dataset? What is the best way to keep data secure?

Is it possible to make the IP address of the JAIL static?

I presume that in my local pc I can set the DNS to the IP address of the so I can have simple domain?

Thank You
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Is it possible to make the IP address of the JAIL static?
Yes, look at the jail settings in the TrueNAS UI and the documentation, first, please. Come back for help if that is not sufficient.

I presume that in my local pc I can set the DNS to the IP address of the so I can have simple domain?
Not necessarily on your PC but on your router, if your model supports manual DNS entries. If you want to do it on your PC it's the file C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS (no extension) of things haven't changed with Windows 10.

Most convenient alternative for a home network IMHO:
Code:
pkg install avahi-app
sysrc dbus_enable="YES"
sysrc avahi_daemon_enable="YES"
service dbus start
service avahi-daemon start

an then use "git.local" as the hostname. Works in Windows from 10 on and Mac OS as the client systems.

You will need to adjust your ROOT_URL and restart the gitea service, when you want to use that option.
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Thanks

I got a basic router, which does not let you manually enter DNS entries

When a repository is created or saved, where is the best place to save the data in JAIL or a datapoint?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I am comfy keeping smaller amounts of data inside my jails. I snapshot and replicate them to an off-site machine and I know how to maintain and upgrade them regularly. Keeping the data outside the jail specifically facilitates deleting the jail and starting over. What precisely needs to be "outside" depends on the application.

That being said I currently keep my Nextcloud data outside of the jail, but e.g. the repos in gitea all inside.

So your decision in the end. Thanks to local mounts you can even have /var/db/mysql on a dataset outside the jail if you are so inclined.

I would not mess with things too much in the beginning. Keep the stuff inside, but do set up an hourly snapshot task. So you can just roll back any mistake you might make. Re-arranging can still be done later, when you have gained some experience.

Specifically opening up your gitea to the internet will take some careful examination of the current setup, recommended reverse proxy, TLS, ... so for now just enjoy what you achieved. Congrats!

Did you go the avahi route for the hostname instead of IP address? If you do, you can even leave the jail set to DHCP, the IP address doesn't matter. IPv6 if available will be picked up automatically, too ...
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
You are right, I will keep the data all in Jail so it easy to mange to begin with. Once the repo gets populated i will make regular snap shots, which will save data to a attached USB drive as well as off site. Therefore, if in future I need to recover my data or get new NAS system, i can simple pullin the JAIL without any configuration setup.

In regards to avahi, I believe this is the code your specified.

Does the domain have to be git.local, can i create something such as abcgit.local?

Will this work on Windows 7 PC as well?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The hostname will always be <nameofjail>.local with avahi.
Rename the jail to "abcgit" and go.

Windows 7 - I think (!) not out of the box. Google for "Windows 7" and "Bonjour" or "mDNS" ...
 

djoshi

Dabbler
Joined
Nov 24, 2021
Messages
39
Code:
[server]
DOMAIN       = localhost
HTTP_ADDR    = 0.0.0.0
HTTP_PORT    = 3000
ROOT_URL     = http://Git.local
DISABLE_SSH  = false
SSH_DOMAIN   = %(DOMAIN)s
SSH_PORT     = 22
OFFLINE_MODE = false
APP_DATA_PATH = /var/db/gitea/data


Does this look correct?

I got it working, only if i do http://git.local:3000/

Do I need to specify the port?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You could try to change the port to 80.
 
Top