<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[VPN tunnel for apps]]></title><description><![CDATA[<p dir="auto">So, the "Cloudron CLI" has a bunch of important functions that the REST API doesn't, yet the REST APIs documentation says the CLI uses the REST API. Are there just undocumented REST API functions that the Cloudron CLI client has?</p>
<p dir="auto">My main goal is that I have a Docker container (<a href="https://github.com/dperson/openvpn-client" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/dperson/openvpn-client</a>) that runs external to Cloudron (named "vpn") on the VPS (though I could build it into an actual Cloudron app if needed). And I need to run my Cloudron apps <strong>on demand</strong> through that container using the <code>--net=container:vpn</code> argument when using Docker Run.</p>
<p dir="auto">The CLI will allow me to update the VPN as needed if I turn it into a Cloudron app, but I haven't found a way within Cloudron CLI or it's REST API to add that argument <code>--net=container:vpn</code> before it starts an Dockerized app.</p>
<p dir="auto">Does anyone have any ideas?</p>
]]></description><link>https://forum.cloudron.io/topic/3180/vpn-tunnel-for-apps</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 01:49:42 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/3180.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Sep 2020 04:28:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to VPN tunnel for apps on Fri, 27 Oct 2023 16:24:58 GMT]]></title><description><![CDATA[<p dir="auto">I use gluetun at home with an OpenVPN-based VPN service, and it works like a charm.<br />
Not sure how we would implement it in cloudron, though.</p>
<p dir="auto">At my home server I use a docker-compose file with all the services, and on the ones I want to use the VPN, I use <code>network_mode: service:gluetun</code>.</p>
<p dir="auto">Gluetun also needs <code>NET_ADMIN</code> capability enabled.</p>
]]></description><link>https://forum.cloudron.io/post/76177</link><guid isPermaLink="true">https://forum.cloudron.io/post/76177</guid><dc:creator><![CDATA[malvim]]></dc:creator><pubDate>Fri, 27 Oct 2023 16:24:58 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 23 Oct 2023 19:11:17 GMT]]></title><description><![CDATA[<p dir="auto">Would <a href="https://github.com/qdm12/gluetun/" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/qdm12/gluetun/</a> work?</p>
<p dir="auto"><a href="https://medium.com/linux-shots/put-a-docker-container-behind-vpn-fdc0e32c9ca5" target="_blank" rel="noopener noreferrer nofollow ugc">https://medium.com/linux-shots/put-a-docker-container-behind-vpn-fdc0e32c9ca5</a></p>
]]></description><link>https://forum.cloudron.io/post/75829</link><guid isPermaLink="true">https://forum.cloudron.io/post/75829</guid><dc:creator><![CDATA[RubenFixit]]></dc:creator><pubDate>Mon, 23 Oct 2023 19:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Thu, 18 Feb 2021 18:53:09 GMT]]></title><description><![CDATA[<p dir="auto">@lonk said in <a href="/post/16363">VPN tunnel for apps</a>:</p>
<blockquote>
<p dir="auto">Oh, and it may require like 4 or 5 patches to <code>box</code> code. Forgot about that. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f605.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--sweat_smile" style="height:23px;width:auto;vertical-align:middle" title="😅" alt="😅" />It's fully functional tho, a little unpolished, a lot unpolished. But everything works. <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> and I will work together to integrate it properly at some point after 6.0. My patches run at "start" time, so the fact they're inefficient isn't too big of a deal, but just know that somewhere down the line, <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> and I will add it properly into a stable version of Cloudron.</p>
</blockquote>
<p dir="auto">What an accomplishment this was for me back then. I like that my first post in the forums is this crazy hellscape of Cloudron and Docker development jargon. I also wonder if this will ever help anyone down the road. Either way, I'm glad this whole thing is archived, it's p nostalgic for me. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/263a.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--relaxed" style="height:23px;width:auto;vertical-align:middle" title="☺" alt="☺" />️</p>
]]></description><link>https://forum.cloudron.io/post/26106</link><guid isPermaLink="true">https://forum.cloudron.io/post/26106</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Thu, 18 Feb 2021 18:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 19 Oct 2020 19:09:25 GMT]]></title><description><![CDATA[<p dir="auto">Oh, and it may require like 4 or 5 patches to <code>box</code> code. Forgot about that. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f605.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--sweat_smile" style="height:23px;width:auto;vertical-align:middle" title="😅" alt="😅" />It's fully functional tho, a little unpolished, a lot unpolished. But everything works. <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> and I will work together to integrate it properly at some point after 6.0. My patches run at "start" time, so the fact they're inefficient isn't too big of a deal, but just know that somewhere down the line, <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> and I will add it properly into a stable version of Cloudron.</p>
]]></description><link>https://forum.cloudron.io/post/16363</link><guid isPermaLink="true">https://forum.cloudron.io/post/16363</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Mon, 19 Oct 2020 19:09:25 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 19 Oct 2020 18:56:31 GMT]]></title><description><![CDATA[<p dir="auto">To anyone who really needs this <strong>right now</strong>. I just finished with the beta. I've tested it, but there is one manual step needed (you have to copy and paste the "containerName" of your app into a file in the OpenVPN Client File Manager) until <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> has time after 6.0 to add some Dashboard polish to the whole thing in which case the only thing you need to do is add an <code>.ovpn</code> file to it's backend, which you simply login with the same credentials you login with Cloudron (since it has LDAP integration) and it'll do the rest. The <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> Dashboard code I <strong>think</strong> he's adding is a dropdown box to all installed OpenVPN client app's to choose which one you want to connect to (right now, like I mentioned, you have to manually add that to the file <strong>inside of</strong> the VPN Client's filesystem which isn't very intuitive)".</p>
]]></description><link>https://forum.cloudron.io/post/16362</link><guid isPermaLink="true">https://forum.cloudron.io/post/16362</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Mon, 19 Oct 2020 18:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sun, 18 Oct 2020 14:21:02 GMT]]></title><description><![CDATA[<p dir="auto">LDAP integration was surprisingly easy to add after I realized <code>cloudron update</code> <strong>doesn't</strong> expose new <code>add-ons</code> added to the manifest and I had to <code>cloudron uninstall</code> and then <code>cloudron install</code>.</p>
]]></description><link>https://forum.cloudron.io/post/16266</link><guid isPermaLink="true">https://forum.cloudron.io/post/16266</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sun, 18 Oct 2020 14:21:02 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sun, 18 Oct 2020 14:22:04 GMT]]></title><description><![CDATA[<p dir="auto"><strong>TODO:</strong> Last two things.<br />
• I WILL: Add backend interface to allow a logged in user to submit any .ovpn file via a file chooser and convert it to what Cloudron needs after submitting the new <code>.ovpn</code>.</p>
<p dir="auto">• <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> <em>MIGHT HAVE TIME TO</em> DO: Modify Dashboard and <code>appdb.js</code> to add the <code>vpnclient</code>'s <code>vpnContainerID</code> <strong>and</strong> <code>internalIP</code> to use in <code>NetworkMode</code> for any apps choosing to route <strong>only their outgoing</strong> traffic through the VPN (presumably a drop-down box in the config option of an app which will need to be coded in the dashboard, codes to the ovpn-client's manifest ID - which allows for getting the <code>containerID</code> and <code>internalIP</code> of the <code>vpnclient</code> app).</p>
<p dir="auto">DONE: <s>Add an HTTP API endpoint to change and convert any .ovpn file a user supplies via POST into the container and disconnect from current to connect to the newly added .ovpn</s></p>
<p dir="auto">DONE: <s>Add a front end web interface login page at the base URL of the app which allows for logging in to the app via Cloudron's LDAP</s></p>
]]></description><link>https://forum.cloudron.io/post/16265</link><guid isPermaLink="true">https://forum.cloudron.io/post/16265</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sun, 18 Oct 2020 14:22:04 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sun, 18 Oct 2020 14:03:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> said in <a href="/post/14784">VPN tunnel for apps</a>:</p>
<blockquote>
<p dir="auto">You shouldn't filter by app id etc in docker. Instead, we have to first create a networkId entry in the apps table. Then, app.networkId is then simply the network id to be used in docker.js when creating the container. We don't even have to filter by openvpnclient app etc. The filtering will be done by the dashboard code (i.e in the UI).</p>
</blockquote>
<p dir="auto">100% agreed. I'm only doing that now as a proof of concept because, tbh, I'm not sure where to put this option in the dashboard code (plus dashboard code is harder to work with). So, my hack to filter the other apps to crab the <code>containerId</code> of the OpenVPN Client (and using a hardcoded <code>app.fqdn</code> conditional to connect to it), I'll use for now until you have time to get together and talk about <strong>how</strong> to implement this on the front end.</p>
]]></description><link>https://forum.cloudron.io/post/16264</link><guid isPermaLink="true">https://forum.cloudron.io/post/16264</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sun, 18 Oct 2020 14:03:39 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sun, 11 Oct 2020 02:33:32 GMT]]></title><description><![CDATA[<p dir="auto">Also, of note, I use some ridiculous exposed port (29875 or something like that) for the VPN app's web interface itself (it's <code>exposedPort</code>) so it'll never conflict with an actual app on the store that tend to use 80 or 8080.</p>
]]></description><link>https://forum.cloudron.io/post/15467</link><guid isPermaLink="true">https://forum.cloudron.io/post/15467</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sun, 11 Oct 2020 02:33:32 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sun, 11 Oct 2020 02:32:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> Well, <a class="plugin-mentions-user plugin-mentions-a" href="/user/mehdi" aria-label="Profile: mehdi">@<bdi>mehdi</bdi></a> is correct that that should be how it works. But it has always worked this way.</p>
<p dir="auto">The problem <strong>was never</strong> trying to run incoming traffic through the VPN. The problem lies in that if you connect two app's NetworkMode’s together, they have to share the same IP and it removes all network binds to the secondary app (so your healthcheck and nginx routing can't do anything with the info it usually uses). So, the reverse proxy change detects if an app is connected to a VPN Client and if it is, it uses the Docker <strong>actual</strong> / internal IP and the secondary app’s <strong>actual</strong> exposed port to route the incoming traffic to.</p>
<p dir="auto">It can’t use localhost:randomizedport (127.0.0.1:56343) unless we used a second nginx proxy to forward its randomized Docker port <code>app.httpPort</code> to its real IP and real exposed port. Docker, in normal circumstances, binds these things for all apps <strong>unless</strong> their “NetworkMode” is another container - which it is in this case, to make the VPN function.</p>
<p dir="auto">Did I properly explain that / does it make sense?</p>
<p dir="auto">Note: I'm positive there's a <strong>very</strong> complicated solution to this that I mapped out and is too ridiculous to implement. But there is a caveat,  which is that multiple apps using the same exact <code>exposedPort</code> <strong>cannot</strong> co-exist on the "same network" / connected-to-the-vpn-container. But that's kind of the point of the OpenVPN Client sharing it's network connection, sharing the IP. So, we could restrict one app to connect to one VPN rn to remove "Error: Port Collision" user errors - because you can always install more than One VPN client and connect it to the same VPN. Less work. Don't really see a use case for a <strong>a lot</strong> of the "same exposed port" apps being used with the same vpn client, but we can let the community decide on that later?</p>
]]></description><link>https://forum.cloudron.io/post/15408</link><guid isPermaLink="true">https://forum.cloudron.io/post/15408</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sun, 11 Oct 2020 02:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Tue, 06 Oct 2020 05:51:33 GMT]]></title><description><![CDATA[<p dir="auto">@Lonk said in <a href="/post/14472">VPN tunnel for apps</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mehdi" aria-label="Profile: mehdi">@<bdi>mehdi</bdi></a> said in VPN tunnel for apps:</p>
<p dir="auto">What you should try to achieve is making only the app's outgoing traffic go through OpenVPN, and the connexion between it and Nginx and stuff stay exactly the same as it currently is</p>
<p dir="auto">That is currently the case as far as I can tell. All incoming traffic bypasses the VPN entirely. Outgoing traffic uses the VPN's connection. But the NGINX needs an incredibly minor change. There's no way around that.</p>
</blockquote>
<p dir="auto">It seems <a class="plugin-mentions-user plugin-mentions-a" href="/user/mehdi" aria-label="Profile: mehdi">@<bdi>mehdi</bdi></a> nailed it already <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> What is the minor change you require in reverse proxy?</p>
]]></description><link>https://forum.cloudron.io/post/14785</link><guid isPermaLink="true">https://forum.cloudron.io/post/14785</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 06 Oct 2020 05:51:33 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Tue, 06 Oct 2020 05:50:30 GMT]]></title><description><![CDATA[<p dir="auto">@Lonk I am not sure changes to the reverse proxy code are required at all. Maybe I didn't get a full grasp of your feature request, so let's take a step back.</p>
<ul>
<li>
<p dir="auto">The reverse proxy is only for <em>inbound</em> traffic. It's not used for outbound traffic. It's just a demuxer for incoming http requests to the app containers. My understanding of the feature you suggested was that we want say TTRSS, to use the tunnel for outbound traffic like say when fetching RSS feeds. This means that <a href="https://reader.domain.com" target="_blank" rel="noopener noreferrer nofollow ugc">https://reader.domain.com</a> itself still points to Cloudron but any outbound traffic originating from the container goes via this tunnel.</p>
</li>
<li>
<p dir="auto">You shouldn't filter by app id etc in docker. Instead, we have to first create a networkId entry in the apps table. Then, app.networkId is then simply the network id to be used in docker.js when creating the container. We don't even have to filter by openvpnclient app etc. The filtering will be done by the dashboard code (i.e in the UI).</p>
</li>
</ul>
<p dir="auto">I can help out a bit more but I want to first double check if we are in sync about this reverse proxy stuff.</p>
]]></description><link>https://forum.cloudron.io/post/14784</link><guid isPermaLink="true">https://forum.cloudron.io/post/14784</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 06 Oct 2020 05:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Tue, 06 Oct 2020 01:04:14 GMT]]></title><description><![CDATA[<p dir="auto">Quick Ideas for the web interface I wanted to jot down:</p>
<p dir="auto">• Easy access to common VPN providers<br />
• Attaching VPN app to other app's from within the app itself (using the Cloudron API)<br />
• Saving previous connections for later use<br />
• Not having to restart itself (the app) every connection change (there's no avoiding needing to restart an app that's connecting to it though, that's a limitation of docker <strong>unless</strong> <code>docker network connect --link vpnclientcontainername cloudron container2</code> would work to mitigate this - it did not in my testing but I know more now, I'll test this again at some point).</p>
]]></description><link>https://forum.cloudron.io/post/14773</link><guid isPermaLink="true">https://forum.cloudron.io/post/14773</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Tue, 06 Oct 2020 01:04:14 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 05 Oct 2020 19:36:42 GMT]]></title><description><![CDATA[<p dir="auto">For anyone interested in the full VPN Client app's code, I pasted it here: <a href="https://github.com/lonkle/openvpn-client-cloudron" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/lonkle/openvpn-client-cloudron</a></p>
<p dir="auto">Still unfinished. Gonna complete 1.0 and then move it to Cloudron's Git.</p>
]]></description><link>https://forum.cloudron.io/post/14676</link><guid isPermaLink="true">https://forum.cloudron.io/post/14676</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Mon, 05 Oct 2020 19:36:42 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 05 Oct 2020 17:53:48 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Note:</strong> I'm still working on a simple web interface to change the <code>.ovpn</code> file rather than having to replace the file in the Cloudron File Manager (the web interface will do it for you). When the file is changed in the web interface, the container / app will restart via a Cloudron API call meaning the user would have to provide their Cloudron token unless there's another way to restart the container from within it (but I plan on just disconnecting and reconnecting to the new file with no container restart - but for an MVP that will work). Right now, you have to change the file in the Cloudron File Manager and restart the app yourself.</p>
]]></description><link>https://forum.cloudron.io/post/14643</link><guid isPermaLink="true">https://forum.cloudron.io/post/14643</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Mon, 05 Oct 2020 17:53:48 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Mon, 05 Oct 2020 17:38:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> (or <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a>)  I'm finished with the OpenVPN Client app, and with the <code>docker.js</code> and <code>reverseproxy.js</code> changes needed to make it work. Right now, it's hardcoded so that if any app being installed with a domain name <strong>containing</strong> "vpnconnect" it will connect to the OpenVPN Client if there is one (you'd need to change this hardcoded <code>if</code> conditional to be the dropdown box value where you choose which VPN Client to connect on the Cloudron Dashboard that <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a>  suggested - since you can install as many as you want and thus connect as many as you want to them, a dropdown will be needed).</p>
<p dir="auto">Everything is working perfectly now. But, my code to get the IP Address and the container name of the OpenVPN Client is...not great.</p>
<p dir="auto">Ideally, on starting the VPN Client app, it <strong>would</strong> (if I could have figured it out) add it's IP Address and container name somewhere easy for other apps to retrieve those two pieces of data and connect to the client since those are the only two values needed. But instead I  changed the <code>docker.js</code> - <code>createSubcontainer()</code> function and also when writing the Nginx <code>.conf</code> in <code>reverseproxy.js</code> - <code>writeAppNginxConfig()</code>  - I parse the DB for those VPNClient values and get them - but it's messy code. Could I send you those files for you to look over? I don't know another way to write the code - but my original goal was to load <code>VPNClientIPAddress</code> and <code>VPNClientContainerName</code> into <strong>every</strong> app object on initialization if an app exists on Cloudron who's <code>manifest.id</code> incudes "vpnclient". I'm sure that's possible, but I couldn't find where you load the <code>app</code> objects values. I <em>could</em> RE some more and find it, but this works so I'm just gonna use it. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title="😂" alt="😂" /></p>
<p dir="auto">So now that this is <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f4af.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--100" style="height:23px;width:auto;vertical-align:middle" title="💯" alt="💯" /> working with no issues, where should I go from here to:</p>
<ol>
<li>Make this an official app on the App Store?</li>
<li>Work with you guys to make the <code>box</code> changes that are needed to make the app work?</li>
</ol>
]]></description><link>https://forum.cloudron.io/post/14642</link><guid isPermaLink="true">https://forum.cloudron.io/post/14642</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Mon, 05 Oct 2020 17:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sat, 03 Oct 2020 15:30:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> said in <a href="/post/14476">VPN tunnel for apps</a>:</p>
<blockquote>
<p dir="auto">getAppByManifestId</p>
</blockquote>
<p dir="auto">I guess the proper function name then would be <code>getAppsByManifestId</code> - the point is to get the  <em>possibly</em> multiple VPN Clients installed to populated the drop down box in other app’s configs asking which VPN Client app they would like to share a network with. So this is a needed function and I can parse through the app DB to collect the data.</p>
<p dir="auto">I found your function to <code>getIDByIPAddress</code>and I’m basically using it as a reference to write the opposite function now <code>getIPAddressById</code>. Would you like me to make this a function or would you like me to just put the code in the <code>NginxAppConfig</code> function the singular time I need to use it? It’s needed to make all of this work.</p>
<p dir="auto">I need you to know of the singular limitation of the VPN Client app though:</p>
<p dir="auto">• Multiple apps can connect to a singular VPN Client app <strong>unless</strong> two apps exposed <code>httpPorts</code> are the same. So you couldn’t connect two of the same app or different apps that use the same web port. I cannot find a way around this except to install a second VPN Client. Which I don’t think is a bad solution given how small my app is. But that will have to be enforced in the drop down box via a new function. I don’t plan on touching dashboard code tho so I’ll leave that up to you. But when you get to that step, tell me and I’ll write you a function to only show you the VPN clients whose connected <code>app.manifest.httpPorts</code> don’t conflict with the app being configured in the dashboard to protect users from port conflicts.</p>
]]></description><link>https://forum.cloudron.io/post/14509</link><guid isPermaLink="true">https://forum.cloudron.io/post/14509</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sat, 03 Oct 2020 15:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sat, 03 Oct 2020 03:47:08 GMT]]></title><description><![CDATA[<p dir="auto">Oh wait, the container object, would contain the IP and the container ID. I could intercept that right after it’s created. 🧐</p>
]]></description><link>https://forum.cloudron.io/post/14486</link><guid isPermaLink="true">https://forum.cloudron.io/post/14486</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sat, 03 Oct 2020 03:47:08 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sat, 03 Oct 2020 03:45:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> I think you’re right about using the app table. I’ll try to RE how you use it to populate the <code>apps</code> variable.</p>
<p dir="auto">And no worries not following along with this thread. It’s been <strong>really</strong> difficult for me to get this working so I used this as kind of note-taking. Now that I’m nearly finished, people won’t get as bugged by my posting here every time I discover something new about the way <code>box</code> works. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title="😂" alt="😂" /></p>
]]></description><link>https://forum.cloudron.io/post/14485</link><guid isPermaLink="true">https://forum.cloudron.io/post/14485</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sat, 03 Oct 2020 03:45:05 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sat, 03 Oct 2020 03:41:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> As for the first function, it was mainly due to me needing to find a way to identify the VPN client app by the only unique identifier I knew. I’ve hardcoded it for my use case rn...but that won’t work for the production version now that I think about it - so I’ll still need to get app data using the <a href="http://manifest.id" target="_blank" rel="noopener noreferrer nofollow ugc">manifest.id</a> (com.joelstickney.openvpn-client-cloudron). So when the app that needs to connect to it starts, it attaches to the container ID of the Open VPN client on <code>containerCreate</code>.</p>
<p dir="auto">Maybe right now I’ll store the things I need in ENV variables and find a way to use the “apps” object to parse through all of them till I find the VPN client. <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=21ee5037fec" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title="🤔" alt="🤔" /></p>
]]></description><link>https://forum.cloudron.io/post/14484</link><guid isPermaLink="true">https://forum.cloudron.io/post/14484</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sat, 03 Oct 2020 03:41:30 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Sat, 03 Oct 2020 03:34:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> I had actually nailed that issue out actually as a matter of fact. The only thing I have left is <code>getLocalIPAddressByApp(app)</code> - but maybe the <code>app</code> object already stores its internal IP (I didn’t think it did, but it stores <strong>a lot</strong>)?</p>
]]></description><link>https://forum.cloudron.io/post/14483</link><guid isPermaLink="true">https://forum.cloudron.io/post/14483</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Sat, 03 Oct 2020 03:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Fri, 02 Oct 2020 23:02:39 GMT]]></title><description><![CDATA[<p dir="auto">You can't getAppByManifestId since there can be many apps for a given manifest id. I think you have to store whatever you want in the database in the apps table. Then when you get the app, you can get that information (like say the network  id). Sorry, if my answer is totally off since I didn't read the full thread completely.</p>
]]></description><link>https://forum.cloudron.io/post/14476</link><guid isPermaLink="true">https://forum.cloudron.io/post/14476</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Fri, 02 Oct 2020 23:02:39 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Fri, 02 Oct 2020 21:47:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> The post above this one, do you know off the top of your head how to get those values?</p>
]]></description><link>https://forum.cloudron.io/post/14475</link><guid isPermaLink="true">https://forum.cloudron.io/post/14475</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Fri, 02 Oct 2020 21:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to VPN tunnel for apps on Fri, 02 Oct 2020 21:50:29 GMT]]></title><description><![CDATA[<p dir="auto">I just need a function like <code>getAppByManifestId(manifestID)</code> - and this will be a fully functioning proof of concept. And then another function for <code>getLocalIPAddressByApp(app)</code>.</p>
<p dir="auto">Oh, and I need to change some slight NGINX config, make it more dynamic (Cloudron hardcodes it's <code>proxy_pass</code> to 127.0.0.1 rn and it needs to be dynamic).</p>
]]></description><link>https://forum.cloudron.io/post/14474</link><guid isPermaLink="true">https://forum.cloudron.io/post/14474</guid><dc:creator><![CDATA[Lonkle]]></dc:creator><pubDate>Fri, 02 Oct 2020 21:50:29 GMT</pubDate></item></channel></rss>