---
apiVersion: v1
kind: ConfigMap
metadata:
  name: repo-configmap
data:
  _settings.yaml: |
    name: "openeuler"
    fs:
      url: "/repo/openeuler"
      update_rate: "60m"
      includes:
      - "*.rpm"
      - "*.iso"
      excludes:
      json_support: false
      filename_as_id: false
      add_filesize: true
      remove_deleted: true
      add_as_inner_object: false
      store_source: false
      index_content: false
      indexed_chars: "0"
      attributes_support: false
      raw_metadata: false
      xml_support: false
      index_folders: true
      lang_detect: false
      continue_on_error: false
      pdf_ocr: false
    elasticsearch:
      nodes:
      - url: "https://log.osinfra.cn:9200"
      index: "openeuler"
      bulk_size: 1000
      flush_interval: "60s"
      byte_size: "10mb"
      username: "<username>"
      password: "<password>"
    rest:
      url: "http://127.0.0.1:8080/fscrawler"
  ssh.pub: |
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQChSk+/FF79F8ut0hpNuYQ4uhAgUSY4hzRIPvQ2uVTukP0B0A99NYPfDNICp7gLa6e7yzaj+bvCpgWZoZCNAWTBWkq+zHTgDDHrLtUE4zPC1guzuR+Gz3yeIzSt0iAzi9uG2p+qh7jUfl8QAwNOs3wosNenoZj7NmgsCF9M1o85msimRc8Roxnn5caao1RtdNkDHDqhw5QiS9doSUjoxT+esD0CI7RHAyMgMCfSlXXl/phpdSU2hVJSFXsHVBTiymkuMQe8Ylmls+OEmCe8Cy7lIqE/Q+56l62Pxv4UJpOWs9T/SrOEr5vtEPGghZzgo5ViewzAs3dGMaODSO25XhrIiRZ7hjBK9tjLOX7ZXfAsb4DpJljq2aPCrlEaGJsHc2laixKIOKogDbqFffM3eXwgEAxPUevX/mYnuyhAVrsRUl8HXIQnTuVIEeYVdmn2MA8I/y6MPWdN5VbLR5gOiNLOuSVhCq3sQLpTZ9CONF+zq+1layCoaGMIZw5JwYgWCQgCGNclbx8eMVY3+J3slH6VjzE/05Eys18HtpuAMCivBLGgpBGeCVdpQqkHodTn5ZjNZEBAgzHypiOgR/txMHhkTi4+1ZvTmSRWs9hggv4/IcDQFaj1f2JVds6lxGvJyOnoy9k1VUC0q4N6sptpJ/n+ElCJ4UaHE48La3Mu79R6+Q== openeuler_hosts
  default.conf: |
    server {
        listen 80;

        if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
               set $year $1;
               set $month $2;
               set $day $3;
        }
        # access_log /var/log/nginx/access.log.$year$month$day main;

        server_name *.openeuler.org;

        location / {
            root   /repo/openeuler;
            fancyindex on;
            fancyindex_exact_size off;
            fancyindex_header /fancySource/header.html;
            fancyindex_footer /fancySource/footer.html;
            autoindex   on;
        }
        location /fancySource {
           root /etc/nginx/conf/static;
        }
        location = /favicon.ico {
          log_not_found off;
          access_log off;
        }
        location ~ \.iso$ {
          rewrite ^/(.*)  https://mirrors.tuna.tsinghua.edu.cn/openeuler$request_uri;
        }
        location ~ iso.sha256sum$ {
          rewrite ^/(.*)  https://mirrors.tuna.tsinghua.edu.cn/openeuler$request_uri;
        }
    }
  rsyncd.conf: |-
    ----
    use chroot = yes
    uid = root
    gid = root
    max connections = 10
    timeout = 600
    read only = yes

    [openeuler]
          path = /repo/openeuler
          comment = openeuler repo folder
          read only = true
          ignore nonreadable = yes
          refuse options = checksum
          dont compress = *
  nginx.conf: |-
    user  root;
    worker_processes  auto;

    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;


    events {
        worker_connections  10240;
    }


    http {
        include       /etc/nginx/conf/mime.types;
        default_type  application/octet-stream;

        # used for geoip2
        # geoip2 /etc/nginx/geoip/country/GeoLite2-Country.mmdb {
        #    $geoip2_metadata_country_build metadata build_epoch;
        #    $geoip2_data_country_code default=US source=$remote_addr country iso_code;
        #    $geoip2_data_country_name country names en;
        #}

        # geoip2 /etc/nginx/geoip/city/GeoLite2-City.mmdb {
        #    $geoip2_data_city_name default=ShenZhen city names en;
        #    $geoip2_data_location_latitude location latitude;
        #    $geoip2_data_location_longitude location longitude;
        #}

        # the cidr used for elb cluster
        # set_real_ip_from 100.125.0.0/16;
        # real_ip_recursive on;
        # real_ip_header X-Forwarded-For;

        # log_format  main  '$remote_addr <$geoip2_data_country_code, $geoip2_data_country_name, $geoip2_data_city_name, $geoip2_data_location_latitude, $geoip2_data_location_longitude> '
        #                   '[$time_local] "$request" $status $body_bytes_sent "$http_referer" '
        #                   '"$http_user_agent" $request_filename';

        sendfile        on;
        tcp_nopush      on;

        keepalive_timeout  65;

        #gzip  on;

        server_tokens off;
        include /etc/nginx/conf/conf.d/*.conf;
    }
