#1794381340
source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && cd /home/hujwckzy/website_app
#1794382032
cd /home/hujwckzy/website_app
#1794382039
echo 'Flask>=3.0,<4.0' > requirements.txt
#1794382049
ls -l requirements.txt
#1794382541
source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate
#1794382548
cd /home/hujwckzy/website_app
#1794382555
python --version
#1794382562
python -m pip show Flask
#1794382576
python -c "from app import app; print('Flask application loaded successfully')"
#1794391486
hostname
#1794391502
whoami
#1794391570
Test-NetConnection cpanel11wh.jpt1.cloud.z.com -Port 9022
#1794392101
pwd
#1794392108
ls -la /home/hujwckzy/website_app
#1794392117
ls -la /home/hujwckzy/website_app/passenger_wsgi.py
#1794392177
cat /home/hujwckzy/website_app/app.py
#1794392189
cat /home/hujwckzy/website_app/passenger_wsgi.py
#1794392196
cat /home/hujwckzy/website_app/requirements.txt
#1794392277
command -v rsync
#1794392283
command -v git
#1794392288
command -v python
#1794392295
ls -la /home/hujwckzy/website_app
#1794392351
source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate
#1794392356
which python
#1794392362
python --version
#1794392369
command -v tar
#1794392374
ls -ld /home/hujwckzy/website_app/tmp
#1794392384
touch /home/hujwckzy/website_app/tmp/restart.txt
#1794392389
ls -l /home/hujwckzy/website_app/tmp/restart.txt
#1794403756
ssh-keygen -t ed25519 -C "github-actions-arkkdigital-v2" -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2" -N ""
#1794403769
ssh-keygen -y -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794403776
Get-Content "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2.pub"
#1794403906
ssh-keygen -y -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794404032
$key = "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2" [Convert]::ToBase64String([System.IO.File]::ReadAllBytes($key)) | Set-Clipboard
#1794404047
$key = "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2" [Convert]::ToBase64String ([System.IO.File]::ReadAllBytes($key)) | Set-Clipboard
#1794404065
$key = "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794404065
[Convert]::ToBase64String(
#1794404065
    [System.IO.File]::ReadAllBytes($key)
#1794404066
) | Set-Clipboard
#1794404097
ssh-keygen -t ed25519 -C "github-actions-arkkdigital-v2" -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2" -N ""
#1794404115
ssh-keygen -y -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794404195
Get-Content "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2.pub"
#1794404275
$key = "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794404275
[Convert]::ToBase64String(
#1794404275
    [System.IO.File]::ReadAllBytes($key)
#1794404279
) | Set-Clipboard
#1794406278
cd /home/hujwckzy/website_app
#1794406286
wc -c app.py
#1794406294
sha256sum app.py
#1794406303
tail -c 24 app.py | od -An -t x1
#1794404627
ssh-keygen -y -f "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2"
#1794404747
Get-Content "$env:USERPROFILE\.ssh\arkkdigital_github_actions_v2.pub"
#1794413609
source /home/hujwckzy/virtualenv/website_production/3.12/bin/activate && cd /home/hujwckzy/website_production
#1794635276
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && flask --app app db init && flask --app app db migrate -m "Initial authentication schema"
#1794635332
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -c "import os, flask_migrate; print('Flask-Migrate: installed'); print('DB_HOST configured:', bool(os.getenv('DB_HOST'))); print('DB_NAME configured:', bool(os.getenv('DB_NAME'))); print('DB_USER configured:', bool(os.getenv('DB_USER'))); print('DB_PASSWORD configured:', bool(os.getenv('DB_PASSWORD')))"
#1794635375
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -c "import flask_migrate, app; print('Flask-Migrate version:', flask_migrate.__version__); print('App extensions:', list(app.app.extensions.keys())); print('Registered CLI commands:', list(app.app.cli.commands.keys()))"
#1794635426
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -c "import flask_migrate, app; print('Flask-Migrate module:', flask_migrate.__file__); print('App extensions:', list(app.app.extensions.keys())); print('Registered CLI commands:', list(app.app.cli.commands.keys()))"
#1794635470
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && flask --app app:app db init
#1794635507
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -m flask --app app:app db init
#1794635539
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -m flask --app app:app db migrate -m "Initial authentication schema"
#1794635584
cat /home/hujwckzy/website_app/migrations/versions/b95e901b0f18_initial_authentication_schema.py
#1794635729
cd /home/hujwckzy/website_app && for f in migrations/env.py migrations/alembic.ini migrations/script.py.mako migrations/README; do echo; echo "========== $f =========="; cat "$f"; done
#1794636022
cd /home/hujwckzy/website_app && find migrations -maxdepth 2 -type f -print
#1794636067
command -v mysqldump
#1794636111
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -c "import os; from sqlalchemy.engine import URL; u=URL.create('mysql+pymysql',username=os.environ['DB_USER'],password=os.environ['DB_PASSWORD'],host=os.environ['DB_HOST'],database=os.environ['DB_NAME']); print(u.render_as_string(hide_password=True))"
#1794636166
cd /home/hujwckzy/website_app && python - <<'PY'
import os
import subprocess
from datetime import datetime, timezone
from pathlib import Path

db_name = os.environ["DB_NAME"]
backup_dir = Path("/home/hujwckzy/website_app_backups/database")
backup_dir.mkdir(parents=True, exist_ok=True)

timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
backup_file = backup_dir / f"{db_name}_{timestamp}.sql"

env = os.environ.copy()
env["MYSQL_PWD"] = env["DB_PASSWORD"]

command = [
    "/bin/mysqldump",
    "--single-transaction",
    "--quick",
    "--skip-lock-tables",
    "--no-tablespaces",
    "--default-character-set=utf8mb4",
    db_name,
]

try:
    with backup_file.open("wb") as output:
        result = subprocess.run(
            command,
            env=env,
            stdout=output,
            stderr=subprocess.PIPE,
            check=False,
        )

    if result.returncode != 0 or backup_file.stat().st_size == 0:
        backup_file.unlink(missing_ok=True)
        print("BACKUP FAILED")
        print(result.stderr.decode("utf-8", errors="replace"))
    else:
        backup_file.chmod(0o600)
        print("BACKUP SUCCESSFUL")
        print(f"File: {backup_file}")
        print(f"Size: {backup_file.stat().st_size:,} bytes")
finally:
    env.pop("MYSQL_PWD", None)
PY

#1794636268
cd /home/hujwckzy/website_app && python - <<'PY'
import os
import subprocess
from datetime import datetime, timezone
from pathlib import Path

backup_dir = Path("/home/hujwckzy/website_app_backups/database")
backup_dir.mkdir(parents=True, exist_ok=True)

timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
backup_file = backup_dir / f"{os.environ['DB_NAME']}_{timestamp}.sql"

env = os.environ.copy()
env["MYSQL_PWD"] = env["DB_PASSWORD"]

command = [
    "/bin/mysqldump",
    "--user=" + env["DB_USER"],
    "--host=" + env["DB_HOST"],
    "--single-transaction",
    "--quick",
    "--skip-lock-tables",
    "--no-tablespaces",
    "--default-character-set=utf8mb4",
    env["DB_NAME"],
]

try:
    with backup_file.open("wb") as output:
        result = subprocess.run(
            command,
            env=env,
            stdout=output,
            stderr=subprocess.PIPE,
            check=False,
        )

    if result.returncode != 0 or backup_file.stat().st_size == 0:
        backup_file.unlink(missing_ok=True)
        print("BACKUP FAILED")
        print(result.stderr.decode("utf-8", errors="replace"))
    else:
        backup_file.chmod(0o600)
        print("BACKUP SUCCESSFUL")
        print("File:", backup_file)
        print("Size:", f"{backup_file.stat().st_size:,} bytes")
finally:
    env.pop("MYSQL_PWD", None)
PY

#1794636301
grep -E '^(CREATE TABLE|INSERT INTO|DROP TABLE)' /home/hujwckzy/website_app_backups/database/hujwckzy_arkk_auth_stg_20261114T060430Z.sql
#1794636326
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -m flask --app app:app db current
#1794636362
cd /home/hujwckzy/website_app && python - <<'PY'
import os
import pymysql

connection = pymysql.connect(
    host=os.environ["DB_HOST"],
    user=os.environ["DB_USER"],
    password=os.environ["DB_PASSWORD"],
    database=os.environ["DB_NAME"],
)

try:
    with connection.cursor() as cursor:
        cursor.execute("SHOW TABLES")
        print("Current database tables:")
        for row in cursor.fetchall():
            print("-", row[0])

        cursor.execute("SELECT version_num FROM alembic_version")
        print("\nRecorded migration revisions:")
        rows = cursor.fetchall()
        if rows:
            for row in rows:
                print("-", row[0])
        else:
            print("No revision recorded.")
finally:
    connection.close()
PY

#1794636409
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python -m flask --app app:app db upgrade
#1794636451
cd /home/hujwckzy/website_app && python - <<'PY'
import os
import pymysql

connection = pymysql.connect(
    host=os.environ["DB_HOST"],
    user=os.environ["DB_USER"],
    password=os.environ["DB_PASSWORD"],
    database=os.environ["DB_NAME"],
)

try:
    with connection.cursor() as cursor:
        cursor.execute("SHOW TABLES")
        print("DATABASE TABLES:")
        for row in cursor.fetchall():
            print("-", row[0])

        cursor.execute("SELECT version_num FROM alembic_version")
        print("\nMIGRATION REVISION:")
        for row in cursor.fetchall():
            print("-", row[0])
finally:
    connection.close()
PY

#1794636485
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from app import app
from extensions import db
from models import Role

default_roles = [
    ("client", "Client portal access"),
    ("admin", "Portal administrator"),
    ("super_admin", "Full system administrator"),
]

with app.app_context():
    for name, description in default_roles:
        role = db.session.query(Role).filter_by(name=name).first()
        if role is None:
            db.session.add(Role(name=name, description=description))
            print(f"Created role: {name}")
        else:
            print(f"Already exists: {name}")

    db.session.commit()
    print("Role initialization completed.")
PY

#1794638768
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from sqlalchemy.orm import configure_mappers
from app import app
from models import User, Role, UserRole

with app.app_context():
    configure_mappers()
    print("SQLAlchemy model relationships: OK")
    print("User model:", User.__tablename__)
    print("Role model:", Role.__tablename__)
    print("UserRole model:", UserRole.__tablename__)
PY

#1794638852
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from sqlalchemy.orm import configure_mappers
from app import app
from models import User, Role, UserRole

with app.app_context():
    configure_mappers()
    print("SQLAlchemy model relationships: OK")
    print("User model:", User.__tablename__)
    print("Role model:", Role.__tablename__)
    print("UserRole model:", UserRole.__tablename__)
PY

#1794638885
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from app import app
from extensions import db
from models import Role

default_roles = [
    ("client", "Client portal access"),
    ("admin", "Portal administrator"),
    ("super_admin", "Full system administrator"),
]

with app.app_context():
    try:
        for name, description in default_roles:
            role = db.session.query(Role).filter_by(name=name).first()
            if role is None:
                db.session.add(Role(name=name, description=description))
                print(f"Created role: {name}")
            else:
                print(f"Already exists: {name}")

        db.session.commit()
        print("\nRole initialization completed successfully.")
    except Exception:
        db.session.rollback()
        raise
PY

#1794638945
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from app import app
from models import Role

with app.app_context():
    for role in Role.query.order_by(Role.id).all():
        print(f"{role.id} | {role.name} | {role.description}")
PY

#1794639593
ls -l /home/hujwckzy/website_app/bootstrap_super_admin.py
#1794639653
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python bootstrap_super_admin.py --email info@arkkdigital.com
#1794639765
cd /home/hujwckzy/website_app && source /home/hujwckzy/virtualenv/website_app/3.12/bin/activate && python - <<'PY'
from app import app
from extensions import db
from models import User, UserRole, Role

with app.app_context():
    user = User.query.filter_by(email="info@arkkdigital.com").first()

    if not user:
        print("Super Admin account not found.")
    else:
        assignments = (
            db.session.query(Role.name)
            .join(UserRole, UserRole.role_id == Role.id)
            .filter(UserRole.user_id == user.id)
            .all()
        )

        print("Email:", user.email)
        print("Status:", user.status)
        print("Email verified:", user.email_verified_at is not None)
        print("Roles:", ", ".join(role[0] for role in assignments))
        print("Password hash stored:", bool(user.password_hash))
PY

#1794799562
python -c "import secrets; print(secrets.token_urlsafe(32))"
#1794801606
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; keys=['DB_HOST','DB_NAME','DB_USER','DB_PASSWORD']; print({k: bool(os.environ.get(k)) for k in keys}); print('Database:', os.environ.get('DB_NAME','NOT FOUND'))"
#1794801660
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app db current
#1794801740
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; from app import app; print('DB_HOST:', bool(os.getenv('DB_HOST'))); print('DB_NAME:', os.getenv('DB_NAME','NOT FOUND')); print('DB_USER:', bool(os.getenv('DB_USER'))); print('DB_PASSWORD:', bool(os.getenv('DB_PASSWORD'))); print('SQLAlchemy configured:', 'SQLALCHEMY_DATABASE_URI' in app.config); print('Flask-Migrate registered:', 'migrate' in app.extensions)"
#1794801781
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app --help
#1794801821
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794802177
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db upgrade
#1794802220
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794802313
curl -i https://arkkdigital.com/staging/messenger/webhook
#1794802373
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; keys=['MESSENGER_ENABLED','MESSENGER_VERIFY_TOKEN','MESSENGER_APP_SECRET','MESSENGER_PAGE_ID']; print({k: ('SET' if os.getenv(k) else 'NOT SET') for k in keys})"
#1794802427
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python - <<'PY'
import os
import urllib.parse
import urllib.request
import urllib.error

params = {
    "hub.mode": "subscribe",
    "hub.verify_token": os.environ["MESSENGER_VERIFY_TOKEN"],
    "hub.challenge": "123456789"
}

url = "https://arkkdigital.com/staging/messenger/webhook?" + urllib.parse.urlencode(params)

try:
    with urllib.request.urlopen(url, timeout=15) as response:
        print("HTTP Status:", response.status)
        print("Response:", response.read().decode())
except urllib.error.HTTPError as error:
    print("HTTP Status:", error.code)
    print("Response:", error.read().decode())
PY

#1794808262
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db upgrade
#1794808312
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794808358
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "from app import app; from sqlalchemy import inspect; i=inspect(app.extensions['sqlalchemy'].engine); print('\n'.join(t for t in i.get_table_names() if t in ['customers','messenger_customer_links','customer_otp_challenges']))"
#1794808466
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "from app import app; from extensions import db; from sqlalchemy import inspect; exec(\"with app.app_context():\\n print('\\n'.join(t for t in inspect(db.engine).get_table_names() if t in ['customers','messenger_customer_links','customer_otp_challenges']))\")"
#1794808510
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "from app import app; from extensions import db; from sqlalchemy import inspect; app.app_context().push(); print([t for t in inspect(db.engine).get_table_names() if t in ('customers','messenger_customer_links','customer_otp_challenges')])"
#1794809523
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794809729
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db upgrade
#1794809738
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794809822
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db upgrade
#1794809861
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794810387
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db upgrade
#1794810396
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -m flask --app app db current
#1794812678
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app reminders-run
#1794813921
ls -l ~/.arkkdigital-staging.env
#1794814061
touch /home/hujwckzy/.arkkdigital-staging.env
#1794814061
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794814067
ls -l /home/hujwckzy/.arkkdigital-staging.env
#1794814071
touch /home/hujwckzy/.arkkdigital-staging.env
#1794814071
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794814073
ls -l /home/hujwckzy/.arkkdigital-staging.env
#1794814648
python -c "import os; print('DB_HOST:', bool(os.getenv('DB_HOST'))); print('DB_NAME:', bool(os.getenv('DB_NAME'))); print('SECRET_KEY:', bool(os.getenv('SECRET_KEY'))); print('SMTP_HOST:', bool(os.getenv('SMTP_HOST'))); print('SMTP_USERNAME:', bool(os.getenv('SMTP_USERNAME'))); print('PAYMENT_REMINDERS_ENABLED:', os.getenv('PAYMENT_REMINDERS_ENABLED', 'NOT SET'))"
#1794814717
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; print('DB_HOST:', bool(os.getenv('DB_HOST'))); print('DB_NAME:', bool(os.getenv('DB_NAME'))); print('SECRET_KEY:', bool(os.getenv('SECRET_KEY'))); print('SMTP_HOST:', bool(os.getenv('SMTP_HOST'))); print('SMTP_USERNAME:', bool(os.getenv('SMTP_USERNAME'))); print('PAYMENT_REMINDERS_ENABLED:', os.getenv('PAYMENT_REMINDERS_ENABLED', 'NOT SET'))"
#1794814821
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; print('PAYMENT_REMINDERS_ENABLED:', os.getenv('PAYMENT_REMINDERS_ENABLED', 'NOT SET'))"
#1794815239
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app reminders-run
#1794815290
cd /home/hujwckzy/website_app && PAYMENT_REMINDERS_ENABLED=1 /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app reminders-run
#1794815370
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; from app import app; from extensions import db; print('DB_HOST:', bool(os.getenv('DB_HOST'))); print('DB_NAME:', bool(os.getenv('DB_NAME'))); print('DB_USER:', bool(os.getenv('DB_USER'))); print('DB_PASSWORD:', bool(os.getenv('DB_PASSWORD'))); print('DATABASE_URI_CONFIGURED:', bool(app.config.get('SQLALCHEMY_DATABASE_URI'))); print('SQLALCHEMY_INITIALIZED:', app in db.engines)"
#1794815412
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "from app import app; from extensions import db; ctx=app.app_context(); ctx.push(); print('SQLALCHEMY_INITIALIZED:', app in db.engines); print('DATABASE_ENGINE:', db.engine.dialect.name); db.session.execute(db.text('SELECT 1')); print('DATABASE_CONNECTION: OK'); ctx.pop()"
#1794815459
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import app, models, extensions, messenger.reminders as r; print('APP_DB_ID:', id(app.db)); print('EXTENSIONS_DB_ID:', id(extensions.db)); print('MODELS_DB_ID:', id(models.db)); print('REMINDERS_DB_ID:', id(r.db)); print('SAME_APP_EXTENSIONS:', app.db is extensions.db); print('SAME_MODELS_EXTENSIONS:', models.db is extensions.db); print('SAME_REMINDERS_EXTENSIONS:', r.db is extensions.db)"
#1794815535
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "from app import app; from extensions import db; print('APP_NAME:', app.name); print('DB_EXTENSION_REGISTERED:', 'sqlalchemy' in app.extensions); print('DB_EXTENSION_OBJECT_MATCH:', app.extensions.get('sqlalchemy') is db); print('CONFIGURED_URI:', bool(app.config.get('SQLALCHEMY_DATABASE_URI')))"
#1794815583
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app routes
#1794815598
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app --help
#1794815659
cd /home/hujwckzy/website_app && sed -n '980,1005p' app.py
#1794815675
cd /home/hujwckzy/website_app && sed -n '100,165p' messenger/reminders.py
#1794815730
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app shell
#1794815839
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; from app import app; from extensions import db; keys=('DB_HOST','DB_NAME','DB_USER','DB_PASSWORD'); print('VARIABLES:', {k: bool(os.environ.get(k)) for k in keys}); print('URI:', bool(app.config.get('SQLALCHEMY_DATABASE_URI'))); print('REGISTERED:', 'sqlalchemy' in app.extensions); print('DB_OBJECT:', id(db))"
#1794815884
cd /home/hujwckzy/website_app && /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app shell
#1794816137
nano /home/hujwckzy/.arkkdigital-staging.env
#1794816187
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794816222
nano /home/hujwckzy/.arkkdigital-staging.env
#1794816579
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794816616
ls -l /home/hujwckzy/.arkkdigital-staging.env
#1794816630
set -a
#1794816630
source /home/hujwckzy/.arkkdigital-staging.env
#1794816633
set +a
#1794816640
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; keys=['DB_HOST','DB_NAME','DB_USER','DB_PASSWORD','SECRET_KEY','SMTP_HOST','SMTP_USERNAME','SMTP_PASSWORD','SMTP_FROM_EMAIL']; print({k:bool(os.getenv(k)) for k in keys}); print('PAYMENT_REMINDERS_ENABLED:',os.getenv('PAYMENT_REMINDERS_ENABLED'))"
#1794816787
nano /home/hujwckzy/.arkkdigital-staging.env
#1794816946
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794816954
bash -n /home/hujwckzy/.arkkdigital-staging.env && echo "Environment file syntax: OK"
#1794816966
set -a
#1794816966
source /home/hujwckzy/.arkkdigital-staging.env
#1794816967
set +a
#1794816973
/home/hujwckzy/virtualenv/website_app/3.12/bin/python -c "import os; print('DB variables:', all(os.getenv(k) for k in ['DB_HOST','DB_NAME','DB_USER','DB_PASSWORD'])); print('SECRET_KEY:', bool(os.getenv('SECRET_KEY'))); print('SMTP configured:', all(os.getenv(k) for k in ['SMTP_HOST','SMTP_USERNAME','SMTP_PASSWORD','SMTP_FROM_EMAIL'])); print('Reminder worker:', os.getenv('PAYMENT_REMINDERS_ENABLED'))"
#1794817009
nano /home/hujwckzy/.arkkdigital-staging.env
#1794817029
cd /home/hujwckzy/website_app
#1794817029
/home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app shell
#1794817614
nano /home/hujwckzy/.arkkdigital-staging.env
#1794817678
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794817757
set -a
#1794817757
source /home/hujwckzy/.arkkdigital-staging.env
#1794817757
set +a
#1794817757
cd /home/hujwckzy/website_app
#1794817758
PAYMENT_REMINDERS_ENABLED=1 /home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app reminders-run
#1794818190
cls
#1794818192
clear
#1794818195
cd /home/hujwckzy/website_app
#1794818196
grep -n -A100 -B20 'def _handle_incoming_message' messenger/routes.py
#1794818334
sed -n '176,300p' messenger/routes.py
#1794818416
cd /home/hujwckzy/website_app
#1794818416
set -a
#1794818416
source /home/hujwckzy/.arkkdigital-staging.env
#1794818416
set +a
#1794818417
/home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app shell
#1794818559
cd /home/hujwckzy/website_app
#1794818564
set -a
#1794818569
source /home/hujwckzy/.arkkdigital-staging.env
#1794818574
set +a
#1794818579
/home/hujwckzy/virtualenv/website_app/3.12/bin/flask --app app shell
#1794834320
nano /home/hujwckzy/.arkkdigital-staging.env
#1794834350
chmod 600 /home/hujwckzy/.arkkdigital-staging.env
#1794883053
nano /home/hujwckzy/.arkkdigital-staging.env
#1795268642
flask --app 'zaleahub:create_app' init-db
#1795268782
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795268793
flask --app 'zaleahub:create_app' init-db
#1795269072
python3 -c "import secrets; print(secrets.token_urlsafe(48))"
#1795269240
flask --app 'zaleahub:create_app' init-db
#1795270231
pip install -r /home/CPANEL_USER/website_zaleahub/requirements.txt
#1795270245
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795270254
pip install -r /home/CPANEL_USER/website_zaleahub/requirements.txt
#1795270293
pip install --upgrade pip
#1795270341
pip install -r /home/hujwckzy/website_zaleahub/requirements.txt
#1795270544
cd /home/hujwckzy/website_zaleahub
#1795270564
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795270576
flask --app 'zaleahub:create_app' init-db
#1795270701
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
#1795270727
flask --app 'zaleahub:create_app' init-db
#1795270758
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795270773
cd /home/hujwckzy/website_zaleahub
#1795270778
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795270792
flask --app 'zaleahub:create_app' init-db
#1795270841
python3 -c "import secrets; print(secrets.token_urlsafe(48))"
#1795270890
flask --app 'zaleahub:create_app' init-db
#1795271006
cd /home/hujwckzy/website_zaleahub
#1795271014
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795271024
read -s -p "Enter ZALEAHUB_SECRET_KEY: " ZALEAHUB_SECRET_KEY
#1795271058
export ZALEAHUB_SECRET_KEY
#1795271066
echo
#1795271091
read -p "Database username: " ZALEAHUB_DB_USER
#1795271124
read -s -p "Database password: " ZALEAHUB_DB_PASSWORD
#1795271146
export ZALEAHUB_DB_USER ZALEAHUB_DB_PASSWORD
#1795271155
echo
#1795271163
export ZALEAHUB_DB_HOST="localhost"
#1795271169
export ZALEAHUB_DB_NAME="hujwckzy_zaleahub"
#1795271177
export ZALEAHUB_PUBLIC_URL="https://arkkdigital.com/zaleahub"
#1795271185
export ZALEAHUB_ADMIN_EMAIL="YOUR_ADMIN_EMAIL"
#1795271194
flask --app 'zaleahub:create_app' init-db
#1795271244
for v in ZALEAHUB_SECRET_KEY ZALEAHUB_DB_USER ZALEAHUB_DB_PASSWORD ZALEAHUB_DB_HOST ZALEAHUB_DB_NAME ZALEAHUB_DATABASE_URL; do   if printenv "$v" >/dev/null; then     echo "$v = SET";   else     echo "$v = MISSING";   fi; done
#1795271275
grep -n 'ZALEAHUB_DB_PASSWORD\|URL.create' /home/hujwckzy/website_zaleahub/zaleahub/config.py
#1795271611
cd /home/hujwckzy/website_zaleahub
#1795271624
flask --app 'zaleahub:create_app' init-db
#1795271664
pip install requests
#1795271673
flask --app 'zaleahub:create_app' init-db
#1795273639
cd /home/hujwckzy/website_zaleahub
#1795273650
grep -n "def _database_url\|URL.create\|ZALEAHUB_DB_\|ZALEAHUB_DATABASE_URL" zaleahub/config.py
#1795274076
cat /home/hujwckzy/website_zaleahub/passenger_wsgi.py
#1795274088
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m pip show Flask
#1795274101
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m pip install -r /home/hujwckzy/website_zaleahub/requirements.txt
#1795274440
cd /home/hujwckzy/website_zaleahub
#1795274457
grep -n "URL.create\|ZALEAHUB_DB_PASSWORD\|ZALEAHUB_DATABASE_URL" zaleahub/config.py
#1795274490
/ home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python - <<'PY'
import os
import runpy

for key in (
    "ZALEAHUB_DB_NAME",
    "ZALEAHUB_DB_USER",
    "ZALEAHUB_DB_HOST",
    "ZALEAHUB_DB_PASSWORD",
    "ZALEAHUB_DATABASE_URL",
):
    value = os.getenv(key)
    print(f"{key}: {'SET' if value else 'NOT SET'}")

config = runpy.run_path(
    "/home/hujwckzy/website_zaleahub/zaleahub/config.py"
)
uri = config["_database_url"]()
print("Database URL type:", type(uri).__name__)
if hasattr(uri, "render_as_string"):
    print("Database URL:", uri.render_as_string(hide_password=True))
else:
    print("Database URL:", "SET" if uri else "NOT SET")
PY

#1795274522
grep -n "URL.create\|ZALEAHUB_DB_PASSWORD\|ZALEAHUB_DATABASE_URL" zaleahub/config.py
#1795274624
cd /home/hujwckzy/website_zaleahub
#1795274630
grep -n "URL.create\|ZALEAHUB_DB_PASSWORD\|ZALEAHUB_DATABASE_URL" zaleahub/config.py
#1795274659
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python - <<'PY'
import os
import runpy

keys = (
    "ZALEAHUB_DB_NAME",
    "ZALEAHUB_DB_USER",
    "ZALEAHUB_DB_HOST",
    "ZALEAHUB_DB_PASSWORD",
    "ZALEAHUB_DATABASE_URL",
)

for key in keys:
    print(f"{key}: {'SET' if os.getenv(key) else 'NOT SET'}")

config = runpy.run_path(
    "/home/hujwckzy/website_zaleahub/zaleahub/config.py"
)
uri = config["_database_url"]()

print("Database URL type:", type(uri).__name__)
if hasattr(uri, "render_as_string"):
    print("Database URL:", uri.render_as_string(hide_password=True))
else:
    print("Database URL:", "SET" if uri else "NOT SET")
PY

#1795274855
cd /home/hujwckzy/website_zaleahub
#1795274860
cat passenger_wsgi.py
#1795274946
cd /home/hujwckzy/website_zaleahub
#1795274952
tail -n 80 stderr.log
#1795275018
cd /home/hujwckzy/website_zaleahub
#1795275023
which python
#1795275028
python --version
#1795275044
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m pip show Flask Flask-SQLAlchemy SQLAlchemy
#1795275130
cd /home/hujwckzy/website_zaleahub
#1795275135
grep -n "SQLALCHEMY_DATABASE_URI\|_database_url\|class Config" zaleahub/config.py
#1795275154
grep -n "from zaleahub\|create_app" passenger_wsgi.py
#1795275204
cd /home/hujwckzy/website_zaleahub
#1795275204
python - <<'PY'
from zaleahub import create_app

app = create_app()

uri = app.config.get("SQLALCHEMY_DATABASE_URI")

print("Application created: OK")
print("Flask version:", __import__("flask").__version__ if hasattr(__import__("flask"), "__version__") else "installed")
print("SQLAlchemy URI type:", type(uri).__name__)

if hasattr(uri, "render_as_string"):
    print("SQLAlchemy URI:", uri.render_as_string(hide_password=True))
else:
    print("SQLAlchemy URI value:", "SET" if uri else "NOT SET")
PY

#1795275246
cd /home/hujwckzy/website_zaleahub
#1795275248
touch tmp/restart.txt
#1795275253
mkdir -p tmp
#1795275254
touch tmp/restart.txt
#1795278598
cd /home/hujwckzy/website_zaleahub
#1795278606
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795278626
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask --app 'zaleahub:create_app' db upgrade
#1795278775
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795278786
cd /home/hujwckzy/website_zaleahub
#1795278791
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795278871
python -c "import os; v=os.getenv('ZALEAHUB_SECRET_KEY'); print('SET' if v and len(v)>=32 else 'MISSING OR TOO SHORT')"
#1795278917
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795278973
python -c "import os; from zaleahub.config import Config; a=os.getenv('ZALEAHUB_SECRET_KEY'); b=Config.SECRET_KEY; print('Process env:', 'SET' if a else 'MISSING', 'length:', len(a) if a else 0); print('Flask Config:', 'SET' if b else 'MISSING', 'length:', len(b) if b else 0); print('Same value:', a == b)"
#1795279007
cd /home/hujwckzy/website_zaleahub
#1795279007
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795279019
python -c "import zaleahub; import zaleahub.config as c; print('Package:', zaleahub.__file__); print('Config:', c.__file__)"
#1795279058
python -c "from zaleahub import create_app; app=create_app(); print('APP FACTORY OK')"
#1795279099
python -m flask --app 'zaleahub:create_app' db upgrade
#1795279187
python -c "from zaleahub.config import Config; keys=['MAIL_HOST','MAIL_FROM','MAIL_USERNAME','MAIL_PASSWORD']; [print(k+':', 'SET' if getattr(Config,k,None) else 'MISSING') for k in keys]; print('PORT:', Config.MAIL_PORT); print('SSL:', Config.MAIL_USE_SSL); print('TLS:', Config.MAIL_USE_TLS)"
#1795279242
grep -nE '_env|MAIL_HOST|MAIL_FROM|MAIL_USE_SSL|SMTP_HOST' zaleahub/config.py
#1795279367
python -c "from zaleahub.config import Config; print('HOST:', bool(Config.MAIL_HOST)); print('FROM:', bool(Config.MAIL_FROM)); print('USERNAME:', bool(Config.MAIL_USERNAME)); print('PASSWORD:', bool(Config.MAIL_PASSWORD)); print('PORT:', Config.MAIL_PORT); print('SSL:', Config.MAIL_USE_SSL); print('TLS:', Config.MAIL_USE_TLS)"
#1795279407
grep -nE 'MAIL_USE_SSL|MAIL_USE_TLS|def _env|MAIL_HOST' zaleahub/config.py
#1795279430
MAIL_USE_SSL = _env(
#1795279430
    "ZALEAHUB_MAIL_USE_SSL",
#1795279430
    "SMTP_USE_SSL",
#1795279430
    "true" if MAIL_PORT == 465 else "false"
#1795279430
).strip().lower() in ("1", "true", "yes")
#1795279430
MAIL_USE_TLS = _env(
#1795279430
    "ZALEAHUB_MAIL_USE_TLS",
#1795279430
    "SMTP_USE_TLS",
#1795279430
    "true" if MAIL_PORT != 465 else "false"
#1795279431
).strip().lower() in ("1", "true", "yes")
#1795279448
python -c "from zaleahub.config import Config; print('HOST:', bool(Config.MAIL_HOST)); print('FROM:', bool(Config.MAIL_FROM)); print('USERNAME:', bool(Config.MAIL_USERNAME)); print('PASSWORD:', bool(Config.MAIL_PASSWORD)); print('PORT:', Config.MAIL_PORT); print('SSL:', Config.MAIL_USE_SSL); print('TLS:', Config.MAIL_USE_TLS)"
#1795279482
grep -nE 'MAIL_USE_SSL|MAIL_USE_TLS|def _env|MAIL_HOST' zaleahub/config.py
#1795279524
cd /home/hujwckzy/website_zaleahub
#1795279524
# Back up the current configuration
#1795279524
cp zaleahub/config.py "zaleahub/config.py.bak.$(date +%Y%m%d%H%M%S)"
#1795279524
# Download the corrected file from the PR branch
#1795279524
curl -fsSL   https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/config.py   -o /tmp/zaleahub-config.py
#1795279525
# Compare before replacing
#1795279527
diff -u zaleahub/config.py /tmp/zaleahub-config.py | head -100
#1795279548
cp /tmp/zaleahub-config.py zaleahub/config.py
#1795279557
python -m py_compile zaleahub/config.py
#1795279558
python -c "from zaleahub.config import Config; print('HOST:', bool(Config.MAIL_HOST)); print('FROM:', bool(Config.MAIL_FROM)); print('USERNAME:', bool(Config.MAIL_USERNAME)); print('PASSWORD:', bool(Config.MAIL_PASSWORD)); print('PORT:', Config.MAIL_PORT); print('SSL:', Config.MAIL_USE_SSL); print('TLS:', Config.MAIL_USE_TLS)"
#1795279785
grep -nE 'SMTP_SSL|SMTP\(|MAIL_USE_SSL|starttls' zaleahub/mail.py
#1795279796
python -c "import socket; s=socket.create_connection(('mail.arkkdigital.com',465),timeout=10); print('TCP CONNECTION OK'); s.close()"
#1795279876
grep -nE 'SMTP_SSL|SMTP\(|MAIL_USE_SSL|starttls' zaleahub/mail.py
#1795279884
python -c "import socket,ssl; ctx=ssl.create_default_context(); s=ctx.wrap_socket(socket.create_connection(('mail.arkkdigital.com',465),timeout=10),server_hostname='mail.arkkdigital.com'); print('TLS OK:',s.version()); s.close()"
#1795279921
cd /home/hujwckzy/website_zaleahub
#1795279921
# Back up the current mail handler
#1795279921
cp zaleahub/mail.py "zaleahub/mail.py.bak.$(date +%Y%m%d%H%M%S)"
#1795279921
# Download the corrected handler from PR #14
#1795279921
curl -fsSL   https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/mail.py   -o /tmp/zaleahub-mail.py
#1795279921
# Confirm the downloaded file uses implicit SSL
#1795279923
grep -nE 'SMTP_SSL|SMTP\(|MAIL_USE_SSL|starttls' /tmp/zaleahub-mail.py
#1795279943
cp /tmp/zaleahub-mail.py zaleahub/mail.py
#1795279976
cd /home/hujwckzy/website_zaleahub
#1795279977
nano zaleahub/mail.py
#1795280162
python -m py_compile zaleahub/mail.py
#1795280168
grep -nE 'SMTP_SSL|SMTP\(|MAIL_USE_SSL|starttls' zaleahub/mail.py
#1795280192
python -m py_compile zaleahub/mail.py
#1795280778
cd /home/hujwckzy/website_zaleahub
#1795280778
mkdir -p backups
#1795280778
cp zaleahub/templates/base.html backups/base.html.before-notice-fix
#1795280778
cp zaleahub/static/zaleahub.css backups/zaleahub.css.before-notice-fix
#1795280778
curl -fL "https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/templates/base.html" -o /tmp/base.html
#1795280778
curl -fL "https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/static/zaleahub.css" -o /tmp/zaleahub.css
#1795280778
test -s /tmp/base.html && test -s /tmp/zaleahub.css
#1795280778
cp /tmp/base.html zaleahub/templates/base.html
#1795280780
cp /tmp/zaleahub.css zaleahub/static/zaleahub.css
#1795280854
mkdir -p backups
#1795280860
cp zaleahub/templates/base.html backups/base.html.before-notice-fix
#1795280864
cp zaleahub/static/zaleahub.css backups/zaleahub.css.before-notice-fix
#1795280871
curl -fL "https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/templates/base.html" -o /tmp/base.html
#1795280881
curl -fL "https://raw.githubusercontent.com/arkkad3/arkkdigital-website/feature/zaleahub-phase-1/zaleahub/static/zaleahub.css" -o /tmp/zaleahub.css
#1795280887
test -s /tmp/base.html && test -s /tmp/zaleahub.css
#1795280892
cp /tmp/base.html zaleahub/templates/base.html
#1795280898
cp /tmp/zaleahub.css zaleahub/static/zaleahub.css
#1795280945
cd /home/hujwckzy/website_zaleahub
#1795280945
cat > zaleahub/templates/base.html <<'EOF'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{% block title %}ZaleaHub{% endblock %}</title>
<link rel="stylesheet" href="{{url_for('static',filename='zaleahub.css')}}">
</head>
<body>
<header>
<a class="brand" href="{{url_for('main.index')}}">zalea<span>hub</span></a>
<nav>
{% if current_user.is_authenticated %}
<a href="{{url_for('main.dashboard')}}">My coffee</a>
{% if current_user.is_admin %}
<a href="{{url_for('admin.qr_codes')}}">QR batches</a>
{% endif %}
<form method="post" action="{{url_for('auth.logout')}}">
<input type="hidden" name="csrf_token" value="{{csrf_token()}}">
<button>Sign out</button>
</form>
{% else %}
<a href="{{url_for('auth.login')}}">Sign in</a>
<a class="pill" href="{{url_for('auth.register')}}">Join free</a>
{% endif %}
</nav>
</header>
<main>
{% with msgs=get_flashed_messages(with_categories=true) %}
{% for kind,msg in msgs %}
<div class="notice notice-{{kind}}">{{msg}}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</main>
<footer>ZaleaHub · Every cup counts.</footer>
</body>
</html>
EOF

#1795280955
cat >> zaleahub/static/zaleahub.css <<'EOF'

/* Authentication notification alignment and feedback */
.notice {
    width: min(100%, 470px);
    margin: 0 auto 16px;
    padding: 13px 16px;
    background: #fff4df;
    color: #79571e;
    border: 1px solid #f0e4c9;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.55;
    box-shadow: 0 5px 18px #173b2b08;
}

.notice-success {
    background: #edf6ef;
    color: #285b39;
    border-color: #d7e9db;
}

.notice-error {
    background: #fff0ed;
    color: #8d382d;
    border-color: #f3d8d2;
}
EOF

#1795280962
grep -n 'notice-{{kind}}' zaleahub/templates/base.html
#1795280962
tail -25 zaleahub/static/zaleahub.css
#1795281168
python -c "from zaleahub.config import Config; print('PUBLIC_URL:', Config.PUBLIC_URL)"
#1795281905
QR_BASE_URL = os.getenv(
#1795281905
    "ZALEAHUB_QR_BASE_URL",
#1795281905
    "https://arkkdigital.com/zaleahub"
#1795281907
).rstrip("/")
#1795283522
cd /home/hujwckzy/website_zaleahub
#1795283527
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795283541
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795283548
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795283573
cd /home/hujwckzy/website_zaleahub
#1795283587
--app 'zaleahub:create_app' db upgrade
#1795283596
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795283696
          ^^^^^^^^^^^^^^^^^^^^^
#1795283696
  File "/home/hujwckzy/website_zaleahub/zaleahub/__init__.py", line 13, in create_app
#1795283696
    raise RuntimeError("Set ZALEAHUB_SECRET_KEY to a random value of at least 32 characters.")
#1795284293
RuntimeError: Set ZALEAHUB_SECRET_KEY to a random value of at least 32 characters.
#1795284296
cd /home/hujwckzy/website_zaleahub
#1795284301
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/flask   --app 'zaleahub:create_app' db upgrade
#1795284342
python -c "import os; print('Secret available:', bool(os.getenv('ZALEAHUB_SECRET_KEY'))); print('Length valid:', len(os.getenv('ZALEAHUB_SECRET_KEY', '')) >= 32)"
#1795284366
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -c "import os, sys; s=os.getenv('ZALEAHUB_SECRET_KEY',''); print('Python:',sys.executable); print('Secret available:',bool(s)); print('Length valid:',len(s)>=32)"
#1795284373
cd /home/hujwckzy/website_zaleahub
#1795284380
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m flask   --app 'zaleahub:create_app' db upgrade
#1795284541
cd /home/hujwckzy/website_zaleahub
#1795284546
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m flask   --app 'zaleahub:create_app' db upgrade
#1795286082
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/pip install -r /home/hujwckzy/website_zaleahub/zaleahub/requirements.txt
#1795286188
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/pip check
#1795286243
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/pip install packaging
#1795286252
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/pip check
#1795286291
cd /home/hujwckzy/website_zaleahub
#1795286299
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m flask   --app 'zaleahub:create_app' db upgrade
#1795286604
/home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/python -m flask   --app 'zaleahub:create_app' db upgrade
#1795356732
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795356739
flask --app 'zaleahub:create_app' db upgrade
#1795356895
read -rsp "Existing ZALEAHUB_SECRET_KEY: " ZALEAHUB_SECRET_KEY
#1795356950
echo
#1795356958
export ZALEAHUB_SECRET_KEY
#1795356970
read -rp "ZALEAHUB_DB_USER: " ZALEAHUB_DB_USER
#1795357022
read -rsp "ZALEAHUB_DB_PASSWORD: " ZALEAHUB_DB_PASSWORD
#1795357048
echo
#1795357050
export ZALEAHUB_DB_PASSWORD
#1795357063
read -rp "ZALEAHUB_DB_HOST: " ZALEAHUB_DB_HOST
#1795357093
read -rp "ZALEAHUB_DB_NAME: " ZALEAHUB_DB_NAME
#1795357125
read -rsp "Existing ZALEAHUB_SECRET_KEY: " ZALEAHUB_SECRET_KEY
#1795357149
echo
#1795357151
export ZALEAHUB_SECRET_KEY
#1795357161
python -c "import os; keys=['ZALEAHUB_SECRET_KEY','ZALEAHUB_DB_USER','ZALEAHUB_DB_PASSWORD','ZALEAHUB_DB_HOST','ZALEAHUB_DB_NAME']; [print(k + ': ' + ('SET' if os.getenv(k) else 'MISSING')) for k in keys]"
#1795357172
flask --app 'zaleahub:create_app' db upgrade
#1795357281
read -rp "ZALEAHUB_DB_USER: " ZALEAHUB_DB_USER
#1795357340
read -rsp "ZALEAHUB_DB_PASSWORD: " ZALEAHUB_DB_PASSWORD
#1795357360
export ZALEAHUB_DB_PASSWORD
#1795357373
read -rp "ZALEAHUB_DB_HOST: " ZALEAHUB_DB_HOST
#1795357391
export ZALEAHUB_DB_HOST
#1795357400
read -rp "ZALEAHUB_DB_NAME: " ZALEAHUB_DB_NAME
#1795357415
export ZALEAHUB_DB_NAME
#1795357454
read -rp "ZALEAHUB_DB_USER: " ZALEAHUB_DB_USER
#1795357473
export ZALEAHUB_DB_USER
#1795357498
read -rsp "ZALEAHUB_SECRET_KEY: " ZALEAHUB_SECRET_KEY
#1795357524
export ZALEAHUB_SECRET_KEY
#1795357533
python -c "import os; keys=['ZALEAHUB_SECRET_KEY','ZALEAHUB_DB_USER','ZALEAHUB_DB_PASSWORD','ZALEAHUB_DB_HOST','ZALEAHUB_DB_NAME']; [print(k + ': ' + ('SET' if os.getenv(k) else 'MISSING')) for k in keys]"
#1795357556
flask --app 'zaleahub:create_app' db upgrade
#1795357597
read -rsp "ZALEAHUB_DB_PASSWORD: " ZALEAHUB_DB_PASSWORD
#1795357616
export ZALEAHUB_DB_PASSWORD
#1795357620
python -c "import os; keys=['ZALEAHUB_SECRET_KEY','ZALEAHUB_DB_USER','ZALEAHUB_DB_PASSWORD','ZALEAHUB_DB_HOST','ZALEAHUB_DB_NAME']; [print(k + ': ' + ('SET' if os.getenv(k) else 'MISSING')) for k in keys]"
#1795357626
flask --app 'zaleahub:create_app' db upgrade
#1795358259
pip install -r requirements.txt
#1795407929
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate && cd /home/hujwckzy/website_zaleahub
#1795407943
flask --app 'zaleahub:create_app' db upgrade
#1795408149
read -rp "ZALEAHUB_DB_USER: " ZALEAHUB_DB_USER
#1795408167
export ZALEAHUB_DB_USER
#1795408174
read -rsp "ZALEAHUB_DB_PASSWORD: " ZALEAHUB_DB_PASSWORD
#1795408189
export ZALEAHUB_DB_PASSWORD
#1795408197
read -rp "ZALEAHUB_DB_HOST: " ZALEAHUB_DB_HOST
#1795408212
export ZALEAHUB_DB_HOST
#1795408218
read -rp "ZALEAHUB_DB_NAME: " ZALEAHUB_DB_NAME
#1795408231
export ZALEAHUB_DB_NAME
#1795408237
read -rsp "ZALEAHUB_SECRET_KEY: " ZALEAHUB_SECRET_KEY
#1795408249
export ZALEAHUB_SECRET_KEY
#1795408264
python -c "import os; keys=['ZALEAHUB_SECRET_KEY','ZALEAHUB_DB_USER','ZALEAHUB_DB_PASSWORD','ZALEAHUB_DB_HOST','ZALEAHUB_DB_NAME']; [print(k + ': ' + ('SET' if os.getenv(k) else 'MISSING')) for k in keys]"
#1795408282
flask --app 'zaleahub:create_app' db upgrade
#1795409145
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795409153
flask --app 'zaleahub:create_app' db upgrade
#1795409170
flask --app 'zaleahub:create_app' db current
#1795409515
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795409524
flask --app 'zaleahub:create_app' db upgrade
#1795409543
flask --app 'zaleahub:create_app' db current
#1795409646
cd /home/hujwckzy/website_zaleahub
#1795409657
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795409683
current_epoch = setting_int("global_session_epoch")
#1795410311
source /home/hujwckzy/virtualenv/website_zaleahub/3.12/bin/activate
#1795410319
flask --app 'zaleahub:create_app' db upgrade
#1795410330
flask --app 'zaleahub:create_app' db current
#1795534425
source /home/hujwckzy/virtualenv/website_production/3.12/bin/activate && cd /home/hujwckzy/website_production
#1795534478
pip install --upgrade pip
#1795587280
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795587285
npm install
#1795590416
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795590463
pwd
#1795590472
ls -la
#1795590506
node -v
#1795590516
npm -v
#1795590530
cat app.js
#1795590545
ls -la dist
#1795590587
node app.js
#1795591908
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795591921
node app.js
#1795592093
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795592104
node -v
#1795592144
npm -v
#1795592153
cat app.js
#1795592163
ls -la dist
#1795592177
node app.js
#1795592285
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795592291
ls -la node_modules/.prisma/client
#1795592344
node app.js
#1795592520
echo $PORT
#1795592567
ls -la
#1795592603
ps -u "$USER" -f | grep -E 'node|Passenger' | grep -v grep
#1795592983
nslookup staging-api.arkkdigital.com
#1795593007
curl -I https://staging-api.arkkdigital.com
#1795593057
nslookup arkkdigital.com
#1795593103
nslookup api.arkkdigital.com
#1795593423
nslookup staging-api.arkkdigital.com
#1795593427
curl -I https://staging-api.arkkdigital.com
#1795593447
nslookup staging-api.arkkdigital.com
#1795593457
node app.js
#1795593537
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795593599
ls -la node_modules/.prisma/client
#1795593610
node app.js
#1795593830
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795593838
nslookup staging-api.arkkdigital.com 8.8.8.8
#1795593849
nslookup staging-api.arkkdigital.com 1.1.1.1
#1795593882
curl -I --resolve staging-api.arkkdigital.com:443:13.228.141.107 https://staging-api.arkkdigital.com/api/health
#1795593908
cat /home/hujwckzy/arkkdigital-platform/.htaccess
#1795593951
find /home/hujwckzy/arkkdigital-platform-staging -maxdepth 2 -type f -name '.*' -print
#1795594299
curl -I --resolve staging-api.arkkdigital.com:443:13.228.141.107 https://staging-api.arkkdigital.com/api/health
#1795594369
curl --resolve staging-api.arkkdigital.com:443:13.228.141.107 https://staging-api.arkkdigital.com/api/health
#1795594379
curl --resolve staging-api.arkkdigital.com:443:13.228.141.107 https://staging-api.arkkdigital.com/api/health/database
#1795597091
source /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/bin/activate && cd /home/hujwckzy/arkkdigital-platform-staging
#1795597247
npm install --omit=dev
#1795597295
npm install
#1795597333
cd /home/hujwckzy/arkkdigital-platform-staging
#1795597336
npm ci --omit=dev
#1795597676
df -h ~
#1795597687
quota -s
#1795597717
df -i ~
#1795597727
ls -ld node_modules
#1795597736
node -v && npm -v
#1795597783
pwd
#1795597794
readlink node_modules
#1795597801
ls -ld /home/hujwckzy/nodevenv/arkkdigital-platform-staging/22/lib/node_modules
#1795597813
ls -la node_modules | head
#1795616328
source /home/hujwckzy/virtualenv/website_production/3.12/bin/activate
