jonasoreland / runnerup

A open source run tracker
GNU General Public License v3.0
753 stars 275 forks source link

Endurain file upload support #1193

Closed AquaWolf closed 2 months ago

AquaWolf commented 3 months ago

This pull requests adds a new Synchronizer for the self-hostable endurain software. This PR solves #1185

I would love to add some unit tests but I can't find some examples where Synchronizers are tested.

To test this implementation I've keeped some commits to use it against a http endurain instance for example with an emulator and docker compose locally.

I used following config of endurain locally:

services:
  # frontend logic
  frontend:
    container_name: frontend
    image: ghcr.io/joaovitoriasilva/endurain/frontend:latest
    environment:
      - MY_APP_BACKEND_PROTOCOL=http
      - MY_APP_BACKEND_HOST=localhost:98
      - MY_APP_STRAVA_CLIENT_ID=REPLACE
    ports:
      - "8081:80" # frontend port, change per your needs
    restart: unless-stopped

  # API logic
  backend:
    container_name: backend
    image: ghcr.io/joaovitoriasilva/endurain/backend:latest
    environment:
      - DB_PASSWORD=YkVenw
      - SECRET_KEY=SECRET # openssl rand -hex 32
      - STRAVA_CLIENT_ID=REPLACE
      - STRAVA_CLIENT_SECRET=REPLACE
      - STRAVA_AUTH_CODE=REPLACE
      - GEOCODES_MAPS_API=REPLACE
      - FRONTEND_PROTOCOL=http # default is http
      - FRONTEND_HOST=localhost:8081 # frontend host or local ip (example: 192.168.1.10:8080), default is frontend:8080
    ports:
      - "98:80" # API port, change per your needs
    volumes:
      -  REPLACE:/app/user_images # necessary for user image persistence on container image updates
    depends_on:
      - mariadb
    restart: unless-stopped
  # mysql mariadb logic
  mariadb:
    image: mariadb:latest
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=SECRET
      - MYSQL_DATABASE=endurain
      - MYSQL_USER=endurain
      - MYSQL_PASSWORD=SECRET
    ports:
      - "3306:3306"
    volumes:
      - /var/lib/mysql
    restart: unless-stopped
networks:
  default:
    external: true
    name: backend_network

If you have further questions how to test that with endurain I could provide more information.

AquaWolf commented 2 months ago

I could provide you an endurain test instance if you don't want to spin it up. But I dont want to put the domain here for public.

gerhardol commented 2 months ago

I could provide you an endurain test instance if you don't want to spin it up. But I dont want to put the domain here for public.

Maybe. But I would prefer that someone that will use this functionality also would test take it for a spin, to make sure it works as expected.

Dont misunderstand me: It is great that features are added, this open source. But if am a very sporadic user, I can only say if it seems to work or not. A regular user could have usage comments.

AquaWolf commented 2 months ago

Totally agree πŸ‘ would also like to see someone who would like to use/test it By the way is there an beta/alpha channel or is there only the live app?

gerhardol commented 2 months ago

Someone else to test? Email info to me and I will make a brief test: gerhard dot nospam (as is) at gmail

AquaWolf commented 2 months ago

I could squash the commits sure πŸ˜ƒ Or you could directly make a squash merge then I don't have to squash them :)

gerhardol commented 2 months ago

I could squash the commits sure πŸ˜ƒ Or you could directly make a squash merge then I don't have to squash them :)

I can do that but then I set the commit message.

AquaWolf commented 2 months ago

done :+1: