update JCLOUDE to JCLOUDE
This commit is contained in:
parent
bedad8d095
commit
8226a31793
8
.github/workflows/main.yaml
vendored
8
.github/workflows/main.yaml
vendored
@ -90,8 +90,8 @@ jobs:
|
|||||||
name: Client
|
name: Client
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
JCLOUDE _ADMIN_USER_EMAIL: playwright@example.com
|
JCLOUDE_ADMIN_USER_EMAIL: playwright@example.com
|
||||||
JCLOUDE _ADMIN_USER_PASSWORD: playwright
|
JCLOUDE_ADMIN_USER_PASSWORD: playwright
|
||||||
BASE_URL: http://test_site:8000
|
BASE_URL: http://test_site:8000
|
||||||
|
|
||||||
services:
|
services:
|
||||||
@ -169,8 +169,8 @@ jobs:
|
|||||||
working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard
|
working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard
|
||||||
run: |
|
run: |
|
||||||
bench --site test_site execute jcloude.jcloude.pagetype.team.test_team.create_test_jcloude_admin_team \
|
bench --site test_site execute jcloude.jcloude.pagetype.team.test_team.create_test_jcloude_admin_team \
|
||||||
--kwargs "{\"email\": \"${JCLOUDE _ADMIN_USER_EMAIL}\", \"free_account\": True, \"skip_onboarding\": True}"
|
--kwargs "{\"email\": \"${JCLOUDE_ADMIN_USER_EMAIL}\", \"free_account\": True, \"skip_onboarding\": True}"
|
||||||
bench --site test_site set-password "$JCLOUDE _ADMIN_USER_EMAIL" "$JCLOUDE _ADMIN_USER_PASSWORD"
|
bench --site test_site set-password "$JCLOUDE_ADMIN_USER_EMAIL" "$JCLOUDE_ADMIN_USER_PASSWORD"
|
||||||
|
|
||||||
- name: Run Playwright Tests
|
- name: Run Playwright Tests
|
||||||
working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard
|
working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import { fileURLToPath } from 'url';
|
|||||||
import { test as setup } from "./coverage.fixture";
|
import { test as setup } from "./coverage.fixture";
|
||||||
|
|
||||||
const localCloudBaseUrl = process.env.BASE_URL!;
|
const localCloudBaseUrl = process.env.BASE_URL!;
|
||||||
const userEmail = process.env.JCLOUDE _ADMIN_USER_EMAIL!;
|
const userEmail = process.env.JCLOUDE_ADMIN_USER_EMAIL!;
|
||||||
const userPassword = process.env.JCLOUDE _ADMIN_USER_PASSWORD!;
|
const userPassword = process.env.JCLOUDE_ADMIN_USER_PASSWORD!;
|
||||||
const sessionStoragePath = process.env.PLAYWRIGHT_SESSION_STORAGE_PATH || '../../.auth/session.json';
|
const sessionStoragePath = process.env.PLAYWRIGHT_SESSION_STORAGE_PATH || '../../.auth/session.json';
|
||||||
|
|
||||||
function getSessionStorageStatePath() {
|
function getSessionStorageStatePath() {
|
||||||
|
|||||||
@ -488,7 +488,7 @@ def check_permissions(pagetype):
|
|||||||
|
|
||||||
if not hasattr(jingrow.local, "team") or not jingrow.local.team():
|
if not hasattr(jingrow.local, "team") or not jingrow.local.team():
|
||||||
jingrow.throw(
|
jingrow.throw(
|
||||||
"current_team is not set. Use X-JCLOUDE -TEAM header in the request to set it.",
|
"current_team is not set. Use X-JCLOUDE-TEAM header in the request to set it.",
|
||||||
TeamHeaderNotInRequestError,
|
TeamHeaderNotInRequestError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import traceback
|
|||||||
|
|
||||||
import jingrow
|
import jingrow
|
||||||
|
|
||||||
JCLOUDE _AUTH_KEY = "jcloude-auth-logs"
|
JCLOUDE_AUTH_KEY = "jcloude-auth-logs"
|
||||||
JCLOUDE _AUTH_MAX_ENTRIES = 1000000
|
JCLOUDE_AUTH_MAX_ENTRIES = 1000000
|
||||||
|
|
||||||
|
|
||||||
ALLOWED_PATHS = [
|
ALLOWED_PATHS = [
|
||||||
@ -110,23 +110,23 @@ def log(path, user_type):
|
|||||||
"referer": jingrow.request.headers.get("Referer", ""),
|
"referer": jingrow.request.headers.get("Referer", ""),
|
||||||
}
|
}
|
||||||
|
|
||||||
if jingrow.cache().llen(JCLOUDE _AUTH_KEY) > JCLOUDE _AUTH_MAX_ENTRIES:
|
if jingrow.cache().llen(JCLOUDE_AUTH_KEY) > JCLOUDE_AUTH_MAX_ENTRIES:
|
||||||
jingrow.cache().ltrim(JCLOUDE _AUTH_KEY, 1, -1)
|
jingrow.cache().ltrim(JCLOUDE_AUTH_KEY, 1, -1)
|
||||||
serialized = json.dumps(data, sort_keys=True, default=str)
|
serialized = json.dumps(data, sort_keys=True, default=str)
|
||||||
jingrow.cache().rpush(JCLOUDE _AUTH_KEY, serialized)
|
jingrow.cache().rpush(JCLOUDE_AUTH_KEY, serialized)
|
||||||
|
|
||||||
|
|
||||||
def flush():
|
def flush():
|
||||||
log_file = os.path.join(jingrow.utils.get_bench_path(), "logs", "jcloude.auth.json.log")
|
log_file = os.path.join(jingrow.utils.get_bench_path(), "logs", "jcloude.auth.json.log")
|
||||||
try:
|
try:
|
||||||
# Fetch all entries without removing from cache
|
# Fetch all entries without removing from cache
|
||||||
logs = jingrow.cache().lrange(JCLOUDE _AUTH_KEY, 0, -1)
|
logs = jingrow.cache().lrange(JCLOUDE_AUTH_KEY, 0, -1)
|
||||||
if logs:
|
if logs:
|
||||||
logs = list(map(jingrow.safe_decode, logs))
|
logs = list(map(jingrow.safe_decode, logs))
|
||||||
with open(log_file, "a", os.O_NONBLOCK) as f:
|
with open(log_file, "a", os.O_NONBLOCK) as f:
|
||||||
f.write("\n".join(logs))
|
f.write("\n".join(logs))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
# Remove fetched entries from cache
|
# Remove fetched entries from cache
|
||||||
jingrow.cache().ltrim(JCLOUDE _AUTH_KEY, len(logs) - 1, -1)
|
jingrow.cache().ltrim(JCLOUDE_AUTH_KEY, len(logs) - 1, -1)
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user