Skip to content

Die KW 21/2022 im Link-Rückblick

Nextcloud create public upload link

So today I wanted to quickly setup a public shared link so that a friend of mine is able to easily upload a file to me.

Of course, I've stumbled over the file drop but I was not able to find the "File drop (upload only" section when I was creating this share.

I tried to find more information and was digging into the documentation. I was going through the issue list but at the end, I was not able to fix the missing option. I was also quickly updating the server to the latest version, but also, no "File drop" selection.

Than, after reading the logs, investigating the config.php, I finally found the missing link.

As an administrator, you have to go to Sharing and check the Allow public uploads configuration setting. After that, you can finally create your share as a user known as "file drop".

Die KW 20/2022 im Link-Rückblick

Upgrade gitea via bash on an uberspace webspace

I've just finished writing a little bash script to almost automatically upgrade my gitea instance on my uberspace webspace.

Hope it will help you.

    cat > "${HOME}/upgrade_gitea.sh" <<DELIM
#!/bin/bash
####
# @see: https://lab.uberspace.de/guide_gitea/
# @since: 2022-05-16
# @author: stev leibelt <artodeto@bazzline.net>
####

function _do_the_update () {
    local PATH_TO_GITEA="${HOME}/gitea/gitea"

    if [[ -f "\${PATH_TO_GITEA}" ]];
    then
        echo ":: Stopping all running gitea process."

        killall gitea

        echo ":: Moving >>\${PATH_TO_GITEA}<< to >>\${PATH_TO_GITEA}.previous<<"

        mv "\${PATH_TO_GITEA}" "\${PATH_TO_GITEA}.previous"
    fi

    echo ":: Please visit >>https://github.com/go-gitea/gitea/releases/tag/latest<<."
    echo ""

    echo ":: Please insert latest Version number without the v."
    read LATEST_GITEAVERSION

    wget -O "\${PATH_TO_GITEA}" https://github.com/go-gitea/gitea/releases/download/v\${LATEST_GITEAVERSION}/gitea-\${LATEST_GITEAVERSION}-linux-amd64

    if [[ -f "\${PATH_TO_GITEA}" ]];
    then
        wget --output-document "\${PATH_TO_GITEA}.asc" https://github.com/go-gitea/gitea/releases/download/v\${LATEST_GITEAVERSION}/gitea-\${LATEST_GITEAVERSION}-linux-amd64.asc

        curl --silent https://keys.openpgp.org/vks/v1/by-fingerprint/7C9E68152594688862D62AF62D9AE806EC1592E2 | gpg --import

        gpg --verify "\${PATH_TO_GITEA}.asc" "\${PATH_TO_GITEA}"

        chmod u+x "\${PATH_TO_GITEA}"

        echo ":: Starting migration"

        \${PATH_TO_GITEA} migrate

        echo ":: Starting gitea"

        \${PATH_TO_GITEA} web
    else
        echo ":: Something went wrong."

        if [[ -f "\${PATH_TO_GITEA}.previous" ]];
        then
            echo ":: Restoring previous gitea."

            mv "\${PATH_TO_GITEA}.previous" \"${PATH_TO_GITEA}"

            echo ":: Starting gitea"

            \${PATH_TO_GITEA} web
        fi
    fi
}

_do_the_update
DELIM

    chmod +x ${HOME}/upgrade_gitea.sh

Best regards, artodeto.