Gitsync



  • What is git-sync used for? updates to the image?

    Best,


  • Rebel Alliance Developer Netgate

    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.



  • 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.



  • @torontob:

    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.



  • 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.


  • Rebel Alliance Developer Netgate

    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.



  • @jimp:

    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.



  • @cmb:

    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.)





  • 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:

    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?


  • Rebel Alliance Developer Netgate

    Yes, the GUI version only does so after a firmware update.

    The CLI version can be done at any time.


Locked