DAT CMS

DAT CMS certificates তৈরি করে, database-এ রাখে এবং issuing ও verifying services-এ উপযুক্ত certificates দেয়। Protocol behavior DAT CMS specification-এ বর্ণিত।

Runtime configuration তৈরি

DAT certificate management service

dns

Server

PortDefault: 8088
HostnameDefault: Auto
terminal

চালানোর command

bash
API পরীক্ষা
bash
database

Database

API cacheDefault: 60
verified_user

DAT certificate

Signature algorithm
Encryption algorithm
Certificate issuance delayসেকেন্ডhelp
DAT issuance periodসেকেন্ডhelp
DAT TTL (lifetime)সেকেন্ডhelp
DAT certificate generation schedule (Cron)help
lock

Access control

Master token
DAT certificates তৈরি ও server version সংগ্রহ
Full Cert token
Full (Pair Key, Hash Key) certificates সংগ্রহ
Verify Cert token
Verify (Verify Key Only) certificates সংগ্রহ

Docker দিয়ে চালান

Container non-root user হিসেবে চালান। SQLite-এ writable data directory mount করুন। command history-এর বদলে secret-injection mechanism দিয়ে tokens ও database passwords দিন।

docker run --rm --name dat-cms -p 8088:8088 \
  --user 10001:10001 \
  -v "$PWD/dat-cms-data:/data" \
  -e PORT=8088 \
  -e DB_URI='sqlite:/data/data.db' \
  -e TOKEN_MASTER='replace-with-a-secret' \
  -e TOKEN_CERT_FULL='replace-with-a-secret' \
  -e TOKEN_CERT_VERIFY='replace-with-a-secret' \
  sarolab/dat-cms

Database

SQLite, PostgreSQL বা MySQL connection-এর জন্য DB_URI ব্যবহার করুন। MariaDB, MySQL protocol-এ যুক্ত হয়। CMS query results snapshot হিসেবে cache করে এবং storage refresh সাময়িক ব্যর্থ হলে শেষ সফল snapshot দিতে থাকে।

DB_CACHE_SECS snapshot refresh interval এবং DB_QUERY_TIMEOUT_SECS refresh query limit সেট করে। সফল snapshot না থাকলে ও storage পড়া না গেলে service DAT_STORE_UNAVAILABLE দেয়।

Access roles

Environment variablePermissionব্যবহারকারী
TOKEN_MASTERCertificates register ও protected version সংগ্রহOperations
TOKEN_CERT_FULLFull certificates সংগ্রহDAT issuing services
TOKEN_CERT_VERIFYVerify-only certificates সংগ্রহVerification ও decryption services

প্রতিটি variable comma-separated alphanumeric tokens নেয়। কোনো role-এর token list খালি হলে endpoints খোলা হয় এবং warning log হয়।

Certificate generation

Master role signature algorithm, encryption algorithm, propagation delay, issuance period ও TTL দিয়ে certificate register করে। propagation delay-তে issuable হওয়ার আগে services নতুন certificate synchronize করে।

Client integration

  1. Issuing services-এ full token ও full-certificate endpoint ব্যবহার করুন।
  2. Verifying services-এ verify token ও verify-only option ব্যবহার করুন।
  3. প্রথম synchronization result দেখুন; startup ব্যর্থ করতে immediate synchronization API call করুন।
  4. Automatic synchronization চালু থাকলে shutdown-এ manager বন্ধ করুন।

প্রতিটি ভাষার builder ও shutdown behavior-এর জন্য library guides দেখুন।

Operational checks

  • /health/version/api authentication ছাড়াই status জানায়।
  • Role configured থাকলে /version-এ master token লাগে।
  • Standard output ও standard error থেকে logs সংগ্রহ করুন।
  • Shutdown signals forward করে database ও scheduler বন্ধের সময় দিন।

Kubernetes

Container port ও probes service port-এর সঙ্গে মিলিয়ে non-root user-এর write access-সহ data directory mount করুন। Secrets দিয়ে tokens ও database connection details inject করুন।

securityContext:
  runAsNonRoot: true
  runAsUser: 10001
  runAsGroup: 10001
containers:
  - name: dat-cms
    image: sarolab/dat-cms
    ports: [{ containerPort: 8088 }]
    readinessProbe: { httpGet: { path: /health, port: 8088 } }
    livenessProbe: { httpGet: { path: /health, port: 8088 } }