Permission issue of generated folders in magento2 - magento2

Whenever we are doing the static content deploy in magento2 instance in ubuntu environment.the generated folders create with following permission
0770 and so that when we are browsing via URL the page is not loading, I have tried in many ways of work for it , what magento2 freak guys doing for this kind of scenario rather giving the manual permission to the folder when it is created, the Following class is responsible for the creating the folders with permission.
This is default driver interface class
Magento\Framework\Filesystem\DriverInterface
const WRITEABLE_DIRECTORY_MODE = 0770;
This below class is used for the file generator
Magento\Framework\Code\Generator\Io
This function is used for creating the directory
private function _makeDirectory($directory)
If you have any suggestions or idea post it now.

We changed the way Magento sets file system permissions in 2.0.6. What version are you using?
We now do not set permissions on static files or anything else. For more information, see this.

Related

how to load workbench ui in vscode extension

I'm developing a vscode extension, and I'm currently facing a problem, and I'd like to seek your help.
I want to use the VScode UI in the webview created by the plug-in to ensure the consistency of the user's vision. How do I refer to the resource?
I tried the following:
Use appRoot to directly splice vscode-file://vscode-app/, displaying network errors
Use appRoot to refer to 'file://' and find: Not allowed to load local resource
Use asWebviewUri, display HTTP code 401
const cssfile = vscode.Uri.file(path.join(vscode.env.appRoot,"out/vs/workbench/workbench.desktop.main.css"));
const cssurl = this.view.webview.asWebviewUri(cssfile);
console.log(cssurl);
I found the reason through the official documentation, because of security restrictions, you need to add approot to the settings.
Use the WebviewOptions.localResourceRoots to allow access to additional local resources.
https://code.visualstudio.com/api/extension-guides/webview#loading-local-content

Generated codelab does not work. Files removed from storage.googleapis.com

I have been using codelabs for creating tutorials.
https://github.com/googlecodelabs
I use the claat tool to generate the tutorial from an md file.
Since the past few days I have noticed my codelabs have stopped rendering.
It appears like the css and js files which were served through storage.googleapis.com are removed. Any idea how to fix this problem?
Tried accessing the css and js files directly
https://storage.googleapis.com/codelab-elements/codelab-elements.css
It gives an error
Anonymous caller does not have storage.objects.get access to the Google Cloud Storage
object. Permission 'storage.objects.get' denied on resource (or it may not exist).
I know this is the problem but dont know how to fix it.
Hi I had the same issues
There is a fix for both the template
https://github.com/googlecodelabs/tools/pull/798/commits/c9e6704bec43413dc972dd17d48df59589d4b2cb#diff-32ca476fba2e5a4abb3a8851cdd88e3f115676a9bce40a587c4d0d3e6a644341
as well a new claat version https://github.com/googlecodelabs/tools/releases/tag/v2.2.5.
In my own claat template I have adjusted the links to all my ressources like ccs and js from /codelab-elements/.. to /claat-public/.. and that fixed the issue.

TYPO3 REST Extension setup

I'm trying to setup the REST-Extension v2 in TYPO3 8.7 following this tutorial. I included the 2 templates called Virtual-Object-Page and Virtual-Object-Content in my template. I made a new extension using Extension Builder 8.7 from Github with a simple model. I installed the new extension and made some Instances of my model in the List View on my start page. In the Typoscript of my template I added:
plugin.tx_rest.settings.paths {
1 {
path = me-kinder-child
read = allow
write = allow
}
}
Me is the Vendor, kinder my extension key and child is my model.
When I'm calling http://localhost/rest/ I get The requested URL /rest/ was not found on this server.
What am I missing?
The path in the setup is explained being possible with several options, so perhaps try different configuration, possible is also all.
I don't see a fault in your setup, so the fault might be related to the server-file .htaccess or the extension realurl respectively the combination of both perhaps.
If you try it already with realurl or cooluri then disable that to get it running without first.
The htaccess file you can disable first too and enable it later again to adjust all requirements to each other.
The problem was not about RealURL was missing in any way. I just did not clear a cache that got cleared while installing RealURL. I guess that the "Clear all caches"-button in the Install-Tool would do it too.

Unable to delete content resources on JasperReports Server

I'm using JasperReports Server 5.6 and I have some reports deployed there.
The problem starts when I generate a PDF output for my reports. I can see the output file in the repository, but I'm unable to delete it.
I'm able to delete other types of resources, as an image or report, for example. But when I need to delete a generated PDF, the upper options bar doesn't offer me any options (including deleting). If I try to right-click the PDF, it doesn't open any pop-up menus (as it does for images, for example).
The image below shows what happens to the options bar:
Here goes some interesting things I've noticed:
The type column in the repo tells me the PDF is a "Content Resource". If I manually upload another PDF from my local machine to the repo as a "Content Resource", the UI also doesn't let me delete the resource.
I'm logged in as the administrator user. It's set with ROLE_USER and ROLE_ADMINISTRATOR roles (it's the default jasperadmin user).
The directory which contains the PDF is set with permissions Read+Write+Delete for the ROLE_USER.
Tried to log in as another user with ROLE_USER and I got the same result.
The JasperReports Server's tomcat is running as root (it's a test environment).
I went through the JasperReports Server's User's Guide and Administrator's Guide. Both said that I need to have the right permissions (and I do), and also I need to have no references to the resources to be deleted. In the case above, where I have an uploaded PDF as a "Content Resource", I don't have any references to it inside the repo, and I still can't delete it!
If I delete the super directory that contains the PDF, it works fine.
So, do you guys have any ideas of what I can try to get rid of these PDF outputs?
So far the best solution, I didn't find any better, for this is to use the delete button on the keyboard
I really don't know why is the menu button disabled but nevermind.
I am facing the same problem. There is a work around for this: Use Jaspersoft Studio.
Add a JasperReports Server Connection, expand the node and locate the file you wanted, then right-click and select Delete.
This is not an elegance solution but works for the moment.
EDIT - found the problem and have a fix.
The JS is missing "Utils" scope in getInitConfiguration. The original source is:
var Utils = {
restOfString: function(str, fromStr) {
var from = str.lastIndexOf(fromStr) + fromStr.length;
return str.substring(from, str.length).trim();
},
getInitOptions: function () {
return localContext.rsInitOptions || __jrsConfigs__.repositorySearch["localContext"].rsInitOptions;
},
getInitConfiguration: function () {
return getInitOptions().configuration;
}
};
Just change "return getInitOptions().configuration;" to get "return Utils.getInitOptions().configuration;"
You'll have to make this change in the optimized version of the script (optimized-scripts/results.page.js). Fortunately there are only two occurrences of getInitOptions so it's easy to find and fix the correct one.
The root cause is a javascript error:
uncaught ReferenceError: getInitOptions is not defined
This is coming from results.page.js, but I haven't found a fix for it yet. This code is attempting to change the state of the toolbar buttons. I tried using the latest 6.x version of the script, and that did not fix the problem either.
Also listed at http://community.jaspersoft.com/questions/843951/unable-delete-report-output-jasperserver-56
When you are going to delete the content resource Delete button show disable. I am also experiencing the same problem so for time being I am deleting my content resources by using following query on Jasperserver schema.
Delete from jicontentresource where id in
(
Select id from jiresource
where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25');
Delete from jiresource where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25';
You have only to mark all files and then push the Delete-Button

External access to Magento instances

I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');