Go to file
2025-10-15 15:15:53 +07:00
certificate first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.AppHost first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.Clients first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.IdentityServer first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.MapManager first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.MapShares first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.OpenIddictClient first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.RobotManager first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.RobotShares first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.Script first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.Script.Expressions first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.Script.Shares first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.ScriptManager first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.ServiceDefaults first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.Shares first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.SystemUpgrade first commit -push 2025-10-15 15:15:53 +07:00
RobotNet.WebApp first commit -push 2025-10-15 15:15:53 +07:00
sehcio first commit -push 2025-10-15 15:15:53 +07:00
.env first commit -push 2025-10-15 15:15:53 +07:00
.gitignore first commit -push 2025-10-15 15:15:53 +07:00
appsettings.RobotNet.WebApp.json first commit -push 2025-10-15 15:15:53 +07:00
clean.ps1 first commit -push 2025-10-15 15:15:53 +07:00
docker-compose.yaml first commit -push 2025-10-15 15:15:53 +07:00
docker-deploy.yaml first commit -push 2025-10-15 15:15:53 +07:00
install.md first commit -push 2025-10-15 15:15:53 +07:00
README.md first commit 2025-10-15 15:14:07 +07:00
RobotNet.sln first commit -push 2025-10-15 15:15:53 +07:00

RobotNet

Create certificate

  • Tạo file san.cnf
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[req_distinguished_name]
CN = iidentityserver

[v3_req]
subjectAltName = DNS:identityserver,DNS:localhost
  • Tạo certificate
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -sha256 -days 365000 -out ca.crt -subj "/CN=LocalCA"

# Tạo private key và CSR
openssl genrsa -out identityserver.key 2048
openssl req -new -key identityserver.key -out identityserver.csr -config san.cnf

# Ký certificate bằng CA
openssl x509 -req -in identityserver.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out identityserver.crt -days 365000 -sha256 -extensions v3_req -extfile san.cnf

# Chuyển đổi sang .pfx
openssl pkcs12 -export -out robotnet.pfx -inkey identityserver.key -in identityserver.crt -certfile ca.crt -password pass:RobotNet@2024

Kiểm tra certificate

openssl pkcs12 -in robotnet.pfx -nokeys -out temp.pem -password pass:RobotNet@2024
openssl x509 -in temp.pem -noout -text
openssl x509 -in ./ca.crt -noout -text 
  • kết quả
X509v3 extensions:
    X509v3 Subject Alternative Name:
        DNS:identity-server, DNS:localhost
  • Kiểm tra khả năng kết nối từ map-manager tới identity-server thêm ca certificate docker exec -it mapmanager curl -v --cacert /usr/local/share/ca-certificates/ca.crt https://identityserver/.well-known/openid-configuration docker exec -it mapmanager curl -v https://identityserver/.well-known/openid-configuration

Tách chứng chỉ (certificate) từ file robotnet.pfx

openssl pkcs12 -in robotnet.pfx -out cert.pem -clcerts -nokeys -passin pass:RobotNet@2024

Tách khóa riêng (private key) từ file robotnet.pfx

openssl pkcs12 -in robotnet.pfx -out key.pem -nocerts -nodes -passin pass:RobotNet@2024

Tự động tạo mới

cd certificate cmd /c .\gencert.cmd

docker exec -it mapmanager curl -X Post -H "Content-Type: application/x-www-form-urlencoded" -d "token=eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZDQkMtSFM1MTIiLCJraWQiOiJCMUY4MUE2NjZCRkQ4MkVENUUyOTY2ODRDMjA4Q0IwNkM2RUY0MjE2IiwidHlwIjoiYXQrand0IiwiY3R5IjoiSldUIn0.k-x_ywHSBonyT0ccp2L_mdrnQvMS03c9XiOuBiuv_N4kn4OZ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tHGKKMsqZ3OnJKonD1J1KXx5qzCrcuFURsQLzPmryPVSdgRPLGZ8HcvFs5hYlcKCUpzP8z58cyTgTsNQr5-Aqny8snNO-WlEl-v_qKEwtmqS_9McRziP0V4kKzsTLs1MM-0pqU80Izsl6mRRkvRzAOMhnqcI-9bsNuvm7e_GF3uqpPQcmMqpuMwYz5YnMU9XCK5fUsUJHmG5GhEvM3Pi-jPQWMuxr_hHmIaeuSbHrCEjROdSifbyeChvcmuQD-91xz1tlVit80EKtozR-xBizMWiTFV3ycNvde0MSVnfEE1xaJ4XRClh1wjHo5obO1MgxlhXXscc2YB9OdxQ0zqPePe-ptdhkCrDTy4s4OD1PF8yhFoMLA6Hvk86rZr8zGff5RSmbfR7jqq1oNFqnBdHVI5aAWnmbqqYcsxUResnMALLDVZo03Xccvf_c_6QJo2Co8O8BT1PYhNyDxebxYObWaMtU7UPCnMrzLVRG3GDxdwfbbs-x7m5wsi0Bn2Rt5qyoP3a8STxdhVm5OqIU_LkcWWWY0-L6Bp-_w2iIjq17sOuH5CZCwlx39RjKo1Vlckzoxnf4ZYyoITEApWTivxgpNzXyT2eBfVr7wFXykRYgj0etWAgiF3jXwmJ3NnbwL4pbsY3-Acvta6mTZq53aOtWQyWheIPi7-rvn877VLbsTdtZFmwD6QleY2dEJNpRn2Gbok94JnG_noVGE7qCl87TJo_p_m_PMaRHLmbf_XRsz26HlrhdkUIsMWYdGZrupOd9PjyA6rSQH6ySA6T4sbu1gnOVcU24oyeRUYqQSbhyMzrnwBTKfsxrcrIeIQUVqEzOPSY9nm3aF-vjyOWyrkdEFGQJB8wxylRvz1.Qdura_6ys8-ar2iPYOhhgW3yyk7preRo9OFeT3cxzTM&client_id=robotnet-map-manager&client_secret=72B36E68-2F2B-455B-858A-77B1DCC79979" -v https://identityserver/connect/introspect

For Windows

docker images | Select-String "robotics.doc" | ForEach-Object { ($_ -split "\s+")[2] } | ForEach-Object { docker rmi $_ }

For Linux

docker rmi -f $(docker images | grep robotics | grep 0.0.33 | awk '{print $3}')