wirecloud default workspace - fiware

I've got my own wirecloud instance running.
I've developed a set of specific widgets and operators, but as I register a new user I have to manually load each component.
It's possible to configure it so users can have a default workspace?
How?

Currently, it's not possible to set up a default workspace for new user. See this ticket for more details.
In the other hand, it's possible to install components for all the users of your WireCloud instance:
You can use the command line interface (doc) and upload the resources for all the users:
$ python manage.py addtocatalogue --public mycomponents/*.wgt
Or your can make use of the Django's admin panel:
Open it:
Go to the Catalogue Resources section:
Select a component:
And make it available to all the users of your WireCloud instance:

Related

Openshift deployment strategy delegation through sa

We have a tool that provisions the ci/cd workflow for all the teams in our company. As part of the tool chain provisioning we are also creating openshift project automatically.
I am trying to figure out a best automated athorization strategy for invidual team's deployment process
Here is what we are doing currently
Create a project (eg: testproject)
Create a service account(oc create sa testuser)
Add user to admin role for the project (oc policy add-role-to-user admin system:serviceaccount:testproject:testuser)
Now we retrieve the api token for sa account testuser
oc describe sa testuser (Get the predefined token of testuser)
oc describe secret testuser-token-gd9sl (Get the session token)
Through describe secret command, we can retrieve the api token. We give these api tokens to individual teams.
oc login https://192.219.152.34.nip.io –token=adfasdfsdaf23423
Teams Once logged in as using their token , they are able to peform any api oerations in the scope of testproject.
eg: oc create -f testproject-deploymentconfig.yml
oc create -f testproject-service.yml
Is this approach correct ? does it have any draw back ? is there a better approach to this? Can anyone suggest
Here is my suggestion which become better your automatic object processing (I hope it).
Above process (create project and sa) should be executed when new project is created, then you can use the task via project template - Modifying the Template for New Projects.
For instance, you can include your serviceaccount yaml definition in the template.
We do it mostly the same way.
Within a Jenkins pipeline we create a project via a template yaml file.
This includes project metadata and annotations, an named user (LDAP login of the requester) associated as admin and some predefined pull secrets.
Login to Openshift is secured by Keycloak with MFA. And afterwards the admin account himself can edit membership and add serviceaccounts as needed.
We also didn't modify the default project template.

What server URL should be used for the `oc login` command when using OpenShift's PaaS?

What do I provide for the server URL in the oc login tool, when using the OpenShift PaaS?
I'm trying to migrate my OpenShift Online v2 app to v3, following the instructions for PHP apps linked to from OpenShift's Migration Center. That page says to run something following the pattern oc new-app https://github.com/<github-id>/<repo-name>.git --name=<app-name> -e <ENV_VAR_NAME>=<env_var_value>. After tracking down a download for oc (which wasn't easy), I tried running that command with my repo URL*; this results in:
$ oc new-app https://USERNAME#bitbucket.org/USERNAME/PROJECTNAME.git --name=PROJECTNAME
error: Missing or incomplete configuration info. Please login or point to an existing, complete config file:
1. Via the command-line flag --config
2. Via the KUBECONFIG environment variable
3. In your home directory as ~/.kube/config
To view or setup config directly use the 'config' command.
Not knowing what subcommand of oc config to use, I searched and found Get Started with the CLI, which says to use oc login to start the configuration process. But when I run that, I get:
Server [https://localhost:8443]:
What do I provide for the URL here, when using the OpenShift PaaS (i.e. not a local installation)? I've tried things like https://openshift.com/ and the URL of my web app, but both of them result in
error: The server was unable to respond - verify you have provided the correct host and port and that the server is currently running.
* I decided to use Bitbucket instead of GitHub; I'm not sure if this is unsupported, or (if it's supported) whether I should be providing USERNAME#bitbucket.org.
It is right over there in the web console.
Click on (?) help icon right beside your user name on top right corner. Select 'Command Line Tool' from the drop down menu.
Alternatively, it is there in the URL :
http://<openshift url>/console/command-line
e.g. it is mentioned on the below URL for me:
https://console.starter-ca-central-1.openshift.com/console/command-line
Hope it helps.
In the RedHat OpenShift Online web console, click on the (?) help icon right beside your user name in the top right corner. Select 'Command Line Tools' from the drop down menu.
A pop-up window appears with a section "oc - OpenShift Command Line Interface (CLI)", and there's a link for Copy Login Command. Click that and it takes you to a page like
https://oauth-openshift.apps.ca-central-1.starter.openshift-online.com/oauth/token/display?code=Ge.....
(You may be prompted at this point to log into the Redhat Portal, do that if necessary.)
The page will then show the text
Display Token
Click Display Token
It will show output similar to this:
Log in with this token
oc login --token=... --server=https://api.ca-central-1.starter.openshift-online.com:6443
On the web console, click in your profile and then you can see "copy Login command" like this:
Then you just click on it and do it again on the button "Display token" in the new browser tab. Here is what your token looks like:
I just tried actually signing up for an OpenShift v3 Starter plan (which I hadn't done before because I didn't want to get ahead of myself, and the migration guide hadn't said to do so yet). That course of action did give me access to the "Command Line Tools" menu item under the ? menu, which gives the command line as oc login https://api.starter-us-east-1.openshift.com --token=<hidden>. (The hidden token is copied to the clipboard if you click the clipboard icon to the right of that line.)
I created an account for OpenShift v3 Starter plan.
Then I installed OC Tool available here.
I created a project called spike1 on US west.
Finally when running oc login and set Server URL to https://console.starter-us-west-1.openshift.com/
Hope this helps.
Once you create a project in public OpenShift. It redirect to my console
starter-us-west-1.openshift.com/console/
If you wana login to openshift using CLI.
command is
oc login https://console.starter-us-west-1.openshift.com

How do start using the deployed wirecloud in the lab?

I have just deployed an image of wirecloud on the https://cloud.lab.fiware.org/#nova/images/
I gave it a floating ip and then I connected to it via ssh.
Now what?
I cant find any command to issue in order to start using wirecloud, the entire user guide (https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Application_Mashup_-Wirecloud-_User_and_Programmer_Guide) is about the UI.
I tried going to the assigned floating ip but all I get is the page (http://150.254.155.20/) from which I cannot log in.
So how do I set up and use the wirecloud once I ssh'ed my way inside the apparently ubuntu machine?
The WireCloud Image available on FIWARE Lab deploys a WireCloud instance at /opt/wirecloud_instance. This instance configures a default admin user (credentials: admin/admin). The first step is to modify this admin user, to do so you have to login inside WireCloud and entering the Django admin panel:
Once in the admin panel, open "Auth -> Users -> admin" and update your admin user:
You can also change the default configuration of this instance (for example, change the default theme, add the emails for error reporting, etc...), please take a look into the Installation and Administration guide for more info.
P.D. Currently the WireCloud image uses WireCloud 0.6.2. You can update it using the following commands:
$ pip install -U wirecloud
$ cd /opt/wirecloud_instance
$ python manage.py syncdb --migrate; python manage.py collectstatic --noinput; python manage.py compress --force

Multiple alias in one account

I never used fortrabbit before and i have a question about it.
I know i can create apps and define the document root, but lets imagine the following:
I want to go with Yii2 Framework (Advanced template)
Advanced template have "two apps" in it (2 folders) the backend and the frontend.
On a real server we have to create two alias, eg:
admin.myapp.com -> root/backend/www
www.myapp.com -> root/frontend/www
Is possible to configure the fortrabbit to work with it within the same application and share the same resources (MySQL, cache, etc)?
your setup is possible at fortrabbit.
Just put both folders in your git repo and push to forrabbit. After that you can route the subdomains (www., admin.) to the subfolders (frontend/www, backend/www).
If your project requires a composer install during the deploy process it will not work our of the box, since we check only for the composer.json/lock in the root of your project.
However you can define your custom post-deploy scripts. In these script you could call a composer install in the subfolders.
Cheers
Oliver (fortrabbit staff)

How i can publish a openshift app in tk domain?

I am trying to register an app in Openshift, in tk domain using freenom. However, when I go to "URL Forwarding" and put the url of the app "xxxx-xxx.rhcloud.com" I have the following error:
Given URL returns 500
I see that the app is running.
Any idea
finnally I find that openshift can't use url forwadding.
The only option is use cname way. (In dot tk select default name servers and later click over "Manage Freenom DNS"
Previously you need create alias in openshift, this opperation can be done in the app console web interface, create alias option is near app web direction.
here a link with more information:
https://blog.openshift.com/custom-url-names-for-your-paas-applications-host-forwarding-and-cnames-the-openshift-way/