From 3676b13411ea544bcf1b10a2f8f7f609f792938e Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 18 Oct 2021 00:29:59 -0700 Subject: [PATCH 1/3] + more content in about section and packaging now --- .gitlab-ci.yml | 29 +++++++++++++++-------------- gitpage/content/about.md | 32 +++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f50984..3a3906a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,20 +3,21 @@ stages: - deploy # Builds out the intended zip package -#package: -# stage: build -# script: -# - rustup default nightly -# - mkdir -p build -# - cp api/templates/ api/static/ build -r -# - cargo build --release -# - cp target/release/api build/server -# - cp ./scripts/generate-thumbnail.sh build/ -# - cp readme.md build/ -# - sh ./scripts/default-rocket-toml.sh -# artifacts: -# paths: -# - build/ +package: + stage: build + script: + - rustup default nightly-2021-09-18 + - mkdir -p build + - cp api/templates/ api/static/ build -r + - cargo --version + - cargo build --release + - cp target/release/api build/server + - cp ./scripts/generate-thumbnail.sh build/ + - cp readme.md build/ + - sh ./scripts/default-rocket-toml.sh + artifacts: + paths: + - build/ diff --git a/gitpage/content/about.md b/gitpage/content/about.md index 9010563..03a9305 100644 --- a/gitpage/content/about.md +++ b/gitpage/content/about.md @@ -12,8 +12,34 @@ You can post whatever you want because its your content, your site, your rules. # How does it work? -Clips are organized into categories(folders).... +Well clips that you upload to your server are organized into categories and +served from there. Categories can have thumbnails too so they look distinct +but that's up to you to setup. -That's it. +# Can I make a script to get videos? -Categories can have thumbnails too so they look distinct but that's up to you. +Sure the public API is actually really simple: + +These are basically all the routes you'll need + +* GET `/api/categories/list` + +Lists out the categories available + +* GET `/api/category/` + +Lists out the videos for that given category + +* GET `/video//` + +Fetches the video file itself named by `file` + + +# How easy is it to upload videos? + +Right now you just need to drop a video file into a sub-folder of your server's +videos directory. So if you had `/media/videos` then you would put a video into +a folder like `/media/videos/cool-clips/` or whatever else it's named. + +Currently I'm working on making a simple clip-uploading tool that would also take +care of generating the appropriate thumbnails for you. From d87d689f031ccac37c9c40f59f4121bc0ccdd646 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 18 Oct 2021 00:31:30 -0700 Subject: [PATCH 2/3] * Seperating build stages --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a3906a..633b5f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ image: rustlang/rust:nightly stages: - - deploy + - pages + - build # Builds out the intended zip package package: @@ -23,7 +24,7 @@ package: pages: image: shockrah/website:latest - stage: deploy + stage: pages before_script: - git submodule init - git submodule update From de51b9141d99ebf1f291a1b8469e16e132c6c21e Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 18 Oct 2021 02:18:00 -0700 Subject: [PATCH 3/3] + DOcker image in registry wew lad + Better docs All around qol for people that don't know what this thing is --- Dockerfile | 8 ++++++++ api/target/CACHEDIR.TAG | 3 --- readme.md | 17 +++++++++++------ scripts/default-rocket-toml.sh | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 Dockerfile delete mode 100644 api/target/CACHEDIR.TAG diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2071b27 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM debian:sid-slim + +# Default daniel dirs +RUN mkdir -p /media/clips /media/thumbnails +COPY build/ /app +WORKDIR /app +ENTRYPOINT [ "/app/server" ] + diff --git a/api/target/CACHEDIR.TAG b/api/target/CACHEDIR.TAG deleted file mode 100644 index 20d7c31..0000000 --- a/api/target/CACHEDIR.TAG +++ /dev/null @@ -1,3 +0,0 @@ -Signature: 8a477f597d28d172789f06886806bc55 -# This file is a cache directory tag created by cargo. -# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/readme.md b/readme.md index 6e0bfca..5e2f987 100644 --- a/readme.md +++ b/readme.md @@ -2,10 +2,18 @@ A small self hostable alternative to streamable. Built with Rocket.rs -## Status +## Testing -Right now the public API is being built so that as long as there videos to serve -the application should serve +A docker container is provided: + +* `docker pull registry.gitlab.com/shockrah/clippable:latest` + +Below is the suggested way test things out + +* `docker run --rm -p 8482:8482 -it -v /path/to/clips:/media/clips -v /path/to/thumbnails:/media/thumbnails` + +**NOTE**: Without proper thumbnails you get the "404" gif everywhere but the +videos will still be there. ## Admin Setup/Configuration @@ -28,6 +36,3 @@ must be ran in order to ensure that output directory is present and compilation succeeds. There are no dependencies and is only written in typescript to enforce some level of consistency among contributor code. -## Roadmap - -_Check the /roadmap.md_ \ No newline at end of file diff --git a/scripts/default-rocket-toml.sh b/scripts/default-rocket-toml.sh index 1b50cf2..59fe496 100644 --- a/scripts/default-rocket-toml.sh +++ b/scripts/default-rocket-toml.sh @@ -8,7 +8,7 @@ port = 8482 keep_alive = 5 read_timeout = 5 write_timeout = 5 -log = "critical" +log_level = "critical" limits = { forms = 4096 } # Must be type (below is not valid toml syntax)