Select repository via the REST API - graphdb

I'm trying to use the new embedded visualisation feature. I have an iframe that points to the graphdb server with url in the form :
http://localhost:7200/graphs-visualizations?uri=[...]&embedded
That works fine, but only for the default or previously selected repository. I can't find a way to select repositories without having to manually go to http://localhost:7200/
It seems that the repository selection is stored in a cookie, and that the X-GraphDB-Repository HTTP header is available, but nothing seems to work with iframes.
Is there a way to select repositories through url ? &repository= would be perfect.
More detail : we have an app with N "studies" backed with N repositories (with SPARQL queries), when a user selects a study, then an uri, we want to display a Visual Graph iframe. That works for the default or previously selected repository, but when she go to another study, we need a way to transparently update/select the repository in the Workbench app.
The only solution we see for the moment is to use a proxy that will set the cookie on the fly. But that seems overkill.

GraphDB Workbench has two mechanisms to control the current selected repository. To illustrate this open Setup > Repositories pages and check:
(1) the "Connect repository" icon (the first option in the Repository list) controls the current selected repository by storing it in the local store. Check what is the difference between local storage and a cookie.
(2) the "Set as default repository" icon (the last option in the repository list) controls the default server repository. When a default repository is selected the server assumes to which repository to dispatch all HTTP requests like linked data publishing or like in your case the Visual Graph.

We finally decided to configure a nginx proxy workaround. It works well, but a ?repository= query feature is definitely missing.
map $arg_repository $repo_cookie {
"~^(?<repo>[0-9a-f]{32})$" "com.ontotext.graphdb.repository7200=$repo";
}
server {
listen 7200;
server_name localhost;
location / {
add_header Set-Cookie $repo_cookie;
proxy_pass http://graphdb:7200;
}
}

Related

Moving Jira Server to https - gadgets and app search no longer working

I have recently moved our Jira Server installation to an https URL - we have a reverse proxy setup and I have configured apache/Jira according to atlassian's docs. https://confluence.atlassian.com/kb/securing-your-atlassian-applications-with-apache-using-ssl-838284349.html
We can access and use Jira with no issues, however the activity feed on the dashboard, and the search function to find new apps is no longer working.
When i look at the console it still appears to be trying to access the http:// version of the URL even though I have updated the base URL to the https version.
When I view source, I can see several references to the old http:// version of the URL. e.g.
WRM._unparsedData["com.atlassian.servicedesk.core-ui:util-base-url.base-url"]="\"http://jira.xxx.xxx\"";
<input type="hidden" id="upmBaseUrl" name="upmBaseUrl" value="http://jira.xxx.xxx">
<input type="hidden" value="http://jira.xxx.xxx/plugins/servlet/upm/marketplace" name="upmUriMarketplace" id="upmUriMarketplace">
Is there some other place where this needs to be updated? I've tried a general search/replace in the database, and i've grepped the installation and application data directories for the old URL.
Could it be a cache issue?
To move the Jira site to a new HTTPS location, you generally need to ensure that you have configured both:
the base URL, and
the proxyName, proxyPort, secure, and the scheme in the <Connector> of Jira's conf/server.xml. Also ensure that you're editing the correct <Connector> (since there are multiple in the default install, some of which are commented out).
You mentioned that you have done both of these, but the symptoms suggest that either #1 or #2 might not be complete or 100% correct.
If you are using a containerized version of Jira, also make sure that any environment variables also correspond to your new setup, since these can override settings in the above places.
For example, if you are using the official Docker image, this means variables such as ATL_TOMCAT_SCHEME, ATL_TOMCAT_SECURE and the like.

Creating LDAP-Authenticated Login Sub-directory/DAM assets in CQ5

I am running CQ 5.4 currently (5.5 upgrade pending) and need to establish a few sub-directories that can only be accessed by logging in and validating against the LDAP. This also means the files users can download after logging in have to be authenticated as well.
I have read as much of Adobe's documentation (and 3rd party) as I can:
http://dev.day.com/docs/en/cq/5-4/howto/create_apply_cug.html
http://dev.day.com/docs/en/cq/5-4/deploying/dispatcher.html#/sessionmanagement
http://www.wemblog.com/2013/01/how-to-associate-cug-with-dam-asset-in.html
We have LDAP enabled to log in and use CQ5 on our development server, but this is different from having our publish server use it for subdirectory-specific authentication and allowing all other static pages be cached. Unless I'm reading all of this wrong, none points out how to accomplish such.
Having the default login component work with LDAP authentication would be wonderful, but I am not holding my breath.
It's possible to configure ACLs (access lists) for each node.
For example, through LDAP you export users which belong to group ldap-users. Then, if you go to Content Repository Explorer (/crx/explorer/index.jsp) -> Content Explorer - > Choose node you need to set ACL for -> Security Access Control Editor -> New ACE. There you can set the access rights for the node.
More on how to set the ACLs: http://helpx.adobe.com/cq/kb/CQ53ACLsMappingToCRX2.html

Changing URL in VisualSVN

Have 5 year old server ready to decommission and have new server with VisualSVN just installed. Our old server had a very memorable URL such as svn://company.com. Now the path on the new server is terrible - https://server.company.com:8443/svn/MyRepo. I'd much prefer to have something much shorter with a dozen engineers needing to use it.
I've read other posts saying we should visit httpd.conf but I can't even find that file in the conf folder.
I've also read that VisualSVN support states they cannot support this as of mid-2009. They also suggest not changing the httpd.conf file.
Anyone have answers on the topic?
OK, lets split problem on separate small tasks
Convert server.company.com into company.com
Pure DNS issue, write needed data in DNS-zone for internal domain or use local hosts-file
Convert company.com:8443 into company.com
Start VisualSVN Server (plain VisualSVN is SVN-plugin for Visual Studio) on 80 port
Convert company.com/svn/ path into company.com/
Read my answer in the part "How to have DAV-SVN in the site-root" ("Implementation", p.3)
Remove repository name from URL
Default config implies using more than one repo from one server. If it is not your case and you have one repo, you can modify Location data and use wanted and needed SVN directive (we'll consult with Subversion Book for this, "Basic Apache Configuration" topic)
You can instruct Apache to delegate the handling of all URLs... to a
DAV provider whose repository is located at /var/svn/repository using
the following httpd.conf syntax:
<Location ...>
...
SVNPath /var/svn/repository
</Location>
Note - /var/svn/repository in example is directory, which contain immediately our single repository
Viola! Task solved?!
When VisualSVN team tell about
not changing the httpd.conf file
they have in mind (I think) the need for the user
have a copy of customized httpd.conf, because on every VisualSVN Server update httpd.conf will be replaced with default
self-integrate their own changes to changed by developers configuration
be intelligent and smart and don't complaint to VisualSVN team about troubles, caused by local changes, not by problems in vanulla product
Beginning with VisualSVN Server 3.5, it is possible to adjust the URL to your repositories. In other words, prior to version 3.5 the URL always looked like https://example/svn/myrepo/. It is now possible to change the "/svn" part to "/repos" or any other prefix you'd like. Moreover, you can completely remove the prefix.
Follow these steps to customize the URL prefix:
Start VisualSVN Server Manager.
Go to Action | Properties.
Select Network tab.
Select Customize under Repositories URL:
You can select "Empty URL prefix" option to remove the "/svn" prefix completely or select "Custom URL prefix" and specify the prefix you'd like to use in the URL (for example, "repos").

Issue Listing multiple SVN repositories from client

I've already setup Apache to manage svn requests.
Basically the structure of the svn related directory is this:
/Repository
-----OneRepo
-----TheOtherRepo
Repository is a "normal" directory, while OneRepo and TheOtherRepo are svn repositories.
I've used SVNParentPath and SVNListParentPath directives and if I go to localhost/Repository/ (with my browser) I can see all my repositories.
Now, if I try to access a single repository (for example: OneRepo) from a client (in my case Cornerstone but Versions is the same) everything works fine.
The problem is that I would like to access the repository listing from the client so that I have a big "folder" with all my projects in it. Does it make sense?
So, instead of writing http://192.168.x.x/Repository/OneRepo in my client (and it works) I would like to write http://192.168.x.x/Repository/ and view a listing of project and so checkout whatever project I would like to.
Is that possible?
Thanks
This works only in a http browser. So your standard SVN Client (commandline , TortoiseSVN, etc.) can not list your repositories

Make Maven Proxy/Server settings configurable based on location?

So I'm not sure what the best way to accomplish this is, but basically I have a laptop that I use at work for Maven projects. It works fine when I'm at work, but as soon as I walk out of the door of their corporate proxy and maven server, I often have to do alot of hand-fudging of the settings.xml file when I'm at home if I'm not VPN'ed in:
We have a corporate-installed Maven Repository proxy server to store some of our own artifacts and handle being the middle-man for our commonly used artifacts.
We have an http proxy that we use for connecting to the outside world.
Both configurations have been handled by my settings.xml file for setting a single Nexus group and maven proxies. If I'm not connected to the VPN while away from the office, I have to muck around with the settings.xml each time I'm not on it, then switch it back when I am on it.
What solutions have anyone else found to handle this? I've been trying profiles to manage the proxy, but I can't seem to get it to work correctly, and it's starting to look pretty ugly. Are there some settings configurations that can detect when I'm not behind the proxy at work and not use the corporate proxy server or Maven server?
While I can think of some profile based solution to handle the proxy (basically, reading the <active> value from a property defined in a profile), this wouldn't be fully automated (the profile activation do not support network based stuff) unless you can find a file that is present or not depending on your location (in which case, you could use an existing/missing file trigger but this is kinda hacky). Anyway, this would solve only one part of the problem because mirrors can't be declared in profiles (see MNG-3525).
So, instead of trying to control this with a profile, my suggestion would be to use two settings.xml and to pass your settings-home.xml file with the -s command line option when you're at home.
Another option would be to automate the changes in your settings.xml with a script (Groovy would be a good choice as someone reported in MNG-3525).
I found a use environment variables to set nonProxyHosts together with proxy and noproxy shell aliases to be the most convenient solution when switching between networks with proxy and without it.
In settings.xml, configure proxy with
<host>proxy.corporation.int</host>
<port>8080</port>
<nonProxyHosts>${env.MAVEN_NONPROXY}</nonProxyHosts>
Then in ~/.profile set
export MAVEN_NONPROXY_PROXY='*.corporation.int|local.net|some.host.com'
export MAVEN_NONPROXY_NOPROXY='*'
alias proxy="export MAVEN_NONPROXY=\"$MAVEN_NONPROXY_PROXY\" && export all_proxy=http://proxy.corporation.int:8080"
alias noproxy="export MAVEN_NONPROXY=\"$MAVEN_NONPROXY_NOPROXY\" && unset all_proxy"
To do the switch when roaming, you would just execute from a shell:
[me#linuxbox me]$ proxy
or
[me#linuxbox me]$ noproxy
Obviously, both aliases proxy and noproxy can include much more changes than just setup of MAVEN_NOPROXY and all_proxy.
I was frustrated by the same problem: having to manually edit settings.xml when roaming between networks. So much in fact, that I wrote a Maven plugin that enables automatic discovery of proxy settings. The current implementation uses the proxy-vole library written by Bernd Rosstauscher to detect proxy settings based on OS configuration, browser, and environment settings.
I've just released the source code of the plugin on Github, under an Apache 2.0 license: https://github.com/volkertb/autoproxy-maven-plugin
You're welcome to give it a try and to see if it meets your needs. Any feedback or contributions are welcome!
(Note: you don't necessarily have to add the plugin to your project's POM. You can invoke it from the command line as well, after you've installed it. See the README on the site for more details.)
You can set MAVEN_OPTS when you need to activate a proxy:
export MAVEN_OPTS="-Dhttp.proxyHost=my-proxy-server -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=*.my.org -Dhttps.proxyHost=my-proxy-server -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=*.my.org"