Skip to content

Commit

Permalink
feat(#458): add auth modules and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 5, 2022
1 parent da58130 commit b34ec6a
Show file tree
Hide file tree
Showing 19 changed files with 1,135 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ tasks:
cd $GITPOD_REPO_ROOT/docs/nuxt && yarn
cd $GITPOD_REPO_ROOT && yarn build:docs
command: |
# Setup Gitpod .env
$GITPOD_REPO_ROOT/.gitpod/scripts/env-setup.sh
# Start Drupal
cd $GITPOD_REPO_ROOT/docs/drupal && ddev start -y && ddev drush uli
cd $GITPOD_REPO_ROOT/docs/drupal && ddev start -y && ddev gitpod-config && ddev drush uli
# Display welcome message
cd $GITPOD_REPO_ROOT && cat .gitpod/WELCOME.md
Expand Down
4 changes: 4 additions & 0 deletions .gitpod/scripts/env-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu -o pipefail

echo -en "OAUTH_CALLBACK=https://3000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}/callback" > docs/.env
1 change: 1 addition & 0 deletions docs/drupal/.ddev/commands/web/drupal-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

composer install
drush -y tome:install
drush cache:rebuild
16 changes: 16 additions & 0 deletions docs/drupal/.ddev/commands/web/gitpod-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

## Description: Update Gitpod configuration in Drupal
## Usage: gitpod-config
## Example: "ddev gitpod-config"

# Update the Consumer redirect URL.
drush php-eval '
$consumer = \Drupal::service("entity.repository")->loadEntityByUuid("consumer", "1a6b8816-26de-4b70-bcdf-919600542f03");
$consumer->redirect = getenv("OAUTH_CALLBACK") ?: "http://localhost:3000/callback";
# var_dump($consumer->redirect->value);
$consumer->save();
'

# Rebuild cache.
drush cache:rebuild
8 changes: 8 additions & 0 deletions docs/drupal/.ddev/docker-compose.env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.6'

services:
web:
env_file:
- "$PWD/../.env"
volumes:
- "$PWD/../.env:/var/www/html/.env"
1 change: 1 addition & 0 deletions docs/drupal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"drupal/decoupled_router": "2.0.3",
"drupal/druxt": "^1.1.1",
"drupal/jsonapi_hypermedia": "^1.6",
"drupal/simple_oauth": "^5.2",
"drupal/tome": "^1.6",
"drush/drush": "^11.0"
},
Expand Down
Loading

0 comments on commit b34ec6a

Please sign in to comment.