The pfSense Store

Author Topic: gitsync  (Read 9676 times)

0 Members and 1 Guest are viewing this topic.

Offline torontob

  • Sr. Member
  • ****
  • Posts: 526
  • Karma: +2/-2
    • View Profile
gitsync
« on: April 02, 2012, 04:38:24 pm »
What is git-sync used for? updates to the image?

Best,

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21373
  • Karma: +1431/-26
    • View Profile
gitsync
« Reply #1 on: April 02, 2012, 05:08:40 pm »
It's for updating the PHP code and other scripts without altering the binaries.

Often there are quick fixes in code that only take a gitsync to correct. Other times binary upgrades are required.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline torontob

  • Sr. Member
  • ****
  • Posts: 526
  • Karma: +2/-2
    • View Profile
gitsync
« Reply #2 on: April 02, 2012, 05:19:58 pm »
So, this would eventually replace the current update mechanism? The git repository used will be the one provided by pfSense team right?

Thanks for the explanation.

Offline cmb

  • Hero Member
  • *****
  • Posts: 11230
  • Karma: +893/-7
    • View Profile
    • Chris Buechler
Re: gitsync
« Reply #3 on: April 02, 2012, 05:25:23 pm »
So, this would eventually replace the current update mechanism?

No, it strictly updates source, not binaries. It's always been available as an option for updating but you have to know what you're doing since it doesn't update binaries and you can break things at times if you don't get the associated binary updates. It comes from the official github repo.

Offline rcfa

  • Hero Member
  • *****
  • Posts: 731
  • Karma: +4/-0
    • View Profile
Re: gitsync
« Reply #4 on: June 05, 2012, 04:43:48 pm »
Maybe I remember incorrectly, but didn't there used to be a ULR field and UI in the web configurator to initiate a gitsync? Don't seem to be able to find it, unless this moved to some unexpected location.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21373
  • Karma: +1431/-26
    • View Profile
Re: gitsync
« Reply #5 on: June 05, 2012, 08:35:47 pm »
It's in the firmware settings, where's it's always been. It shows up for me there on 2.0.x and 2.1.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline cmb

  • Hero Member
  • *****
  • Posts: 11230
  • Karma: +893/-7
    • View Profile
    • Chris Buechler
Re: gitsync
« Reply #6 on: June 06, 2012, 01:04:33 am »
It's in the firmware settings, where's it's always been. It shows up for me there on 2.0.x and 2.1.

IIRC only once you've already done one gitsync via CLI on that system.

Offline rcfa

  • Hero Member
  • *****
  • Posts: 731
  • Karma: +4/-0
    • View Profile
Re: gitsync
« Reply #7 on: June 06, 2012, 01:40:53 am »
IIRC only once you've already done one gitsync via CLI on that system.

Well, that would explain why it's not there on my system...
So what's the shell procedure? (URL?, etc.)

Offline chpalmer

  • Hero Member
  • *****
  • Posts: 1758
  • Karma: +93/-3
    • View Profile
    • Home of Cablenut
P.S. statements made by me are not necessarily condoned by the management of this fine organization.  http://badmodems.com

Offline rcfa

  • Hero Member
  • *****
  • Posts: 731
  • Karma: +4/-0
    • View Profile
Re: gitsync
« Reply #9 on: June 06, 2012, 02:33:17 am »
Thanks for the info. Doing it, results in this:

pfSsh.php playback gitsync master
 
Starting the pfSense shell system...............

Cannot find git, fetching...Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/Latest/git.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/expat-2.0.1_2.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/ca_root_nss-3.13.3.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/python27-2.7.2_4.tbz...
====
Note that some of the standard modules are provided as separate
ports since they require extra dependencies:

bsddb           databases/py-bsddb
gdbm            databases/py-gdbm
sqlite3      databases/py-sqlite3
tkinter         x11-toolkits/py-tkinter

Install them as needed.
====

 Done.


but the prompt doesn't return. It just sits there.

On the other hand, on the web GUI I get one of these crash alerts, which then directs me to this crash report:

Code: [Select]
Crash report begins.  Anonymous machine information:

amd64
8.3-RELEASE-p2
FreeBSD 8.3-RELEASE-p2 #1: Tue Jun  5 06:16:07 EDT 2012     root@FreeBSD_8.3_pfSense_2.1.snaps.pfsense.org:/usr/obj./usr/pfSensesrc/src/sys/pfSense_SMP.8

Crash report details:

PHP Errors:
[06-Jun-2012 07:10:16 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /etc/inc/pfsense-utils.inc on line 433
[06-Jun-2012 07:11:03 UTC] PHP Parse error:  syntax error, unexpected $end in /usr/local/pkg/squid_ng.inc on line 709
[06-Jun-2012 07:12:51 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /etc/inc/pfsense-utils.inc on line 433
[06-Jun-2012 07:12:53 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /etc/inc/pfsense-utils.inc on line 433
[06-Jun-2012 07:13:07 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /etc/inc/pfsense-utils.inc on line 433
[06-Jun-2012 07:14:40 UTC] PHP Fatal error:  Call to a member function read() on a non-object in /etc/inc/pfsense-utils.inc on line 433


Likely that's from the CLI git sync, because other than that nothing of relevance was happening on the pfSense box.

So then I hit the return key a few times in the Terminal, and suddenly the install continues:

Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/perl-5.12.4_4.tbz...Removing stale symlinks from /usr/bin...
    Removing /usr/bin/perl

    Skipping /usr/bin/perl5
Done.
Creating various symlinks in /usr/bin...
    Symlinking /usr/local/bin/perl5.12.4 to /usr/bin/perl
    Symlinking /usr/local/bin/perl5.12.4 to /usr/bin/perl5
Done.
cd: can't cd to /usr/include
Cleaning up /etc/make.conf... Done.
Spamming /etc/make.conf... Done.
 Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/p5-Net-SMTP-SSL-1.01_1.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/p5-Error-0.17017.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/curl-7.24.0.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/All/cvsps-2.1.tbz...Updating /etc/shells
 Done.


------------------------------------------------------------------------
*************************** GITWEB *************************************
If you installed the GITWEB option please follow these instructions:

In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.

All you have to do to make gitweb work is:
1) Copy the files /usr/local/share/examples/git/gitweb/* to a directory on
   your web server (e.g. Apache2) in which you are able to execute
   CGI-scripts.
2) In gitweb.cgi, adjust the variable $projectroot to point to
   your git repository (that is where you have your *.git project
   directories).
*************************** GITWEB *************************************

*************************** CONTRIB ************************************
If you installed the CONTRIB option please note that the scripts are
installed in /usr/local/share/git-core/contrib. Some of them require
other ports to be installed (perl, python, etc), which you may need to
install manually.
*************************** CONTRIB ************************************
------------------------------------------------------------------------


===> Checking out master
Executing cd /root/pfsense//pfSenseGITREPO && git clone git://github.com/bsdperimeter/pfsense.git pfSenseGITREPO
remote: Counting objects: 128945, done.
remote: Compressing objects: 100% (35192/35192), done.
remote: Total 128945 (delta 92817), reused 128757 (delta 92644)
Receiving objects: 100% (128945/128945), 23.89 MiB | 1.95 MiB/s, done.
Resolving deltas: 100% (92817/92817), done.
===> Installing new files...
===> Removing FAST-CGI temporary files...
===> Upgrading configuration (if needed)...
===> Configuring filter...
===> Running /etc/rc.php_ini_setup...
===> Locking down the console if needed...
===> Signaling PHP and Lighty restart...
===> Checkout complete.

Your system is now sync'd and PHP and Lighty will be restarted in 5 seconds.


So I'm not sure if there was a hang somewhere in there...

In any case, I have the gitsync auto-sync option now in the System:Firmware:Settings page, although that only seems to allow an automatic gitsync after a regular update, but I guess I still have to go to the CLI to just gitsync without updating the entire system?
« Last Edit: June 06, 2012, 02:45:46 am by rcfa »

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21373
  • Karma: +1431/-26
    • View Profile
Re: gitsync
« Reply #10 on: June 06, 2012, 07:15:46 am »
Yes, the GUI version only does so after a firmware update.

The CLI version can be done at any time.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!