local gitlab Auth 2.0 and django - django

Hello We made our own Gitlab installation on our server. I installed Readthedocs Local in the link below. In order to connect our accounts on gitlab with readthedocs, I was asked to make the following settings from the gitlab section in the readthedocs document.
https://readthedocs.org/
https://dev.readthedocs.io/en/latest/install.html
But interestingly, even though I set the settings on our own server gitlab.local, by default django goes to gitlab.com when I connect to gitlab via devthedocs.org. However, it should connect to gitlab.local on my server, how can I fix this problem?
On page 34 of this document here
https://readthedocs.org/projects/django-allauth/downloads/pdf/latest/
"The GitLab provider works by default with https://gitlab.com. It allows you to connect to your private GitLab
server and use GitLab as an OAuth2 authentication provider as described in GitLab docs at http://doc.gitlab.com/
ce/integration/oauth_provider.html"
I need your support in this matter.
Thank you very much.
Configure the applications on GitHub, Bitbucket, and GitLab. For each of these, the callback URI is http://devthedocs.org/accounts//login/callback/ where is one of github, gitlab, or bitbucket_oauth2. When setup, you will be given a “Client ID” (also called an “Application ID” or just “Key”) and a “Secret”.
Take the “Client ID” and “Secret” for each service and enter it in your local Django admin at: http://devthedocs.org/admin/socialaccount/socialapp/. Make sure to apply it to the “Site”.

Related

IBM-Cloud Django Application integration with APP-ID

I've deployed a Python & Django Application in IBM Cloud Foundry and trying to integrate APP-ID for SSO. I received the OIDC provider information from the metadata provided from the APP-ID. But my question is how do I integrate the APP-ID with DJANGO APPLICATION for a Successful integration of SSO?
Here is an example of how flask application, can be used but is there an example or process of how a Django application is done?
https://dzone.com/articles/securing-your-python-app-with-openid-connect-oidc-1
For this integration, I tried to use below links for OIDC client in Django App and IBM APP-ID information for integration but no luck.
APP-ID: https://dzone.com/articles/securing-your-python-app-with-openid-connect-oidc-1
OIDC: https://django-oidc-rp.readthedocs.io/en/stable/getting_started.html
The DZone article on the Python app with OIDC refers to this IBM Cloud solution tutorial. The tutorial discusses the use of IBM Cloud App ID for the Python Flask app and provides the code in this GitHub repository. Take a look at how the Flask OIDC module is initialized:
# Configure access to App ID service for the OpenID Connect client
appID_clientinfo=ClientMetadata(client_id=appIDInfo['clientId'],client_secret=appIDInfo['secret'])
appID_config = ProviderConfiguration(issuer=appIDInfo['oauthServerUrl'],client_metadata=appID_clientinfo)
The code uses OIDC discovery for the actual setup. It requires only the clientID and secret as well as the URI. Aren't those exactly the properties you are asked for in the second article you linked to?
I'm using mozilla-django-oidc. The setup is well documented:
https://mozilla-django-oidc.readthedocs.io/en/stable/installation.html#quick-start
It looks quite similar to django-oidc-rp from a quick glance, but mozilla-django-oidc seems to be a bit more active on github and works for me.

Parse Dashboard on AWS and adding cloud code

I configured a parse server on my AWS elastic beanstalk using this guid I've tested it and it all works fine
Now I can't find a way to deploy parse dashboard on my server.
I did deployed parse dashboard on my local host and connected it to the application on server, But this way I cannot manage (Add and remove) my apps.
Another problem is that parse dashboard missing cloud code on default, I found this on git, but I cant understand where do I add the requested endpoints, is it something like adding app.use('/scripts', express.static(path.join(__dirname, '/scripts'))); on the index.js file?
in order to deploy parse-dashboard to your EC2 you need to follow the Deploying Parse Dashboard section in parse-dashboard github page
parse-dashbard github page
Please make sure that when you deploy parse-dashboard you are using https and also basic authentication (it is also part of the guide)
Now regarding the cloud code: the ability to deploy cloud code via parse CLI and to view the nodejs code in parse dashboard are not available in parse-server but those are parse.com features. Cloud code in parse-server is handled by modifying the main.js file which exist under the cloud folder and deployment should be done manually by you but the big advantage in parse-server cloud code is that you can use any NodeJS module that you want from there and you are not restricted to the modules that were used by parse.com .
Another point about the dashboard. What you can do is to create an express application and then add parse-server and parse-dashboard as a middleware to your express application and deploy the whole application to AWS and then you can enjoy both parse-server (that will be available under the /parse path, unless you changed it to something else) and parse dashboard that will be available under the /dashboard path
Enjoy :)

WSO2 P.PaaS : Accessing the AS and other WSO2 products

So I have got WSO2 P.PaaS installed and running. I want to deploy .war file to the Application Server. It seems the AS on P.PaaS does not accept .war file; but the stand-alone one does. See here. Also, I want to use the WSO2 products deployed into the PaaS. I am not sure what URL or port I should use. Is there a tutorial that I can use to experiment?
Sorry for the brevity, but, I am new to WSO2.
What PPaaS version you have installed, 4.0.0 or from current master branch which is 4.1.0 milestone 1 version?
Here is the quick start guide Quick start guide .
You can access the management console as https://STRATOS_DOMAIN:9443/console.
Assuming you are using PP 4.0.0 version,
Log into management console
Go to cartridges page. There you can find the available cartridges, you should find Application Server as a cartridge.
Click on AS cartridge in order to subscribe for it. At subscribing process you would be asked a GIT repository URL.
After you subscribe, PP will clone what is in your GIT repository url in to Application server. So if you provide a url which has your web application, those application would be automatically deployed into the Application server. Here is a sample GIT repository , you can include your web apps under "webapps" folder.
There after if you modify your web apps (say web app version 2) and commit the changes to your repository, Stratos/PP automatically update Application server with the new web apps.
Since you have already deployed PP, you can have a loot at this screencast to see how you can deploy a web app

deployment steps for deploying a wso2 server to a production environment

I would like to understand the steps for deploying a WSO2 server to a production environment.
Using WSO2 ESB as an example, I have seen instructions for extracting the binary and running the
startup script, but just these steps don't seem robust enough for a production environment - in a production environment, I would expect to see some additional steps:
what directory is the normally used for installing? /opt, /usr/local, something else?
create a unix user account and unix group for running the service
setting up ulimits - are ulimits normally configured for wso2 services?
creating init.d scripts for starting the service automatically (there is a blog here, but as discussed in the blog comments, the blog seems to go against a warning in the official ESB document not to install the service as a daemon)
to security harden the service:
e.g. replace self signed certificates - which certificates?
e.g. change default passwords - which user accounts?
what else needs to be security hardened?
configuring clustering (this seems to be documented here)
configuring the credential store:
production database credential store (this seems to be documented here), or
ldap credential store
Question: What are the steps required to deploy a WSO2 server to a production environment?
Question: I've also seen some puppet scripts. Are these scripts production ready?
NOTE: I've previously posted this question on the wso2 mailing lists which is primarily attended by WSO2 employees. I'm also posting here to the user community who hopefully have put some wso2 servers into production.
what directory is the normally used for installing? /opt, /usr/local, something else?
/opt
create a unix user account and unix group for running the service
Have an Admin user to install/run the server.
setting up ulimits - are ulimits normally configured for wso2 services?
You need to define ulimits at OS level
to security harden the service: e.g. replace self signed
certificates - which certificates? e.g. change default passwords -
which user accounts? what else needs to be security hardened?
You need to change self signed default server certs (certs are in wso2carbon.jks)
Have an strong admin password and encrypt it in all config files using cipher tool
You can check the documentation for further info.

Grails App with Multi Tenant Single DB plugin URL implementation in Cloudfoundry

I am currently creating a web app using Grails implementing Multi Tenant Single DB plugin. The plugin allows me to have multiple tenants on a single db using a tenantID to differentiate between tenants. The plugin detects witch tenant will deal the current request that is made on my app by resolving using different domains/subdomains for each tenant.
For example:
Tenant 1 = companyA.myapp.com
Tenant 2 = companyB.myapp.com
On my local machine running Grails development mode I was able to implement the different hosts by changing my /etc/hosts and each tenant would have their own subdomain.
I am currently interested in using cloud foundry as my cloud platform but when I deploy my app to cloud foundry it is already using my app name as the subdomain for cloud foundry.
For example:
- myapp.cloudfoundry.com
Is it possible to change or control the domain name resolver in
cloud foundry?
Does anybody know how to handle multi-tenant subdomains as explained above in cloud foundry? Probably provide the steps in implementing this using cloud foundry?
What is the best approach to implement this using cloud foundry?
My App is using Grails 2.0.4 and Multi Tenant Single DB plugin 0.8.2.
Thanks
Unfortunately the current beta version CloudFoundry does not allow modification of the cloudfoundry subdomain. The plan is to have the GA towards the end of this year with a private preview of the version of the site available sooner in the fall. At that time you could be able to customize the subdomain.
Therefore you might need to change a little in your TenantResolver to only check the subdomain that varies.
To implement your requirement, did you try installing the grails cf plugin? If not you can start from here.
If you are using cli, installing the plugin just needs command in your project workspace:
grails install-plugin cloud-foundry
When your app is ready for deployment, push it to cloudfoundry:
grails cf-push
Note that you will have to have your cf credentials configured in the grails config file.
After that you can map multiple URLs you want using:
grails cf-map user1.yourapp.cloudfoundry.com
If you have already known about vmc which is the client command line interface for cf, you can see the urls mapped with your app by
vmc apps
If not you can refer to the installation guide to start if you would like to do that.
If you are using STS/eclipse, things will be even easier. First you need to have grails-support extension as well as the cloud foundry integration installed. For detailed docs of the cf integration please refer here.
After your app is deployed, right click the project and choose "Grails Tools" -> "Open Grails Command Prompt". This will enable you to have same grails cf plugin commands as the CLI does.
Hope this can help your move forward in the cloudfoundry world. Let me know if you have more questions.
Thanks,
William