dan6erbond / share-me Goto Github PK
View Code? Open in Web Editor NEWAn image and video hosting platform for your server, with rich embed support and API.
Home Page: https://dan6erbond.github.io/share-me/
License: MIT License
An image and video hosting platform for your server, with rich embed support and API.
Home Page: https://dan6erbond.github.io/share-me/
License: MIT License
Example: https://shareme.domain.com
Setup (using *.domain.com as an example):
Docker Compose
frontend:
environment:
POCKETBASE_URL: https://shareme-pb.domain.com
I then go to shareme-pb.domain.com/_/
I create an admin account.
I create a user account.
I go to Settings > Application > and set the following:
Application name: shareme
Application url: https://shareme.domain.com (same url as above but without "-pb")
Both domains work. But I am unable to login or sign up for a new account on the front end. Clicking "Login" does nothing. Clicking "Sign Up" gives me a 500 error.
I'm a little confused on the setup at this point.. The documentation says to forward "/api and /_ to the PocketBase backend" and "the rest of the traffic including /_next to the frontend". I saw in a Reddit post this possible to do with using subdomains, but I'm not sure what subdomains should be pointed to which domains or IP addresses. I don't believe SWAG can forward paths, so subdomains might be my only route.
Also, would the backend in this case be "shareme-pb.domain.com" or would I need to forward api and /_ to something else?
Thank you for the help if at all possible. I'm a self-host hobbyist so a few concepts do go over my head. I was able to get it working locally without a reverse proxy and this seems to be exactly what I was looking for. I appreciate the hard work that's gone into this project. It was definitely needed in the self-hosting space.
{
"Version": "15.0.0",
"Name": "Share Me",
"DestinationType": "ImageUploader",
"RequestMethod": "POST",
"RequestURL": "https://Share-Me-Domain.com/api/posts",
"Headers": {
"Accept": "*/*",
"Authorization": "YourTokenHere"
},
"Body": "MultipartFormData",
"FileFormName": "files",
"URL": "https://Share-Me-Domain.com/posts/{json:id}"
}
How to add
Implement optional object detection for Share Me that allows users to search for images by tags. This can be leveraged by the MeiliSearch integration added by #16.
Use Case: ShareX allows you to define Custom Uploaders within it's application. I'd like the ability to use ShareX and have it automatically create a new post with the screenshot it took.
Docs: https://getsharex.com/docs/custom-uploader
File Format:
{
"Version": "14.1.0",
"DestinationType": "ImageUploader, TextUploader, FileUploader",
"RequestMethod": "POST",
"RequestURL": "https://domain.com/upload",
"Body": "MultipartFormData",
"Arguments": {
"file": "{filename}",
"text": "{input}",
"token": "apitoken"
},
"FileFormName": "upload",
"URL": "{json:url}",
"ThumbnailURL": "{json:url}/raw",
"DeletionURL": "{json:url}/delete/apitoken"
}
Whenever a logged-in user attempts to visit Settings or their Posts page, they are logged out. I also can't view/create API tokens as a result.
I've finally had a moment to try this out. I've setup the containers in my docker-compose.yml
file and launched the server and frontend containers. Unfortunately when I click on the Sign Up button I get a lovely 500 ISE error. The frontend container logs:
ClientResponseError 404: Something went wrong while processing your request.
at new ClientResponseError (file:///app/node_modules/pocketbase/dist/pocketbase.es.mjs:1:2306)
at file:///app/node_modules/pocketbase/dist/pocketbase.es.mjs:1:45475
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getServerSideProps (/app/.next/server/pages/sign-up.js:152:25) {
url: 'https://share.mydomain.com/api/collections/users/auth-methods',
status: 404,
response: {},
isAbort: false,
originalError: null
}
which oddly enough seems to be a 404. My docker-compose.yml
:
share-me-frontend:
image: ghcr.io/dan6erbond/share-me-frontend:latest
container_name: share-me-frontend
labels:
- traefik.http.routers.share-me-frontend.rule=Host(`share.mydomain.com`)
- traefik.http.routers.share-me-frontend.entrypoints=websecure
- traefik.http.routers.share-me-frontend.service=share-me-frontend
- traefik.http.routers.share-me-frontend.tls=true
- traefik.http.routers.share-me-frontend.tls.certresolver=letsencrypt
- traefik.http.routers.share-me-frontend.tls.domains[0].main=share.mydomain.com
- traefik.http.services.share-me-frontend.loadbalancer.server.port=3000
environment:
- POCKETBASE_URL=${SHARE_ME_POCKETBASE_URL}
networks:
- production
depends_on:
- traefik
restart: unless-stopped
share-me-server:
image: ghcr.io/dan6erbond/share-me-server:latest
container_name: share-me-server
labels:
- traefik.enable=false
volumes:
- ${DOCKER_DATA_DIR}/share-me/pb_data:/pb/pb_data
networks:
- production
depends_on:
- traefik
restart: unless-stopped
Any ideas! Thanks! ๐
The homepage and /posts
routes should load all posts from getServerSideProps()
in order to render the posts on the server. This will enable indexing by search engines.
Hi,
Is there an image upload size limit / restriction? When I tried a 6.5MB one, it didn't work (no errors) and when I tried 4.5MB it worked.
Thanks,
Issue: Using 0.20.0 on Docker, Discord is not embeding the post.
Debug: http://ynd.one/KXdJ0V
File Column: http://ynd.one/t45qOD
Entire Page (shows thumbnails): http://ynd.one/KR8TPv
Post URL: https://images.yndlabs.com/posts/pehzs1xhhkced6b
How it looks in discord: http://ynd.one/mwJtBC
Was instructed to make an issue to see if someone has seen this before.
Thanks!
When you reach a post, the blurryness over a NSFW image is there. But on the main page the picture isn't blurred
Is there a method to disable sign-ups?
Thanks,
Using Postman
I receive a 200 Response (below)
API Response:
{ "author": "on2imnwqggminrg", "collectionId": "tqco9f8weal93h6", "collectionName": "posts", "created": "2023-05-20 04:23:05.739Z", "files": [ "z1qxne4clk31jlw" ], "id": "p5othop5v4z4k18", "nsfw": false, "public": false, "tags": null, "title": "", "updated": "2023-05-20 04:23:05.739Z" }
And the file does appear to be uploaded (admin UI) -
\Edit: It has to do with the invalid type - when setting it to "image/png", it loads correctly on the frontend. I'm not seeing a way to set this via the api call?
The actual post is trying to load a video:
With popular demand for this feature, ShareX support will require some additional API functionality since PocketBase uses limited duration JWTs for authentication.
This will also allow users to create and manage API keys, with variable expiration.
revoked
field.If visiting Share Me on mobile, the Sign Up button is visible even though 'Username/Password' & 'Email/Password' is disabled in PocketBase.
OAuth2 is also not an option when enabled properly (mobile). The desktop version works fine for all of this.
Hello!
I would like to propose the ability to add a title to the post via the same api call that was used to generate it. ShareX allows you to use a variable to define this.
I'd also like the API response to provide the post URL - this is to also put a variable in the ShareX config which will allow it to be easier shared.
Before: API Response:
{
"author": "on2imnwqggminrg",
"collectionId": "tqco9f8weal93h6",
"collectionName": "posts",
"created": "2023-05-20 04:23:05.739Z",
"files": [
"z1qxne4clk31jlw"
],
"id": "p5othop5v4z4k18",
"nsfw": false,
"public": false,
"tags": null,
"title": "",
"updated": "2023-05-20 04:23:05.739Z"
}
After API:
API Response:
{
"author": "on2imnwqggminrg",
"collectionId": "tqco9f8weal93h6",
"collectionName": "posts",
"created": "2023-05-20 04:23:05.739Z",
"files": [
"z1qxne4clk31jlw"
],
"id": "p5othop5v4z4k18",
"nsfw": false,
"public": false,
"tags": null,
**"title": "FileName",**
"updated": "2023-05-20 04:23:05.739Z",
**"PostURL": "https://Share-Me-Domain.com/posts/$id"**
}
This would allow your ShareX config file to be like the following:
{
"Version": "15.0.0",
"Name": "Share-Me",
"DestinationType": "ImageUploader",
"RequestMethod": "POST",
"RequestURL": "https://Share-Me-Domain.com/api/posts",
"Headers": {
"Accept": "*/*",
"Authorization": "TokenHere"
},
"Body": "MultipartFormData",
"Arguments": {
"Title": "{filename}"
},
"FileFormName": "files",
"URL": "{json:PostURL}"
}
Example cURL command
curl --location 'https://share-me-domain.com/api/posts' \
--header 'Accept: */*' \
--header 'Authorization: TokenHere' \
--form 'files=@"/C:/Users/Name/Folder/FileName.png"' \
--form 'title="FileName"'
warning " > @mantine/[email protected]" has incorrect peer dependency "embla-carousel-react@^7.0.0".
warning " > @mantine/[email protected]" has incorrect peer dependency "@mantine/[email protected]".
warning " > @mantine/[email protected]" has incorrect peer dependency "@mantine/[email protected]".
Feature: I'd like to be able to customize the home screen to better fit my monitor setup (2k's) - being able to customize it would allow all users the ability to fine tune to their liking
After (removing the attribute, but maybe somehow could be a backend # setting?):
Would also like the ability to replace the Share Me on the top left with an image, or make it customizable, or add a custom.css
I noticed that this repository is missing a license. Having a license is essential to provide clarity on how others can use and distribute the code.
If there's no license, people can't legally use or share the code. This means they might get in trouble for copyright issues and have to pay money or go to court. Also, it's hard to know what's allowed and what's not when using or sharing the code, since there are no clear rules or guidelines.
Would it be possible to add a license to this repository, such as the MIT License or the GNU General Public License?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.