Connecting to s3 bucket with Media Library Strapi - amazon-s3

I've used Strapi for a while as a headless cms and, in their most recent update, they changed the File Upload plugin to Media Library. You used to be able to connect an s3 bucket to your app via File Upload's settings- does anyone have any idea how you do the same thing now that Media Library has replaced it?

If you are using strapi version 3.0.0-beta.20.x
What you have to do is to create a settings.json file with below config
./extensions/upload/config/settings.json
{
"provider": "aws-s3",
"providerOptions": {
"accessKeyId": "dev-key",
"secretAccessKey": "dev-secret",
"region": "aws-region",
"params": {
"Bucket": "my-bucket"
}
}
}
You can check out the plugin for more details

Related

Filepulse Connector error with S3 provider (Source Connector)

I am trying to poll csv files from S3 buckets using Filepulse source connector. When the task starts I get the following error. What additional libraries do I need to add to make this work from S3 bucket ? Config file below.
Where did I go wrong ?
Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:208)
java.nio.file.FileSystemNotFoundException: Provider "s3" not installed
at java.base/java.nio.file.Path.of(Path.java:212)
at java.base/java.nio.file.Paths.get(Paths.java:98)
at io.streamthoughts.kafka.connect.filepulse.fs.reader.LocalFileStorage.exists(LocalFileStorage.java:62)
Config file :
{
"name": "FilePulseConnector_3",
"config": {
"connector.class": "io.streamthoughts.kafka.connect.filepulse.source.FilePulseSourceConnector",
"filters": "ParseCSVLine, Drop",
"filters.Drop.if": "{{ equals($value.artist, 'U2') }}",
"filters.Drop.invert": "true",
"filters.Drop.type": "io.streamthoughts.kafka.connect.filepulse.filter.DropFilter",
"filters.ParseCSVLine.extract.column.name": "headers",
"filters.ParseCSVLine.trim.column": "true",
"filters.ParseCSVLine.seperator": ";",
"filters.ParseCSVLine.type": "io.streamthoughts.kafka.connect.filepulse.filter.DelimitedRowFilter",
"fs.cleanup.policy.class": "io.streamthoughts.kafka.connect.filepulse.fs.clean.LogCleanupPolicy",
"fs.cleanup.policy.triggered.on":"COMMITTED",
"fs.listing.class": "io.streamthoughts.kafka.connect.filepulse.fs.AmazonS3FileSystemListing",
"fs.listing.filters":"io.streamthoughts.kafka.connect.filepulse.fs.filter.RegexFileListFilter",
"fs.listing.interval.ms": "10000",
"file.filter.regex.pattern":".*\\.csv$",
"offset.policy.class":"io.streamthoughts.kafka.connect.filepulse.offset.DefaultSourceOffsetPolicy",
"offset.attributes.string": "name",
"skip.headers": "1",
"topic": "connect-file-pulse-quickstart-csv",
"tasks.reader.class": "io.streamthoughts.kafka.connect.filepulse.fs.reader.LocalRowFileInputReader",
"tasks.file.status.storage.class": "io.streamthoughts.kafka.connect.filepulse.state.KafkaFileObjectStateBackingStore",
"tasks.file.status.storage.bootstrap.servers": "172.27.157.66:9092",
"tasks.file.status.storage.topic": "connect-file-pulse-status",
"tasks.file.status.storage.topic.partitions": 10,
"tasks.file.status.storage.topic.replication.factor": 1,
"tasks.max": 1,
"aws.access.key.id":"<<>>",
"aws.secret.access.key":"<<>>",
"aws.s3.bucket.name":"mytestbucketamtrak",
"aws.s3.region":"us-east-1"
}
}
What should I put in the libraries to make this work ? Note : The lenses connector sources from S3 bucket without issues. So its not a credentials issue.
As mentioned in comments by #OneCricketeer
Suggest you follow - github.com/streamthoughts/kafka-connect-file-pulse/issues/382 pointed to root cause.
Modifying the config file to use this property sourced the file:
"tasks.reader.class": "io.streamthoughts.kafka.connect.filepulse.fs.reader.AmazonS3RowFileInputReader"

How to open external app file in React Native

Using the package react-native-receive-sharing-intent, I receive this intent from the Obisidan app when a page is shared:
{
"contentUri": "content://md.obsidian.fileprovider/my_images/Documents/Myoas/Hello%20obsidian.md",
"fileName": "Hello obsidian.md",
"filePath": "/data/user/0/com.xxxxxxx.xxxxxx/cache/Hello obsidian.md",
"mimeType": "text/markdown",
"subject": null,
"text": null,
"weblink": null
}
Now my goal is to open programmatically the Obsidian app showing the same file.
I tried that but it is not working. This opens the web browser and gives an error:
import { Linking } from "react-native";
Linking.openURL("content://md.obsidian.fileprovider/my_images/Documents/Myoas/Hello%20obsidian.md");
I don't want a copy of the file or open the markdown file in my app.
I want to open the original file in the external app.
I find a solution here:
Linking.openUrl("obsidian://action?param1=value&param2=value")

What should be used for endpoint in renovate-bot config.json?

I am trying to set up config.json for Bitbucket Cloud to automatically update dependencies in npm repos of Bitbucket Cloud. I found one example, but cannot figure out two things:
endpoint - what should go there (ABC)? - our company's bitbucket namespace link looks like: https://bitbucket.org/uvxyz/
Can I use renovate-bot to issue PRs without bitbucket pipelines? If so, can I make renovate to update only particular repo or repos via config.json mods or I shall put renovate.json file in each repo where automatic dependency update is required?
appreciate any examples on the latter.
config.json:
module.exports = {
"platform": "bitbucket",
"username": "<my.username>",
"password": "<bitbucket token on my account>",
"endpoint": "ABC",
"hostRules": [
{
"hostType": "bitbucket",
"domainName": "ABC",
"timeout": 10000,
"username": "<my.username>",
"password": "<bitbucket token on my account>"
}
]
};
according to the code:
const BITBUCKET_PROD_ENDPOINT = 'https://api.bitbucket.org/';
const defaults = { endpoint: BITBUCKET_PROD_ENDPOINT };
there's a default, it works for me without setting it
what you see in the documentation is all you need
I was able to get renovate working with BB after putting the following configuration into its config.js file as
{
hostType: 'bitbucket',
matchHost: 'https://api.bitbucket.org/2.0/',
username: "bb-username",
password: "<special app password generated for bb-username>",
}
for BitBucket app passwords please look at
https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/
and
https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/

How to upload .net core build artifacts into JFrog Artifactory Cloud

I have configured build pipeline for .net core application in Azure DevOps. In that I have added the Artifactory Generic Upload build task to upload build artifacts into JFrog Artifactory instead of keeping in Azure DevOps Server.
In the Artifactory Generic Upload task, I am using this file spec configuration.
{
"files": [
{
"pattern": "*.zip",
"target": "generic-local" // This is my generic repository name in JFrog Artifactory Cloud
}
]
}
Whenever I run the build, then I am getting the below error.
> [Error] No errors, but also no files affected (fail-no-op flag).
{
"status": "success",
"totals": {
"success": 0,
"failure": 0
}
}
##[debug]task result: Failed
##[error]Error: Command failed: C:\hostedtoolcache\windows\jfrog\1.38.4\x64\jfrog.exe rt u --url="https://xxxxx.jfrog.io/artifactory" --user=*** --password=*** --fail-no-op=true --dry-run=false --insecure-tls=false --threads=3 --retries=3 --symlinks=false
So, can anyone suggest me how to upload .net core build artifacts into JFrog Artifactory Cloud.
I have changed the File Spec like this below:
{
"files": [
{
"pattern": "$(Build.ArtifactStagingDirectory)/*.zip",
"target": "generic-local/generic-local/drop/" // Format: "Repository_Name/Repository_Path/Folder_Name/"
}
]
}
With this File Spec configuration, I am able to upload .NET Core build artifacts into JFrog Artifactory.
Reference documentation : https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles

Settings for hosting an application in cumulocity

i want to configure the application to be hosted at cumulocity via uploaded archives.
The documentation shows two application types, HOSTED and EXTERNAL.
If i set the type to HOSTED, it requires the params resourcesUrl, which references a repository.
What steps are required to create an application with plugins,
which is hosted at cumulocity and not from a repository?
cumulocity.json
{
"availability": "PRIVATE",
"contextPath": "appContextPath",
"key": "appKey",
"name": "appName",
"type": "HOSTED",
"resourcesUrl": "appResourceUrl",
"imports": [
"core/c8yBranding",
"core/deviceList",
"appKey/plugin",
"devicemanagement/deviceRegistration",
"devicemanagement/measurements",
"devicemanagement/groupsHierarchy",
"devicemanagement/location",
"devicemanagement/deviceGroupList",
"devicemanagement/deviceListMap",
"devicemanagement/logViewer"
]
}
For HOSTED applications uploaded as ZIP files the valid resourcesURL would be "/".