Recompiling Git with Gitweb in jail

andrewm659

Active Member

Reaction score: 4
Messages: 131

I need some help. I want to get gitweb working in my jail instance (ezjail). I don't know how to recompile from within the jaill. Do I need to download the ports package in the jail or from the host system? Is there a separate package that has this compiled in?

FreeBSD 10.3
Code:
pkg query -e "%n=git" "%n-%v %Ok %Ov"
git-2.9.0 CONTRIB on
git-2.9.0 CURL on
git-2.9.0 CVS on
git-2.9.0 GITWEB off  <---TURN THAT ON
git-2.9.0 GUI off
git-2.9.0 HTMLDOCS off
git-2.9.0 ICONV on
git-2.9.0 NLS on
git-2.9.0 P4 on
git-2.9.0 PERL on
git-2.9.0 SEND_EMAIL on
git-2.9.0 SVN off
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,075
Messages: 31,686

I don't know how to recompile from within the jail.
It works exactly the same way, why would it be different?

Do I need to download the ports package in the jail or from the host system?
There is no ports "package". There's a ports tree though, you can get it using portsnap(8) for example.

Is there a separate package that has this compiled in?
No, not unless you build it yourself.
 

tobik@

Daemon
Developer

Reaction score: 1,386
Messages: 1,909

Honestly I don't understand why GITWEB isn't turned on by default. GITWEB requires PERL (which is enabled by default) and adds maybe ~ 330kb to the installed size. I've opened a bug for this asking for it to be enabled by default: PR 211573.
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

Sorry,
I meant downloading the ports tree within the jail.


There is no ports "package". There's a ports tree though, you can get it using portsnap(8) for example.


No, not unless you build it yourself.[/QUOTE]
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

I was able to do a portsnap fetch
Code:
root@rancid3git:~ # portsnap extract
mkdir: /usr/ports: No such file or directory
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

root@rancid3git:~ # mkdir /usr/ports
mkdir: /usr/ports: File exists
root@rancid3git:~ #
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

It took to long to compile and I ran out of swap space on my host. :-(

I've never compiled or recompiled from ports so i'm new to this. Any tips would be great. Recompiling/Compiling git with GITWEB.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,075
Messages: 31,686

How "small" is the machine? I mean, how much memory? How much disk space? How large is your swap?
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

Code:
root@asm-freebsd01:~ # df -hT
Filesystem           Type       Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default   zfs        109G    8.0G    101G     7%    /
devfs                devfs      1.0K    1.0K      0B   100%    /dev
zroot/tmp            zfs        101G    120K    101G     0%    /tmp
zroot/usr/home       zfs        101G     39M    101G     0%    /usr/home
zroot/usr/ports      zfs        105G    3.5G    101G     3%    /usr/ports
zroot/usr/src        zfs        102G    547M    101G     1%    /usr/src
zroot/var/audit      zfs        101G     96K    101G     0%    /var/audit
zroot/var/crash      zfs        101G     96K    101G     0%    /var/crash
zroot/var/log        zfs        101G    328K    101G     0%    /var/log
zroot/var/mail       zfs        101G    160K    101G     0%    /var/mail
zroot/var/tmp        zfs        101G     96K    101G     0%    /var/tmp
zroot                zfs        101G     96K    101G     0%    /zroot
/usr/jails/basejail  nullfs     109G    8.0G    101G     7%    /jails/rancid3svn.borg.local/basejail
devfs                devfs      1.0K    1.0K      0B   100%    /jails/rancid3svn.borg.local/dev
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /jails/rancid3svn.borg.local/dev/fd
procfs               procfs     4.0K    4.0K      0B   100%    /jails/rancid3svn.borg.local/proc
/usr/jails/basejail  nullfs     109G    8.0G    101G     7%    /jails/rancid3git.borg.local/basejail
devfs                devfs      1.0K    1.0K      0B   100%    /jails/rancid3git.borg.local/dev
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /jails/rancid3git.borg.local/dev/fd
procfs               procfs     4.0K    4.0K      0B   100%    /jails/rancid3git.borg.local/proc
/usr/jails/basejail  nullfs     109G    8.0G    101G     7%    /jails/proxy01.borg.local/basejail
devfs                devfs      1.0K    1.0K      0B   100%    /jails/proxy01.borg.local/dev
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /jails/proxy01.borg.local/dev/fd
procfs               procfs     4.0K    4.0K      0B   100%    /jails/proxy01.borg.local/proc
/usr/jails/basejail  nullfs     109G    8.0G    101G     7%    /jails/nagios.borg.local/basejail
devfs                devfs      1.0K    1.0K      0B   100%    /jails/nagios.borg.local/dev
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /jails/nagios.borg.local/dev/fd
procfs               procfs     4.0K    4.0K      0B   100%    /jails/nagios.borg.local/proc
/usr/jails/basejail  nullfs     109G    8.0G    101G     7%    /jails/mta1.borg.local/basejail
devfs                devfs      1.0K    1.0K      0B   100%    /jails/mta1.borg.local/dev
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /jails/mta1.borg.local/dev/fd
procfs               procfs     4.0K    4.0K      0B   100%    /jails/mta1.borg.local/proc
root@asm-freebsd01:~ # 

root@asm-freebsd01:~ # sysctl hw.physmem
hw.physmem: 1044865024
root@asm-freebsd01:~ #
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,075
Messages: 31,686

1 GB? Am I reading this correctly? That's not a lot, especially since you're also using ZFS.

You could circumvent it by building your own packages using ports-mgmt/synth or ports-mgmt/poudriere. Just set up a VM at home, have it build all the packages you need and configure your jails to download it from your home system. That's how I update my VPS :)
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

This really isn't production. I'm just messing around w/ FBSD. So I didn't know.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,075
Messages: 31,686

In that case I definitely recommend setting up your own repository. Makes it a lot easier to adjust various default settings while keeping the ease of using packages.
 

Oko

Daemon

Reaction score: 773
Messages: 1,620

I need some help. I want to get gitweb working in my jail instance (ezjail).
I am not sure if you are dead set on gitweb but unlike GitLab which is pain in the rear end to set up (even with the new port) I have great experience with Gogs. I run it out of Jail on the top of ZFS pool (check out old iocage 1.74 written in shell) for a group of about 60 researchers, Ph.D. students, and programmers.
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

Isn't Gogs also a replacement for Git? Or is JUST the web interface? I really just need an interface to show me my changes do a compare. I was using WebSVN with Subversion which is great.
 

Oko

Daemon

Reaction score: 773
Messages: 1,620

Isn't Gogs also a replacement for Git? Or is JUST the web interface? I really just need an interface to show me my changes do a compare. I was using WebSVN with Subversion which is great.
Gogs is just a web interface GitHub style for Git. The only feature which is present in GitLab (full blown clone of GitHub) and GitHub we are missing is integration with continuous integration services (think of Jenkins). Everything else works exactly the same as GitHub and if you just want to use vanilla Git you can do it as well.
 
OP
OP
andrewm659

andrewm659

Active Member

Reaction score: 4
Messages: 131

Sweet! how hard is it to setup? Do I have to pull it from Github and install it that way?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,075
Messages: 31,686

I've set up devel/phabricator, just for fun, a while a go. Setting it up was actually quite easy, using it properly however was something else ;)
 

Oko

Daemon

Reaction score: 773
Messages: 1,620

Sweet! how hard is it to setup? Do I have to pull it from Github and install it that way?
It is not very hard. I am half year overdue to write up notes for my own documentation. If you are not in the hurry I might post howto on this forum by the end of next week for example. The good starting point is

https://gogs.io/docs/installation/install_from_source

I use PostgreSQL as a backend which made things little more complicated (Google PostgreSQL, Jail, FreeBSD to see what I am talking about). With sqlite which should be OK (data base stores only credentials if you are using local authentication) for about 50 people. You will also need to setup proxy (Nginx in my case) which is 3 minute thing if you have done things like that in the past. I tested Gogs also on DragonFly BSD and OpenBSD. Works fantastic.
 
Top