Git Product home page Git Product logo

phagrancy's Introduction

Private Vagrant Box Hosting

Travis CI Code Climate

Phagrancy implements a self-hosted subset of Vagrant Cloud. It allows you to build images in Packer, publish them and then share the images with your co-workers via Vagrant, all on-premise.

Documentation

Please see the wiki for documentation.

Security

Phagrancy is intended to be used in a trusted network. There are limited authentication options, that control access to the api and the frontend.

Credits

The idea is based off of the Vagrancy project, but has been updated for current packer releases.

phagrancy's People

Contributors

crypto-scythe avatar dlundgren avatar syntacticvexation avatar tuningyourcode avatar vhaidamaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

phagrancy's Issues

Generic index page at /

Have a page at the web root that enables easy confirmation the application has been correctly configured, it currently displays 404 whether working or not.

works with vagrant-cloud?

Hi!
It looks like the Atlas post processor changed into vagrant-cloud post processor (the info on it is a bit sparse but the packer docs mention that the ATLAS_TOKEN env. variable is still accepted as a source of auth token). Alas, this thing tries to connect to connect to /authenticate on Phagrancy. Could it be that the vagrant-cloud api just has different endpoints? Can Phagrancy still be made to work with it?

Packer push fails due to pushed box version not following SemVer

Hi,

we had the issue that we pushed a box to phagrancy as "20201224" (or something similar ;)).

That's a totally valid version as of https://github.com/TuningYourCode/phagrancy/blob/5aef5376d114f0d021f7b690c8e18ef3050211c7/src/Model/Input/ValidatesVersion.php#L31

Sadly the following push by packer gave us an error because of something like "versions.version of type number is not of type string".
We thought that we pushed a new false version but packer parses all existing versions before it will push new boxes.

As per https://www.vagrantup.com/docs/boxes/versioning#version-constraints versions have to be strictly in format "X.Y.Z" - even if they don't enforce it on their api themself (https://app.vagrantup.com/TuningYourCode/boxes/debian-buster64-puppet6).

That would be a breaking change in the api but would probably prevent new starters from doing the same mistake and headache during debugging.

@dlundgren if you agree i could prepare a PR to sharpen the version validation.

Best regards,
TuningYourCode

Secure installation

Would be nice to open the installation to the public at large, but control access to it

Hidden semantic version error

If I upload a box without semantic versioning - i.e. 22 instead of 22.0.0, according to the code the API should return "must be semantically versioned" however I get a 404 returned:
`
<title>Page Not Found</title>
<style>
body{
margin:0;
padding:30px;
font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
}
h1{
margin:0;
font-size:48px;
font-weight:normal;
line-height:48px;
}
strong{
display:inline-block;
width:65px;
}
</style>


Page Not Found



The page you are looking for could not be found. Check the address bar
to ensure your URL is spelled correctly. If all else fails, you can
visit our home page at the link below.


Visit the Home Page

`

This is the case with using either nginx or Apache.

Don't overwrite existing boxes

Nice project!

I use phagrancy with packer.io, using the vagrant cloud post processor.

This works really well, but if I forget to update the version number, phagrancy overwrites my previously uploaded box.

I think best practice dictates that we should never overwrite a release.

Could we add an option so that phagrancy returns an error if the release already exists?

Docker workflow problems

Docker workflow on the wiki doesn't work for me - either command for building the php-fpm container in the docker/README.md

docker % docker build -t phagrancy-php-fpm:latest php-fpm
[+] Building 1.0s (4/4) FINISHED                                                               
 => [internal] load build definition from Dockerfile                                      0.0s
 => => transferring dockerfile: 153B                                                      0.0s
 => [internal] load .dockerignore                                                         0.0s
 => => transferring context: 2B                                                           0.0s
 => CANCELED [internal] load metadata for docker.io/library/php:7.3-fpm-buster            1.0s
 => ERROR [internal] load metadata for docker.io/library/phagrancy-nginx:latest           1.0s
------
 > [internal] load metadata for docker.io/library/phagrancy-nginx:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
rsn5133@penxfalcon docker % docker build -t phagrancy-php-fpm:latest php-fpm
[+] Building 0.9s (4/4) FINISHED                                                               
 => [internal] load build definition from Dockerfile                                      0.0s
 => => transferring dockerfile: 36B                                                       0.0s
 => [internal] load .dockerignore                                                         0.0s
 => => transferring context: 2B                                                           0.0s
 => CANCELED [internal] load metadata for docker.io/library/php:7.3-fpm-buster            0.8s
 => ERROR [internal] load metadata for docker.io/library/phagrancy-nginx:latest           0.8s
------
 > [internal] load metadata for docker.io/library/phagrancy-nginx:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I get the following error when attempting to build the php-fpm directory -

 php-fpm % docker build .
[+] Building 0.7s (4/4) FINISHED                                                               
 => [internal] load build definition from Dockerfile                                      0.0s
 => => transferring dockerfile: 153B                                                      0.0s
 => [internal] load .dockerignore                                                         0.0s
 => => transferring context: 2B                                                           0.0s
 => CANCELED [internal] load metadata for docker.io/library/php:7.3-fpm-buster            0.6s
 => ERROR [internal] load metadata for docker.io/library/phagrancy-nginx:latest           0.6s
------
 > [internal] load metadata for docker.io/library/phagrancy-nginx:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I was able to build the nginx container from the README.md file, and for the nginx directory.

Do you have a recommendation for getting past this error?

Respectfully,
-Roy Nielsen

Incorporate Prometheus Exporter

I would like to see a prometheus php client incorporated into phragrancy to

  1. Give a view into the repository in terms of box metrics such as names, versions, sizes
  2. Service monitoring and alerting.

Packer vagrant-cloud postprocessor fails when checking available box versions

Environment

Docker Compose

Issue

vagrant-cloud postprocessor fails when attempting to validate versions:

==> virtualbox-vm (vagrant-cloud): Creating version: 0.1.0
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin: Post-Processor Vagrant Cloud API POST: http://127.0.0.1/api/v1/box/devops/macos-catalina/versions.
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin:
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin:  Body: {"version":{"version":"0.1.0"}}
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin: Post-Processor Vagrant Cloud API Response:
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin:
2020/05/17 17:22:56 packer-post-processor-vagrant-cloud plugin: &{Status:405 Method Not Allowed StatusCode:405 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Allow:[POST] Connection:[keep-alive] Content-Length:[556] Content-Type:[text/html;charset=UTF-8] Date:[Sun, 17 May 2020 14:22:56 GMT] Server:[nginx] X-Powered-By:[PHP/7.3.18]] Body:0xc00061a200 ContentLength:556 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0001a8300 TLS:0xc00015a0b0}
==> virtualbox-vm (vagrant-cloud): error decoding error response: invalid character '<' looking for beginning of value
==> virtualbox-vm (vagrant-cloud): Error creating version:
==> virtualbox-vm (vagrant-cloud): Step "stepCreateVersion" failed

Packer postprocessors configuration:

  "post-processors": 
    [
        [
            {
            "type": "vagrant",
            "output": "{{user `vagrant_box_directory`}}/packer_{{.BuildName}}_{{.Provider}}.box"
            },
            {
                "type": "vagrant-cloud",
                "box_tag": "devops/macos-catalina",
                "vagrant_cloud_url": "http://127.0.0.1/api/v1",
                "insecure_skip_tls_verify": true,
                "access_token": "",
                "version": "0.1.0"
            }
        ]
    ],

Server logs:

phagrancy-nginx | 172.19.0.1 - - [17/May/2020:14:22:56 +0000] "POST /api/v1/box/devops/macos-catalina/versions HTTP/1.1" 301 162 "-" "Go-http-client/1.1"
phagrancy-php-fpm | 172.19.0.2 -  17/May/2020:14:22:56 +0000 "GET /index.php" 405
phagrancy-nginx | 172.19.0.1 - - [17/May/2020:14:22:56 +0000] "GET /api/v1/box/devops/macos-catalina/versions HTTP/1.1" 405 556 "http://127.0.0.1/api/v1/box/devops/macos-catalina/versions" "Go-http-client/1.1" "-"

Any chance the API is changed recently and this is yet to be supported ?

Need basic installation documentation

@dlundgren

We are trying to install the phagrancy on Oracle Linux 6. We have been able to host the application but are not able to check whether it is properly running or not.
Can we have a documentation that would provide us with the information on what httpd.conf we would need to host the application correctly.

Also the curl command provided in the readme.md are incorrect. As the httpd is hosted on port 80 and not port 8099.

Having a basic documentation stating what needs to be placed where and what configuration should be done for apache would help a lot.

Thanks for building the application though. :-)

Packer doesn't currently work

Packer changed the vagrant-cloud post-processor so we need to do the following:

  • provide an /api/v1/authenticate route
  • allow for the Authorization header to be parsed for the token

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.