https://github.com/ragedunicorn/obsidian-plugin-s3-link
An Obsidian Plugin for Linking to AWS S3 Objects
https://github.com/ragedunicorn/obsidian-plugin-s3-link
aws aws-s3 aws-s3-bucket obsidian obsidian-plugin
Last synced: 9 months ago
JSON representation
An Obsidian Plugin for Linking to AWS S3 Objects
- Host: GitHub
- URL: https://github.com/ragedunicorn/obsidian-plugin-s3-link
- Owner: RagedUnicorn
- License: mit
- Created: 2023-08-01T12:51:48.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-06-29T09:27:22.000Z (about 1 year ago)
- Last Synced: 2025-06-29T09:36:04.623Z (about 1 year ago)
- Topics: aws, aws-s3, aws-s3-bucket, obsidian, obsidian-plugin
- Language: TypeScript
- Homepage:
- Size: 5.08 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🪨 obsidian-plugin-s3-link

> A plugin that retrieves and caches objects from AWS S3 Buckets
## Overview
The plugin supports custom URLs to an AWS S3 Bucket, allowing users to retrieve and cache files from S3 efficiently.
### Usage
To retrieve files:
* **Standard URL:** `s3:[objectKey]`
* Downloads and caches the file locally. It checks periodically for newer versions in the S3 bucket but only downloads if a newer version exists.
* **Signed URL:** `s3-sign[objectKey]`
* Creates a signed URL instead of downloading the file. The generated signed URL is valid for 7 days and will be automatically renewed after expiration.
> Note: Signed URLs cannot be used with embed functionality, as embedded links expect a local file. The documentation below specifies which links support signed URLs.
### Embedding Content
- **Image Links:**
```markdown


```
- **Anchor Links:**
```markdown
[Name of the link](s3:[objectKey])
[Name of the link](s3-sign:[objectKey])
```
> The first link opens the file within Obsidian, while the second opens it in the browser.
- **Video Links:**
```markdown
```
> Note: Signed URLs are not supported for obsidian video embeds.
- **PDF & Sound Links:**
```markdown
![[s3:[objectKey]]]
```
> Note: Signed URLs are not supported.
### Configuration
Before using the plugin, some basic configuration is needed:
- **S3 Bucket Name:** Specify the AWS S3 Bucket name.
- **S3 Bucket Region:** Define the region where the AWS S3 Bucket resides.
- **AWS Credentials:** Authenticate using the `~/.aws/credentials` file or the Access Key Id and Secret Access Key.
- **AWS Profile:** The plugin checks all profiles in `~/.aws/credentials`.
- **AWS Access Key ID:** Your AWS IAM user's Access Key ID.
- **AWS Secret Access Key:** Your AWS IAM user's Secret Access Key.
> Note: Using the profile is recommended to avoid storing credentials directly within Obsidian.
- **S3 Bucket CORS Configuration:** Ensure the S3 Bucket has CORS configured to accept requests from Obsidian.
```json
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"HEAD"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]
```
- **AWS IAM User:** An example IAM configuration for user read access to an S3 Bucket.
```json
{
"Statement": [
{
"Action": [
"s3:ListBucketVersions",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::[bucketname]",
"Sid": ""
},
{
"Action": [
"s3:GetObjectVersion",
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::[bucketname]/*",
"Sid": ""
}
],
"Version": "2012-10-17"
}
```
## Development
### Setting up
1. **Dependencies:**
```bash
npm install
```
2. **Run Project:** This watches for project changes. After the build finishes, reload Obsidian using the `Reload app without saving` command.
```bash
npm run dev
```
3. **Linting:**
```bash
npx eslint .
```
### Creating Releases
Releases for this project are automated using GitHub Actions. Here's how it works:
1. **Tagging a Release:** To initiate a new release, you need to create a new git tag. Use the following convention for versioning: `vx.x.x`.
```bash
git tag vx.x.x
```
2. **Pushing the Tag:** After creating the tag, push it to the repository. This will trigger the GitHub Action to create a new release.
```bash
git push --tags
```
3. **GitHub Actions:** Once the tag is pushed, the GitHub Action associated with release creation is automatically invoked. You can view the workflow in the `.github/workflows/release.yaml` directory of the repository.
## License
MIT License
Copyright (c) 2023 Michael Wiesendanger
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.