Skip to content

Commit

Permalink
Merge branch '1.1.1'
Browse files Browse the repository at this point in the history
* 1.1.1:
  registering a public package for the first time, hit count fixed #157
  Added tip for API usage in README.md #154
  Added process.env.PORT and process.env.IP support #141
  Added help text to package detail errors #149
  • Loading branch information
Hacklone committed Jul 26, 2015
2 parents ed79bf1 + 1a5478f commit d3e1bfd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ Must be a valid JSON

| name | description | default |
|--------------------------------------------|--------------------------------------------------------------------------------------|---------------------------------------|
| port | Port on which the private bower server will listen | 5678 |
| port | Port on which the private bower server will listen | 5678 (process.env.PORT if set to null)|
| hostName | Host name on which the private bower server will listen | null (process.env.IP if set to null) |
| registryFile | File for persisting private packages (must be a valid json) | ./bowerRepository.json |
| timeout | server package timeout | 144 000 |
| public.disabled | Disable fallback feature for public packages | false |
Expand Down Expand Up @@ -244,6 +245,9 @@ Add ```Auth-Key``` header to request.
##Use behind proxy
> git config --global url."https://".insteadOf git://
##Calling the API
- do not forget to set the ```Content-Type``` header to ```application/json```

#License
> The MIT License (MIT)
Expand Down
1 change: 1 addition & 0 deletions bower.conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"port": 5678,
"hostName": null,
"registryFile": "./bowerRepository.json",
"timeout": 144000,
"public": {
Expand Down
4 changes: 2 additions & 2 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module.exports = function Application() {
repoCacheHandler.start(repoCacheOptions);
}

function _listen(port) {
_listeningServer = _serverApp.listen(port);
function _listen(port, hostName) {
_listeningServer = _serverApp.listen(port, hostName);
}

function _serveStatic(staticPath) {
Expand Down
3 changes: 3 additions & 0 deletions lib/infrastructure/configurationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ module.exports = function ConfigurationManager() {
function setConfigValues() {
self.config.registryFile = getRelativeFilePath(configFile.registryFile || './bowerRepository.json');

self.config.port = self.config.port || utils.process.env.PORT;
self.config.hostName = self.config.hostName || utils.process.env.IP;

self.config.public = self.config.public || {};

self.config.public.registryFile = getRelativeFilePath(configFile.public.registryFile || './bowerRepositoryPublic.json');
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = function Main() {
res.status(500).send('Something wen\'t wrong :(');
});

application.listen(_config.port);
application.listen(_config.port, _config.hostName);
}

function _handleErrors() {
Expand Down
2 changes: 1 addition & 1 deletion lib/service/packageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ module.exports = function PackageManager() {
var privatePackage = {
name: packageName,
url: pack.url,
hits: publicPackage.hits
hits: 1
};

privatePackageStore.registerPackages([privatePackage]);
Expand Down
2 changes: 1 addition & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h3 style="line-height: 1.5em; cursor: pointer;" class="text-primary" ng-click="
Loading package details...
</span>
<span ng-if="package.detailsError" class="text-danger">
Failed to load package details!
Failed to load package details! (Your private-bower server needs read access to this Git repository!)
</span>
</div>
<div ng-if="package.details" class="details">
Expand Down

0 comments on commit d3e1bfd

Please sign in to comment.