Python and Alpine upgrade

This commit is contained in:
krateng 2025-01-19 19:13:46 +01:00
parent 9d21800eb9
commit 63386b5ede
5 changed files with 17 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM lsiobase/alpine:3.19 AS base
FROM lsiobase/alpine:3.21 AS base
WORKDIR /usr/src/app

View File

@ -2,6 +2,8 @@ import os
import shutil
from importlib import resources
from pathlib import PosixPath
from doreah.io import col, ask, prompt
from .pkg_global.conf import data_dir, dir_settings, malojaconfig, auth
@ -26,13 +28,20 @@ def copy_initial_local_files():
if cat == 'config' and malojaconfig.readonly:
continue
shutil.copytree(data_file_source / cat, dir_settings[cat])
# to avoid permission problems with the root dir
for subfolder in os.listdir(data_file_source / cat):
src = data_file_source / cat / subfolder
dst = PosixPath(dir_settings[cat]) / subfolder
if os.path.isdir(src):
shutil.copytree(src, dst, dirs_exist_ok=True)
charset = list(range(10)) + list("abcdefghijklmnopqrstuvwxyz") + list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
def randomstring(length=32):
import random
return "".join(str(random.choice(charset)) for _ in range(length))
def setup():
copy_initial_local_files()
@ -47,10 +56,11 @@ def setup():
print(f"\tCurrently not using a {col['red'](keyname)} for image display.")
elif key is None or key == "ASK":
if malojaconfig.readonly:
continue
promptmsg = f"\tPlease enter your {col['gold'](keyname)}. If you do not want to use one at this moment, simply leave this empty and press Enter."
key = prompt(promptmsg,types=(str,),default=False,skip=SKIP)
malojaconfig[k] = key
print(f"\tCurrently not using a {col['red'](keyname)} for image display - config is read only.")
else:
promptmsg = f"\tPlease enter your {col['gold'](keyname)}. If you do not want to use one at this moment, simply leave this empty and press Enter."
key = prompt(promptmsg,types=(str,),default=False,skip=SKIP)
malojaconfig[k] = key
else:
print(f"\t{col['lawngreen'](keyname)} found.")

View File

@ -3,7 +3,7 @@ name = "malojaserver"
version = "3.2.3"
description = "Self-hosted music scrobble database"
readme = "README.md"
requires-python = "==3.11.*"
requires-python = "==3.12.*"
license = { file="LICENSE" }
authors = [ { name="Johannes Krattenmacher", email="maloja@dev.krateng.ch" } ]

View File

@ -9,7 +9,6 @@ psutil==5.9.*
sqlalchemy==2.0
python-datauri==3.0.*
requests==2.32.*
setuptools==75.8.*
toml==0.10.*
PyYAML==6.0.*