Skip to content
Browse files

Add stream context options documetation

  • Loading branch information...
1 parent 7ef7044 commit 8b29cf06abcd63e246aa540b6c5022c6b1c69336 @sandermarechal sandermarechal committed with
Showing with 60 additions and 2 deletions.
  1. +13 −2 doc/04-schema.md
  2. +7 −0 doc/05-repositories.md
  3. +40 −0 doc/articles/handling-private-packages-with-satis.md
View
15 doc/04-schema.md
@@ -504,8 +504,10 @@ ignored.
The following repository types are supported:
* **composer:** A composer repository is simply a `packages.json` file served
- via HTTP, that contains a list of `composer.json` objects with additional
- `dist` and/or `source` information.
+ via the network (HTTP, FTP, SSH), that contains a list of `composer.json`
+ objects with additional `dist` and/or `source` information. The `packages.json`
+ file is loaded using a PHP stream. You can set extra options on that stream
+ using the `options` parameter.
* **vcs:** The version control system repository can fetch packages from git,
svn and hg repositories.
* **pear:** With this you can import any pear repository into your composer
@@ -525,6 +527,15 @@ Example:
"url": "http://packages.example.com"
},
{
+ "type": "composer",
+ "url": "https://packages.example.com",
+ "options": {
+ "ssl": {
+ "verify_peer": "true"
+ }
+ }
+ },
+ {
"type": "vcs",
"url": "https://github.com/Seldaek/monolog"
},
View
7 doc/05-repositories.md
@@ -148,6 +148,13 @@ hash changed.
This field is optional. You probably don't need it for your own custom
repository.
+#### stream options
+
+The `packages.json` file is loaded using a PHP stream. You can set extra options
+on that stream using the `options` parameter. You can set any valid PHP stream
+context option. See [Context options and parameters](http://nl3.php.net/manual/en/context.php)
+for more information.
+
### VCS
VCS stands for version control system. This includes versioning systems like
View
40 doc/articles/handling-private-packages-with-satis.md
@@ -85,3 +85,43 @@ itself.
"company/package3": "dev-master"
}
}
+
+### Security
+
+To secure your private repository you can host it over SSH or SSL using a client
+certificate. In your project you can use the `options` parameter to specify the
+connection options for the server.
+
+Example using a custom repository using SSH (requires the SSH2 PECL extension):
+
+ {
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "ssh2.sftp://example.org",
+ "options": {
+ "ssh2": {
+ "username": "composer",
+ "pubkey_file": "/home/composer/.ssh/id_rsa.pub",
+ "privkey_file": "/home/composer/.ssh/id_rsa"
+ }
+ }
+ }
+ ]
+ }
+
+Example using HTTP over SSL using a client certificate:
+
+ {
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://example.org",
+ "options": {
+ "ssl": {
+ "cert_file": "/home/composer/.ssl/composer.pem",
+ }
+ }
+ }
+ ]
+ }

0 comments on commit 8b29cf0

Please sign in to comment.
Something went wrong with that request. Please try again.