Is it possible to specify the location of ".composer"? - hyperledger-composer

Composer version: 0.16.3
It seems composer command by default create/update $HOME/.composer folder. Is it possible to change this folder ? For example, specify some environmental variable, then it create something like $HOME/.composer-stage, $HOME/.composer-production. The purpose is to change the target. E.g. staging environment to production environment for .bna file upgrade.
I remember in 0.12.x, we were able to select connection profiles for target selection.
Thanks !

This is not available at present, but there is an Issue already logged on Github and it is being worked on Hyperledger Composer Issue 3121 - In making the card store more generic it is likely that it will allow you to specify a folder name of your choice.

so the question (and answer here) relates to Hyperledger Composer. The .composer directory represents the wallet or credentials store for business network cards relating to a user connecting to business network(s) whether via CLI, Playground, APIs, REST etc etc. The current answer is no - not presently. See https://github.com/hyperledger/composer/issues/3121 as referred above.

Related

Why do some Jelastic providers block Export Environment option

According to Jelastic documentation it is possible to export the Environment configuration and download it so it can be restored in another provider
However I have tried with 2 Jelastic providers and they both have disabled the option for exporting private data.
So exporting/download/upload/import of environment is not possible.
i.e. I was expecting to have a process similar to CPanel backup/restore tool
In fact, another view for the deployment process gives a possibility to get rid of the model of handling the data or configuration on the platform. Try to think a bit differently and using CI/CD approach. The Jelastic provides a platform where something you created, locate on somewhere you're elaborating(VCS or GIT as an example) and based on or depends on the specific stack, already pre-configured like a layer and can be installed(copied) over Jelastic. Don't need to handle the data somewhere in the cloud because you have it locally(means within any VCS) and doing the changes there. Then just do a 'pull' procedure(manually or automatically) on that deployment(test, production, staging) environment you're expecting.
Moreover, you can expect any environments type like a code and perform it creating before deploying the data.
Please, find the articles being described each case:
Deployment Guide
Jelastic Packaging Standard for CI/CD Automation
In case you would like to handle the databases' backups, check this article:
Scheduling Database Backups
Additional FTP add-on can make the copies more easily for each instance:
FTP/FTPS Support in Jelastic

Jelastic: how to contribute to Certified App source code?

while setting up a basic 1 x NGINX load-balancer in front of 2 backends, I ended up in what it is clear to me to be a bug: the cron of this Certified App cannot be edited:
As you can see, in this particular App the cron file is owned by root:root and doesn't have the extended attribute (the plus on the right of permissions) necessary for the file to be edited also by the logged in user (nginx in this case).
All other certified apps allow instead the main login user to have crontabs, even though I found the permissions of each file vary a lot.
I've stumbled on https://github.com/jelastic/jem/blob/master/etc/jelastic/export.conf and it seems the file to go for proposing a bugfix, but it's last update if Aug-2016, so I guess Jelastic had closed much of its source code.
How can we contribute to Certified App source code?
indeed it is a bug as cron file of nginx user isn't editable in a balancer template, by design in has to be.
As for exports.conf - this file left for backwards comparability, but no more used.
The problem will be definitely fixed in latest templates, as for existing containers - we would like to apply a patch to fix them, if you provide us more details about hosting service provider you are using - we will help with that.
As for contribution to certified templates, all the images are publicly available on Docker Hub, you can create your own version of template based on existing one if you build a docker image and in your Dockerfile you specify
"from jelastic/nginxbalancer" as a base, then you can do any modifications to the filesystem. Next step will be just to replace existing balancer with your custom one.
Anyway, let's start with fix of existing containers.
Many thanks for finding out the bug!

laravel 5.2 run composer update at hosting

I developed my website and publish it on my host.while editing it in host I add package in composer file to use it.
My question
How to run composer update in host and how to get CMD screen ?
Or
How to add package in host?
please any one help me
This highly depends on your host. The usual "cheap" hosters are shared hosters. Which might or might not give you access to the cmd. Most probably you do not have root access - that makes a lot of things really hard.
One thing you can always do is running the commands directly from your code. You could put this code behind a specific route for example and remove it after the update.
exec('composer install my-package');
// or
shell_exec('composer install my-package');
You should look for ssh / shell access in your hosters faq. However I highly recommend hosting laravel applications on your own server or at least virtual server so that you have full access to everything.

How to fix 'HttpRequest' object has no attribute 'endpoint_arguments' in Odoo?

I was given a database backup (with filestore), the filestore folder and another folder with the installed modules on that database.
I am expected to restore that backup in Odoo 8 with no more data. So what I did is create the PostgreSQL role who owns the database tables and give it enough permissions (login, createdb, replication). Then I created an Odoo config file. Inside this, I set this new PostgreSQL role in db_user and its password in db_password. I added the path where I stored the filestore in data_dir, and the path of the folder with all the modules in addons_path.
As I was given no launcher file, I copied the OCB folder of other Odoo instance I have and used its odoo.py file to start Odoo.
The new instance seems to run well, but now I have just restored the database, and I get this error:
QWebException: "'HttpRequest' object has no attribute 'endpoint_arguments'" while evaluating
'website.get_alternate_languages(request.httprequest)'
I was googling a lot but I was not able to find anything about it, except for a non-answered question in other forum.
Does anyone know what is this about?
Changes related to this issue were introduced in Odoo on 29 February, 2016 (I mean the following changes: [FIX] website: alternate languages translated URL and [FIX] website: backport of as you can check for now these changes are available in the official Odoo 8.0 code base as well).
So most probably you have used outdated Odoo 8.0 server that do not contain above mentioned fixes. Please update to the latest official Odoo 8.0 and check if the issue still persists. Normally your issue should disappear after the update.
When you move backup databases and you want to restore them later on, make sure you mark the branch and commit point of the server files that you took the backup from. I have taken a look at my local v8 odoo and I can see that the endpoint_arguments variable is initialised upon the creation of a web request (openerp/http.py class WebRequest around line 192.)
You mention though that you are restoring the database on the v8 OCB Odoo. If you navigate their distribution and on commit:
https://github.com/OCA/OCB/commit/3913667396e17075528108ac1031939e6f479ced#diff-5e2f434047c379642786a87195c806f9
you will see that this variable was missing and they have added it. So make sure that you git pull the server file to get that commit.
The root of the issue is that you took a backup from a server that had different codebase than the one you are trying to restore the database to. (The qweb file was searching for a variable that is not there)

How are keys 'protected' by storing them in ENV variables?

I am confused about how Laravel protects keys using environment variables. It seems to me that a hacker could just look through the environment variables or at the hidden file. How is this better than storing it in the default array. Does Laravel do something with the environment variable to make this more secure? Or is it just a way to separate keys for different configurations.
I tried searching for an answer but I only found a non-Laravel question of the same nature that didn't seem to have a good answer either.
The configuration file is not meant to be stored in source control. This means the sensitive data is never stored anywhere it does not need to be. If a hacker were to gain access to your repository, they wouldn't be able to access for example; your database password.
This configuration file will placed upon deployment or once manually (eg ssh) into the project for the application to access.
Web server rewrites (apache .htaccess) or NGINX config will ensure that this configuration file can never be directly accessed.
If a hacker gets access to your server via an exploit or another method, they will still be able to access the configuration file.
Security is about having multiple layers, and removing this sensitive data from source control is one of many.
At the bottom of the configuration section in the laravel docs it mentions this very briefly:
Be sure to add the .env.local.php file to your .gitignore file. This
will allow other developers on your team to create their own local
environment configuration, as well as hide your sensitive
configuration items from source control.
Now, on your production server, create a .env.php file in your project
root that contains the corresponding values for your production
environment. Like the .env.local.php file, the production .env.php
file should never be included in source control.

Resources