From e3045cb9d109f5560d64b8106a9dd7404d4bdd80 Mon Sep 17 00:00:00 2001 From: soneill Date: Fri, 10 Sep 2021 11:30:35 +1200 Subject: [PATCH] Removes SSO workaround and updates Readme --- Dockerfile | 1 - README.md | 8 +-- docker-compose.yml | 2 +- pathfinder | 2 +- static/pathfinder/Sso.php | 105 -------------------------------------- 5 files changed, 7 insertions(+), 111 deletions(-) delete mode 100644 static/pathfinder/Sso.php diff --git a/Dockerfile b/Dockerfile index b834089..ee3464b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 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/Sso.php /var/www/html/pathfinder/vendor/exodus4d/pathfinder_esi/app/Client/Ccp/Sso/Sso.php WORKDIR /var/www/html EXPOSE 80 diff --git a/README.md b/README.md index 765f3e6..1cb03a7 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ A fork of techfreak's [Pathfinder-container](https://gitlab.com/techfreak/pathfi 1. **Build & Run it** ```shell docker network create web && docker-compose up --build - ``` + ``` 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. @@ -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** * 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.

+ * Delete the `./letsencrypt/acme.json` configuration file so Let's Encrypt will get a new certificate.

+ * 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.
@@ -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 * [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 +* [tyrheimdaleve](https://github.com/TyrHeimdalEVE/pathfinder_esi) for maintaining the pathfinder_esi dependency ## Authors * techfreak diff --git a/docker-compose.yml b/docker-compose.yml index c45c7ff..f159a7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -94,7 +94,7 @@ services: - "8080:8080" volumes: - "/var/run/docker.sock:/var/run/docker.sock:ro" - - "./letsencrypt:/letsencrypt" + - "${path}/letsencrypt:/letsencrypt" networks: - web restart: always diff --git a/pathfinder b/pathfinder index 8a3f3f3..9061145 160000 --- a/pathfinder +++ b/pathfinder @@ -1 +1 @@ -Subproject commit 8a3f3f380f3c4e5bcf0fc41ddd5f136865c51f74 +Subproject commit 906114519dbf5fc034fb464090493cf4273713ef diff --git a/static/pathfinder/Sso.php b/static/pathfinder/Sso.php deleted file mode 100644 index 2f33551..0000000 --- a/static/pathfinder/Sso.php +++ /dev/null @@ -1,105 +0,0 @@ - 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(); - } -} \ No newline at end of file