Giter VIP home page Giter VIP logo

share-me's People

Contributors

dan6erbond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

share-me's Issues

Setting up Reverse Proxy with SWAG?

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.

docs: ShareX Setup

{
  "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}"
}

ShareX_rnuP7vwkjU

How to add

  1. Right click system tray icon
  2. Destinations
  3. Custom Uploader Settings
  4. (1) Import
  5. Paste from Clipboard
  6. (2) Ensure Method is POST
  7. (3) Change Domain in Request URL
  8. (4) Add API Token received from Share-Me
  9. (5) Update Domain URL with Share-Me Domain (can be made a variable if PostURL is an api response field ๐Ÿ‘€, one less thing to change)
  10. (6) Change Image Uploader to Share-Me
  11. Close window

Object Detection with ResNet for Searching

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.

Tasks

  • Create Python Service / Find Existing for Object Detection with Docker Container
  • Implement Model Hooks to Run Object Detection for Images and Add Detected Objects to Files
  • Sync Detected Objects with MeiliSearch

[Feature Request] ShareX Image Upload

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"
}

Description (and other?) text input laggy/horrible

Behold, entirely vanilla. Happens in incognito tabs too

Looks like it might be sending a request every keypress? That's a no no

image

chrome_9y_bd1_hbuw_x_uvkqFWhdkf.mp4

Nothing fancy in my docker compose, just the default install.

500 Internal Server Error When Visiting /sign-up

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! ๐Ÿ˜

Image upload size limit?

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,

[Feature] NSFW pictures blurred on main page

When you reach a post, the blurryness over a NSFW image is there. But on the main page the picture isn't blurred

  • Would be good to blur the picture on the mainpage or add a setting that disable the blur once set

API Posts Issue

Using Postman

Postman_rynVMBdiM8 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?

chrome_D1uBq0iTaU

The actual post is trying to load a video:

chrome_23oHpUIROy

chrome_sYyga3a3cB

chrome_0J74cGu534

ARM Arch support

Hi! congrats for the app!

I would love to know if the docker container has ARM support? because when a try to install it via docker-compose got this log messages on my raspi:

image

image

image

thanks!

API Keys & ShareX Integration

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.

Tasks

  • Add database table to store hashed keys with revoked field.
  • Implement API endpoint to generate keys.
  • Implement API endpoint to revoke keys.
  • Implement API endpoint to create a post with file upload support for ShareX.

Viewing Share Me on mobile does not respect no user sign-ups

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.

Feature Request: Set Title via API Post and return Post URL in API Response

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"'

Feature request: Customizable width on homepage

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

Before:
76ChppRkiG

After (removing the attribute, but maybe somehow could be a backend # setting?):
chrome_kbG2d6iix1

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

Project is missing a license

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.