Skip to content

Commit

Permalink
Rewrite code using composer
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-bongers committed Sep 20, 2019
1 parent 0e899a3 commit 8158948
Show file tree
Hide file tree
Showing 15 changed files with 540 additions and 922 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Transip/
vendor/
log.txt
config/transip.php
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] -
### Changed
- Complete rewrite of the code base
- Now using composer for installation
- No more need to manually download the TransIp API library

### Removed
- Outdated PurplePixie PhpDns library

## [1.0.1] - 2019-09-12
### Changed
- Replaced deprecated constructors

## [1.0.0] - 2018-12-23
### Added
- Write output to log file for easier debugging.
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@ I created this script to request wildcard SSL certificates from [Let's Encrypt][
challenge for which you need to create a DNS (TXT) record. [TransIP][3] has an API which allows you to automate this.
When you need to renew your certificate you also need to perform the DNS-01 challenge again. This should happen automatically.

Requirements
------------
## Requirements
* PHP with XML and SOAP extensions enabled
* At least [Certbot][2] v0.22 for ACME-v2 support

Installation
------------
## Installation
* Run `composer install --no-dev`
* Copy `config/transip.example.php` to `config/transip.php`
* Acquire an API key for TransIP in [your account][4] on their website
* Edit `config/transip.php` and set your login and private key. Make sure you set the access to this file to only allow your user to read the contents of this file (on linux `chmod og-rwx config/transip.php`)

* Download the [TransIP API][3] and extract the "Transip" folder in this project's directory
* Aquire an API key for TransIP in [your account][4] on their website
* Edit the Transip/ApiSettings.php and set your login and private key. Make sure you set the access to this file to only allow your user to read the contents of this file (on linux `chmod og-rwx Transip/ApiSettings.php`)

Request a wildcard certificate
------------
## Request a wildcard certificate

Use this command to request the certificate. Replace "/path/to/" with the actual path on your computer.
```
```shell
certbot --server https://acme-v02.api.letsencrypt.org/directory \
certonly --manual --preferred-challenges=dns \
--manual-auth-hook /path/to/auth-hook \
Expand All @@ -34,8 +31,7 @@ If you need to do some testing use the staging environment from Let's Encrypt:
--server https://acme-staging-v02.api.letsencrypt.org/directory
```

Contributors
------------
## Contributors

When creating an issue please include a detailed description of what you are trying to execute and any output you receive. Feel free to fork the project and create a pull request. Make sure your code complies with the [PSR-1][5] and [PSR-2][6] coding standards.

Expand Down
7 changes: 5 additions & 2 deletions auth-hook
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/php
<?php
$_SERVER['ACME_HOOK'] = 'challenge';
require_once('hooks.php');
require_once('./vendor/autoload.php');

use \RoyBongers\CertbotTransIpDns01\HookLoader;

new HookLoader(HookLoader::AUTH_HOOK);
7 changes: 5 additions & 2 deletions cleanup-hook
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/php
<?php
$_SERVER['ACME_HOOK'] = 'cleanup';
require_once('hooks.php');
require_once('./vendor/autoload.php');

use \RoyBongers\CertbotTransIpDns01\HookLoader;

new HookLoader(HookLoader::CLEANUP_HOOK);
20 changes: 20 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"require": {
"php": "^7.0",
"ext-soap": "*",
"ext-xml": "*",
"transip/transip-api-php": "^5.16",
"monolog/monolog": "^2.0",
"purplepixie/phpdns": "^2.0"
},
"autoload": {
"psr-4": {
"RoyBongers\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"RoyBongers\\Tests\\": "tests/"
}
}
}
224 changes: 224 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/transip.php.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'login' => '',
'private_key' => '',
];
Loading

0 comments on commit 8158948

Please sign in to comment.