fdocr / udl-server

This is a server that bounces traffic to better leverage Deep Linking in mobile apps.
MIT License
10 stars 6 forks source link

Support MS Power Apps scheme #21

Open Danielx64 opened 1 year ago

Danielx64 commented 1 year ago

Hello,

I'm pleased to hear that this still works. I'm just wondering, do you have any basic setup instructions (OS already installed) for setting up a standalone server and what the requirements are? I see you have details for Heroku, however they stopped their free plan and at this point I thought that I may as well put this in a VM on a internal company server.

At one point I figured that I would do a little php script (see below) that would handle another issue that we have (we can't view links in outlook that starts with ms-mobile-apps:/// for some stupid reason) but thought that there may be a better way and want to try this out. <?php function Redirect($url, $permanent = false) { header('Location: ' . $url, true, $permanent ? 301 : 302); exit(); } Redirect("ms-mobile-apps:///providers/Microsoft.PowerApps/apps/".trim($_SERVER['QUERY_STRING']), false); ?>

I guess the other thing I should ask, I guess it would be easy for me to edit the source code so that I can use the ms-mobile-apps:/// protocol instead of https?

Looking forward to having some fun with this :)

fdocr commented 1 year ago

do you have any basic setup instructions (OS already installed) for setting up a standalone server and what the requirements are?

and at this point I thought that I may as well put this in a VM on a internal company server.

What VM are you planning on using? Can you use a Linux distro or need to use something specific like a Microsoft OS?

Since it's Ruby code it should work fine as long as the Ruby runtime is available. If you're comfortable with and also able to use Linux let me know and I can share with you an easy to use (almost "packaged") Docker image to run. Just FYI Ruby images aren't known for being lightweight, but I think it shouldn't be too bad and it's an easy way to run it and have the Docker daemon handle the restarts, errors, logging, etc.

If you're not into the Docker option then I'd recommend something along the lines of:

  1. Installing Ruby 3.1.2
  2. Fork the repo and clone your fork on that VM
  3. From the repo directory install dependencies with bundle install
  4. Run bundle exec puma -p 4567 to ensure it runs (customize the port if you want)
  5. Find a way to handle VM restarts/failures/etc for your OS
fdocr commented 1 year ago

(we can't view links in outlook that starts with ms-mobile-apps:/// for some stupid reason)

I guess the other thing I should ask, I guess it would be easy for me to edit the source code so that I can use the ms-mobile-apps:/// protocol instead of https?

I may or may not be understanding the use case exactly right, but I think what you want work with is changing the schema handled by the server.rb. Something along the lines of what I did on #22. You can checkout and test that branch to see if it works for you once you have the server up and running.

That PR was just a very quick and dirty experiment so I'm a bit skeptical of whether it will work. Let me know if it does so I can implement a more permanent solution to support these in the codebase. Otherwise talk me through the situation you want to achieve a bit more in detail to see if I can help. Perhaps something like:

I want to have users go into the URL ms-mobile-apps:///providers/Microsoft.PowerApps/apps/<appID>?tenantId=<tenantId> from an Outlook email so I want to have the browser redirect me to XXXXXXX for deep linking

Danielx64 commented 1 year ago

I'm using Rocky Linux (https://rockylinux.org/), from what I understand is like CentOS (the free version of RedHat).

I managed to get things up and running (I went the manual route as I have no experience with docker), just had to fight with versions (I had ruby 3.1.2 for example) and open up the firewall a little. Other than that, in my quick testing, things are working as expected.

As to what I'm waiting to do, you pretty much got it. Since outlook doesn't support linking to ms-mobile-apps:// protocol properly, I thought that I could use UDL as a mini proxy where I could just link people to something like https://r.domain.com/?r=ms-mobile-apps://xxxxxx and then the browser would do the direction for me.

fdocr commented 1 year ago

I managed to get things up and running (I went the manual route as I have no experience with docker), just had to fight with versions (I had ruby 3.1.2 for example) and open up the firewall a little. Other than that, in my quick testing, things are working as expected.

That's great to hear 👍🏼

As to what I'm waiting to do, you pretty much got it. Since outlook doesn't support linking to ms-mobile-apps:// protocol properly, I thought that I could use UDL as a mini proxy where I could just link people to something like https://r.domain.com/?r=ms-mobile-apps://xxxxxx and then the browser would do the direction for me

Sounds good then. If you can, let me know if what's on main works with that ms-mobile-apps scheme. If it doesn't work pull the latest from branch ms-powerapps (the branch of #22) and then let me know if that does the job. I pushed some quick changes there to better handle these custom scheme redirects.