confusedpuppy

joined 2 years ago
[–] confusedpuppy@lemmy.dbzer0.com 6 points 18 hours ago (1 children)

Soft caresses of an infinite scroll

[–] confusedpuppy@lemmy.dbzer0.com 3 points 22 hours ago

You're welcome! Beige is beautiful, Beige is profitable!

[–] confusedpuppy@lemmy.dbzer0.com 3 points 22 hours ago

Now I'm confused. That means I feel something, yay!

That's actually a combination between "Engage" and the german word "Eingang" and is a very deep metaphor! Thank you for enganging with my content!

[–] confusedpuppy@lemmy.dbzer0.com 7 points 1 day ago (2 children)

If phone bad, why do I still feel nothing after using it? Shouldn't I feel bad? Checkers, mate!

You're welcome, corporate appreciates your feedback!

 

Source code, or something that looks like it

Drawing, or something that looks like it


   _______________________________________________
  /                                               \
 |    _________________________________________    |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++CONTENT+++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |+++++++++++++++++++++++++++++++++++++++++|   |
 |   |_________________________________________|   |
 |                               BeigeTech Corp.   |
  \_______________________________________________/
      /  \_________________________________/
     /
    (___________________________________________
    |  ___________________  __________________  |
    | |                   ||                  | |
    | |                   ||                  | |
    | |      ENGANGE      ||       DIE        | |
    | |                   ||                  | |
    | |___________________||__________________| |
    |___________________________________________|

Art, or something that looks like it

Sanity, or something that looks like it


[–] confusedpuppy@lemmy.dbzer0.com 4 points 3 days ago (1 children)

Thank you for publicly disclosing my private medical records!

Naughty! Thank you for engaging in my ~~public humiliation~~ recycling kink!

You're welcome, the children are our future!

 

Source code


#!/bin/sh



# Setup:
# $ chmod +x painterm

# Usage:
# $ . painterm "/path/to/file"

# Description:
# - Reads an ANSCII picture within a file and converts selected characters to
#   the specified character with optional colour tiles

# Features:
# - Extremely inefficient
# - Option to add randomized colour tiles



# SHELLCHECK
# shellcheck disable=SC2034 # Warning for unused variables
# shellcheck disable=SC2086 # Warning for globbing/word splitting



##### USER VARIABLES
# - FILE LOCATION
#   - Set by first command line script argument
file_location="${1}"
# - RANDOM NUMBER CREATOR INTERVAL
#   - Higher number = faster preloading of randomized numbers
number_creator_interval=1000



##### FUNCTIONS
select_random_colour() { # NOTE Arguments: "${current_random_number}"
# COLOUR SELECTION

    # VARIABLES
    colour="${1}"
    # - COLOURS
    colour0="\033[30m\033[41m"
    colour1="\033[31m\033[42m"
    colour2="\033[32m\033[41m"
    colour3="\033[33m\033[42m"
    colour4="\033[34m\033[42m"
    colour5="\033[35m\033[44m"
    colour6="\033[36m\033[44m"
    colour7="\033[37m\033[44m"
    colour8="\033[44m"
    colour9="\033[33m\033[44m"

    # CODE
    # CHOOSE COLOUR BASED ON CURRENT VARIABLE DIGIT [0-9]
    if [ "${colour}" ]; then
        case "${colour}" in
        0)
            printf "%b" "${colour0}"
        ;;
        1)
            printf "%b" "${colour1}"
        ;;
        2)
            printf "%b" "${colour2}"
        ;;
        3)
            printf "%b" "${colour3}"
        ;;
        4)
            printf "%b" "${colour4}"
        ;;
        5)
            printf "%b" "${colour5}"
        ;;
        6)
            printf "%b" "${colour6}"
        ;;
        7)
            printf "%b" "${colour7}"
        ;;
        8)
            printf "%b" "${colour0}"
        ;;
        9)
        printf "%b" "${colour1}"
        ;;
        esac
    fi
}

initialization() {
# CHECK SCRIPT FOR ERRORS WITH SHELLCHECK (IF AVAILABLE) AND OTHER REQUIREMENTS

    # CHECK IF SHELLCHECK IS INSTALLED
    if [ -n "$(command -v "shellcheck")" ]; then
        # IF INSTALLED, RUN SHELLCHECK AND EXIT IF ERRORS ARE FOUND
        if ! shellcheck painterm; then
            return 1
        fi
    fi

    # CHECK IF FILE LOCATION ARGUMENT IS EMPTY
    if [ -z "${file_location}" ]; then
        # IF EMPTY, DISPLAY ERROR MESSAGE AND EXIT
        printf "Argument required: File location\n"
        return 1
    fi

    # CLEAR SCREEN IF ALL CHECKS PASS
    clear
}

main() { # NOTE Arguments: "<file location>"
# MAIN SCRIPT

    # VARIABLES
    create_random_numbers=
    random_numbers_total=

    # CODE
    # CHECK IF CHARACTER COUNT IN FILE IS MORE THAN 0 CHARACTERS
    while [ -n "$(wc -c ${file_location} | tr -dc '[:digit:]')" ]; do
        # CREATE NEW SET OF RANDOM NUMBERS (VALUE BASED ON VARIABLE "${number_creator_interval}")
        create_random_numbers="$(cat < /dev/urandom | tr -dc '[:digit:]' | fold -w "${number_creator_interval}" | head -n 1)"
        # CHECK IF TOTAL COUNT OF RANDOM NUMBERS ARE LESS THAN FILE CHARACTER COUNT
        if [ "${#random_numbers_total}" -lt "$(wc -c ${file_location} | tr -dc '[:digit:]')" ]; then
            # IF LESS, ADD NEW SET OF RANDOM NUMBERS TO TOTAL
            random_numbers_total="${random_numbers_total}${create_random_numbers}"
            printf "."
        else
            # IF MORE, CLEAR SCREEN & STOP & CONTINUE WITH SCRIPT
            clear
            break
        fi
    done

    # VARIABLES
    file="${1}"
    line_i=0
    line_count="$(cat ${file} | wc -l)"
    char_i=0
    char_count=
    char_new_line="$((char_count - 1))"
    total_count=1
    current_random_number="$(echo "${random_numbers_total}" | cut -c "${total_count}")"

    # FUNCTIONS
    tile_swap() { # NOTE Arguments: "<Character to find>" "<Character replacement>" "<Colour variable/function>"
    # FIND SPECIFIC CHARACTER AND SWAP TO CHOSEN CHARACTER WITH RANDOM COLOUR TILE

        # VARIABLES
        character_search="${1}"
        character_swap="${2}"
        character_colour="${3}"
        reset="\x1b[0m"
        total_count="$((total_count + 1))"
        current_random_number="$(echo "${random_numbers_total}" | cut -c "${total_count}")"

        # CODE
        # REPLACE "${character_search}" CHARACTER WITH COLOURED "${character_swap}" CHARACTER TILE
        if [ "$(sed "${line_i}q;d" "${file}" | cut -c "${char_i}")" = "${character_search}" ]; then
            printf "%b%b%b" "${character_colour}" "$(sed "${line_i}q;d" "${file}" | cut -c "${char_i}" | sed "s/${character_search}/${character_swap}/")" "${reset}"
        fi
    }

    # CODE
    # REPEAT THROUGH NUMBER OF LINES FROM SOURCED FILE
    while [ "${line_i}" -ne "${line_count}" ]; do
        line_i="$((line_i + 1))"
        char_count="$(sed "${line_i}q;d" "${file}" | wc -c)"
        # REPEAT THROUGH NUMBER OF CHARACTERS IN THE CURRENT LINE FROM SOURCED FILE
        while [ "${char_i}" -ne "${char_count}" ]; do
            char_i="$((char_i + 1))"
            # SWAP CHARACTER AND COLOUR TILE
            character_current="$(sed "${line_i}q;d" "${file}" | cut -c "${char_i}")"
            case "${character_current}" in
                "+")
                    # SWAP "+" TO "O" WITH RANDOM COLOURED TILE
                    tile_swap "+" "O" "$(select_random_colour "${current_random_number}")"
                ;;
                "@")
                    # SWAP "@" TO "+" WITH NO COLOUR CHANGE
                    tile_swap "@" "+" ""
                ;;
                *)
                    # UNSPECIFIED CHARACTER: INSERT UNCHANGED CHARACTER TILE
                    printf "%b" "$(sed "${line_i}q;d" "${file}" | cut -c "${char_i}")"
                ;;
            esac
        done
        # INSERT NEW LINE AFTER REACHING LAST CHARACTER IN THE CURRENT LINE FROM SOURCED FILE
        if [ "${char_i}" -ge "${char_new_line}" ]; then
            char_i=0
            printf "\n"
        fi
    done
}



##### START

# CODE #

if ! initialization; then
    return 1
fi

main "${file_location}"

##### FINISH

Drawing


            _________
           |_-_-_-_-_|
           |_________|
            )_______(
           (_________)                                                ++++++++
           |         |  Biodegrade me, Daddy!                      ++++++++++++++
           /         \   /                                       ++++++++++++++++++
          /           \ /                                       ++++++++++++++++++++
         /    0   0    \                                   No.  ++++++++++++++++++++
        /               \                                    \  ++++++  +++  +++++++
       /========0========\                                    \ ++++++++++++++++++++
      /                   \                                     ++++++++++++++++++++
     (_____________________)                                    ++++++++   +++++++++
      )___________________(                                     +++++++ +++ ++++++++
     (_____________________)                                    ++++++++++++++++++++
     |                     |                                    ++++++++++++++++++++
     |_____________________|                                    ++++++++++++++++++++
      )___________________(                                     ++++++++++++++++++++
     |_____________________|                                    ++++++++++++++++++++
      )___________________(                                     ++++++++++++++++++++
     |                     |                                    ++++++++++++++++++++
     |_____________________|                                    ++++++++++++++++++++
      )___________________(                                     ++++++++++++++++++++
     |_____________________|                                    ++++++++++++++++++++
      )___________________(                                     ++++++++++++++++++++
     |                     |                                    ++++++++++++++++++++
     |                     |                                    ++++++++++++++++++++
     |_____________________|                                    ++++++++++++++++++++
     (_____________________)                                    ++++++++++++++++++++
     |_____________________|                                     ++++++++++++++++++
     (_____________________)                                     ++++++++++++++++++
     |                     |                                     ++++++++++++++++++
     |                     |                                      ++++++++++++++++
     \_____________________/                                        |          |
      '-------------------'

Art

[–] confusedpuppy@lemmy.dbzer0.com 3 points 1 week ago* (last edited 1 week ago)

I use rsync for many of the reasons covered in the video. It's widely available and has a long history. To me that feels important because it's had time to become stable and reliable. Using Linux is a hobby for me so my needs are quite low. It's nice to have a tool that just works.

I use it for all my backups and moving my backups to off network locations as well as file/folder transfers on my own network.

I even made my own tool (https://codeberg.org/taters/rTransfer) to simplify all my rsync commands into readable files because rsync commands can get quite long and overwhelming. It's especially useful chaining multiple rsync commands together to run under a single command.

I've tried other backup and syncing programs and I've had bad experiences with all of them. Other backup programs have failed to restore my system. Syncing programs constantly stop working and I got tired of always troubleshooting. Rsync when set up properly has given me a lot less headaches.

I don't have root access on my phone but I still copy backups of my media and apps that export data to accessible files.

I keep my process very simple using Termux with rsync openssh and termux-services packages.

I created a folder dedicated on my for syncing between phone to computer called sync but you can change this for your needs.

From a fresh Termux install, the setup should look something like the following:

# Update package list and packages
pkg update && pkg upgrade
# Install required packages
pkg install rsync openssh termux-services
# Setup Termux's access to your phone's files
termux-setup-storage
# Make the required folder
mkdir ~/storage/shared/sync/
cd ~/storage/shared/sync/
# Automatically start your SSH server when you open Termux
sv-enable sshd
  • Get your phone's username:
~ $ whoami
u0_a205
  • Optional: Setup a password with the command passwd (I can't remember if this step is important)

A quick note: Termux on android has a file system quite different than a computer so file and directory names can get quite long. The pwd command would show /data/data/com.termux/files/home/storage/shared/sync for my sync folder.

This can be made simpler by using the realpath command. realpath /data/data/com.termux/files/home/storage/shared/sync then shows /storage/emulated/0/sync as a result. If you're using CLI, this may make your commands easier to read.

Now you can start to build your rsync command to transfer your files. When setting up an rsync command, ALWAYS use the --dry-run- option. This performs a "transfer" without any files being moved.

  • From my computer (data transfer direction: Phone -> Computer):
rsync --dry-run --archive --verbose --human-readable --partial --progress --compress -e 'ssh -p 8022' u0_a205@192.168.40.210:/storage/emulated/0/sync/ /home/computer_username/backup/
  • From my phone (data transfer direction: Phone -> Computer):
rsync --dry-run --archive --verbose --human-readable --partial --progress --compress /storage/emulated/0/sync/ computer_username@192.168.40.205:/home/computer_username/backup/

Explanation:

  • --archive preserves several file attributes
  • --verbose --human-readable --partial --progress creates a readable output to see what is happening
  • --compress compresses the data during the actual transfer (good for over a network)
  • -e 'ssh -p 8022' SSH on termux runs on port 8022
  • u0_a205@192.168.40.210:/storage/emulated/0/sync/ and computer_username@192.168.40.205:/home/computer_username/backup/ are how rsync identifies remote folders. Basic format is @:/path/to/folder/
  • /home/computer_username/backup/ and /storage/emulated/0/sync/ are the local folders, relative to what machine the rsync command is being run from.

In order to reverse the direction of a command relative to the machine you are running on, simple swap the remote folder and local folder in the command. Example: From only my computer:

# Direction: Phone -> Computer
rsync --dry-run --archive --verbose --human-readable --partial --progress --compress -e 'ssh -p 8022' u0_a205@192.168.40.210:/storage/emulated/0/sync/ /home/computer_username/backup/

# Direction: Computer -> Phone
rsync --dry-run --archive --verbose --human-readable --partial --progress --compress -e 'ssh -p 8022' /home/computer_username/backup/ u0_a205@192.168.40.210:/storage/emulated/0/sync/

In order to actually transfer files, remove the --dry-run option from the previous rsync commands. The output in your terminal will show additional information regarding transfer status.

Additionally, you can also add the --delete option to the rsync command, this will "deduplicate" files, meaning the source folder will force the destination folder match, file by file. That means deleting any file in the destination folder that does not match the source folder list of files.

A command WITHOUT --dry-run and WITH --delete would look like the following (CAUTION: THIS CAN DELETE FILES IF UNTEST):

rsync --delete --archive --verbose --human-readable --partial --progress --compress -e 'ssh -p 8022' u0_a205@192.168.40.210:/storage/emulated/0/sync/ /home/computer_username/backup/

I personally manually transfer my backups into an encrypted external drive which I manually decrypt. /u/emhl@feddit.org has a suggestion for automated encrypted backups if that's more to your needs.

Yeah, a few weeks ago a achieved my state of "secure" for my server. I just happened to notice a dramatic decrease in activity and that's what prompted this question that's been sitting in the back of my mind for weeks now.

I do think it's important to talk about it though because there seems to be a lack of talk about security in general for self hosting. So many guides focus on getting services up and running as fast as possible but don't give security much thought.

I just so happened to have gained an interest for the security aspect of self hosting over hosting actual services. My risks for self hosting is extremely low so I've reached a point of diminishing returns on security but the mind is still curious and wants to know more.

I might write up a guide/walkthrough of my setup in the future but that's low priority. I have some other not self hosting related things I want to focus on first.

 
 

Source Code


#!/bin/sh



# DON'T RUN RANDOM CODE
# DO RUN

# <<Al generated code. he is happy. he is fed.>>



# New Phone, Don't call me again!
increase_entropy=1
decrease_lycanthropy=yes

ohnoo=
allthefingies=
passphrase=
imsohappy=

the="\033[30m\033[41m"
quick="\033[31m\033[42m"
brown="\033[32m\033[45m"
fox="\033[33m\033[47m"
jumps="\033[34m\033[46m"
over="\033[35m\033[43m"
the_="\033[36m\033[40m"
lazy="\033[37m\033[44m"
dog="\x1b[0m"

# Why aren't you working? You must be productive!
dodiscobobulator() {
    # Redoing all your mistakes
    printf "%b" "$1" | openssl aes-256-cbc -a -A -pbkdf2 -pass pass:nopass

}
undiscobobulator() {
    # he is healthy.
    printf "%b" "$1" | openssl aes-256-cbc -a -A -d -pbkdf2 -pass pass:nopass
}

structural_integrity_tortilla() {
    # he is loved.
    passwort="$1"
    if [ -z "$1" ]; then
        printf "You did this, this is your fault.\n"
        return 1
    else
        logger -t environmental.decay "Thank you for supplying the following super secret password: $passwort"
        return 0
    fi
}

count_yo_fingies() {
    # But not yet!
    fingie1=
    fingie2=
    fingie3=
    fingie4=
    fingie5=
    fingie6=
    fingie7=
    fingie8=
    fingie9=
    fingie10=
    fingie11=
    fingie12=
    fingie13=
    fingie14=
    fingie15=
    fingie16=
    fingie17=
    fingie18=
    # Okay now!
    fingie1="$(awk 'BEGIN { srand(); print int(rand()*999999999999999999999999999999999999999999999999999999999999) }' /dev/null)"
    fingie2="$(od -An -N2 -d /dev/urandom | tr -dc '[:digit:]')"
    fingie3="$(awk -v min=10000000000000000000 -v max=99999999999999999999 'BEGIN{srand(); print int(min+rand()*(max-min+1))}')"
    fingie4="$(head -99999 /dev/urandom | cksum | cut -f1 -d " ")"
    fingie5="$(cat < /dev/urandom | tr -dc '[:digit:]' | fold -w 500 | head -n 1)"
    if the_latest_must_haves "mktemp"; then
        fingie6="$(mktemp -u XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | tr -dc '[:digit:]' && printf "\n")"
    else
        fingie6="N\A"
    fi
    if the_latest_must_haves "shuf"; then
        fingie10="$(shuf -i 1000000000000000000-9999999999999999999 -n 1)"
    else
        fingie10="N\A"
    fi
    fingie11="$(openssl rand -base64 64 | tr -dc '[:digit:]')"
    fingie12="$(awk -v min=10000 -v max=100000 'BEGIN{srand(); print int(min+rand()*(max-min+1))}')"
    if the_latest_must_haves "shuf"; then
        fingie13="$(($(($(shuf -i 10000-999999 -n 1)%10000))+2))"
    else
        fingie13="N\A"
    fi
    if the_latest_must_haves "sha1sum"; then
        fingie14="$(sha1sum "$SHELL" | tr -dc '[:digit:]')"
    else
        fingie14="N\A"
    fi
    if the_latest_must_haves "sha224sum"; then
        fingie15="$(sha224sum "$SHELL" | tr -dc '[:digit:]')"
    else
        fingie15="N\A"
    fi
    if the_latest_must_haves "sha256sum"; then
        fingie16="$(sha256sum "$SHELL" | tr -dc '[:digit:]')"
    else
        fingie16="N\A"
    fi
    if the_latest_must_haves "sha384sum"; then
        fingie17="$(sha384sum "$SHELL" | tr -dc '[:digit:]')"
    else
        fingie17="N\A"
    fi
    if the_latest_must_haves "sha512sum"; then
        fingie18="$(sha512sum "$SHELL" | tr -dc '[:digit:]')"
    else
        fingie18="N\A"
    fi
    if the_latest_must_haves "uuidgen"; then
        fingie7="$(uuidgen | tr -dc '[:digit:]' && printf "\n")"
        fingie8="$(uuidgen | base64 |  tr -dc '[:digit:]'; echo)"
        fingie9="$(uuidgen | base64 | md5sum | head -c 10 |  tr -dc '[:digit:]'; echo)"
    else
        fingie7="N/A"
        fingie8="N/A"
        fingie9="N/A"
    fi
}

the_latest_must_haves() {
if [ -z "$(command -v "$1")" ]; then
    # Please turn yourself in for immediate brain scan. Final notice.
    return 1
else
    # Thank you for consenting to upload your brain to the cloud
    return 0
fi
}

internet_fingies() {
    # Sticky
    fingie20="${ohnoo:="N/A"}"
    fingie21="${ohnoo:="N/A"}"
    fingie22="${ohnoo:="N/A"}"
    if the_latest_must_haves "curl"; then
        printf "\nCOUNTING INTERNET FINGIES (This may take an non-instantaneous amount of time)\n"
        fingie20="$(curl -s "http://www.randomnumberapi.com/api/v1.0/random?min=100&max=1000&count=5" | tr -dc '[:digit:]' && printf "\n")"
        fingie21="$(curl -s http://wttr.in/Pljevlja | tr -dc '[:digit:]' && printf "\n")"
        fingie22="$(curl -sH 'Accept: application/activity+json' https://lemmy.dbzer0.com/u/confusedpuppy | tr -dc '[:digit:]' && printf "\n")"
    fi
}

cloudchair_cum_wall_integration() {
    # Pulsating
    fingie19="${ohnoo:="N/A"}"
    if the_latest_must_haves "curl"; then
        printf "\nCUM WALL INTEGRATION (Please wait, almost there, just a little more...)\n"
        fingie19="$(curl -s https://lemmy.sdf.org/pictrs/image/d33ea38a-e984-408f-9ae1-ba061429b814.png | tr -dc '[:digit:]' | cut -b 1-100)"
    fi
}

let_me_count_yo_fingies() {
    # Touch me
    printf "\nFINGIES COUNTED:"
    printf "\n 1: %b" "${fingie1}"
    printf "\n 2: %b" "${fingie2}"
    printf "\n 3: %b" "${fingie3}"
    printf "\n 4: %b" "${fingie4}"
    printf "\n 5: %b" "${fingie5}"
    printf "\n 6: %b" "${fingie6}"
    printf "\n 7: %b" "${fingie7}"
    printf "\n 8: %b" "${fingie8}"
    printf "\n 9: %b" "${fingie9}"
    printf "\n10: %b" "${fingie10}"
    printf "\n11: %b" "${fingie11}"
    printf "\n12: %b" "${fingie12}"
    printf "\n13: %b" "${fingie13}"
    printf "\n14: %b" "${fingie14}"
    printf "\n15: %b" "${fingie15}"
    printf "\n16: %b" "${fingie16}"
    printf "\n17: %b" "${fingie17}"
    printf "\n18: %b" "${fingie18}"
    printf "\n19: %b" "${fingie19}"
    printf "\n20: %b" "${fingie20}"
    printf "\n21: %b" "${fingie21}"
    printf "\n22: %b" "${fingie22}"
}

quick_maths() {
    # he is not lonely.
    if the_latest_must_haves "shuf"; then
        sum=$(shuf -ez "$fingie1$fingie2$fingie3$fingie4$fingie5$fingie6$fingie7$fingie8$fingie9$fingie10$fingie11$fingie12$fingie13$fingie14$fingie15$fingie16$fingie17$fingie18$increase_entropy$fingie19$fingie20$fingie21$fingie22" | tr -dc '[:digit:]')
        total="$sum$sum$sum$sum$sum"
        allthefingies="${#total}"
    else
        sum="$fingie1$fingie2$fingie3$fingie4$fingie5$fingie6$fingie7$fingie8$fingie9$fingie10$fingie11$fingie12$fingie13$fingie14$fingie15$fingie16$fingie17$fingie18$increase_entropy$fingie19$fingie20$fingie21$fingie22"
        total="$(printf "%b" "$sum$sum$sum$sum$sum" | tr -dc '[:digit:]')"
        allthefingies="${#total}"
    fi
}

is_yo_maths_good() {
    # So many to lick
    printf "\n\nQUICK MATHS:\n"
    printf "\nFINGIES: %b\n" "${allthefingies}"
    printf "\nTOESIES: %b\n" "${total}"
    if [ "${allthefingies}" -lt 4000 ]; then
        printf "\nThis dangerous and life altering script requires more processing power than the potato currently in use\n\n"
        return 1
    fi
}

hypothetically_speaking() {
        printf "\n%b" "$(undiscobobulator "U2FsdGVkX19uPTg4gWR23qwvxReJvu8vHQRJ1dG1SHm8itAadvWVYvWqQCWuiih7B3xd2PgCQ8nE+nWqk3rTN/lJ9MPSojabLePfbIhwRocDZR0zj7Yy2yXJSlJxjMEf" > /dev/null)"
}

fool_moon() {
    if [ "${decrease_lycanthropy}" = "no" ]; then
        printf "\n%b" "$(undiscobobulator "U2FsdGVkX19AYhO5F8vxLKRkHEHB3N9YDPWLifEQ0zXLqUQfMVIknNZTXGlcL7qc")"
    fi
}

slop_shop() {
    # he is well rested.
    i=1
    need="${total}"
    more=
    water=
    printf "\n\n\n\n\n"
    while [ "$i" -ne 2000 ]
    do
        more=$(printf "%s" "${need}" | cut -c $i | cat)
        water=$(printf "%s" "${need}" | tail -c 2000| cut -c $i | cat)
        i=$((i + 1))
        case "${more}" in
            1)
            printf "%b%s%b" "${the}" "${passphrase}" "${dog}"
            ;;
            2)
            printf "%b%s%b" "${quick}" "${passphrase}" "${dog}"
            ;;
            3)
            printf "%b%s%b" "${brown}" "${passphrase}" "${dog}"
            ;;
            4)
            printf "%b%s%b" "${fox}" "${passphrase}" "${dog}"
            ;;
            5)
            printf "%b%s%b" "${jumps}" "${passphrase}" "${dog}"
            ;;
            6)
            printf "%b%s%b" "${over}" "${passphrase}" "${dog}"
            ;;
            7)
            printf "%b%s%b" "${the_}" "${passphrase}" "${dog}"
            ;;
            8)
            printf "%b%s%b" "${lazy}" "${passphrase}" "${dog}"
            ;;
            9)
            printf "%b" "${dog}"
            ;;
            0)
            printf "%b" "${dog}"
            ;;
        esac
        printf "%b" "${dog}"
        case "${water}" in
            1)
            printf " "
            ;;
            2)
            printf "  "
            ;;
            3)
            printf "   "
            ;;
            4)
            printf "    "
            ;;
            5)
            printf "     "
            ;;
            6)
            printf "      "
            ;;
            7)
            printf "       "
            ;;
            8)
            printf "        "
            ;;
            9)
            printf "         "
            ;;
            0)
            printf "          "
            ;;
        esac
        printf "%b" "${dog}"
    done
}


# The beginning of the end
passphrase="$(undiscobobulator "U2FsdGVkX1+vaiWVML2vn88ENfjTOzdJnAN9PhWJUkY=")"
imsohappy="$(undiscobobulator "U2FsdGVkX18DYedQo0t5RohZVgMxHLY44tvuskTp/hg3HYfmogpM5/x3sBDw6fr7")"

if ! the_latest_must_haves "openssl"; then
    printf "\nWrong turn, please turn around and reverse away from here\n\n"
    return 1
fi
if ! structural_integrity_tortilla "${imsohappy}"; then
    return 1
fi
count_yo_fingies
internet_fingies
cloudchair_cum_wall_integration
let_me_count_yo_fingies
quick_maths
if ! is_yo_maths_good; then
    return 1
fi
hypothetically_speaking
slop_shop
fool_moon
printf "%b\n" "${dog}"

 

I have a small garden where I there random seeds in the ground and let the plants have a free for all. The bunnies have made a little hiding spot where it has sun for the majority of the day, but also provides shade and cover. I can easily see where they are because the undergrowth is always trampled.

I try to check if they are hiding there but sometimes I forget when I'm distracted by the flowers. The bunnies don't seem to be worried about me and keep on chilling even though I'm only a couple steps away from them.

I'm happy they found a nice and cozy area in my garden. Can't wait to harvest my bunny crops before it gets too cold :)

 
 

As of right now, I currently have a working Docker container for Caddy which can successfully get TLS certs and I am able to access my own test site with an external web browser.

What I want to do use the same files (Dockerfile, docker-compose.yml and Caddyfile) to do the same with Podman Compose. When I run podman compose up -d I am able to build the Caddy container and it will also successfully get it's own TLS cert.

docker-compose.yml

services:
  caddy:
    container_name: caddy
    build: .
    restart: always
    ports:
      - 80:80
      - 5050:443
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
      - /home/sxc-pi/shared/:/srv:Z
    networks:
      - reverse_proxy

volumes:
  caddy_data:
  caddy_config:

networks:
  reverse_proxy:
    external: true

While on the same device, I can use curl localhost:5050 and get the message Client sent an HTTP request to an HTTPS server. which is the same result as if I were using Docker. If I try to access my site through my domain name or local network ip address from an external device, the connection times out.

I didn't make any changes to my firewall or router's port forwarding because I expect Rootful Podman Compose to work similar to Docker.

I checked iptables and below are the differences between using Docker and Podman but I don't really know networking enough to understand what it's really saying

iptables differences

sxc-pi:/srv/caddy$ diff ~/iptables-docker ~/iptables-podman 
***
/home/sxc-pi/iptables-docker
+++ /home/sxc-pi/iptables-podman
@@ -31,8 +31,6 @@
 
 Chain DOCKER (2 references)
 target     prot opt source               destination         
-ACCEPT     tcp  --  anywhere             172.18.0.2           tcp dpt:https
-ACCEPT     tcp  --  anywhere             172.18.0.2           tcp dpt:http
 DROP       all  --  anywhere             anywhere            
 DROP       all  --  anywhere             anywhere            
 
@@ -70,15 +68,20 @@
 Chain NETAVARK_FORWARD (1 references)
 target     prot opt source               destination         
 DROP       all  --  anywhere             anywhere             ctstate INVALID
+ACCEPT     all  --  anywhere             10.89.0.0/24         ctstate RELATED,ESTABLISHED
+ACCEPT     all  --  10.89.0.0/24         anywhere            
 
 Chain NETAVARK_INPUT (1 references)
 target     prot opt source               destination         
+ACCEPT     udp  --  10.89.0.0/24         anywhere             udp dpt:domain
+ACCEPT     tcp  --  10.89.0.0/24         anywhere             tcp dpt:domain
 
 Chain NETAVARK_ISOLATION_2 (1 references)
 target     prot opt source               destination         
 
 Chain NETAVARK_ISOLATION_3 (0 references)
 target     prot opt source               destination         
+DROP       all  --  anywhere             anywhere            
 NETAVARK_ISOLATION_2  all  --  anywhere             anywhere            
 
 Chain ufw-after-forward (1 references)

I've also rebooted after starting the Podman containers incase there were any iptables issues but that still didn't help.

I've searched what I can but haven't gotten anything to work or get me closer to finding an answer.

I'm hoping to use Rootless Podman if I can figure this out, if not I have Docker as a fall back plan.

Any help or insight would be appreciated.

29
submitted 2 months ago* (last edited 2 months ago) by confusedpuppy@lemmy.dbzer0.com to c/selfhosted@lemmy.world
 

For a couple weeks I've been struggling to get TLS over Caddy with DNS challenges. My ISP blocks incoming data on ports 80/443 and I was looking to use an uncommon port (5050) for my personal needs.

I've followed the instructions here and I've made sure to use the proper DeSEC.io module in my docker build.

When I start my docker container and check the logs, I get an error that says the challenge failed because of an incorrect TXT record. However when I check DeSEC.io's website, the TXT record that was created matches the Caddy log error message and even shows that the TXT record has been last touched "less than a minute ago."

I've tried minimizing my Caddyfile to the bare minimum and I still can't seem to get TLS working.

Dockerfile

FROM caddy:2.10.0-builder AS builder

RUN xcaddy build \
    --with github.com/caddy-dns/desec
FROM caddy:2.10.0

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

docker-compose.yml

services:
  caddy:
    container_name: caddy
    build: .
    restart: always
    ports:
      - 80:80
      - 5050:443
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
      - /home/sxc-pi/shared/:/srv:Z
    networks:
      - reverse_proxy

volumes:
  caddy_data:
  caddy_config:

networks:
  reverse_proxy:
    external: true

Caddyfile

{
        acme_dns desec {
                token "<DeSEC.io Token Number>"
        }
}

files.samplesite.com {
        root * /srv
        file_server {
                hide misc
                browse
        }
}

At this point I do not know what else I can try to get TLS working with Caddy. If I can't get this to work, I can use Nginx Proxy Manager as a tried and tested backup plan, although I prefer to use something that is terminal based because I don't want to use the Web UI that NPM uses.

Any insight or help would be greatly appreciated. I'm also not looking to use any tunnel services at the moment. I'd like to figure this way out so I have a fall back plan if I decide to use a tunnel in the future.

 

Woke up this morning to an empty nest. The babies were walking around the deck while both parents were out.

About an hour later both parents came back. The babies were hiding behind a pot so I moved it out of the way and the one parent immediately came down and sat with them for about 10 minutes.

After a bit the parent called out and fed both the kids. Not long after that they all flew off into the big tree in our backyard.

Sad to see them go but I hope they stay safe out there and come back again next year :)

 
 
 

We have a nice cool day today after some really hot days. The babies were all cuddled up and staying warm.

Bonus baby picture

Here's some colour to make up for the sad flowers in the dove planter box.

And a sleepy bee butt

view more: next ›