<commit_before>cachish:
    pkgrepo.managed:
        - name: deb https://thusoy-apt.s3-accelerate.amazonaws.com/apt/debian {{ grains.oscodename }} main
        - key_url: salt://cachish/release-key.asc

    pkg.installed:
        - require:
            - pkgrepo: cachish

    file.managed:
        - name: /etc/cachish.yml
        - source: salt://cachish/config.yml
        - template: jinja
        - show_changes: False
        - user: root
        - group: cachish
        - mode: 640
        - require:
            - pkg: cachish

    service.running:
        - watch:
            - file: cachish


{% for family in ('ipv4', 'ipv6') %}
cachish-outgoing-firewall-{{ family }}:
    firewall.append:
        - family: {{ family }}
        - chain: OUTPUT
        - protocol: tcp
        - dport: 443
        - match:
            - comment
            - owner
        - comment: 'cachish: Allow outgoing traffic'
        - uid-owner: cachish
        - jump: ACCEPT
        - require:
            - pkg: cachish
{% endfor %}<commit_msg>Allow cachish DNS requests through firewall<commit_after>cachish:
    pkgrepo.managed:
        - name: deb https://thusoy-apt.s3-accelerate.amazonaws.com/apt/debian {{ grains.oscodename }} main
        - key_url: salt://cachish/release-key.asc

    pkg.installed:
        - require:
            - pkgrepo: cachish

    file.managed:
        - name: /etc/cachish.yml
        - source: salt://cachish/config.yml
        - template: jinja
        - show_changes: False
        - user: root
        - group: cachish
        - mode: 640
        - require:
            - pkg: cachish

    service.running:
        - watch:
            - file: cachish


{% for family in ('ipv4', 'ipv6') %}
cachish-outgoing-firewall-{{ family }}:
    firewall.append:
        - family: {{ family }}
        - chain: OUTPUT
        - protocol: tcp
        - dport: 443
        - match:
            - comment
            - owner
        - comment: 'cachish: Allow outgoing traffic'
        - uid-owner: cachish
        - jump: ACCEPT
        - require:
            - pkg: cachish


{% for protocol in ('tcp', 'udp') %}
cachish-outgoing-firewall-dns-{{ family }}-{{ protocol }}:
    firewall.append:
        - family: {{ family }}
        - chain: OUTPUT
        - protocol: {{ protocol }}
        - dport: 53
        - destination: system_dns
        - match:
            - comment
            - owner
        - comment: 'cachish: Allow outgoing DNS'
        - uid-owner: cachish
        - jump: ACCEPT
        - require:
            - pkg: cachish
{% endfor %}
{% endfor %}
{'fraction_non_alphanumeric': 0.12335653518948182, 'fraction_numerical': 0.007733952049497293, 'mean_word_length': 1.449810606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6235448', 'n_tokens_mistral': 858, 'n_tokens_neox': 798, 'n_words': 174}