It’s primarily a reverse proxy! However you can host a nginx docker container and serve it this way.
I had no idea caddy is also a web server/reverse proxy? I though of caddy being more similar to Treafik than nginx. My bad :/
You have already made your choice :) But Traefik is also a good alternative ! Specially if you work with a lot of docker containers !
Once you get how Traefik works, it just simple as adding a few lines into your yaml file and everything is handled by Traefik !
Yeah :) piped self-hosting !
However, we have to wait until they merge the poToken and visitor data issue. Something invidious has already implemented.
Still it’s very strange you have to restart your container every hour :/ I’m sure I’m to stupid to understand the backend/code to make any sense out of it, but piped instances never had to restart anything.
I host my own locally and set it to restart the docker every hour like they mentioned in their guide.
That’s the part why I stay away from Invidious. Why would you need to restart every hour? How inconvenient :/.
Piped has other issues right now but fixes are underway :)
Yeaaah ! It has some degree of customization via docker environment. Dunno how far you can go though, I only have a sleep interval option.
But the barebone default configuration works out of the box :D!
It’s simple, no UI bloat, can export audio, video and I don’t have to mess with yt-dlp which is huge and the documentation is like reading a whole book xD.
Though barebone yt-dlp allows way more :)
Hey take your time :) Don’t worry even if you forget, you did more than enough to help some random on the web ! 2 other users came up with a plain/bare bone regex solution if you want to have a look and maybe there’s something you can learn out of it? (I doubt it xD).
Plain sed regex (https://lemmy.ml/post/25346014/16453351)
sed -E ':l;s/(\[[^]]*\]\()([^)#]*#[^)]*\))/\1\n\2/;Te;H;g;s/\n//;s/\n.*//;x;s/.*\n//;/^https?:/!{:h;s/^([^#]*#[^)]*)(%20|\.)([^)]*\))/\1-\3/;th;s/(#[^)]*\))/\L\1/;};tl;:e;H;z;x;s/\n//;'
Plain Pearl regex (https://lemmy.ml/post/25346014/16453161)
perl -pe 's/\[[^]]+\]\((?!https?)[^#]*#\K[^)]+(?=\))/lc $&=~s:%20|\d\K\.(?=\d):-:gr/ge'
Nonetheless, I really prefere your solution because as someone else said I will have an easier time to change a script I “understand”. Soo thanks again !
Thank you ! It does actually ticks every use case (for my files) looks pretty rad !
This might work, but I think it is best to not tinker further if you already have a working script (especially one that you understand and can modify further if needed).
I totally agree but I will keep your regex as reference, in the near future I will give it a try to decompose you regex as learning process but it looks rather very complex !
Another user came up with the following solution:
sed -E ':l;s/(\[[^]]*\]\()([^)#]*#[^)]*\))/\1\n\2/;Te;H;g;s/\n//;s/\n.*//;x;s/.*\n//;/^https?:/!{:h;s/^([^#]*#[^)]*)(%20|\.)([^)]*\))/\1-\3/;th;s/(#[^)]*\))/\L\1/;};tl;:e;H;z;x;s/\n//;'
Just as a little experiment, If you want to spend some time and give me a answer, what do you think? It’s a another way to achieve the same kind of results but they are significantly different. I know there a thousand ways to achieve the same results but I’m kinda curious how it looks from an experts eyes :).
Thanks again for your help and the time you took to write up a complex regex for my use case ! 👍
Hello :) Sorry to pin you, I just gave pandoc a try but it doesn’t work and I had to dig a bit further into the web to find out why !
Links to Headings with Spaces are not specified by CommonMark and each tool implement a different approach… Most replace space with hyphens other use URL encoding (%20). So even though pandoc looks awesome it doesn’t work for my use case (or did i miss something? Feel free to comment).
You can give it a try on https://pandoc.org/try/ with commonmark to gfm:
[Just a test](#Just a test)
[Just a link](https://mylink/%20with%20space.com)
[External link](Readme.md#JUST%20a%20test)
[Link with numbers](readme.md#1.3%20this%20is%20another%20test)
[Link with numbers](Another%20file%20to%20readme.md#1.3%20this%20is%20another%20test)
If you prefere a cli version:
pandoc --from=commonmark_x --to=gfm+gfm_auto_identifiers "/home/user/Documents/test.md" -o "pandoc_test.md"
Wow ! Thank you ! It did a rapid test on a test-file.md
[Just a test](#just-a-test)
[Just a link](https://mylink/%20with%20space.com)
[External link](readme.md#just-a-test)
[Link with numbers](readme.md#1-3-this-is-another-test)
[Link with numbers](Another%20file%20to%20readme.md#1-3-this-is-another-test)
Great job ! Thank you very much !!! I’m really impressed what someone with proper knowledge can do ! However, I really do not want to mess around with your regex… This will only call for disaster xD ! I will keep preciously your regex and annotated file in my knowledge base, I’m sure some time in the future I will come back to it and try to break it down as learning process.
Thank you very much !!! 👍
Yeah, I had a Android application installed recently which strangely enough tried to reach my vaultwarden DNS? That sounded sketchy AF and just blocked it, removed it and cleaned every trace of it…
I don’t really have a technical reason, but I do only named volumes to keep things clear and tidy, specially compose files with databases.
When I do a backup I run a script that saves each volumes/database/compose files well organized in directories archived with tar.
In have this structure in my home directory: /home/user/docker/application_name/docker-compose.yaml
and it only contains the docker-compose.yml file (some times .env/Docker file).
I dunno if this is the most efficient way or even the best way to do things :/ but It also helps me to keep everything separate between all the necessary config files and the actual files (like movie files on Jellyfin) and it seems easier to switch over If I only need one part and not the other (uhhr sorry for my badly worded English, I hope it makes sense).
Other than that I also like to tinker arround and learn things :) Adding complexity gives me some kind of challenge? XD
Thank you very much for taking your time and trying to help me with comments and all !
you need a full featured markdown parser for this.
Do you mean something like pandoc? Someone pointed me to it and it seems it can covert to GitHub-Flavored Markdown ! Thanks for the pointer will give it a try to see how it works out with my actual script :)
Sorry for the very late response !! Here is the working bash script another user helped me put together:
#! /bin/bash
files="/home/USER/projects/test.md"
mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"
while IFS= read -r line; do
#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9])
dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
sed -i "s/$line/${dashlink}/" "$files"
#Puts everything to lowercase after a hashtag
lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
sed -i "s/$dashlink/${lowercaselink}/" "$files"
#Removes spaces (%20) from markdown links after a hashtag
spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
sed -i "s/$lowercaselink/${spacelink}/" "$files"
done <<<"$mdlinks2"
Hello :) Sorry for the very late response !
Effectively your regex is very close as a one line, I’m pretty impress ! :0 However I missed to mention something In my post (I only though about it after working on it with another user in the comments…). There a 2 things missing on your beautiful and complex regex:
FROM
---------------
[Link with numbers](readme.md#1.3%20this%20is%20another%20test)
TO
---------------
[Link with numbers](readme.md#1-3-this-is-another-test)
FROM
---------------
[Link with numbers](Another%20file%20to%20readme.md#1.3%20this%20is%20another%20test.md)
TO
---------------
[Link with numbers](Another%20file%20to%20readme.md#1-3-this-is-another-test.md)
Sorry for the trouble I wasn’t aware of all the GitHub-Flavored Markdown syntax :/. I got a a very cool working script that works perfectly with another user but If you want to modify your regex and try to solve the issue in pure regex feel free :) I’m very curious how It could look like (god regex is so obscure and at the same time it has some beauty in it !)
#! /bin/bash
files="/home/USER/projects/test.md"
mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"
while IFS= read -r line; do
#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9])
dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
sed -i "s/$line/${dashlink}/" "$files"
#Puts everything to lowercase after a hashtag
lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
sed -i "s/$dashlink/${lowercaselink}/" "$files"
#Removes spaces (%20) from markdown links after a hashtag
spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
sed -i "s/$lowercaselink/${spacelink}/" "$files"
done <<<"$mdlinks2"
Sorry for the late response… I was busy with another user :S My English is so bad I’m not able to response to every one at the same time… Whatever…
I tried your pearl regex substitution and effectively it does what I ask from my post, so thank you very much for your help ! However, I missed a few use cases were your regex breaks… But that’s on me, your command works as expected !!!
[Link with numbers](Another%20Markdown%20file.md#1.3%20this%20is%20another%20test.md)
The part before the hashtag need to keeps it’s original form (even with %20) because it links to a markdown file directly and not a header (Hope it’s comprehensible?). It took me a lot of time with another user and we came to a wrapped up script that does everything:
#! /bin/bash
files="/home/USER/projects/test.md"
mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"
while IFS= read -r line; do
#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9])
dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
sed -i "s/$line/${dashlink}/" "$files"
#Puts everything to lowercase after a hashtag
lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
sed -i "s/$dashlink/${lowercaselink}/" "$files"
#Removes spaces (%20) from markdown links after a hashtag
spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
sed -i "s/$lowercaselink/${spacelink}/" "$files"
done <<<"$mdlinks2"
If you are motivated you can still improve your regex If you want :) I’m kinda curious If it’s possible with a one-liner ! Thank again for your help and sorry for the late response !!
Yeah probably bare bone regex was a mistake however a friendly user gave me a step by step guide on how to achieve my goal:
#! /bin/bash
files="/home/USER/projects/test.md"
mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"
while IFS= read -r line; do
#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9])
dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
sed -i "s/$line/${dashlink}/" "$files"
#Puts everything to lowercase after a hashtag
lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
sed -i "s/$dashlink/${lowercaselink}/" "$files"
#Removes spaces (%20) from markdown links after a hashtag
spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
sed -i "s/$lowercaselink/${spacelink}/" "$files"
done <<<"$mdlinks2"
If you know a better way to achieve similar results I’m very open for every new lead and learn something new !
Thanks for the pointer I wasn’t aware pandoc was able to do that :/ It seems It can convert to Github-Flavored Markdown !! I have to give it a try :) Still I learned a lot from another user about regex/sed and Pearl :) !
Hello :) Sorry for the late response !!! I was busy working it out with another user ! However out of curiosity gave your sed regex a try, but there seems a missing (
somewhere ! I tried to fix the issue but your regex is way over my capabilities ! If you are sed/regex fanatic a want to give it another try feel free :). Right now I found a solution with another user that works great here’s the script in question if you are interested:
#! /bin/bash
files="/home/USER/projects/test.md"
mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"
while IFS= read -r line; do
#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9])
dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
sed -i "s/$line/${dashlink}/" "$files"
#Puts everything to lowercase after a hashtag
lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
sed -i "s/$dashlink/${lowercaselink}/" "$files"
#Replace spaces (%20) from markdown links to - after a hashtag
spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
sed -i "s/$lowercaselink/${spacelink}/" "$files"
done <<<"$mdlinks2"
It’s not very elegant but it does the job… While working on it with another very friendly user I came across other thing I haven’t though of like:
[
) ]([20File.md
) ](Another%[20File.md
) ](Another%Well I think that bare bone sed/regex wasn’t the right tool, but in a bash script it does exactly what I’m expecting :)
Thanks for your help and pointers !
Mostly phishing or link redirects. But the PDF in itself is harmless. Or Am I wrong here? Is it possible to install malware just by opening a PDF file?
My guess would be no… Because there isn’t any execution file to install sketchy binaries. This is very different from cracked games in the sense that getting malware from a PDF is more like a user mistake while a crack… You already know you are doing something sketchy and have no idea what it does in the background.
If someone has more details on how PDF can be exploited, except for the classical phishing attack (social engineering) I’m open to learn something new !