-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b1a87fb
Showing
10 changed files
with
509 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ENDPOINT=https://gitlab.example.com/api/v4/ | ||
API_KEY=123456789ABCDEFGHIJKL | ||
METHOD=ssh | ||
PORT=22 | ||
INCLUDE_BRANCHES=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/confs/static-repos.json | ||
/vendor | ||
/composer.lock | ||
/.idea | ||
/.php_cs.cache | ||
/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Config; | ||
use Symfony\Component\Finder\Finder; | ||
|
||
$finder = Finder::create() | ||
->in(__DIR__) | ||
->name('*.php') | ||
->exclude('vendor') | ||
->ignoreDotFiles(true) | ||
->ignoreVCS(true); | ||
|
||
return Config::create() | ||
->setRules([ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
]) | ||
->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Gitlab NPM repository | ||
|
||
Small script that loops through all branches and tags of all projects in a Gitlab installation | ||
and if it contains a `package.json`, and has a non empty `name` it is added. | ||
|
||
This script is not a full repository like npmjs.com, but only implements the install command. | ||
|
||
## Installation | ||
|
||
1. Run `composer install` | ||
2. Copy `.env.example` to `.env` | ||
3. Get a "personal access token" with scopes: `api,read_repository` | ||
4. For some reason npm sends `/` like `%2F`, so you need to set `AllowEncodedSlashes NoDecode` inside your `<VirtualHost>` | ||
|
||
## Usage | ||
|
||
Simply include a package.json in your project, all branches and tags using | ||
[semver](https://semver.org/) will be detected. "v1.2.3" will be converted to "1.2.3" | ||
|
||
To use your repository, use this command to install the packages: | ||
``` | ||
npm install project-name --registry http://npm.gitlab.localhost/ | ||
``` | ||
|
||
## Warning | ||
|
||
This script could allow access to private repositories. Because I haven't figured out the | ||
correct way for npm authorization, the current .htaccess restricts to local usage. | ||
So be sure to update the .htaccess to match your requirements. | ||
|
||
## Author | ||
* [Maglr](https://github.com/maglr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"require": { | ||
"m4tthumphrey/php-gitlab-api": "^9.0", | ||
"php-http/guzzle6-adapter": "^1.1", | ||
"vlucas/phpdotenv": "^3.4", | ||
"ext-json": "*", | ||
"ext-curl": "*" | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"chmod 777 cache || true" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DirectoryIndex /index.php | ||
FallbackResource /index.php | ||
|
||
Require ip ::1 | ||
Require ip 127.0.0.1 | ||
Require ip 192.168.1 |
Oops, something went wrong.