Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,21 @@ services:
JWT_SECRET: DH8kSxcflUVfNRdkEiJJCn2dOOKI3qfw
POSTGRES_URI: postgresql+psycopg://zimfarm:zimpass@zimfarm-db:5432/zimfarm
ALEMBIC_UPGRADE_HEAD_ON_START: true
DEBUG: true
INIT_USERNAME: admin
INIT_PASSWORD: admin
ALLOWED_ORIGINS: http://localhost:8003
ARTIFACTS_UPLOAD_URI: s3+http://minio:9000/?keyId=minio_key&secretAccessKey=minio_secret&bucketName=org-kiwix-dev-artifacts
LOGS_UPLOAD_URI: s3+http://minio:9000/?keyId=minio_key&secretAccessKey=minio_secret&bucketName=org-kiwix-dev-logs
ZIM_UPLOAD_URI: s3+http://minio:9000/?keyId=minio_key&secretAccessKey=minio_secret&bucketName=org-kiwix-dev-zims
OAUTH_JWKS_URI: https://ory.login-staging.kiwix.org/.well-known/jwks.json
Comment thread
audiodude marked this conversation as resolved.
OAUTH_ISSUER: https://ory.login-staging.kiwix.org
OAUTH_OIDC_CLIENT_ID: 38302485-7f3d-4e88-b1b3-ec02fb92ec8c
OAUTH_OIDC_LOGIN_REQUIRE_2FA: true
OAUTH_SESSION_AUDIENCE_ID: 309693e7-ad5e-4379-bf93-ba89314230fd
OAUTH_SESSION_LOGIN_REQUIRE_2FA: true
CREATE_NEW_OAUTH_ACCOUNT: false
AUTH_MODES: local,oauth-session
networks:
- wp1bot-dev
depends_on:
Expand Down
5 changes: 4 additions & 1 deletion docker/zimfarm/zimfarm_ui_dev/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"ZIMFARM_WEBAPI": "http://localhost:8004/v2"
"ZIMFARM_WEBAPI": "http://localhost:8004/v2",
"OAUTH_BASE_URL": "https://ory.login-staging.kiwix.org",
Comment thread
audiodude marked this conversation as resolved.
"OAUTH_MODE": "session",
"LOGIN_MODES": ["local"]
}
2 changes: 1 addition & 1 deletion wp1/logic/builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ def test_handle_zim_generation(
"wp1.logic.builder.utcnow",
return_value=datetime.datetime(2022, 12, 25, 0, 1, 2),
)
@patch("wp1.logic.builder.zimfarm.get_zimfarm_token", return_value="test_token")
@patch("wp1.logic.builder.zimfarm.token_provider", return_value="test_token")
def test_handle_zim_generation_long_title(
self, mock_utcnow, mock_get_zimfarm_token
):
Expand Down
14 changes: 7 additions & 7 deletions wp1/web/builders_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def test_create_zim_file_for_builder(
patched_request_zimfarm_task.assert_called_once()
with self.wp10db.cursor() as cursor:
cursor.execute(
"SELECT z_task_id, z_status FROM zim_tasks " "WHERE z_selection_id = 3"
"SELECT z_task_id, z_status FROM zim_tasks WHERE z_selection_id = 3"
)
data = cursor.fetchone()

Expand Down Expand Up @@ -665,7 +665,7 @@ def test_create_zim_file_for_builder_400(self, patched_request_zimfarm_task):
@patch("wp1.zimfarm.request_zimfarm_task")
# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_no_title(
self, mock_get_token, mock_requests, mock_request_zimfarm_task
):
Expand All @@ -685,7 +685,7 @@ def test_create_zim_file_for_builder_no_title(
@patch("wp1.zimfarm.request_zimfarm_task")
# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_too_long_title(
self, mock_get_token, mock_requests, mock_request_zimfarm_task
):
Expand All @@ -706,7 +706,7 @@ def test_create_zim_file_for_builder_too_long_title(
@patch("wp1.zimfarm.request_zimfarm_task")
# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_too_long_description(
self, mock_get_token, mock_requests, mock_request_zimfarm_task
):
Expand All @@ -727,7 +727,7 @@ def test_create_zim_file_for_builder_too_long_description(
@patch("wp1.zimfarm.request_zimfarm_task")
# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_too_long_long_description(
self, mock_get_token, mock_requests, mock_request_zimfarm_task
):
Expand All @@ -752,7 +752,7 @@ def test_create_zim_file_for_builder_too_long_long_description(
@patch("wp1.zimfarm.request_zimfarm_task")
# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_too_short_long_description(
self, mock_get_token, mock_requests, mock_request_zimfarm_task
):
Expand All @@ -775,7 +775,7 @@ def test_create_zim_file_for_builder_too_short_long_description(

# Mock requests to avoid actual HTTP calls
@patch("wp1.zimfarm.requests")
@patch("wp1.zimfarm.get_zimfarm_token")
@patch("wp1.zimfarm.token_provider.get_access_token")
def test_create_zim_file_for_builder_too_many_articles(
self, token_mock, requests_mock
):
Expand Down
Loading
Loading