Sign inSign up

hanad/dsig

By hanad

•Updated over 1 year ago

XMl DSIG Xades For Envelopes

Image
Security
0

264

hanad/dsig repository overview

⁠Docker Compose Setup for DSIG

This document provides instructions for setting up and running the DSIG service using Docker Compose.

⁠Prerequisites

  • Docker
  • Docker Compose

⁠Docker Compose Configuration

The docker-compose.yml file defines the DSIG service configuration.

services:
  dsig:
    image: hanad/dsig:latest
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    env_file:
      - ./.env
    volumes:
      - ./logs:/logs
      - ./certs:/certs
⁠Services
  • dsig: The main service that runs the DSIG application.
⁠Ports
  • 8080:8080: Maps port 8080 on the host to port 8080 in the container.
⁠Environment Variables

The service uses an .env file to configure environment variables. Ensure you have a .env file in the root directory with the necessary configurations.

⁠Volumes
  • ./logs:/logs: Maps the logs directory on the host to the logs directory in the container. Ensure you create a logs directory in the root of your project.
  • ./certs:/certs: Maps the certs directory on the host to the certs directory in the container. Ensure you create a certs directory in the root of your project.

⁠Setup Instructions

  1. Prepare the Volumes:

    • Create a logs directory in the root of your project:
      mkdir logs
      
    • Create a certs directory in the root of your project:
      mkdir certs
      
  2. Configure the .env File:

    • Create a .env file in the root of your project with the necessary environment variables.:
Serilog__WriteTo__File__Args__path=/logs/log.log
Serilog__MinimumLevel__Override__Microsoft=Information
Serilog__MinimumLevel__Override__System=Information
Serilog__MinimumLevel__Default=Information
AppConfig__Security__Certificate=/certs/certificate.pem
AppConfig__Security__Chain=/certs/chain.pem
AppConfig__Security__PrivateKey=/certs/private.key
AppConfig__VerificationWindow__Minutes=1000
AppConfig__Security__Auth__ApiSecret=_very_secret_key_
AppConfig__Security__Auth__ApiKey=_very_secret_key_
AppConfig__Security__Cryptography__Algorithms__0=SHA256withRSA
AppConfig__Security__Cryptography__Algorithms__1=SHA1withRSA
AppConfig__Security__Cryptography__Algorithms__2=SHA512withRSA
AppConfig__CR__BaseURl=get/this/from/your/pki/repo
AppConfig__CR__Endpoints__Login=get/this/from/your/pki/repo
AppConfig__CR__Endpoints__Refresh=/auth/refresh
AppConfig__CR__Endpoints__DownloadCert=get/this/from/your/pki/repo
AppConfig__CR__Auth__Username=get/this/from/your/pki/repo
AppConfig__CR__Auth__Password=get/this/from/your/pki/repo
ASPNETCORE_ENVIRONMENT=Development
  • Replace the placeholders with the actual values.
  • The AppConfig__Security__Auth__ApiSecret and AppConfig__Security__Auth__ApiKey are used for authentication. Replace them with your own secret keys.
  • The AppConfig__CR__BaseURl, AppConfig__CR__Endpoints__Login, AppConfig__CR__Endpoints__Refresh, AppConfig__CR__Endpoints__DownloadCert, AppConfig__CR__Auth__Username, and AppConfig__CR__Auth__Password are used for PKI integration. Replace them with the actual values from your PKI repository.
  • The AppConfig__VerificationWindow__Minutes is the time window in minutes for verifying the signature. Adjust this value as needed.
  • The AppConfig__Security__Cryptography__Algorithms are the supported cryptographic algorithms for verifying the signature. Add or remove algorithms as needed.
  • The ASPNETCORE_ENVIRONMENT is set to Production by default. Change it to Development for development environment. in development you can access the swagger UI at http://localhost:8080/swagger/index.html
  1. Build and Run the Service:
    • Use Docker Compose to build and run the service:
      docker-compose up --build
      

⁠Running the Image

To run the DSIG image without compose file, use the following command:

docker run -p 8080:8080 -v $(pwd)/logs:/logs -v $(pwd)/certs:/certs --env-file ./.env hanad/dsig:latest

⁠Conclusion

Following these steps will set up and run the DSIG service using Docker Compose. Ensure that the volumes and environment variables are correctly configured for the service to function properly.

services:
  dsig:
    image: hanad/dsig:latest
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    env_file:
      - ./.env
    volumes:
      - ./logs:/logs
      - ./certs:/certs

Tag summary

Content type

Image

Digest

sha256:b3fca5b60…

Size

87.6 MB

Last updated

over 1 year ago

docker pull hanad/dsig