From 2e69e9ab550a156fa017b1e0f05e4bb477b3846b Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 1 Apr 2021 10:38:34 +0200 Subject: [PATCH] update readme --- ...ci.yml => __activate_later__.gitlab-ci.yml | 0 readme.md | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+) rename .gitlab-ci.yml => __activate_later__.gitlab-ci.yml (100%) create mode 100644 readme.md diff --git a/.gitlab-ci.yml b/__activate_later__.gitlab-ci.yml similarity index 100% rename from .gitlab-ci.yml rename to __activate_later__.gitlab-ci.yml diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..143f533 --- /dev/null +++ b/readme.md @@ -0,0 +1,95 @@ +# CI Package Server + +A sattelite system of the CI server to delivery built packages in other +networks. The file access is protected with a dynamic authorization to +prevent public access. + +An example client was coded in Bash (using curl) + +SOURCE https://git-repo.iml.unibe.ch/iml-open-source/ci-pkg + +## License + +GNU GPL 3.0 + +## Requirements + +* Webserver with xsentfile module +* Set filepath to [approot]/packages +* Rewrite rule for [ur]/packages/ + + +## Installation on server + + +### Xsentfile module + +On Apache Webserver install xentfile module. + +i.e. on CentOS + + yum install mod_xsendfile + + +### Configuration of vhost + +In the Apache vhost for cipkg server set the XSendFilePath - it is an absolute +path on your websever. + +Redirect all requests to /packages/[whatever] to /packages/index.php + + +Ecample snippet + +```text + + XSendFile On + XSendFilePath "/var/www/cipkg.example.com/packages/" + + <Location "/packages"> + + <Location "/packages"> + RewriteEngine on + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [QSA,L] + + </Location> +``` + + +### Configuration of secret on server + +if [approot]/public_html/ copy inc_config.php.dist to inc_config.php.dist. +set a secret behind key apikey. + +```php +return array( + 'apikey'=>'our-package-server-secret', + 'cutfromrequest'=>'^/packages', + 'packagedir'=>dirname(__DIR__).'/packages', +); +``` + +## Installation on client + +On a target system you need a bash and curl. + +Copy the files from [approot]/shellscripts/ somewhere in a project related +directory. + +Copy getfile.sh.cfg.dist to getfile.sh.cfg and setup values: + +```text +# ---------------------------------------------------------------------- +# defaults +# ---------------------------------------------------------------------- + +IMLCI_PKG_SECRET=our-package-server-secret +IMLCI_URL=https://cipkg.example.com +IMLCI_PHASE=preview +IMLCI_PROJECT=myproject-id +IMLCI_FILE= +``` + +Remark: using the cfg file is optional. It countains default values. +all values can be set by command line parameters. \ No newline at end of file -- GitLab