diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab85255ca3..00d4d2666e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,12 +16,21 @@ jobs: - name: Checkout source code uses: actions/checkout@v2 + - name: Install system packages + run: | + sudo apt-get update + sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev + env: + DEBIAN_FRONDEND: NONINTERACTIVE + - name: Set up Python uses: actions/setup-python@v2 with: python-version: 3.8 + - name: Upgrade pip run: pip3 install -U pip + - name: Cache pip dependencies uses: actions/cache@v2 with: @@ -30,6 +39,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- + - name: Install Ralph's python dependencies run: pip3 install -r "${GITHUB_WORKSPACE}/requirements/dev.txt" @@ -86,7 +96,7 @@ jobs: - name: Install system packages run: | sudo apt-get update - sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev + sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev env: DEBIAN_FRONDEND: NONINTERACTIVE @@ -134,7 +144,7 @@ jobs: - name: Install system packages run: | sudo apt-get update - sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev + sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev env: DEBIAN_FRONDEND: NONINTERACTIVE @@ -223,7 +233,7 @@ jobs: - name: Install system packages run: | sudo apt-get update - sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev + sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev libssl-dev env: DEBIAN_FRONDEND: NONINTERACTIVE diff --git a/src/ralph/settings/local.template b/src/ralph/settings/local.template index fe205aaf91..ed8acf2ae3 100644 --- a/src/ralph/settings/local.template +++ b/src/ralph/settings/local.template @@ -1,22 +1,36 @@ from ralph.settings.dev import * # noqa +INSTALLED_APPS += ("corsheaders",) +DEBUG = True +MIDDLEWARE = MIDDLEWARE + ("corsheaders.middleware.CorsMiddleware",) + +CORS_ORIGIN_WHITELIST = ( + "https://localhost:8080", + "https://127.0.0.1:8080", +) + +POSTGRES = True DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': os.environ.get('DATABASE_NAME', 'ralph_ng'), - 'USER': os.environ.get('DATABASE_USER', 'ralph_ng'), - 'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'ralph_ng') or None, - 'HOST': os.environ.get('DATABASE_HOST', '127.0.0.1'), - 'PORT': os.environ.get('DATABASE_PORT', 3306), - 'ATOMIC_REQUESTS': True, - 'TEST': { - 'NAME': 'test_ralph_ng', - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'USER': os.environ.get('DATABASE_USER', 'ralph_ng'), - 'PASSWORD': os.environ.get('DATABASE_PASSWORD', 'ralph_ng') or None, - 'HOST': os.environ.get('DATABASE_HOST', '127.0.0.1'), - 'PORT': os.environ.get('DATABASE_PORT', 3306), - } + "default": { + "ENGINE": "django.db.backends.postgresql" + if POSTGRES + else "django.db.backends.mysql", + "NAME": os.environ.get("DATABASE_NAME", "ralph_ng"), + "USER": os.environ.get("DATABASE_USER", "ralph_ng"), + "PASSWORD": os.environ.get("DATABASE_PASSWORD", "ralph_ng") or None, + "HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"), + "PORT": 54320 if POSTGRES else 3306, + "ATOMIC_REQUESTS": False, + "TEST": { + "NAME": "test_ralph_ng", + "ENGINE": "django.db.backends.postgresql" + if POSTGRES + else "django.db.backends.mysql", + "USER": os.environ.get("DATABASE_USER", "ralph_ng"), + "PASSWORD": os.environ.get("DATABASE_PASSWORD", "ralph_ng") or None, + "HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"), + "PORT": os.environ.get("DATABASE_PORT", 5432 if POSTGRES else 3306), + }, } }