1 (edited by apmuthu 09/25/2014 12:20:53 pm)

Topic: Local Repo

For those on the LAN with no internet connection, a local FA repo can be setup with ability to use unsigned packages. Grab the repo bundle from my GitHub Repo (may not be upto date) and extract it to your locally resolvable domain like: http://localhost.or.localdomain.com/farepo/2.3/ such that the themes, languages, charts and extensions folders are under it.

Now in the config.php file, append the following code:

// LAN repo (0), WAN repo with signed packages (1)

    $repo_sign = 0;

// Comment out parameters not used

    $repo_auth = array(
//         'scheme' => 'http://',        // 'ftp://', 'https://'
//         'login' => '',
//         'pass' => '',
         'host' => 'localhost.or.localdomain.com',
         'path' => 'farepo',             // no leading or trailing slashes (/)
         'branch' => '2.3'             // Repository branch for current sources version
    );

Now edit the function get_pkg_or_list() in includes/packages.inc file:

1. Append the $repo_sign variable to the list of global variables.
2. Replace the line:

        if (openssl_verify($data, $sig, $cert) <= 0) {

with

        if ((!isset($repo_sign) || $repo_sign == 1) && openssl_verify($data, $sig, $cert) <= 0) {

Now the local repo is fully functional since the config.php parameters override the values in version.php.

@joe - can this flag ($repo_sign = true;) and a commented out repo array be included in the config.php file along with the changes in the includes/packages.inc in the mainstream stable distribution itself?

2 (edited by garrapato 09/22/2014 03:57:43 am)

Re: Local Repo

Hi apmuthu, currently I have my own repo but, as I discuss in private message, works fine using "localhost", but when trying to access it remotely via the URL "repo.garrapato.com" is too slow, I can not decipher why

$repo_auth = array(
         'login' => 'anonymous',
         'pass' => 'password',
         'host' => 'repo.garrapato.com', // repo server address
         'branch' => '2.3'      // Repository branch for current sources version
);

You can test it in my SandBox:

http://garrapato.com/sandbox/fa

some clue?

Regards

3 (edited by apmuthu 09/22/2014 08:47:36 am)

Re: Local Repo

Attempting to visit http://repo.garrapato.com/ results in a "no content here" webpage instead of prompting for a username and password. If you have set no username and password for it's access, then comment out / remove the first two array elements. It should then work.

The extensions did not download within FA but only when manually the URLs were entered in FireFox.

http://repo.garrapato.com/2.3/ seems to be password protected though.

http://repo.garrapato.com/2.3/extensions/cfdi-2.3.0-1.pkg did successfully download after providing the credentials.

http://repo.garrapato.com/2.3/extensions/zen_import-2.3.15-1.pkg also was successfully downloaded without asking for the credentials again and it is the official signed pkg.

Expect you created the Extensions.gz and Release.gz properly (since it displays only a subset including yours), otherwise enable error display and check out the SHA1sums in them if you are manually making it.

Make sure that the FA webroot has the FA.pem file if you are using any official pkgs.

Also see if the same problem arises if FA is installed in the server's webroot:
from
http://garrapato.com/sandbox/fa/
to
http://garrapato.com/

You are using latin1 charset - try utf8 / utf8-general-ci


Did you actually compile the pkgs listed in the repo? If so, please list the method you used right from key creation to pkg creation and repo updation.

4 (edited by garrapato 09/22/2014 04:44:40 pm)

Re: Local Repo

Hi apmuthu, I had placed the htaccess file in the wrong directory:

${WEBROOT}/repo/2.3

and I moved it to the correct directory:

${WEBROOT}/repo

Now all the repo directory is protected.

My repository does NOT contain all of the official extensions repository, only one or two of each type, themes, charts of accounts, extensions and languages, only to test the repository. I built the Extensions.gz, Themes.gz, Charts.gz and Languages.gz files with some shell scripts to automate the process, as well as file Release.gz and Release.sig file through my local certificate. So I replaced the file FA.pem with my own certificate.

http://garrapato.com/sandbox/fa/FA.pem

Everything works fine the only thing is that on my local installation, where use:

'host' => 'localhost',

and operate normally, whereas if I use:

'host' => 'repo.garrapato.com'

takes too long to access the repository.

Please check: http://garrapato.com/sandbox/fa/admin/inst_module.php?

5 (edited by apmuthu 09/22/2014 04:57:15 pm)

Re: Local Repo

I deactivated the cfdi extension for the Sandbox and then tried to delete the cfdi pkg in vain. It appears that there may be some openssl issue in verification. Try to bypass the signed pkg requirement in the first post in this thread and see if that is the problem.

Also please list the steps taken to make the Release.sig file so I can replicate here.

To the extent possible try to avoid using htaccess file and place it's contents in the apache conf directly with no overrides.

Re: Local Repo

Actually yes you deleted the extension, but as the Ajax timeout is exceeded, the window is not refreshed and seems not to erase, but if you do a refresh, you'll see that yes it erased.

I replaced my repository with the official repository, downloaded from your github repository (farepo.zip), reestablished the original FA.pem in my sandbox, then tried and the problem persists, I thimk tha the cause is not my repository.

7 (edited by apmuthu 09/23/2014 06:07:52 am)

Re: Local Repo

The latency from here to your host at both www.garrapato.com and the repo subdomain are about 330 to 350 ms and that may not be an issue as I've worked with far slower ones.

Please delete gz files in the modules/_cache folder and then try again. The code does not bother to retrieve the gz files afresh and relies on existing ones even if their sha1sum is different if they exist locally (YMMV).

Also request how / which file you made as Release.sig.

The automation scripts placed in the farepo folder (permissions 700,  execute as ./getrelease) for creating the various gz files are:

Filename: getconfigs

#!/bin/sh

# Use with
# find ./2.3/extensions/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip > Extensions.gz

tar xOzf $1 _init/config |  sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' && 
echo -n SHA1sum: && 
sha1sum $1 | cut -d" " -f1 && 
echo

Filename: getrelease

#!/bin/sh

SRCDIR=./2.3/
RELFILE=${SRCDIR}Release

find ${SRCDIR}extensions/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Extensions.gz
find ${SRCDIR}charts/     -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Charts.gz
find ${SRCDIR}languages/  -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Languages.gz
find ${SRCDIR}themes/     -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Themes.gz

echo Path: charts > ${RELFILE}
echo Type: chart >> ${RELFILE}
echo Filename: Charts.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Charts.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: extensions >> ${RELFILE}
echo Type: extension >> ${RELFILE}
echo Filename: Extensions.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Extensions.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: languages >> ${RELFILE}
echo Type: language >> ${RELFILE}
echo Filename: Languages.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Languages.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: themes >> ${RELFILE}
echo Type: theme >> ${RELFILE}
echo Filename: Themes.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Themes.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
gzip -f ${RELFILE}

8 (edited by apmuthu 09/25/2014 12:23:22 pm)

Re: Local Repo

My GitHub Repo has been updated with the latest extensions.

Re: Local Repo

hi apmuthu!, i followed your post but i was not able to see any extensions available,

im using usbwebserver http://www.usbwebserver.net/en/ to test FA, i would like to try the other extensions and themes available without internet connection.

im using your githup repo and the address http://localhost/farepo/2.3/ and also change  'host' => 'localhost',
and followed the editing of function get_pkg_or_list() exactly.

i was able to open the install/activate options unlike before apache would show an error/crash, the only problem left is i dont see anything to install or activate. it shows just the heading.

what could be the problem here? thank you!

Re: Local Repo

You must decide on your webroot path and set them in your apache conf file and restart your webserver.

The extensions are available in my GitHub repo for manual inclusion for offline use - slightly outdated by a one point release in some pkgs as on date.