2024年 08月 17日 - 使用acme.sh生成letsencrypt的泛域名证书

    使用acme.sh生成letsencrypt的泛域名证书

    • 原先的服务器都是使用的certbot,没有使用泛域名证书,每次新增一个服务需要手动执行一次
    • Challenge Types有多种模式,其中DNS支持泛域名证书,早期列出的DNS域名服务商没有阿里云
      • HTTP-01 challenge
      • DNS-01 challenge
      • TLS-SNI-01
      • TLS-ALPN-01

    acme.sh支持通过阿里云的API实现的

    域名服务商支持列表

    DNS Hosting Provider ACME Client Support Cost
    Akamai Edge DNS 443 Certbot 339, lego 3.0k, Posh-ACME 3.0k , acme.sh 16.0k Contract Specific
    Aliyun (CN) 251 & Alibaba Cloud DNS (EN) 127 acme.sh 16.0k, lego 3.0k, Posh-ACME 3.0k Bundled with domain registration or Cloud DNS pricing 132
    Amazon Route53 Certbot 1.8k, acme.sh 16.0k, others 2.3k ~$0.50/mo per domain
    Azure DNS acme.sh 16.0k, lego 3.0k, Posh-ACME 3.0k ~$0.50/mo per domain
    Cloudflare Certbot 3.4k, acme.sh 16.0k, others 2.3k Free (except for Freenom domains) 3.1k Note: Cloudflare is also a Registrar.
    ClouDNS acme.sh 16.0k, lego 3.0k, Posh-ACME 3.0k, others 2.3k >= $2.95/mo (with API-support)

    docker方式运行

    阿里云access_key申请

    --dns dns_ali表示域名服务商名称为ali

    docker run --rm -it -v "$(pwd)/out":/acme.sh \
      -e Ali_Key=your_access_key_id \
      -e Ali_Secret=your_access_key_secret \ 
      neilpang/acme.sh --issue --dns dns_ali --server letsencrypt \
      -d *.eoekun.top --dnssleep 300
    

    2024年 07月 19日 - gitlab多项目cicd构建方案

    gitlab多项目cicd构建方案

    解决: 多应用构建场景、依赖服务构建场景

    基于docker run -it --rm -p 4000:4000 registry.gitlab.com/gitlab-org/gitlab-docs:13.11

    Moved to GitLab Free in 12.8.

    http://0.0.0.0:4000/13.11/ee/ci/multi_project_pipelines.html

    官方文档

    好文

    2024年 06月 27日 - java中的webp图像处理

    java中使用thumbnailator实现图片压缩

    public static void main(String args[]) throws IOException {
      // 原始比例大小,0.5倍清晰度
      Thumbnails.of(new File("original.jpg")).scale(1f).outputQuality(0.5f).toFile(new File("thumbnail.jpg"));
    }
    

    2024年 06月 17日 - java中的webp图像处理

    java中的webp图像处理

    package example;
    
    import com.luciad.imageio.webp.WebPReadParam;
    
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.FileImageInputStream;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    
    public class DecodeTest {
      public static void main(String args[]) throws IOException {
        String inputWebpPath = "test_pic/test.webp";
        String outputJpgPath = "test_pic/test_.jpg";
        String outputJpegPath = "test_pic/test_.jpeg";
        String outputPngPath = "test_pic/test_.png";
    
        // Obtain a WebP ImageReader instance
        ImageReader reader = ImageIO.getImageReadersByMIMEType("image/webp").next();
    
        // Configure decoding parameters
        WebPReadParam readParam = new WebPReadParam();
        readParam.setBypassFiltering(true);
    
        // Configure the input on the ImageReader
        reader.setInput(new FileImageInputStream(new File(inputWebpPath)));
    
        // Decode the image
        BufferedImage image = reader.read(0, readParam);
    
        ImageIO.write(image, "png", new File(outputPngPath));
        ImageIO.write(image, "jpg", new File(outputJpgPath));
        ImageIO.write(image, "jpeg", new File(outputJpegPath));
    
      }
    }