Giter VIP home page Giter VIP logo

orepan2-server's Introduction

NAME

OrePAN2::Server - DarkPAN Server

SYNOPSIS

#launch orepan2 standalone server http://localhost:5888/
% orepan2-server.pl -p 5888

#upload git managed module to my orepan2 by curl 
curl --data-urlencode '[email protected]:Songmu/p5-App-RunCron.git' --data-urlencode 'author=SONGMU' http://localhost:5888/
curl --data-urlencode 'module=git+ssh://git@mygit/home/git/repos/MyModule.git' --data-urlencode 'author=SONGMU' http://localhost:5888/
curl --data-urlencode 'module=git+file:///home/hirobanex/project/MyModule.git' --data-urlencode 'author=SONGMU' http://localhost:5888/

#install by cpanm
cpanm --mirror=http://localhost:5888/orepan Your::Module

#install by carton install
PERL_CARTON_MIRROR=http://localhost:5888/orepan carton install

DESCRIPTION

OrePAN2::Server is DarkPAN server, or OrePAN2 Uploader that use API provided by OrePAN2.

Like uploading to cpan, you can upload to your DarkPAN by http post request.

If you set your DarkPAN url in options(cpanm --mirror, carton PERL_CARTON_MIRROR), you can easily install and manage your modules in your project.

You should set up DarkPAN in private space. If you upload your modules to DarkPAN on public space, you consider to upload your modules to cpan.

USAGE

launch OrePAN2 server instantly

See orepan2-server.pl

attach your plack app.

use Plack::Builder;
use OrePAN2::Server::CLI;
use Your::App;

my $orepan = OrePAN2::Server::CLI->new_with_options(
    delivery_dir     => "orepan",
    delivery_path    => "/",
    authenquery_path => "/authenquery",
    compress_index   => 1,
);

builder {
    mount '/'       => Your::App->to_app();
    mount '/orepan' => $orepan->app;
};

attach your plack with Basic Auth

If your need only DarkPAN Uploader and add Basic Auth with Plack::Middleware::Auth::Basic, you code this.

use Plack::Builder;
use OrePAN2::Server;
use Your::App;

my $orepan_uploader = OrePAN2::Server->uploader(
    directory        => "orepan",
    compress_index   => 1,
);

builder {
    mount '/'            => Your::App->to_app();
    mount '/authenquery' => builder {
        enable "Auth::Basic", authenticator => sub { return ($_[0] eq 'userid' && $_[1] eq 'password') };
        $orepan_uploader;
    }
};

upload by minil release.

There is three step.

minil.toml

[release]
pause_config="/path/to/your-module/.pause"

If you want to know other options, See Minilla.

/path/to/your-module/.pause

upload_uri http://orepan2-server/authenquery
user hirobanex
password password

If you want to know other options, See CPAN::Uploader.

You must pay attention to set your DarkPAN uri as upload_uri.If you don't, you will upload to cpan!

upload command

minil release

SEE ALSO

orepan2-server.pl, OrePAN2, Minilla

LICENSE

Copyright (C) Hiroyuki Akabane.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Hiroyuki Akabane [email protected]

Songmu [email protected]

orepan2-server's People

Contributors

hirobanex avatar

Watchers

 avatar  avatar  avatar

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.