This commit is contained in:
Zsolt Ero
2026-05-02 21:46:09 +02:00
parent b0fc592f7c
commit b7bc98d950
4 changed files with 41 additions and 33 deletions

View File

@@ -1,49 +1,57 @@
target-version = "py310" target-version = "py313"
unsafe-fixes = true
line-length = 100 line-length = 100
extend-exclude = ["temp"] extend-exclude = ["alembic", "*.ipynb", "temp"]
lint.select = [ lint.select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
'UP', # pyupgrade
'A', # flake8-builtins 'A', # flake8-builtins
"C4", # flake8-comprehensions "C4", # flake8-comprehensions
'DTZ', # flake8-datetimez
"E", # pycodestyle errors
'EXE', # flake8-executable 'EXE', # flake8-executable
"F", # Pyflakes
'FA', # flake8-future-annotations 'FA', # flake8-future-annotations
"I", # isort
'PT', # flake8-pytest-style 'PT', # flake8-pytest-style
'RSE', # flake8-raise 'RSE', # flake8-raise
'SIM', # flake8-simplify 'SIM', # flake8-simplify
'DTZ', # flake8-datetimez, https://beta.ruff.rs/docs/rules/#flake8-datetimez-dtz 'UP', # pyupgrade
"W", # pycodestyle warnings
] ]
lint.ignore = [ lint.ignore = [
'A003', 'A003',
'DTZ007', # 'C408', # keep dict() as-is
'DTZ007', # naive datetime.strptime() without %z
'E501', 'E501',
'E711', 'E711',
'E712', 'E712',
# 'E721', # type comparison 'E721', # type() comparison
# 'E722', # bare except
'E741', 'E741',
'F401', # unused imports 'EXE003', # shebang should contain "python"
'F401', # unused imports
'F841', 'F841',
# 'PT018', # assertion should be broken into multiple parts
'SIM102', 'SIM102',
#'SIM103', # needless-bool, return the condition {condition} directly 'SIM103', # return the condition directly
'SIM105', 'SIM105',
'SIM108', 'SIM108',
# 'SIM110', # use any() instead of a for loop
# 'SIM114',
'SIM115', 'SIM115',
# 'DTZ007', # Naive datetime constructed using `datetime.datetime.strptime()` without %z # 'UP007', # use X | Y instead of Union[X, Y]
# 'UP032', # use an f-string instead of format()
# 'UP046', # prefer type parameters over Generic subclasses
] ]
[format] [format]
quote-style = "single" quote-style = "single"
[lint.isort] [lint.isort]
known-first-party = ["ssh_lib"] known-first-party = ["lib", "api", "deploy", "ssh_lib"]
lines-after-imports = 2 lines-after-imports = 2
[lint.flake8-comprehensions] [lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true allow-dict-calls-with-keyword-arguments = true

View File

@@ -1,3 +1,8 @@
making web maps free and fun again
add dark themes in website
logrotate logrotate
/var/log/nginx/*.log /var/log/nginx/*/*.log { /var/log/nginx/*.log /var/log/nginx/*/*.log {

View File

@@ -1,14 +1,16 @@
from ssh_lib.utils import ( from ssh_lib.apt import (
apt_get_install, apt_get_install,
apt_get_purge, apt_get_purge,
apt_get_update, apt_get_update,
put_str, setup_apt_repository,
sudo_cmd, )
from ssh_lib.utils import (
ubuntu_codename, ubuntu_codename,
) )
JAVA_VER = 24 JAVA_VER = 24
ADOPTIUM_REPO_NAME = 'adoptium'
def java(c): def java(c):
@@ -16,25 +18,17 @@ def java(c):
# remove old Ubuntu version of OpenJDK # remove old Ubuntu version of OpenJDK
apt_get_purge(c, 'openjdk* temurin*') apt_get_purge(c, 'openjdk* temurin*')
# Download and install the Eclipse Adoptium GPG key
sudo_cmd(
c,
'wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public '
'| gpg --dearmor '
'| tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null',
)
# Get the Ubuntu codename
codename = ubuntu_codename(c) codename = ubuntu_codename(c)
# Configure the Eclipse Adoptium apt repository setup_apt_repository(
put_str(
c, c,
'/etc/apt/sources.list.d/adoptium.list', repo_name=ADOPTIUM_REPO_NAME,
f'deb https://packages.adoptium.net/artifactory/deb {codename} main', key_url='https://packages.adoptium.net/artifactory/api/gpg/key/public',
repo_url='https://packages.adoptium.net/artifactory/deb',
suite=codename,
component='main',
) )
# Update package list and install Temurin JDK
apt_get_update(c) apt_get_update(c)
apt_get_install(c, f'temurin-{JAVA_VER}-jdk') apt_get_install(c, f'temurin-{JAVA_VER}-jdk')

View File

@@ -1,4 +1,5 @@
from ssh_lib.utils import apt_get_update, exists from ssh_lib.apt import apt_get_update
from ssh_lib.utils import exists
def rclone(c): def rclone(c):