Removes SSO workaround and updates Readme
This commit is contained in:
parent
6b944fd94d
commit
e3045cb9d1
5 changed files with 7 additions and 111 deletions
|
|
@ -34,7 +34,6 @@ COPY --chown=nobody --from=build /app pathfinder
|
||||||
RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh
|
RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh
|
||||||
COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/
|
COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/
|
||||||
COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini
|
COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini
|
||||||
COPY static/pathfinder/Sso.php /var/www/html/pathfinder/vendor/exodus4d/pathfinder_esi/app/Client/Ccp/Sso/Sso.php
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ A fork of techfreak's [Pathfinder-container](https://gitlab.com/techfreak/pathfi
|
||||||
1. **Build & Run it**
|
1. **Build & Run it**
|
||||||
```shell
|
```shell
|
||||||
docker network create web && docker-compose up --build
|
docker network create web && docker-compose up --build
|
||||||
```
|
```
|
||||||
|
|
||||||
1. **Open the http://< your-domain >/setup page.**
|
1. **Open the http://< your-domain >/setup page.**
|
||||||
* Your username is `pf` and password is the password you set in `APP_PASSWORD` in the *.env* file.
|
* Your username is `pf` and password is the password you set in `APP_PASSWORD` in the *.env* file.
|
||||||
|
|
@ -84,10 +84,11 @@ A fork of techfreak's [Pathfinder-container](https://gitlab.com/techfreak/pathfi
|
||||||
|
|
||||||
1. **When everthing works, configure Traefik correctly for production**
|
1. **When everthing works, configure Traefik correctly for production**
|
||||||
* Remove the beta CA server lines [(#87 - #90)](https://github.com/goryn-clade/pathfinder-containers/blob/master/docker-compose.yml#L87-L90) from `docker-compose.yml`.
|
* Remove the beta CA server lines [(#87 - #90)](https://github.com/goryn-clade/pathfinder-containers/blob/master/docker-compose.yml#L87-L90) from `docker-compose.yml`.
|
||||||
* Delete the `letsencrypt/acme.json` configuration file so Let's Encrypt will get a new certificate.</br></br>
|
* Delete the `./letsencrypt/acme.json` configuration file so Let's Encrypt will get a new certificate.</br></br>
|
||||||
|
* If you are not connectin as root user to your host you may need to edit file permissions. Docker-engine creates the `letsencrypt` director as root user, which means that you would need to prefix `sudo` on any future docker commands (`sudo docker-compose up` etc). To avoid doing this you can take ownership of the letsencrypt directory by running `sudo chown -R $USER ./letsencrypt`.
|
||||||
|
|
||||||
|
|
||||||
> Hint: If you need to make changes, perform your edits first, then do `docker-compose down` to bring down the project, and then `docker-compose up --build -d` to rebuild the containers and run them again.
|
> Hint: If you need to make changes, perform your edits first, then do `docker-compose down` to bring down the project, and then `docker-compose up --build -d` to rebuild the containers and run them again.
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
|
|
@ -131,6 +132,7 @@ It's best to create a new SSO application for development work, so that you can
|
||||||
* [exodus4d](https://github.com/exodus4d/) for pathfinder
|
* [exodus4d](https://github.com/exodus4d/) for pathfinder
|
||||||
* [techfreak](https://gitlab.com/techfreak/pathfinder-container) for the original Pathfinder-container project
|
* [techfreak](https://gitlab.com/techfreak/pathfinder-container) for the original Pathfinder-container project
|
||||||
* [johnschultz](https://gitlab.com/johnschultz/pathfinder-container/) for improvements to the traefik config
|
* [johnschultz](https://gitlab.com/johnschultz/pathfinder-container/) for improvements to the traefik config
|
||||||
|
* [tyrheimdaleve](https://github.com/TyrHeimdalEVE/pathfinder_esi) for maintaining the pathfinder_esi dependency
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
* techfreak
|
* techfreak
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ services:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
- "./letsencrypt:/letsencrypt"
|
- "${path}/letsencrypt:/letsencrypt"
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8a3f3f380f3c4e5bcf0fc41ddd5f136865c51f74
|
Subproject commit 906114519dbf5fc034fb464090493cf4273713ef
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Created by PhpStorm.
|
|
||||||
* User: Exodus 4D
|
|
||||||
* Date: 26.12.2018
|
|
||||||
* Time: 16:21
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Exodus4D\ESI\Client\Ccp\Sso;
|
|
||||||
|
|
||||||
use Exodus4D\ESI\Client\Ccp;
|
|
||||||
use Exodus4D\ESI\Config\ConfigInterface;
|
|
||||||
use Exodus4D\ESI\Config\Ccp\Sso\Config;
|
|
||||||
use Exodus4D\ESI\Lib\RequestConfig;
|
|
||||||
use Exodus4D\ESI\Lib\WebClient;
|
|
||||||
use Exodus4D\ESI\Mapper;
|
|
||||||
|
|
||||||
class Sso extends Ccp\AbstractCcp implements SsoInterface {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* verify character data by "access_token"
|
|
||||||
* -> get some basic information (like character id)
|
|
||||||
* -> if more character information is required, use ESI "characters" endpoints request instead
|
|
||||||
* @param string $accessToken
|
|
||||||
* @return RequestConfig
|
|
||||||
*/
|
|
||||||
protected function getVerifyCharacterRequest(string $accessToken) : RequestConfig {
|
|
||||||
$requestOptions = [
|
|
||||||
'headers' => $this->getAuthHeader($accessToken, 'Bearer')
|
|
||||||
];
|
|
||||||
|
|
||||||
return new RequestConfig(
|
|
||||||
WebClient::newRequest('GET', $this->getVerifyUserEndpointURI()),
|
|
||||||
$requestOptions,
|
|
||||||
function($body) : array {
|
|
||||||
$characterData = [];
|
|
||||||
if(!$body->error){
|
|
||||||
$characterData = (new Mapper\Sso\Character($body))->getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $characterData;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get a valid "access_token" for oAuth 2.0 verification
|
|
||||||
* -> verify $authCode and get NEW "access_token"
|
|
||||||
* $requestParams['grant_type] = 'authorization_code'
|
|
||||||
* $requestParams['code] = 'XXXX'
|
|
||||||
* -> request NEW "access_token" if isset:
|
|
||||||
* $requestParams['grant_type] = 'refresh_token'
|
|
||||||
* $requestParams['refresh_token] = 'XXXX'
|
|
||||||
* @param array $credentials
|
|
||||||
* @param array $requestParams
|
|
||||||
* @return RequestConfig
|
|
||||||
*/
|
|
||||||
protected function getAccessRequest(array $credentials, array $requestParams = []) : RequestConfig {
|
|
||||||
$requestOptions = [
|
|
||||||
'form_params' => $requestParams,
|
|
||||||
'auth' => $credentials
|
|
||||||
];
|
|
||||||
|
|
||||||
return new RequestConfig(
|
|
||||||
WebClient::newRequest('POST', $this->getVerifyAuthorizationCodeEndpointURI()),
|
|
||||||
$requestOptions,
|
|
||||||
function($body) : array {
|
|
||||||
$accessData = [];
|
|
||||||
if(!$body->error){
|
|
||||||
$accessData = (new Mapper\Sso\Access($body))->getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $accessData;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getAuthorizationEndpointURI() : string {
|
|
||||||
return '/oauth/authorize';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getVerifyUserEndpointURI() : string {
|
|
||||||
return '/oauth/verify';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getVerifyAuthorizationCodeEndpointURI() : string {
|
|
||||||
return '/oauth/token';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return ConfigInterface
|
|
||||||
*/
|
|
||||||
protected function getConfig() : ConfigInterface {
|
|
||||||
return ($this->config instanceof ConfigInterface) ? $this->config : $this->config = new Config();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue