Checkins via Swarm App # Pebble Time will not be shown in herenow - foursquare

When using the Swarm app at Pebble Time Smartwatch, the checkins will be recognized within the app but not be shown via API "herenow". Is there any reason for that?

Related

NodeJs + Puppeteer on Azure App Services fails to run

I've wrote a simple NodeJs (ExpressJs) server that uses Puppeteer to generate PDF files on JSON data being passed to it. While locally everything is working like charm, I'm struggling to run this server on Azure App Services.
I've created a Resource group, within it I've created an App Servces instance (running on Linux) that is connected to my repo at Azure DevOps (via the Deployment Center).
My server has two endpoints:
/ - returns a JSON - { status: "ok" }. I'm using this to validate the running server instance.
/generate-pdf - uses the Puppeteer to generate and return a PDF file.
After successfully starting the App Service instance I'm able to access the "/" route and get a valid response but upon accessing the "/generate-pdf" route the result is "502 - Bad Gateway".
Does my instance require some additional configuration that I haven't done?
Does App Services can not run Puppeteer? Perhaps there is a different service on Azure that I need to use?
Is there a way to automate the process via the Azure DevOps pipeline or release?
Any questions/thoughts/FAQs are more than welcomed. Thanks =)
I'm answering my own question: as was mentioned here https://stackoverflow.com... the Azure App Services does not allow the use of GDI (which is required by Chrome) regardless if you're using Linux or Windows based system. The solution was to put the NodeJs application into a Docker container and manually install Chrome. Once you have a container - just upload it to the Azure App Services and viola!
By default App Servies exposes 80 and 443 ports, so if your application listens on a different port be sure to specify it via the WEBSITES_PORT environment variable.
In my case, I had to upload the Docker image to the Docker hub but you can also set up a pipeline to automate the process.
I've built the Docker image on my M1 Pro and it led to some arch issues when the container was uploaded to Azure. Be sure to add the --platform linux/amd64 in the image-building step if you're building for Linux.

How to restrict access to an azure app service for certain subdomains

I created an App service and run a Docker image and I would like to allow only certain url to access it.
To be more specific I am running the docker image of https://shields.io/ which provides the badges for my OS project hosted in GitHub. So what I am looking for is to allow only all repositories of my GitHub organization e.g https://github.com/myorganization/repo1, https://github.com/myorganization/repo2 to request service from the Azure app
I don't think you'll be able to achieve that with just an app service. I think a URL will be easily spoofed. I suggest looking at securing a webhook. What you can do is create a function or logic app that can verify the hash you've configured for webhook. If it matches, you can forward the request to your app service. To protect the app service, you can add it and the function app to a Vnet and restrict traffic so that your docker app only receives traffic from the function app.

How to make an API accessible all the time and not just when the project is executed?

I am making my first mobile app using Xamarin.Forms and FreshMVVM as the architecture and I want this app to get info off my SQL database (which is located in azure) by calling an API Rest. I already know how to develop an Api, and all the SQL and Azure related stuff, as well as how to get info from my API.
But what I don't know is how to access this API when the project in which is created is not executed, in other words, I don't know how to make my API Rest accessible all the time, so the App can access to it whenever is needed.
How do you do this?
Thank you all for your time, hope you have a good day.
You need to publish the API to a web host. Azure App Services. AWS. Digital Ocean VM running a web server. Possibly GoDaddy, though I have never used them. Your own server.

Google Cloud Endpoints security

I'm new to Google Cloud and trying to understand the relationship between a Google Cloud endpoint and a back-end app on App Engine.
It looks like when I deploy my application (gcloud app deploy) I get a URL that looks something like https://my-service-dot-my-app#appspot.com/path/operation/etc. Is this URL going through the cloud endpoint, or right to the container?
When I call the service in this way I don't see any traffic to the cloud endpoint. In fact when I try to access the service using what I think is the cloud endpoint it just gives me a 404 (https://my-app#appspot.com/path/operation/etc). Why can't I access with the endpoint? Permissions?
My initial thought was that the endpoint was something separate that routes traffic to the back-end. However, when I do something like change the security configuration in openapi.yaml and just redeploy the endpoint definition (gcloud endpoints services deploy openapi.yaml), this does not seem to actually have any effect.
For example, the initial deployment had Firebase security. I removed it and redeployed the endpoint definition but security remains on when calling the service. Seems I have to redeploy the back-end to disable security.
Any insight would be appreciated.
Cloud Endpoint is a security layer in front of your API. It acts as a proxy and performs security checks (based on API Key, OAuth, SAML,...) and routing to the correct Endpoint. The endpoint definition is based on OpenAPI 2 (not 3, be careful!). There is new advance feature like rate limit and soon billing.
Initially integrated to AppEngine, this product has been open sourced and can be deployed on Cloud Run, Cloud Function and on GKE/Kubernetes. A similar paid and more powerful product is Apigee.
I wrote an article for using Endpoint deployed on Cloud Run, with API Key security and which route requests to Cloud Run, Cloud Function and App Engine.
Cloud Endpoint also offers a developer portal to allow your customer, prodiver and developer to view your API specification and to test it dynamically on line.
I hope these elements provide you a better overview of Cloud Endpoint to abstract your underlying API deployment.
I believe we need to address a few points before providing the correct way forward:
For your first question:
Is this URL going through the cloud endpoint, or right to the container?
Deploying an application to App Engine will generate an #appspot URL for the app. This URL is used to access the application directly, and it will remain available to the internet unless you enable Cloud IAP, or set any other restrictions to the service.
For your second question:
Why can't I access with the endpoint?
If you are referring to the https://my-app#appspot.com/path/operation/etc, there can be a lot of reasons for it to not work, it will depend on which step of the setup process you are.
Normally for setting up Cloud Endpoints with OpenAPI, with an App Engine backend, you need to limit access to the #appspot URL, but also deploy an Extensible Service Proxy (ESP) to Cloud Run to access it later.
Conclusion:
Now, for actually achieving this setup, I suggest you follow the Getting Started with Endpoints for App Engine standard environment.
As per the guide, the following is the full task list required to set Endpoints for an App Engine Standard backend, using Cloud Endpoints:
1 - Configure IAP to secure your app.
2 - Deploy the ESP container to Cloud Run.
3 - Create an OpenAPI document that describes your API, and configure
the routes to your App Engine.
4 - Deploy the OpenAPI document to create a managed service.
5 - Configure ESP so it can find the configuration for your service.
Keep in mind that once you set up the ESP configuration, any calls will need to go through the [YOUR-GATEWAY-NAME].a.run.app.
If you happen to be stuck in any particular step, please provide what you have done so far.
I hope this helps.
Is this URL going through the cloud endpoint, or right to the container?
App engines are container based deployments on Google's infrastructure. The url are created when you deploy it and please note its not API.
When I call the service in this way I don't see any traffic to the cloud endpoint
I dont think a Cloud Endpoint is created by default
One way to check if a Cloud Endpoint is created is to check if its API is enabled in your project or a service account is created in IAM page
To configure a Cloud Endpoint for App engine, following this procedure

How to get AWS to interact with a self hosted webpage?

I have a webpage running on my raspberry using node.js. The webpage has a simple login and after logging in I can control some hardware. The login in is using BCrypt and a mongoDB locally hosted.
I'm using below code to access a specific page, and from there I can send POST commands.
app.get('/profile', isLoggedIn, function(req, res){
// do code (function call)
}
How can I setup AWS to communicate with my server and potentially access the function call?
How should I store my login information to my server in AWS?
/ Thomas
Based on your tags, you just want to use aws lambda.
You create end points in your node app ran on raspberry PI. Make sure you enable cors so that other servers can also make requests to your raspberry server.
When you have your endpoints all set up you can use aws lambda to make requests to your server. Lambdas are node instances, so all you need to do is make node http requests to the endpoints you created. Now what triggers your lambdas depends on what you want to do, just set up events accordingly.
If you want to call some function in your raspberry pi simply create an endpoint which calls that function and then aws lambda does a request to that endpoint, thus aws calls your local functions.
Same with logging in. I assume you use tokens to authorize requests to your server. Since you are making requests from lambdas and not a client, you can't use cookies/local storage to save the token. You will have to use some aws storage service, rds/s3/dynamodb/etc.
If you are open to changing your current web app architecture I suggest looking into using AWS IoT Platform. It seems like a perfect fit to set up your rasberry pi communication with AWS.
Description of IoT Platform:
AWS IoT is a managed cloud platform that lets connected devices easily and securely interact with cloud applications and other devices. AWS IoT can support billions of devices and trillions of messages, and can process and route those messages to AWS endpoints and to other devices reliably and securely.
Guide how to set it up on raspberry pi with javascript:
http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-node.html

Resources