Chrome WebExtension - Private Store and Enterprise Environment - google-chrome

I'm trying to publish a Chrome Extension in a Private Store and to propagate it with a Group Policy.
In order to do that I'm using the following references:
CRX Packaging
GPO Propagation
I'm 100% sure that the GPO is configured correctly (if I use the same GPO to propagate an extension published on the Chrome WebStore it works).
Unfortunately, both my private extension (line in the Configure the list of force-installed apps and extension section: [my_extension_id];[my_xml_url]) and the example extension (line: bcanfnleljfidkjhhfknjjiicdonddad;https://sites.google.com/site/pushcrx/privatewebstore/2hrtimer.xml) are not installed in the domain controlled machine.
My question is: am I doing something wrong or the Google Chrome Policies have changed and the examples above are outdatet?
Thanks so much,
Daniele

In order to publish, deploy and update a Chrome extension outside the Google Chrome Store you have to follow the guide below.
1. Architecture
Firstable it is necessary to define the CRX and XML names and the url where they would be deployed.
For what concerns this example:
the CRX name would be myCRX.crx and it would be deployed at the url https://my.server/resources/myCRX.crx
the XML name would be myXML.xml and it would be deployed at the url https://my.server/resources/myXML.xml
2. JSON Manifest
As specified in this link the update_url (where the update XML could be found) must be contained in the JSON manifest: in order to do that it is necessary to insert the following line into the JSON file.
{
[...],
"update_url": "https://my.server/resources/myXML.xml",
[...]
}
3. CRX and private key creation
The creation of the CRX and the PEM can be performed following this guide.
At the end of the process two files would be created (a CRX and a PEM): after that it is necessary to rename them to myCRX.crx and myPEM.pem, respectively.
4. Public key extraction
The extraction of the public key can be performed by executing the following command from the folder where the PEM is located:
openssl.exe rsa -in myPEM.pem -pubout > myPEM_pub.pem
After that a new file containing the public key (named myPEM_pub.pem) would be created.
5. Extension ID extraction
The Extension ID extraction can be performed following this guide.
In particular, it is necessary to download the extension_id.py file, copy it in the folder containing the myPEM_pub.pem file and execute, from the same folder, the following command:
python extension_id.py myPEM_pub.pem
Note: if you're using Python 3 you have to modify the line 94 of the extension_id.py file from
with file(first_arg) as f:
to
with open(first_arg) as f:
The command output would be the following one:
[...]
Extension ID: <myExtensionID>
[...]
6. XML file creation
In order to properly deploy the extension it is necessary to create the update XML file (named, in this example, myXML.xml).
In this case its content would be:
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='<myExtensionID>'>
<updatecheck codebase='https://my.server/resources/myCRX.crx' version='<myExtensionVersion>' />
</app>
</gupdate>
Note: it is necessary to replace the following entries with the right values
<myExtensionID>, output of paragraph 5
https://my.server/resources/myCRX.crx, defined in paragraph 1
<myExtensionVersion>, defined in the manifest file
7. Publishing
In order to properly configure the environment it is necessary to publish the CRX created in paragraph 3 and the XML created in paragraph 6 at the urls defined in paragraph 1.
8. Deployment
The deployment of the extension can be performed following this guide.
In particular, it is necessary to add to the list of the force installed app and extension the following line:
<myExtensionID>;https://my.server/resources/myXML.xml
Note: it is necessary to replace the following entries with the right values
<myExtensionID>, output of paragraph 5
https://my.server/resources/myCRX.crx, defined in paragraph
1
9. Update - CRX creation
In order to update the extension it is necessary to create a new CRX package, with an updated version number (in this example <myNewExtensionVersion>).
The CRX creation can be performed following this guide.
Note: in order to make this process work it is necessary to select the key myPEM.pem, created in paragraph 3.
10. Update - Publishing
In order to publish the update it is necessary to rename the CRX created in paragraph 9 to myCRX.crx and to modify the version number in the XML created in paragraph 6 (see below).
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='<myExtensionID>'>
<updatecheck codebase='https://my.server/resources/myCRX.crx' version='<myNewExtensionVersion>' />
</app>
</gupdate>
After that, the last thing that has to be done in order to perform the update is the publishing of the CRX and the XML at the urls defined in paragraph 1.

Related

How to configure JupyterLab to look the same when opened?

I'm developing a small application using JupyterLab that I will distribute around the world. I would like to configure JupyterLab so that when my users download my code, move into the directory, and execute jupyter-lab, they will always start with the same view.
For example, I want JupyterLab to open up with the README.md file shown rendered as markdown. I don't want Python or Jupyter Notebook files opened (initially).
Is there a way to configure JupyterLab in this way?*
You can use jupyterlab-workspace.json file to specify layout. Here are some examples:
Dask: jupyterlab-workspace.json binder
Pangeo: jupyterlab-workspace.json binder
Ian's demo (possibly outdated)
They work by executing the following command before starting up JupyterLab:
jupyter lab workspaces import jupyterlab-workspace.json
Do NOT try to create the JSON file manually (do not use them as a reference). Instead create a new workspace, arrange tabs/files as you wish and then use:
jupyter lab workspaces export workspace_name > jupyterlab-workspace.json
See the workspaces documentation for more details. There is also a relevant topic on discourse.
For your particular use case I would just create a file with a script that your users would use instead of executing jupyter-lab, e.g. a simple two-liner like:
jupyter-lab workspaces import jupyterlab-workspace.json
jupyter-lab
But if you just want one single file to be shown you may as well just create a wrapper that asks for that file to be opened like:
jupyter-lab README.md
Please note that there was a bug that meant that above did not work some time ago (it is working well if you have the latest versions of jupyterlab-server, jupyter-server, jupyterlab; while updating remember to update nbclassic - if installed - as well).

How do I tell MSDeploy to deploy a package using a manifest?

I have a TeamCity build that creates a package by running the following:
msdeploy -verb:sync -source:contentPath=C:\path\to\files\myFilesToDeploy -dest:package=C:\path\to\packages\filesToDeployPackage.zip
Now I want to deploy this package and its contents to a few servers, but I want to do it using a manifest:
msdeploy -verb:sync -source:package=C:\path\to\packages\filesToDeployPackage.zip -dest:manifest=C:\path\to\manifests\destManifest.xml
destManifest.xml contains:
<?xml version="1.0" encoding="UTF-8"?>
<sitemanifest>
<contentPath path="\\machineNetworkName\path\to\final\content"/>
</sitemanifest>
But this gets me the following error:
Error: Source (contentPath) and destination (sitemanifest) are not compatible for the given operation.
The only way that I managed to have something work was by having 2 manifests, one for source and one for dest, and use contentPath on both XMLs, but then I can't use the package that my build produces. This case requires that folders are uncompressed first. Also I don't like having 2 manifests, I want to solve this with a single manifest.
I've checked Microsoft's docs and other threads and I can't find an example of this. Any hints?

SAP HANA: not able to call xsjs file in HTML

I had an SAP UI5 application project in which one of the pages is product.html and a xsjs file getProductCat.xsjs.
Now I made some changes in HTMl page from notepad. When I try to open in HANA's web browser the changes are there but it is not able to connect to xsjs file. However, if I try to open through browser it connects to xsjs but the changes are not there, it seems it's opening the old file.
As I am new to SAP UI5 so I think I am missing some basic step.
Go to HANA client installation folder, run the following command line to get the help for HANA content activation:
C:\Program Files\sap\hdbclient>regi help activate
Action:
activate
What:
inactiveObjects (all inactive objects in the current workspace)
package (all objects in a package)
packages (all objects in a package and its sub-packages)
trackedPackages (all objects in all tracked packages and their sub-packages)
object (specific objects)
Call "regi help activate <WHAT>" for more information.
after you changed the xsjs file, did you activate it? You need to setup your workspace for the xs app. Did you?
Actually, this is not sapui5 question. This is a HANA XS application related question.
-D

What manifest visual studio is using to generate msdeploy package

I want to package a folder with msdeploy.exe to a zip destination at the end of CI process.
I run the following command line
msdeploy.exe -verb:sync -source:contentpath="C:\SampleWebApp" -dest:package="c:\SampleWebApp.zip" -declareParamFile="parameters.xml"
I also like the *.deploy.cmd and *.SetParameters.xml which msbuild generates when it spits out a deployment package. I renamed the one set of *.deploy.cmd and *.SetParameters.xml file and changed the content accordingly. to be able to run in deployment environment.
When I run *.deploy.cmd file it generates the folder "C:\SampleWebApp" rather than creating the iis app based on parameters provided in .SetParameter.xml.
After some investigation, I've found that the .cmd deploys to -dest:auto which is good. but apparently my package manifest inside the package indicates that this package is contentPath whereas packages generated by msbuild has more complex manifest in archive.xml inside package using iisApp provider.
Having looked at following post
http://blogs.msdn.com/b/webdev/archive/2013/01/09/real-scenario-folder-deployment-scenarios-with-msdeploy.aspx
I believe if I use -source:manifest="Package.xml" with right Package.xml the end result should be similar to VS package output
The I thought maybe the *.SourceManifest.xml is the manifest for the package. I used and it builds the package but when I want to deploy that to the using .deploy.cmd it complains about setAclUser
Error: A value for the 'setAclUser' setting must be specified when the
'setAcl' provider is used with a physical path.
Does anybody know that is the manifest msbuild uses?
To directly answer your question: the manifest is generated dynamically based on MsDeploySourceManifest MSBuild items.
You can make it use contentPath rather than iisApp by declaring DeployAsIisApp=false in your publish profile (or command line /p:DeployAsIisApp=false). This will also disable the setAcl providers.
If you want to keep iisApp, you can disable the ACL providers...
... being added to the package by declaring IncludeSetAclProviderOnDestination=false in your publish profile
... being deployed by passing /I:False to deploy.cmd
Following is the manifest template
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<iisApp path="[PATH1]"/>
</sitemanifest>
and Parameter.xml template
<parameters>
<parameter name="IIS Web Application Name" defaultValue="WEBSITENAME" tags="IisApp">
<parameterEntry kind="ProviderPath" scope="IisApp" match="^[PATH1ESCAPED]$" />
</parameter>
<!-- appSetting section-->
</parameters>
note: [PATH1] should be replaced with your folder path like C:\MY.FOLDER\WWW
and [PATH1ESCAPED] should be same path but escaped with postfix and prefix ^ $ like
^C:\MY.FOLDER\WWW$
Then you can call
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:manifest="Manifest.xml" -dest:package=%1 -declareParamFile="parameters.xml"
and %1 being folder path like C:\MY.FOLDER\WWW

Azure Worker Role configuration issue while using SlowCheetah with custom config

We are using Nlog as logging tool with our Worker Role of Azure app.
It requires NLog.config file. We installed "SlowCheetah - XML Transforms", and have two Debug/Release transforms).
Solution does get rebuild successfully.
But when I try to run, I am getting following error. (I used exact transformation for nolog.config in one of my Windows service app, and it is working fine there).
Error 163 The item "bin\Debug\NLog.config" in item list "OutputGroups"
does not define a value for metadata "TargetPath". In order to use
this metadata, either qualify it by specifying
%(OutputGroups.TargetPath), or ensure that all items in this list
define a value for this metadata. C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure
Tools\1.6\Microsoft.WindowsAzure.targets 2299 5 Insight.CloudWeb
I don't know if this is done by the SlowCheetah extension, but could you verify if your *.csproj file contains the AfterCompile target similar to this?
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask TaskName="TransformXml"
AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="exists(’app.$(Configuration).config’)">
<TransformXml Source="NLog.config"
Destination="$(IntermediateOutputPath)$(TargetFileName).config"
Transform="NLog.$(Configuration).config" />
<ItemGroup>
<AppConfigWithTargetPath Remove="NLog.config"/>
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
Take a look at Oleg's blog post .Config File Transformation under App.config File Transformation for more information.
I have a fix for this. Now you should be able to transform app.config as well as other XML files for Azure Worker Roles using SlowCheetah. Once I get the fix verified I will release the update to the VS gallery.
If you would like to try the fix you can download the updated VSIX at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44.zip. If you are interested in following up on this please use the issue #44.