diff --git a/Containerfile b/Containerfile index b808ccc..b46c8ae 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -FROM lsiobase/alpine:3.19 AS base +FROM lsiobase/alpine:3.21 AS base WORKDIR /usr/src/app diff --git a/maloja/data_files/state/scrobbles/dummy b/maloja/data_files/state/scrobbles/dummy deleted file mode 100644 index e69de29..0000000 diff --git a/maloja/setup.py b/maloja/setup.py index 6eb88cc..1ac700a 100644 --- a/maloja/setup.py +++ b/maloja/setup.py @@ -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.") diff --git a/pyproject.toml b/pyproject.toml index 4196c8e..dc63ff4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" } ] diff --git a/requirements.txt b/requirements.txt index 9bcea41..e81dd5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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.*