How to configure artifactory CEPH S3 with Direct Upload Mechanism? - artifactory

Artifactory: 7.38.8
It works fine with the Eventual Upload Mechanism. I try to change it to the Direct Upload Mechanism, but I cannot upload any file.
My binarystore.xml configuration:
<config version="1">
<chain>
<provider id="cache-fs" type="cache-fs">
<provider id="s3" type="s3"/>
</provider>
</chain>
<provider type="s3" id="s3">
<bucketName>xxx</bucketName>
<endpoint>xxx.xx.xx.xxx</endpoint>
<port>8060</port>
<credential>xxxxx</credential>
<identity>xxxxx</identity>
<s3AwsVersion>AWS2</s3AwsVersion>
<httpsOnly>false</httpsOnly>
<property name="s3service.disable-dns-buckets" value="true"/>
</provider>
</config>
Error messages:
{
"errors" : [ {
"status" : 500,
"message" : "Expecting stream to be instance of FileWrappingInputStream"
} ]
2022-08-16T07:56:25.351Z [jfrt ] [ERROR] [31d9214b03152aae] [o.a.w.s.RepoFilter:315 ] [http-nio-8081-exec-8] - Upload request of example-repo-local:test/1/delivery/test.sh failed due to {}
java.lang.RuntimeException: Expecting stream to be instance of FileWrappingInputStream

The chain defined in the storage configuration doesn't have an actual definition. Removing <provider id="cache-fs" type="cache-fs"> from the configuration file (binarystore.xml) and restarting Artifactory should help resolving the error.
[OR]
Amendment of cache settings for the definition you have made under should help.

Related

$http.get request does not work with API level 31

I ask for your help for a problem that I encounter with IONIC 1.
When I change the API level from 30 to 31 in the config.xml file:
this code is not working
$http.get($scope.url)
.then(function (success) {
...
}, function (error) {
$scope.errTXT = JSON.stringify(error);
});
returns a status of 0.
{
"data": null,
"status": 0,
"config": {
"method": "GET",
"transformRequest": [
null
],
"transformResponse": [
null
],
"url": "https://xxxxxxxxxxxxxxxxxx",
headers: {
"Accept": "application/json, text/plain, /"
}
},
"statusText": ""
}
I don't understand why the result of http is null
Just for information, when i change back to API 30, everything is
working well. I do not think is a server problem. I start thinking
that the $http.get is not supported in API 31? My server is running on
HTTPS://.......
Ionic CLI : 5.4.16 (C:xxxxxxxx\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic1 1.3.1
#ionic/v1-toolkit : not installed
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 9.1.0
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 16 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
Android SDK Tools : 26.1.1 (xxxxxxxx
\AppData\Local\Android\Sdk\)
NodeJS : v14.16.1 (C:\Program Files\nodejs\node.exe)
npm : 7.24.2
OS : Windows 10
Did you remove the "android" folder and add it again?
ionic cordova platform remove android
ionic cordova platform add android
Status code 0 usually means a CORS error.
You can read about Ionic CORS errors here.
Essentially, it is likely a misconfiguration on your server headers which are causing your Android app to throw the status code 0.
If you are using a development environment (e.g. localhost:4200) then you can add the following to your config.xml which should allow you to run it without needing a HTTPS:
<preference name="hostname" value="localhost" />
<preference name="AndroidInsecureFileModeEnabled" value="true" />

Integrating Keycloak with Alfresco

I Use Alfresco in my spring boot Application. I wanted to use authentication subsystem(identity-service). i have given configurations to use in alfresco-global.properties.
It is not connecting to Keycloak. No errors found in log. I could find in logs Authentication subsystem starts though.
[ restartedMain] a.i.IdentityServiceDeploymentFactoryBean : Keycloak JWKS URL: http://localhost:8011/auth/realms/alfresco-dbp/protocol/openid-connect/certs
2019-10-24 16:41:34.956 INFO --- [ restartedMain] a.i.IdentityServiceDeploymentFactoryBean : Keycloak Realm: alfresco-dbp
2019-10-24 16:41:34.956 INFO --- [ restartedMain] a.i.IdentityServiceDeploymentFactoryBean : Keycloak Client ID: alfresco-client
2019-10-24 16:41:34.958 INFO --- [ restartedMain] o.a.r.m.s.ChildApplicationContextFactory : Startup of 'Authentication' subsystem, ID: [Authentication, managed, identity-service1] complete
Alfresco provides Identity Service for SSO. I have integrated Alfresco 6.2.2 with Identity Service 1.3. It is working fine.
But still if you want to implement standalone keycloak independently, it will work with same configuration. I have tested with keycloak 9.0.3 and keycloak 11.0.0 (which is the underlying version of Identity Service 1.3) - both integrated with Alfresco, and working correctly.
The configuration in alfresco files would remain the same :
Below are the alfresco-global.properties settings. Keycloak is assumed to be running on port 8081:
authentication.chain=identity-service-1:identity-service,alfrescoNtlm-1:alfrescoNtlm
identity-service.auth-server-url=http://localhost:8081/auth
identity-service.enable-basic-auth=true
identity-service.realm=sharerealm
identity-service.resource=alfresco
csrf.filter.referer=http://localhost:8080
csrf.filter.origin=http://localhost:8080/*
aims.enabled=true
aims.realm=sharerealm
aims.resource=alfresco
aims.authServerUrl=http://localhost:8081/auth
aims.publicClient=true
Entry in share-config-custom.xml file:
<!-- AIMS -->
<config evaluator="string-compare" condition="AIMS">
<enabled>true</enabled>
<realm>sharerealm</realm>
<resource>alfresco</resource>
<authServerUrl>http://localhost:8081/auth</authServerUrl>
<sslRequired>none</sslRequired>
<publicClient>true</publicClient>
<autodetectBearerOnly>true</autodetectBearerOnly>
<alwaysRefreshToken>true</alwaysRefreshToken>
<principalAttribute>email</principalAttribute>
<enableBasicAuth>true</enableBasicAuth>
</config>
If you are working with ADF or ADW (Alfresco Digital Workspace), then the following entry in app.config.json:
"$schema": "../node_modules/#alfresco/adf-core/app.config.schema.json",
"ecmHost": "http://localhost:8080",
"aosHost": "http://localhost:8080/alfresco/aos",
"baseShareUrl": "http://localhost:8080/adw",
"providers": "ECM",
"authType": "OAUTH",
"oauth2": {
"host": "http://localhost:8081/auth/realms/sharerealm",
"clientId": "alfresco",
"scope": "openid",
"secret": "",
"implicitFlow": true,
"silentLogin": true,
"publicUrls": [
"**/preview/s/*",
"**/settings"
],
"redirectSilentIframeUri": "http://localhost:8080/adw/assets/silent-refresh.html",
"redirectUri": "/adw",
"redirectUriLogout": "/adw/#/login"
},

Audit Alfresco Authority Deletion: no event is recorded

My goal is to audit deletion of authorities in Alfresco. When audit logging is enabled (which generates a lot of log entries), deleting a group results in these log entries (shortend):
/alfresco-api/pre/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-node/beforeDeleteNode/node=workspace://SpacesStore/a4f5e9bb-6584-4997-a550-6080d0dce177
/alfresco-api/post/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-api/post/AuthorityService/deleteAuthority/no-error=null
If I understand the documentation correctly, an audit XML file like this should record the first event:
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" class="org.alfresco.repo.audit.generator.AuthenticatedUserDataGenerator"/>
<DataGenerator name="personFullName" class="org.alfresco.repo.audit.generator.AuthenticatedPersonDataGenerator"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="name" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name"/>
</AuditPath>
</Application>
</Audit>
Note that in the source of the PathMap I use the path /alfresco-api/pre/AuthorityService/deleteAuthority as it appears in the first log entry. This looks correct to me, even though I am quite unsure how the Application element should look.
Putting this into the XML file tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-deleteAuthority-extractors.xml registers the application correclty:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/control
{
"enabled" : true,
"applications":
[
{
"name": "Alfresco Tagging Service",
"path" : "/tagging",
"enabled" : true
}
,
{
"name": "DeleteAuthority",
"path" : "/deleteAuthority",
"enabled" : true
}
,
{
"name": "alfresco-access",
"path" : "/alfresco-access",
"enabled" : true
}
]
}
But when I now delete a group, nothing is recorded. A query for the application returns an empty result:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/query/DeleteAuthority
{
"count":0,
"entries":
[
]
}
Question: Is my above audit application configuration correct? How would I have to change it to generate audit entries for the deletion of authorities?
Your path-mapping section is correct, your application definition though is not set correctly to track the correct path.
You probably should try something like :
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="authority" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name" dataTrigger="/deleteAuthority/args/name"/>
<GenerateValue key="deletingUser" dataGenerator="currentUser"/>
</AuditPath>
</Application>
</Audit>

using network-bootstrapper to generate node-info expects certificates with devMode=false

I am trying to use network-bootstrapper tool to generate node-infos(like certificates etc) by passing node.conf file as input with devMode=false, following is my node.conf file:
myLegalName="O=Bank,L=Paris,C=FR"
p2pAddress="localhost:10011"
devMode=false
rpcSettings {
address="localhost:10012"
adminAddress="localhost:10052"
}
security {
authService {
dataSource {
type=INMEMORY
users=[
{
password=test
permissions=[
ALL
]
user=user3
}
]
}
}
}
I am passing the path of node.conf file as an argument to the bootsrapper.jar, but it is exiting with error code 1, below is the screenshot of the error:
following is the log generated:
[INFO ] 2018-07-04T14:19:21,901Z [main] internal.Node.generateAndSaveNodeInfo - Generating nodeInfo ... {}
[ERROR] 2018-07-04T14:19:21,901Z [main] internal.Node.validateKeystore - IO exception while trying to validate keystore {}
java.nio.file.NoSuchFileException: C:\corda\work\keys- gen\Bank\certificates\sslkeystore.jks
......
......
And
[ERROR] 2018-07-04T14:19:21,917Z [main] internal.Node.run - Exception during node startup {}
java.lang.IllegalArgumentException: Identity certificate not found. Please either copy your existing identity key and certificate from another node, or if you don't have one yet, fill out the config file and run corda.jar --initial- registration. Read more at: https://docs.corda.net/permissioning.html
......
......
Can you please let me know how to generate certificates and place it already inside the folder {workspace}/{nodeName}/certificates which already does not exists and is being generated by the bootstrapper tool itself? can you help with certificate generation and usage of network-bootstrapper.jar tool with devMode turned off?
The bootstrapper tool can't be used outside of devMode. Outside of devMode, proper certificates and a network map server must be used.
This issue is being tracked here: https://r3-cev.atlassian.net/browse/CORDA-1735.

Error when calling Rabbitmq consumer from command line

I am trying to setup a simple AMQP publisher/consumer using Symfony2.2 with RabbitMq bundle, I am following the documentation on the bundle page
The publisher works fine, I can see my messages on the web manager of rabbitMq.
When I try to run a consumer using the command
php app/console rabbitmq:consumer my.api
I get the following error:
Call to undefined method My\ApiBundle\Service\ConsumerService::setRoutingKey() in /***/vendor/oldsound/rabbitmq-bundle/OldSound/RabbitMqBundle/Command/BaseConsumerCommand.php on line 91
My setup:
confi.yml
old_sound_rabbit_mq:
connections:
my.api:
host: %amqp_host%
port: %amqp_port%
user: %amqp_user%
password: %amqp_password%
vhost: %amqp_vhost%
producers:
my.api:
connection: my.api
exchange_options: {name: 'my.api', type: fanout}
consumers:
my.api:
connection: my.api
exchange_options: {name: 'my.api', type: fanout}
queue_options: {name: 'my.api'}
callback: my.api
My\ApiBundle\Service\ConsumerService.php
namespace My\ApiBundle\Service;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
class ConsumerService implements ConsumerInterface
{
public function execute(\PhpAmqpLib\Message\AMQPMessage $msg)
{
return false;
}
}
My\ApiBundle\Resources\config\services.xml
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="old_sound_rabbit_mq.my.api_consumer" class="My\ApiBundle\Service\ConsumerService"></service>
</services>
</container>
My question is: what is wrong with my config or my code?
There is no need to register your handler as a service - removing the My\ApiBundle\Resources\config\services.xml definition completely should solve the problem.
I was dealing with the same issue. The problem was that I forgot to include the RabbitMQ config file.
You can compare your solution with my working repository:
https://github.com/petrvacha/rebbitmq-basic
I'm not sure if the documentation is correct.. but I found a workaround by extending from OldSound\RabbitMqBundle\RabbitMq\BaseConsumer
So my code looks like:
namespace My\ApiBundle\Service;
use OldSound\RabbitMqBundle\RabbitMq\BaseConsumer;
class ConsumerService extends BaseConsumer
{
}

Resources