Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple private bower registry

License

NotificationsYou must be signed in to change notification settings

Hacklone/private-bower

Repository files navigation

private-bower

The ultimate private bower server.

Twitter:@private_bower,#private_bower

Features

  • Register private packages
  • Fallback to public packages
  • Cache public registry
  • Cache public git repositories
  • Cache public svn repositories
  • Web UI with package details
  • Web UI package management
  • Blacklist public packages
  • Whitelist public packages

Installation

Install

npm install -g private-bower

Run

private-bower

Run with config file specified

private-bower --config ./myBowerConfig.json

If there's no private package with requested package name the servers calls through to the public bower registry.

Parameters

namedescription
--helpprint out help
--configpath to config file (Must be a valid json)

Config file

Must be a valid JSON

{"registryFile":"./bowerRepository.json","timeout":144000,"server":{"port":5678,"hostName":null,"siteBaseUrl":null},"public":{"disabled":false,"registry":"http://bower.herokuapp.com/packages","registryFile":"./bowerRepositoryPublic.json","whitelist":[],"blacklist":[]},"authentication":{"enabled":false,"key":"password"},"repositoryCache":{"cachePrivate":false,"git":{"enabled":false,"cacheDirectory":"./gitRepoCache","host":"localhost","port":6789,"protocol":"git","publicAccessURL":null,"refreshTimeout":10,"refreshDisabled":false},"svn":{"enabled":false,"cacheDirectory":"./svnRepoCache","host":"localhost","port":7891,"protocol":"svn","publicAccessURL":null,"refreshTimeout":10,"refreshDisabled":false}},"proxySettings" :{"enabled":false,"host":"proxy","username":"name","password":"pass","port":8080,"tunnel":false},"log4js" :{"enabled":false,"configPath":"log4js.conf.json"}}
namedescriptiondefault
server.portPort on which the private bower server will listen5678 (process.env.PORT if set)
server.hostNameHost name on which the private bower server will listennull (process.env.IP if set)
server.siteBaseUrlLoad private bower server on a specific path, useful for using a reverse proxynull
registryFileFile for persisting private packages (must be a valid json)./bowerRepository.json
timeoutServer package timeout144 000
public.disabledDisable fallback feature for public packagesfalse
public.registryPublic bower registry's urlhttps://registry.bower.io
public.registryFileFile for persisting public packages (must be a valid json)./bowerRepositoryPublic.json
public.whitelistDefine public packages that are allowed to be installed[]
public.blacklistDefine public packages that are not allowed to be installed[]
authentication.enabledAuthentication enabled for registering packagesfalse
authentication.keyAuthentication key (Auth-Key header)password
repositoryCache.(svn, git).enabledPublic repository caching enabledfalse
repositoryCache.cachePrivateAlso cache privately registered packagesfalse
repositoryCache.(svn, git).hostServer's host name for repository accesslocalhost
repositoryCache.(svn, git).portPort to open repository server on7891, 6789
repositoryCache.(svn, git).protocolProtocol the mirrored repositories will usegit, svn, https, http
repositoryCache.(svn, git).publicAccessURLPublic address to access repository cache (useful if repository is behind an apache)null
repositoryCache.(svn, git).cacheDirectoryDirectory where the public repository cache will save repositories./svnRepoCache, ./gitRepoCache
repositoryCache.(svn, git).refreshTimeoutTime to wait between repository cache refresh (minutes)10 minutes
repositoryCache.(svn, git).refreshDisabledDisable automatic updates of the cached repository source codefalse
repositoryCache.(svn, git).parameters.XCustom parameters for git-daemon and svnserveundefined
proxySettings.enabledEnable the proxy, use the proxy to call the bower remote repofalse
proxySettings.hostProxy hostproxy
proxySettings.usernameProxy usernamename
proxySettings.passwordProxy passwordpass
proxySettings.portProxy port8080
proxySettings.tunnelUse tunnel?false
log4js.enabledUse log4js ?false
log4js.configPathLog4js configuration file. See: log4js-node for configuration optionsnone

Usage

Web interface

Convenient way for viewing your packages in a browser. The web interface will only list your private packages, it willnot list the public packages if you have a public registry enabled. However, when searching for packages in bower, thepublic ones will show up just fine.

http://localhost:5678/

Project

Within your project, you will need to create a .bowerrc file containing the URL of your private bower server:

{"registry":"http://yourPrivateBowerRepo:5678","timeout":300000}

If you are using private bower withserver.siteBaseURL option, you need to add the same path the registry url in your .bowerrc file:

Config

{"server": {"port":6789,"hostName":"yourPrivateBowerRepo","setBaseURL":"/my-private-bower"  }}

.bowerrc

{"registry":"http://yourPrivateBowerRepo:6789/my-private-bower","timeout":300000}

List packages

GET

bower-server:5678/packages

Search packages

bower search [packageName]

Register package

bower register [packageName] [gitRepo]

orPOST

bower-server:5678/packages

{ "name": "package-name", "url": "git://repoPath" }

orPOST

bower-server:5678/packages/<package name>

{ "url": "git://repoPath" }

Register packages

POST

bower-server:5678/packages

[ { "name": "package-name", "url": "git://repoPath" } ]

Remove package

DELETE

bower-server:5678/packages/<package name>

Remove packages

DELETE

bower-server:5678/packages

["package-name"]

Restart server

POST

bower-server:5678/restart

Refresh caches

POST

bower-server:5678/refresh

Authentication

Authentication can be enabled for the following features:

  • Register package
  • Register packages
  • Remove package
  • Remove packages
  • Restart server

AddAuth-Key header to request.

Auth-Key = password

Log4js configuration

There are two appenders set in the example configuration.You need to remove one of the two if you want to use it.fileDate appender will write the log to a file which will be rotated daily.Console will write the logging to the console in the log4js format.You need to set the replaceConsole to true if you want to write the logging to the log4j appenders.See github.com/nomiddlename/log4js-node for more information

Tips for usage

Server as a service

Use behind proxy

git config --global url."https://".insteadOf git://

Calling the API

  • do not forget to set theContent-Type header toapplication/json

Contributing

Please read the rules of contributing on thecontribution page.

License

The MIT License (MIT)

Copyright (c) 2014 Hacklonehttps://github.com/Hacklone

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

A simple private bower registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors24


[8]ページ先頭

©2009-2025 Movatter.jp