mirror of
https://github.com/krateng/maloja.git
synced 2025-05-31 20:24:21 -04:00
Python and Alpine upgrade
This commit is contained in:
parent
9d21800eb9
commit
63386b5ede
@ -1,4 +1,4 @@
|
|||||||
FROM lsiobase/alpine:3.19 AS base
|
FROM lsiobase/alpine:3.21 AS base
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from importlib import resources
|
from importlib import resources
|
||||||
|
from pathlib import PosixPath
|
||||||
|
|
||||||
from doreah.io import col, ask, prompt
|
from doreah.io import col, ask, prompt
|
||||||
|
|
||||||
from .pkg_global.conf import data_dir, dir_settings, malojaconfig, auth
|
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:
|
if cat == 'config' and malojaconfig.readonly:
|
||||||
continue
|
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")
|
charset = list(range(10)) + list("abcdefghijklmnopqrstuvwxyz") + list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||||
def randomstring(length=32):
|
def randomstring(length=32):
|
||||||
import random
|
import random
|
||||||
return "".join(str(random.choice(charset)) for _ in range(length))
|
return "".join(str(random.choice(charset)) for _ in range(length))
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
|
|
||||||
copy_initial_local_files()
|
copy_initial_local_files()
|
||||||
@ -47,10 +56,11 @@ def setup():
|
|||||||
print(f"\tCurrently not using a {col['red'](keyname)} for image display.")
|
print(f"\tCurrently not using a {col['red'](keyname)} for image display.")
|
||||||
elif key is None or key == "ASK":
|
elif key is None or key == "ASK":
|
||||||
if malojaconfig.readonly:
|
if malojaconfig.readonly:
|
||||||
continue
|
print(f"\tCurrently not using a {col['red'](keyname)} for image display - config is read only.")
|
||||||
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."
|
else:
|
||||||
key = prompt(promptmsg,types=(str,),default=False,skip=SKIP)
|
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."
|
||||||
malojaconfig[k] = key
|
key = prompt(promptmsg,types=(str,),default=False,skip=SKIP)
|
||||||
|
malojaconfig[k] = key
|
||||||
else:
|
else:
|
||||||
print(f"\t{col['lawngreen'](keyname)} found.")
|
print(f"\t{col['lawngreen'](keyname)} found.")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ name = "malojaserver"
|
|||||||
version = "3.2.3"
|
version = "3.2.3"
|
||||||
description = "Self-hosted music scrobble database"
|
description = "Self-hosted music scrobble database"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = "==3.11.*"
|
requires-python = "==3.12.*"
|
||||||
license = { file="LICENSE" }
|
license = { file="LICENSE" }
|
||||||
authors = [ { name="Johannes Krattenmacher", email="maloja@dev.krateng.ch" } ]
|
authors = [ { name="Johannes Krattenmacher", email="maloja@dev.krateng.ch" } ]
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ psutil==5.9.*
|
|||||||
sqlalchemy==2.0
|
sqlalchemy==2.0
|
||||||
python-datauri==3.0.*
|
python-datauri==3.0.*
|
||||||
requests==2.32.*
|
requests==2.32.*
|
||||||
setuptools==75.8.*
|
|
||||||
toml==0.10.*
|
toml==0.10.*
|
||||||
PyYAML==6.0.*
|
PyYAML==6.0.*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user