<commit_before>#cloud-config

coreos:
  etcd:
    discovery: https://discovery.etcd.io/<token>
    addr: $public_ipv4:4001
    peer-addr: $private_ipv4:7001
  units:
    - name: etcd.service
      command: start
    - name: fleet.service
      command: start
    - name: gitevents-proxy.service
      command: start
      content: |
        [Unit]
        Description=gitevents Proxy

        [Service]
        User=core
        TimeoutStartSec=0
        ExecStartPre=-/usr/bin/docker kill gitevents-proxy
        ExecStartPre=-/usr/bin/docker rm gitevents-proxy
        ExecStartPre=/usr/bin/docker pull quay.io/gitevents/proxy
        ExecStart=/usr/bin/docker run --net=host --restart=always --name=gitevents-proxy quay.io/gitevents/proxy
        ExecStop=/usr/bin/docker stop gitevents-proxy
    - name: gitevents.service
      command: start
      content: |
        [Unit]
        Description=gitevents Core
        After=docker.service

        [Service]
        User=core
        TimeoutStartSec=0
        ExecStartPre=-/usr/bin/docker kill gitevents
        ExecStartPre=-/usr/bin/docker rm gitevents
        ExecStartPre=/usr/bin/docker pull quay.io/gitevents/gitevents
        ExecStart=/usr/bin/docker run -p 127.0.0.1:3000:3000 --restart=always --name=gitevents -e "CONFIG_URL=<production.js>" quay.io/gitevents/gitevents
        ExecStop=/usr/bin/docker stop gitevents
        Restart=on-failure
        RestartSec=5
  fleet:
    public-ip: $public_ipv4<commit_msg>using docker net=host and iptables firewall instead of Docker bridge<commit_after>#cloud-config

coreos:
  etcd:
    discovery: https://discovery.etcd.io/<token>
    addr: $public_ipv4:4001
    peer-addr: $private_ipv4:7001
  units:
    - name: etcd.service
      command: start
    - name: fleet.service
      command: start
    - name: iptables-restore.service
      enable: true
    - name: gitevents-proxy.service
      command: start
      content: |
        [Unit]
        Description=gitevents Proxy

        [Service]
        User=core
        TimeoutStartSec=0
        ExecStartPre=-/usr/bin/docker kill gitevents-proxy
        ExecStartPre=-/usr/bin/docker rm gitevents-proxy
        ExecStartPre=/usr/bin/docker pull quay.io/gitevents/proxy
        ExecStart=/usr/bin/docker run --net=host --restart=always --name=gitevents-proxy quay.io/gitevents/proxy
        ExecStop=/usr/bin/docker stop gitevents-proxy
    - name: gitevents.service
      command: start
      content: |
        [Unit]
        Description=gitevents Core
        After=docker.service

        [Service]
        User=core
        TimeoutStartSec=0
        ExecStartPre=-/usr/bin/docker kill gitevents
        ExecStartPre=-/usr/bin/docker rm gitevents
        ExecStartPre=/usr/bin/docker pull quay.io/gitevents/gitevents
        ExecStart=/usr/bin/docker run --net=host --restart=always --name=gitevents -e "CONFIG_URL=<production.js>" quay.io/gitevents/gitevents
        ExecStop=/usr/bin/docker stop gitevents
        Restart=on-failure
        RestartSec=5
  fleet:
    public-ip: $public_ipv4
write_files:
  - path: /var/lib/iptables/rules-save
    permissions: 0644
    owner: root:root
    content: |
      *filter
      :INPUT DROP [0:0]
      :FORWARD DROP [0:0]
      :OUTPUT ACCEPT [0:0]
      -A INPUT -i lo -j ACCEPT
      -A INPUT -i eth1 -j ACCEPT
      -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
      -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
      -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
      -A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
      -A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
      -A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
      COMMIT
{'fraction_non_alphanumeric': 0.10517711171662125, 'fraction_numerical': 0.016893732970027248, 'mean_word_length': 2.2486725663716816, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6838841', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1235, 'n_words': 270}