diff --git a/Dockerfile b/Dockerfile index 6350961..1858b5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,13 +10,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ supervisor \ # Others net-tools curl less nano \ + # PHP extensions needed by the OIDC helpers + libzip-dev libpng-dev libicu-dev libpq-dev \ + && docker-php-ext-install pdo_mysql \ + && docker-php-ext-install zip \ + && docker-php-ext-install intl \ # Clean up && rm -rf /var/lib/apt/lists/* +# ------------------------------------------------------------- +# Install Composer (stand‑alone) +# ------------------------------------------------------------- +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + # Apache on 8069 COPY apache_ports.conf /etc/apache2/ports.conf COPY apache_vhost.conf /etc/apache2/sites-available/000-default.conf COPY web/ /var/www/html/ +# Set up composer +WORKDIR /var/www/html/ +RUN composer install --no-dev --optimize-autoloader --no-interaction # API on 5000 RUN mkdir -p /opt/Fitness diff --git a/web/login/.env b/web/login/.env deleted file mode 100644 index 675657e..0000000 --- a/web/login/.env +++ /dev/null @@ -1,9 +0,0 @@ -OIDC_CLIENT_ID=fitness-oidc -OIDC_CLIENT_SECRET=egebuqzZfVnjjBG9JDQ8tjW3TzV9gJurvT7qfB6c2SX2nPBNeaGycDfx4788QzJd -OIDC_REDIRECT_URI=https://fitness.matt-cloud.com/pgapi/auth/oidc/callback -OIDC_AUTH_ENDPOINT=https://auth.matt-cloud.com/oidc/auth -OIDC_TOKEN_ENDPOINT=https://auth.matt-cloud.com/oidc/token -OIDC_USERINFO_ENDPOINT=https://auth.matt-cloud.com/oidc/userinfo -OIDC_LOGOUT_ENDPOINT=https://auth.matt-cloud.com/logout -# Optional: the default redirect after logout -OIDC_POST_LOGOUT_REDIRECT_URI=https://fitness.matt-cloud.com/ \ No newline at end of file diff --git a/web/login/callback.php b/web/login/callback.php deleted file mode 100644 index b6b1534..0000000 --- a/web/login/callback.php +++ /dev/null @@ -1,59 +0,0 @@ -exchangeCode($code); - - // Validate ID token (minimal). - $idInfo = $oidc->validateIDToken($tokens['id_token'], $nonce); - - // Get userinfo (includes groups because of scope). - $userInfo = $oidc->getUserInfo($tokens['access_token']); - - // Store everything we need in the session. - $_SESSION['user'] = [ - 'id_token' => $tokens['id_token'], - 'access_token'=> $tokens['access_token'], - 'refresh_token'=> $tokens['refresh_token'] ?? null, - 'expires_in' => $tokens['expires_in'] ?? null, - 'id_info' => $idInfo, - 'user_info' => $userInfo, - ]; -} catch (\Throwable $e) { - http_response_code(500); - exit('Error during OIDC exchange: ' . $e->getMessage()); -} - -// Clean up the query string (code, state) by redirecting to the home page. -header('Location: /'); -exit; \ No newline at end of file diff --git a/web/login/composer.json b/web/login/composer.json deleted file mode 100644 index 365b572..0000000 --- a/web/login/composer.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "require": { - "guzzlehttp/guzzle": "^7.0", - "firebase/php-jwt": "^6.0" - } -} \ No newline at end of file diff --git a/web/login/config.php b/web/login/config.php deleted file mode 100644 index 7495633..0000000 --- a/web/login/config.php +++ /dev/null @@ -1,23 +0,0 @@ -load(); - -/** - * Basic OIDC configuration – keep all secrets out of source‑control. - */ -define('OIDC_CLIENT_ID', getenv('OIDC_CLIENT_ID')); -define('OIDC_CLIENT_SECRET', getenv('OIDC_CLIENT_SECRET')); -define('OIDC_REDIRECT_URI', getenv('OIDC_REDIRECT_URI')); -define('OIDC_AUTH_ENDPOINT', getenv('OIDC_AUTH_ENDPOINT')); -define('OIDC_TOKEN_ENDPOINT', getenv('OIDC_TOKEN_ENDPOINT')); -define('OIDC_USERINFO_ENDPOINT', getenv('OIDC_USERINFO_ENDPOINT')); -define('OIDC_LOGOUT_ENDPOINT', getenv('OIDC_LOGOUT_ENDPOINT')); -define('OIDC_POST_LOGOUT_REDIRECT_URI', getenv('OIDC_POST_LOGOUT_REDIRECT_URI')); \ No newline at end of file diff --git a/web/login/index.php b/web/login/index.php deleted file mode 100644 index 1e1c6eb..0000000 --- a/web/login/index.php +++ /dev/null @@ -1,38 +0,0 @@ - - - -
- -You are not logged in.
- - -Logged in as: =htmlspecialchars($_SESSION['user']['user_info']['name'] ?? 'N/A')?>
- -=htmlspecialchars(json_encode($_SESSION['user']['user_info'], JSON_PRETTY_PRINT))?>-
=htmlspecialchars(json_encode($_SESSION['user']['id_info'], JSON_PRETTY_PRINT))?>-
Upload permissions disabled. Contact administrator.
- - -Upload images to display them here
-| ID | Name | Phone | Photo |
|---|