Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Debian 13 / Trixie #2002

Draft
wants to merge 34 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
493c853
FIXME: remove conflicts with trixie package verisons
Salamandar Nov 3, 2024
52be108
chore: add python3-pydantic-extra-types dependency
Salamandar Nov 5, 2024
2239e30
DONOTMERGE: patch because sury doesn't support trixie yet
Salamandar Nov 5, 2024
5cba66b
nginx now configures 'server_tokens off' in its core config
Salamandar Nov 5, 2024
7f2f5f7
Replace mysqlshow, mysqldump with mariadb-show, mariadb-dump
Salamandar Nov 13, 2024
63c2bdf
Try to run CI on trixie
Salamandar Nov 21, 2024
2ddc9bd
Use py312 as tox target
Salamandar Nov 21, 2024
695772a
Fix lint312 job
Salamandar Nov 21, 2024
b8f098f
pydanticv2: Model.dict() -> Model.dump_model()
Axolotle Nov 20, 2024
f0303aa
pydanticv2: Model.__fields__ -> Model.model_fields
Axolotle Nov 20, 2024
0c74ed6
pydanticv2: Model.construct() -> Model.model_construct()
Axolotle Nov 20, 2024
68e9eb6
pydanticv2: Class Config -> ConfigDict()
Axolotle Nov 20, 2024
aedbcab
pydanticv2: Class Config.schema_extra() -> __get_pydantic_json_schema…
Axolotle Nov 20, 2024
29166b7
pydanticv2: validator() -> field_validator()
Axolotle Nov 20, 2024
ad1073a
pydanticv2: root_validator() -> model_validator()
Axolotle Nov 20, 2024
8c38c8d
pydanticv2: Field's allow_mutation -> frozen
Axolotle Nov 20, 2024
14982e6
pydanticv2: regex -> pattern
Axolotle Nov 20, 2024
d29545d
pydanticv2: fix missing imports
Axolotle Nov 20, 2024
42a9947
pydanticv2: rework custom validators and extra args
Axolotle Nov 20, 2024
8626711
pydanticv2: fix SelectOption and other choices options
Axolotle Nov 20, 2024
3e88242
pydanticv2: fix TimeOption, was no longer parsing numbers
Axolotle Nov 20, 2024
22847c6
pydanticv2: fix DateOption, was no longer parsing numbers
Axolotle Nov 20, 2024
b97230f
pydanticv2: fix PasswordOption, properly handle forbidden fields
Axolotle Nov 20, 2024
7c81896
pydanticv2: 'ask' as optional
Axolotle Nov 20, 2024
aaa87ac
pydanticv2: fix missing imports
Axolotle Nov 20, 2024
353165f
pydanticv2: fix pydantic i18n error key might not be available
Axolotle Nov 20, 2024
4384129
pydanticv2: fix tests boolean handling in string types
Axolotle Nov 20, 2024
8b3bbee
pydanticv2: fix EmailOption tests
Axolotle Nov 20, 2024
7caada2
pydanticv2: fix UrlOption tests
Axolotle Nov 20, 2024
fbc2e9f
pydanticv2: fix missing imports
Axolotle Nov 20, 2024
69514f2
pydanticv2: fix validators return type
Axolotle Nov 20, 2024
2b5514d
Merge pull request #2001 from YunoHost/pydantic-v2
Salamandar Nov 21, 2024
becd8a9
Remove migration to bookworm (it's actually failing and putting weird…
Salamandar Nov 21, 2024
56c101f
Fix migrations after deleting migration to bookworm
Salamandar Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ workflow:
variables:
GIT_CLONE_PATH: '$CI_BUILDS_DIR/$CI_COMMIT_SHA/$CI_JOB_ID'
YNH_SOURCE: "https://github.com/yunohost"
YNH_DEBIAN: "bookworm"
YNH_DEBIAN: "trixie"
YNH_SKIP_DIAGNOSIS_DURING_UPGRADE: "true"

include:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/ci/build.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
stage: build
needs:
- job: actionsmap
- job: invalidcode311
- job: invalidcode312
image: "build-and-lint"
variables:
YNH_BUILD_DIR: "$GIT_CLONE_PATH/build"
Expand Down
10 changes: 5 additions & 5 deletions .gitlab/ci/lint.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ actionsmap:
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap.yml"))'
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap-portal.yml"))'

lint311:
lint312:
stage: lint
image: "build-and-lint"
needs: []
allow_failure: true
script:
- tox -e py311-lint
- tox -e py312-lint

invalidcode311:
invalidcode312:
stage: lint
image: "build-and-lint"
needs: []
script:
- tox -e py311-invalidcode
- tox -e py312-invalidcode

mypy:
stage: lint
image: "build-and-lint"
needs: []
script:
- tox -e py311-mypy
- tox -e py312-mypy

i18n-keys:
stage: lint
Expand Down
1 change: 0 additions & 1 deletion conf/nginx/global.conf
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
server_tokens off;
15 changes: 8 additions & 7 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Depends: python3-all (>= 3.11),
, python3-toml, python3-packaging, python3-publicsuffix2
, python3-ldap, python3-zeroconf (>= 0.47), python3-lexicon,
, python3-cryptography, python3-jwt, python3-passlib, python3-magic
, python-is-python3, python3-pydantic, python3-email-validator
, python-is-python3, python3-email-validator, python3-pydantic, python3-pydantic-extra-types
, nginx, nginx-extras (>=1.22)
, apt, apt-transport-https, apt-utils, aptitude, dirmngr
, openssh-server, iptables, fail2ban, bind9-dnsutils
Expand All @@ -39,12 +39,13 @@ Conflicts: iptables-persistent
, bind9
, openresolv
, systemd-resolved
, nginx-extras (>= 1.23)
, openssl (>= 3.1)
, slapd (>= 2.6)
, dovecot-core (>= 1:2.4)
, fail2ban (>= 1.1)
, iptables (>= 1.8.10)
# FIXME: Those version should be updated to trixie-backports versions
# , nginx-extras (>= 1.23)
# , openssl (>= 3.1)
# , slapd (>= 2.6)
# , dovecot-core (>= 1:2.4)
# , fail2ban (>= 1.1)
# , iptables (>= 1.8.10)
Description: manageable and configured self-hosting server
YunoHost aims to make self-hosting accessible to everyone. It configures
an email, Web and IM server alongside a LDAP base. It also provides
Expand Down
6 changes: 3 additions & 3 deletions helpers/helpers.v1.d/mysql
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ynh_mysql_drop_db() {
#
# usage: ynh_mysql_dump_db --database=database
# | arg: -d, --database= - the database name to dump
# | ret: The mysqldump output
# | ret: The mariadb-dump output
#
# example: ynh_mysql_dump_db --database=roundcube > ./dump.sql
#
Expand All @@ -133,7 +133,7 @@ ynh_mysql_dump_db() {
# Manage arguments with getopts
ynh_handle_getopts_args "$@"

mysqldump --single-transaction --skip-dump-date --routines "$database"
mariadb-dump --single-transaction --skip-dump-date --routines "$database"
}

# Create a user
Expand Down Expand Up @@ -184,7 +184,7 @@ ynh_mysql_user_exists() {
#
ynh_mysql_database_exists() {
local database=$1
mysqlshow | grep -qE "^|\s+$database\s+|"
mariadb-show | grep -qE "^|\s+$database\s+|"
}

# Drop a user
Expand Down
6 changes: 3 additions & 3 deletions helpers/helpers.v2.1.d/mysql
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ ynh_mysql_drop_db() {
#
# usage: ynh_mysql_dump_db database
# | arg: database - the database name to dump (by default, $db_name)
# | ret: The mysqldump output
# | ret: The mariadb-dump output
#
# example: ynh_mysql_dump_db "roundcube" > ./dump.sql
#
ynh_mysql_dump_db() {
local database=${1:-$db_name}
mysqldump --single-transaction --skip-dump-date --routines "$database"
mariadb-dump --single-transaction --skip-dump-date --routines "$database"
}

# Create a user
Expand Down Expand Up @@ -101,7 +101,7 @@ ynh_mysql_user_exists() {
#
ynh_mysql_database_exists() {
local database=$1
mysqlshow | grep -q "^| $database "
mariadb-show | grep -q "^| $database "
}

# Drop a user
Expand Down
10 changes: 9 additions & 1 deletion hooks/conf_regen/10-apt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ do_pre_regen() {

# Add sury
mkdir -p ${pending_dir}/etc/apt/sources.list.d/
echo "deb [signed-by=/etc/apt/trusted.gpg.d/extra_php_version.gpg] https://packages.sury.org/php/ $(lsb_release --codename --short) main" > "${pending_dir}/etc/apt/sources.list.d/extra_php_version.list"

# FIXME: sury doesn't support trixie yet
case "$(lsb_release --codename --short)" in
bullseye) sury_distro=bullseye ;;
bookworm) sury_distro=bookworm ;;
trixie) sury_distro=bookworm ;;
esac

echo "deb [signed-by=/etc/apt/trusted.gpg.d/extra_php_version.gpg] https://packages.sury.org/php/ $sury_distro main" > "${pending_dir}/etc/apt/sources.list.d/extra_php_version.list"

# Ban some packages from sury
echo "
Expand Down
6 changes: 3 additions & 3 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ def app_install(
# Retrieve arguments list for install script
raw_options = manifest["install"]
options, form = ask_questions_and_parse_answers(raw_options, prefilled_answers=args)
args = form.dict(exclude_none=True)
args = form.model_dump(exclude_none=True)

# Validate domain / path availability for webapps
# (ideally this should be handled by the resource system for manifest v >= 2
Expand Down Expand Up @@ -1892,7 +1892,7 @@ def _apply(
previous_settings: dict[str, Any],
exclude: Union["AbstractSetIntStr", "MappingIntStrAny", None] = None,
) -> None:
env = {key: str(value) for key, value in form.dict().items()}
env = {key: str(value) for key, value in form.model_dump().items()}
return_content = self._call_config_script("apply", env=env)

# If the script returned validation error
Expand All @@ -1908,7 +1908,7 @@ def _apply(
)

def _run_action(self, form: "FormModel", action_id: str) -> None:
env = {key: str(value) for key, value in form.dict().items()}
env = {key: str(value) for key, value in form.model_dump().items()}
self._call_config_script(action_id, env=env)

def _call_config_script(
Expand Down
6 changes: 4 additions & 2 deletions src/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@ def _apply(
exclude: Union["AbstractSetIntStr", "MappingIntStrAny", None] = None,
) -> None:
next_settings = {
k: v for k, v in form.dict().items() if previous_settings.get(k) != v
k: v
for k, v in form.model_dump().items()
if previous_settings.get(k) != v
}

if "default_app" in next_settings:
Expand Down Expand Up @@ -863,7 +865,7 @@ def _apply(
# that can be read by the portal API.
# FIXME remove those from the config panel saved values?

portal_values = form.dict(include=set(portal_options))
portal_values = form.model_dump(include=set(portal_options))
# Remove logo from values else filename will replace b64 content
if "portal_logo" in portal_values:
portal_values.pop("portal_logo")
Expand Down
Loading
Loading