From 126ee5c366f80dd5fdd637564e3203db6e96b81b Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 22 Mar 2024 18:13:36 -0400 Subject: [PATCH 01/14] Use Docker runner and dind service for Docker build --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c74cbba..89d4b7e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,9 +9,11 @@ build: docker-build: needs: ["build"] image: docker:latest + services: + - docker:dind + tags: + - docker script: - - /usr/local/bin/dockerd-entrypoint.sh & - - while ! docker info; do echo "Waiting for Docker to become available..."; sleep 1; done - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA . # If running on the default branch, tag as latest From 5e2b41da5df1f3692e59fad01fbc6ba86ab1acd0 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Tue, 26 Mar 2024 16:19:31 -0400 Subject: [PATCH 02/14] Create Docker base template --- .gitlab-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89d4b7e..2aba41c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,16 +5,20 @@ build: script: - cargo-leptos build -# Build the docker image and push it to the registry -docker-build: - needs: ["build"] +.docker: image: docker:latest services: - docker:dind tags: - docker - script: + before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + +# Build the docker image and push it to the registry +docker-build: + needs: ["build"] + extends: .docker + script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA . # If running on the default branch, tag as latest - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then docker tag From fd4d823cf5e7d7b6cf0d0b58260e7ccaaac48737 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Tue, 26 Mar 2024 16:36:50 -0400 Subject: [PATCH 03/14] Add misc CICD scripts and compose file --- cicd/add-dns.sh | 22 +++++++++++++++ cicd/create-tunnel-config.sh | 19 +++++++++++++ cicd/docker-compose-cicd.yml | 55 ++++++++++++++++++++++++++++++++++++ cicd/remove-dns.sh | 22 +++++++++++++++ 4 files changed, 118 insertions(+) create mode 100755 cicd/add-dns.sh create mode 100755 cicd/create-tunnel-config.sh create mode 100644 cicd/docker-compose-cicd.yml create mode 100755 cicd/remove-dns.sh diff --git a/cicd/add-dns.sh b/cicd/add-dns.sh new file mode 100755 index 0000000..7247314 --- /dev/null +++ b/cicd/add-dns.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +ZONE_ID=$1 +RECORD_NAME=$2 +RECORD_COMMENT=$3 +API_TOKEN=$4 +TUNNEL_ID=$5 + +curl --request POST --silent \ + --url https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer $API_TOKEN" \ + --data '{ + "content": "'$TUNNEL_ID'.cfargotunnel.com", + "name": "'$RECORD_NAME'", + "comment": "'$RECORD_COMMENT'", + "proxied": true, + "type": "CNAME", + "ttl": 1 +}' \ diff --git a/cicd/create-tunnel-config.sh b/cicd/create-tunnel-config.sh new file mode 100755 index 0000000..f4c69ab --- /dev/null +++ b/cicd/create-tunnel-config.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +TUNNEL_ID=$1 +HOSTNAME=$2 +SERVICE=$3 + +echo "Creating tunnel config for $HOSTNAME" + +cat < cloudflared-tunnel-config.yml +tunnel: $TUNNEL_ID +credentials-file: /etc/cloudflared/auth.json + +ingress: + - hostname: $HOSTNAME + service: $SERVICE + - service: http_status:404 +EOF diff --git a/cicd/docker-compose-cicd.yml b/cicd/docker-compose-cicd.yml new file mode 100644 index 0000000..723ca41 --- /dev/null +++ b/cicd/docker-compose-cicd.yml @@ -0,0 +1,55 @@ +version: '3' + +services: + cloudflare: + image: cloudflare/cloudflared:latest + command: tunnel run + volumes: + - cloudflared-config:/etc/cloudflared:ro + + libretunes: + image: registry.mregirouard.com/libretunes/libretunes:${LIBRETUNES_VERSION} + environment: + REDIS_URL: redis://redis:6379 + POSTGRES_HOST: postgres + POSTGRES_USER: libretunes + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: libretunes + volumes: + - libretunes-audio:/site/audio + depends_on: + - redis + - postgres + restart: always + + redis: + image: redis:latest + volumes: + - libretunes-redis:/data + restart: always + healthcheck: + test: ["CMD-SHELL", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 + + postgres: + image: postgres:latest + environment: + POSTGRES_USER: libretunes + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: libretunes + volumes: + - libretunes-postgres:/var/lib/postgresql/data + restart: always + healthcheck: + test: ["CMD-SHELL", "pg_isready -U libretunes"] + interval: 10s + timeout: 5s + retries: 5 + +volumes: + cloudflared-config: + libretunes-audio: + libretunes-redis: + libretunes-postgres: diff --git a/cicd/remove-dns.sh b/cicd/remove-dns.sh new file mode 100755 index 0000000..3a80869 --- /dev/null +++ b/cicd/remove-dns.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +ZONE_ID=$1 +RECORD_NAME=$2 +RECORD_COMMENT=$3 +API_TOKEN=$4 + +RECORD_ID=$( +curl --request GET --silent \ + --url "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?name=$RECORD_NAME&comment=$RECORD_COMMENT" \ + --header "Content-Type: application/json" \ + --header "Authorization: Bearer $API_TOKEN" \ +| jq -r '.result[0].id') + +echo "Deleting DNS record ID $RECORD_ID" + +curl --request DELETE --silent \ + --url "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \ + --header "Content-Type: application/json" \ + --header "Authorization: Bearer $API_TOKEN" From 0ed4de8bfd58fa44e7cfa8189c204992b8e544ee Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Tue, 26 Mar 2024 16:37:49 -0400 Subject: [PATCH 04/14] Deploy using Docker compose and Cloudflare for review environments --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2aba41c..9d0cd24 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,20 +50,29 @@ cargo-doc: paths: - target/doc -.argocd: - image: argoproj/argocd:v2.6.15 - before_script: - - argocd login ${ARGOCD_SERVER} --username ${ARGOCD_USERNAME} --password ${ARGOCD_PASSWORD} --grpc-web - # Start the review environment start-review: - extends: .argocd + extends: .docker rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" when: manual script: - - argocd app sync argocd/libretunes-review-${CI_COMMIT_SHORT_SHA} - - argocd app wait argocd/libretunes-review-${CI_COMMIT_SHORT_SHA} + - apk add curl openssl + - cd cicd + - echo "$CLOUDFLARE_TUNNEL_AUTH_JSON" > tunnel-auth.json + - ./add-dns.sh $CLOUDFLARE_ZONE_ID review-$CI_COMMIT_SHORT_SHA libretunes-auto-review $CLOUDFLARE_API_TOKEN $CLOUDFLARE_TUNNEL_ID + - ./create-tunnel-config.sh http://libretunes:3000 review-$CI_COMMIT_SHORT_SHA.libretunes.xyz $CLOUDFLARE_TUNNEL_ID + - COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA + - POSTGRES_PASSWORD=$(openssl rand -base64 32) + - LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA + - docker compose --file docker-compose-cicd.yml pull + - docker compose --file docker-compose-cicd.yml create + - CONFIG_VOL_NAME=review-${CI_COMMIT_SHORT_SHA}_cloudflared-config + - TMP_CONTAINER_NAME=$(docker run --rm -d -v $CONFIG_VOL_NAME:/data busybox sh -c "sleep infinity") + - docker cp tunnel-auth.json $TMP_CONTAINER_NAME:/data/auth.json + - docker cp cloudflared-tunnel-config.yml $TMP_CONTAINER_NAME:/data/config.yml + - docker stop $TMP_CONTAINER_NAME + - docker compose --file docker-compose-cicd.yml up -d environment: name: review/$CI_COMMIT_SHORT_SHA url: https://review-$CI_COMMIT_SHORT_SHA.libretunes.mregirouard.com @@ -72,13 +81,18 @@ start-review: # Stop the review environment stop-review: needs: ["start-review"] - extends: .argocd + extends: .docker rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" when: manual allow_failure: true script: - - argocd app delete argocd/libretunes-review-${CI_COMMIT_SHORT_SHA} --cascade + - apk add jq curl + - ./cicd/remove-dns.sh $CLOUDFLARE_ZONE_ID review-$CI_COMMIT_SHORT_SHA.libretunes.xyz libretunes-auto-review $CLOUDFLARE_API_TOKEN + - COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA + - LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA + - docker compose --file cicd/docker-compose-cicd.yml down + - docker compose --file cicd/docker-compose-cicd.yml rm -f -v environment: name: review/$CI_COMMIT_SHORT_SHA action: stop From eb56957a27e2241e684ad98a5a951dcf6663378b Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Tue, 26 Mar 2024 16:41:42 -0400 Subject: [PATCH 05/14] Automatically stop review environment after 1 week --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d0cd24..5e3c85a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,6 +77,7 @@ start-review: name: review/$CI_COMMIT_SHORT_SHA url: https://review-$CI_COMMIT_SHORT_SHA.libretunes.mregirouard.com on_stop: stop-review + auto_stop_in: 1 week # Stop the review environment stop-review: From c736695cea17876412039d39873b837477f0fe19 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 16:48:50 -0400 Subject: [PATCH 06/14] Add export command for environment variables --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e3c85a..49eb801 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,13 +62,13 @@ start-review: - echo "$CLOUDFLARE_TUNNEL_AUTH_JSON" > tunnel-auth.json - ./add-dns.sh $CLOUDFLARE_ZONE_ID review-$CI_COMMIT_SHORT_SHA libretunes-auto-review $CLOUDFLARE_API_TOKEN $CLOUDFLARE_TUNNEL_ID - ./create-tunnel-config.sh http://libretunes:3000 review-$CI_COMMIT_SHORT_SHA.libretunes.xyz $CLOUDFLARE_TUNNEL_ID - - COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA - - POSTGRES_PASSWORD=$(openssl rand -base64 32) - - LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA + - export COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA + - export POSTGRES_PASSWORD=$(openssl rand -base64 32) + - export LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA - docker compose --file docker-compose-cicd.yml pull - docker compose --file docker-compose-cicd.yml create - - CONFIG_VOL_NAME=review-${CI_COMMIT_SHORT_SHA}_cloudflared-config - - TMP_CONTAINER_NAME=$(docker run --rm -d -v $CONFIG_VOL_NAME:/data busybox sh -c "sleep infinity") + - export CONFIG_VOL_NAME=review-${CI_COMMIT_SHORT_SHA}_cloudflared-config + - export TMP_CONTAINER_NAME=$(docker run --rm -d -v $CONFIG_VOL_NAME:/data busybox sh -c "sleep infinity") - docker cp tunnel-auth.json $TMP_CONTAINER_NAME:/data/auth.json - docker cp cloudflared-tunnel-config.yml $TMP_CONTAINER_NAME:/data/config.yml - docker stop $TMP_CONTAINER_NAME @@ -90,8 +90,8 @@ stop-review: script: - apk add jq curl - ./cicd/remove-dns.sh $CLOUDFLARE_ZONE_ID review-$CI_COMMIT_SHORT_SHA.libretunes.xyz libretunes-auto-review $CLOUDFLARE_API_TOKEN - - COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA - - LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA + - export COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA + - export LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA - docker compose --file cicd/docker-compose-cicd.yml down - docker compose --file cicd/docker-compose-cicd.yml rm -f -v environment: From 27ef4589bfdb01fb265c220b23c72489454d2ab6 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 17:08:24 -0400 Subject: [PATCH 07/14] Fix tunnel config script argument order --- cicd/create-tunnel-config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd/create-tunnel-config.sh b/cicd/create-tunnel-config.sh index f4c69ab..11fb59a 100755 --- a/cicd/create-tunnel-config.sh +++ b/cicd/create-tunnel-config.sh @@ -2,9 +2,9 @@ set -e -TUNNEL_ID=$1 +SERVICE=$1 HOSTNAME=$2 -SERVICE=$3 +TUNNEL_ID=$3 echo "Creating tunnel config for $HOSTNAME" From 6fc66336b7cc3679c849f0c751132f53a7dfdecd Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 19:27:11 -0400 Subject: [PATCH 08/14] Fix review environment URL --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49eb801..4900151 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,7 +75,7 @@ start-review: - docker compose --file docker-compose-cicd.yml up -d environment: name: review/$CI_COMMIT_SHORT_SHA - url: https://review-$CI_COMMIT_SHORT_SHA.libretunes.mregirouard.com + url: https://review-$CI_COMMIT_SHORT_SHA.libretunes.xyz on_stop: stop-review auto_stop_in: 1 week From a783fb4e624a0425ff9bd140180b7a0e873b6745 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 19:48:29 -0400 Subject: [PATCH 09/14] Generate random hex value for Postgres password instead of base64 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4900151..db9a867 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,7 +63,7 @@ start-review: - ./add-dns.sh $CLOUDFLARE_ZONE_ID review-$CI_COMMIT_SHORT_SHA libretunes-auto-review $CLOUDFLARE_API_TOKEN $CLOUDFLARE_TUNNEL_ID - ./create-tunnel-config.sh http://libretunes:3000 review-$CI_COMMIT_SHORT_SHA.libretunes.xyz $CLOUDFLARE_TUNNEL_ID - export COMPOSE_PROJECT_NAME=review-$CI_COMMIT_SHORT_SHA - - export POSTGRES_PASSWORD=$(openssl rand -base64 32) + - export POSTGRES_PASSWORD=$(openssl rand -hex 16) - export LIBRETUNES_VERSION=$CI_COMMIT_SHORT_SHA - docker compose --file docker-compose-cicd.yml pull - docker compose --file docker-compose-cicd.yml create From 5a62f93ba82540772d8dbc119ec13f22ae095263 Mon Sep 17 00:00:00 2001 From: ecco257 <72117210+ecco257@users.noreply.github.com> Date: Fri, 29 Mar 2024 20:14:50 -0400 Subject: [PATCH 10/14] Update copyright year and author in LICENSE file --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e869ce3..2ba4393 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 henrik +Copyright (c) 2024 The LibreTunes Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From d09caba44cba95b64671ddfbc6f2c32e5bdfb6a9 Mon Sep 17 00:00:00 2001 From: ecco257 <72117210+ecco257@users.noreply.github.com> Date: Fri, 29 Mar 2024 20:18:11 -0400 Subject: [PATCH 11/14] Update copyright year to include 2023 in LICENSE file --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2ba4393..43bb24e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 The LibreTunes Authors +Copyright (c) 2023-2024 The LibreTunes Authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From f2b68fd8e34250b001cb8bc3b2e491985ae5f6b2 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 20:25:16 -0400 Subject: [PATCH 12/14] Add example environment variable file --- .env.example | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ef8c8dd --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +# Example environment variable file +# Copy this to .env or manually set the environment variables + +# Redis URL -- Used for storing session data +REDIS_URL=redis://localhost:6379 + +# PostgreSQL URL -- Used for storing data +# Option 1: Specify the URL directly +DATABASE_URL=postgresql://libretunes:password@localhost:5432/libretunes + +# Option 2: Specify the individual components +# Must specify at least POSTGRES_HOST +# POSTGRES_USER=libretunes +# POSTGRES_PASSWORD=password +# POSTGRES_HOST=localhost +# POSTGRES_PORT=5432 +# POSTGRES_DB=libretunes From 6cef7ed36ddceb29bc2e85548bbba22216cb7ff7 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 21:18:48 -0400 Subject: [PATCH 13/14] Set deny warnings Rust flag --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db9a867..4954a4c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,8 @@ build: needs: [] image: $CI_REGISTRY/libretunes/ops/docker-leptos:latest + variables: + RUSTFLAGS: "-D warnings" script: - cargo-leptos build From 93ea42b727339725ced79f2ef0a623f2092b4e38 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 29 Mar 2024 21:24:01 -0400 Subject: [PATCH 14/14] Fix warnings --- src/app.rs | 2 +- src/database.rs | 2 +- src/lib.rs | 1 - src/models.rs | 2 +- src/pages/signup.rs | 3 --- src/playbar.rs | 2 -- 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/app.rs b/src/app.rs index 8d1c582..a98eb17 100644 --- a/src/app.rs +++ b/src/app.rs @@ -37,7 +37,7 @@ pub fn App() -> impl IntoView { /// Renders the home page of your application. #[component] fn HomePage() -> impl IntoView { - let mut play_status = PlayStatus::default(); + let play_status = PlayStatus::default(); let play_status = create_rw_signal(play_status); view! { diff --git a/src/database.rs b/src/database.rs index cb1bee1..6ec58cc 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,8 +1,8 @@ use cfg_if::cfg_if; -use leptos::logging::log; cfg_if! { if #[cfg(feature = "ssr")] { +use leptos::logging::log; use lazy_static::lazy_static; use std::env; diff --git a/src/lib.rs b/src/lib.rs index 95ab806..9765d4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,6 @@ if #[cfg(feature = "hydrate")] { #[wasm_bindgen] pub fn hydrate() { use app::*; - use leptos::*; console_error_panic_hook::set_once(); diff --git a/src/models.rs b/src/models.rs index 7ad0cda..15a6d12 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,5 +1,4 @@ use std::time::SystemTime; -use std::error::Error; use time::Date; use serde::{Deserialize, Serialize}; @@ -9,6 +8,7 @@ cfg_if! { if #[cfg(feature = "ssr")] { use diesel::prelude::*; use crate::database::PgPooledConn; + use std::error::Error; } } diff --git a/src/pages/signup.rs b/src/pages/signup.rs index c2de8f8..20f0912 100644 --- a/src/pages/signup.rs +++ b/src/pages/signup.rs @@ -1,6 +1,5 @@ use crate::auth::signup; use crate::models::User; -use leptos::ev::input; use leptos::leptos_dom::*; use leptos::*; use leptos_icons::AiIcon::*; @@ -15,8 +14,6 @@ pub fn Signup() -> impl IntoView { let (show_password, set_show_password) = create_signal(false); - let navigate = leptos_router::use_navigate(); - let toggle_password = move |_| { set_show_password.update(|show_password| *show_password = !*show_password); log!("showing password"); diff --git a/src/playbar.rs b/src/playbar.rs index fcab9a7..11700aa 100644 --- a/src/playbar.rs +++ b/src/playbar.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use crate::playstatus::PlayStatus; use leptos::ev::MouseEvent; use leptos::html::{Audio, Div};