8000 [Feature Request] Execute bash Scripts · Issue #504 · sablierapp/sablier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Feature Request] Execute bash Scripts #504

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

Open
r4nchy opened this issue Feb 5, 2025 · 2 comments
Open

[Feature Request] Execute bash Scripts #504

r4nchy opened this issue Feb 5, 2025 · 2 comments

Comments

@r4nchy
Copy link
r4nchy commented Feb 5, 2025

Can you add a feature such that whenever the sablier triggers the container start signal it can also has the ability to execute a custom bash script.

For example something like on_start

subdomain.example.com {
    sablier http://localhost:10000 {
        group glances
        session_duration 1h
        dynamic
        on_start /bin/bash /home/ubuntu/myscript.sh
    }
    reverse_proxy http://localhost:1234
}
@acouvreur
Copy link
Member

Can you provider more details on what this feature would allow you to do ?

I think something quite similar is described here: #423

But instead of specifying a something to execute, you could subscribe to such event directly and do whatever you want.

I think it would give you more flexibility, but also require more setup because you need an http server to listen to the webhook events.

@ravngr
Copy link
ravngr commented Apr 22, 2025

I think this is adjacent to the fix for #159 as this functionality would enable arbitrary calls to other machines and services. It could trigger a webhook (leveraging curl directly perhaps), call out to an external machine over SSH or SNMP, there are a lot of options...

I was considering this sort of approach for integration with hypervisors like Proxmox, you could bring a VM or container up/down as requested. Having a layer of abstraction provided by bash (or any scripting language) between the start/stop request and the target would also allow for formatting of messages for specific APIs or generation of notifications for events.

I think a good paradigm for this setup would be to follow what @r4nchy is suggesting, but specify the script as on_event or something, then passing the event type as an environment variable or command line argument. The environment could also be setup to include useful variables like URL, group, etc.

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

3 participants
0