Review email configuration #2144
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OAuth2-OIDC | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
test_oauth2_oidc: | |
name: OAuth2-OIDC | |
runs-on: ubuntu-22.04 | |
services: | |
dexidp: | |
image: ghcr.io/fractal-analytics-platform/oauth:0.1 | |
ports: | |
- 5556:5556 | |
mailpit: | |
image: axllent/mailpit | |
ports: | |
- 1025:1025 | |
- 8025:8025 | |
env: | |
MP_SMTP_AUTH: "sender@example.org:fakepassword" | |
MP_SMTP_AUTH_ALLOW_INSECURE: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Start Postgres | |
run: | | |
sudo systemctl start postgresql.service | |
sudo --login -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';" | |
sudo --login -u postgres createdb fractal_test | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install dependencies | |
run: pip install -e . | |
- name: Run Fractal | |
env: | |
FRACTAL_TASKS_DIR: /dev/fractal/task | |
FRACTAL_RUNNER_WORKING_BASE_DIR: /dev/fractal/base_dir | |
FRACTAL_RUNNER_BACKEND: local | |
JWT_SECRET_KEY: jwt_secret_key | |
JWT_EXPIRE_SECONDS: 1000 | |
# Postgres | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: fractal_test | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
# Dex (OAuth) | |
OAUTH_DEXIDP_CLIENT_ID: client_test_id | |
OAUTH_DEXIDP_CLIENT_SECRET: client_test_secret | |
OAUTH_DEXIDP_REDIRECT_URL: http://localhost:8001/auth/dexidp/callback/ | |
OAUTH_DEXIDP_OIDC_CONFIGURATION_ENDPOINT: http://127.0.0.1:5556/dex/.well-known/openid-configuration | |
FRACTAL_EMAIL_SENDER: sender@example.org | |
FRACTAL_EMAIL_SMTP_SERVER: localhost | |
FRACTAL_EMAIL_SMTP_PORT: 1025 | |
FRACTAL_EMAIL_INSTANCE_NAME: test | |
FRACTAL_EMAIL_RECIPIENTS: recipient1@example.org,recipient2@example.org | |
FRACTAL_EMAIL_USE_STARTTLS: false | |
FRACTAL_EMAIL_USE_LOGIN: true | |
# FRACTAL_EMAIL_PASSWORD and FRACTAL_EMAIL_PASSWORD_KET are generated with the following command | |
# `printf "fakepassword\n" | poetry run fractalctl encrypt-email-password` | |
FRACTAL_EMAIL_PASSWORD: gAAAAABnoQUGHMsDgLkpDtwUtrKtf9T1so44ahEXExGRceAnf097mVY1EbNuMP5fjvkndvwCwBJM7lHoSgKQkZ4VbvO9t3PJZg== | |
FRACTAL_EMAIL_PASSWORD_KEY: lp3j2FVDkzLd0Rklnzg1pHuV9ClCuDE0aGeJfTNCaW4= | |
run: | | |
fractalctl set-db | |
fractalctl start --port 8001 & | |
sleep 2 | |
- name: Run OAuth2 script | |
env: | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
PGHOST: localhost | |
PGPORT: 5432 | |
PGDATABASE: fractal_test | |
run: bash -x scripts/oauth/oauth.sh |