Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add additional port to expose Data Source #58

Open
scetu opened this issue Sep 9, 2024 · 0 comments
Open

[ENH] Add additional port to expose Data Source #58

scetu opened this issue Sep 9, 2024 · 0 comments

Comments

@scetu
Copy link

scetu commented Sep 9, 2024

Would it be possible to add additional port for this addon, to expose it from the HA instance?

For example it would be usefull to use it to forward logs from Reverse Proxy (Nginx/Caddy/...) to Crowdsec instance installed as this addon. Setup as https://docs.crowdsec.net/docs/next/data_sources/syslog

root@424ccef4-crowdsec:/config/.storage/crowdsec/config/acquis.d# cat syslog.yaml 
source: syslog
listen_addr: 0.0.0.0
listen_port: 4242
labels:
 type: syslog

Then forward logs from Caddy with https://caddyserver.com/docs/caddyfile/directives/log#net

{
        # CROWDSEC Local API access
        order crowdsec first
        crowdsec {
                api_key <some_key>
                api_url http://<api_url>/
        }
        # Log to file
        log {
                include http.log.access
                output file /var/log/caddy/caddy.log {
                        roll_size 1gb
                        roll_keep 5
                        roll_keep_for 720h
                }
               #Forward logs to Crowdsec intance
                output net <homeassistant_ip>:4242 {
                        dial_timeout 60s
                        soft_start
                }
        }
}

I have forked the repository and tried to make the changes for PR 84333c7
I can see the new unpublished port in addon config in HA, but if I enter the port number to publish it, then after restart no port is getting published outside of the addon (checked with nmap).

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant