Skip to content

Commit

Permalink
Merge branch 'dev' into ynh_service_remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar authored Aug 30, 2024
2 parents eb97b36 + aff885e commit 3941471
Show file tree
Hide file tree
Showing 89 changed files with 3,341 additions and 567 deletions.
7 changes: 6 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ workflow:
- if: $CI_COMMIT_TAG # For tags
- if: $CI_COMMIT_REF_NAME == "ci-format-$CI_DEFAULT_BRANCH" # Ignore black formatting branch created by the CI
when: never
- if: $CI_COMMIT_REF_NAME == "actions/black" # Ignore black formatting branch created by the CI
when: never
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push" # If it's not the default branch and if it's a push, then do not trigger a build
when: never
- when: always

variables:
YNH_BUILD_DIR: "/ynh-build"
GIT_CLONE_PATH: '$CI_BUILDS_DIR/$CI_COMMIT_SHA/$CI_JOB_ID'
YNH_SOURCE: "https://github.com/yunohost"
YNH_DEBIAN: "bullseye"
YNH_SKIP_DIAGNOSIS_DURING_UPGRADE: "true"

include:
- template: Code-Quality.gitlab-ci.yml
Expand Down
17 changes: 6 additions & 11 deletions .gitlab/ci/build.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
.build-stage:
stage: build
image: "before-install"
image: "build-and-lint"
variables:
YNH_SOURCE: "https://github.com/yunohost"
YNH_BUILD_DIR: "$GIT_CLONE_PATH/build"
before_script:
- mkdir -p $YNH_BUILD_DIR
- DEBIAN_FRONTEND=noninteractive apt update
artifacts:
paths:
- ./*.deb

.build_script: &build_script
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" install devscripts --no-install-recommends
- cd $YNH_BUILD_DIR/$PACKAGE
- VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null)
- VERSION_NIGHTLY="${VERSION}+$(date +%Y%m%d%H%M)"
- dch --package "${PACKAGE}" --force-bad-version -v "${VERSION_NIGHTLY}" -D "unstable" --force-distribution "Daily build."
- VERSION_TIMESTAMPED="${VERSION}+$(date +%Y%m%d%H%M)"
- dch --package "${PACKAGE}" --force-bad-version -v "${VERSION_TIMESTAMPED}" -D "unstable" --force-distribution "CI build."
- debuild --no-lintian -us -uc
- cp $YNH_BUILD_DIR/*.deb ${CI_PROJECT_DIR}/
- cd ${CI_PROJECT_DIR}
Expand All @@ -36,14 +34,12 @@ build-yunohost:
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- *build_script


build-ssowat:
extends: .build-stage
variables:
PACKAGE: "ssowat"
script:
- DEBIAN_DEPENDS=$(cat debian/control | tr "," "\n" | grep -Po "ssowat \([>,=,<]+ .*\)" | grep -Po "[0-9\.]+")
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $DEBIAN_DEPENDS $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- *build_script

Expand All @@ -52,7 +48,6 @@ build-moulinette:
variables:
PACKAGE: "moulinette"
script:
- DEBIAN_DEPENDS=$(cat debian/control | tr "," "\n" | grep -Po "moulinette \([>,=,<]+ .*\)" | grep -Po "[0-9\.]+")
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $DEBIAN_DEPENDS $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- *build_script
3 changes: 1 addition & 2 deletions .gitlab/ci/doc.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

generate-helpers-doc:
stage: doc
image: "before-install"
image: "build-and-lint"
needs: []
before_script:
- apt-get update -y && apt-get install git hub -y
- git config --global user.email "yunohost@yunohost.org"
- git config --global user.name "$GITHUB_USER"
script:
Expand Down
4 changes: 1 addition & 3 deletions .gitlab/ci/install.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@

upgrade:
extends: .install-stage
image: "after-install"
image: "core-tests"
script:
- apt-get update -o Acquire::Retries=3
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb


install-postinstall:
extends: .install-stage
image: "before-install"
script:
- apt-get update -o Acquire::Retries=3
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb
- yunohost tools postinstall -d domain.tld -u syssa -F 'Syssa Mine' -p the_password --ignore-dyndns --force-diskspace
6 changes: 3 additions & 3 deletions .gitlab/ci/lint.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

lint39:
stage: lint
image: "before-install"
image: "build-and-lint"
needs: []
allow_failure: true
script:
- tox -e py39-lint

invalidcode39:
stage: lint
image: "before-install"
image: "build-and-lint"
needs: []
script:
- tox -e py39-invalidcode

mypy:
stage: lint
image: "before-install"
image: "build-and-lint"
needs: []
script:
- tox -e py39-mypy
16 changes: 9 additions & 7 deletions .gitlab/ci/test.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
.install_debs: &install_debs
- apt-get update -o Acquire::Retries=3
- DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes apt --assume-yes -o Dpkg::Options::="--force-confold" --allow-downgrades install ${CI_PROJECT_DIR}/*.deb
- pip3 install -U mock pip pytest pytest-cov pytest-mock pytest-sugar requests-mock tox ansi2html black jinja2 "packaging<22"

.test-stage:
stage: test
image: "after-install"
image: "core-tests"
variables:
PYTEST_ADDOPTS: "--color=yes"
before_script:
Expand Down Expand Up @@ -34,6 +32,7 @@ full-tests:
PYTEST_ADDOPTS: "--color=yes"
before_script:
- *install_debs
- pip install mock pip pyOpenSSL pytest pytest-cov pytest-mock pytest-sugar requests-mock "packaging<22"
- yunohost tools postinstall -d domain.tld -u syssa -F 'Syssa Mine' -p the_password --ignore-dyndns --force-diskspace
script:
- python3 -m pytest --cov=yunohost tests/ src/tests/ --junitxml=report.xml
Expand All @@ -57,14 +56,17 @@ test-actionmap:
changes:
- share/actionsmap.yml

test-helpers:
test-helpers2:
extends: .test-stage
script:
- cd tests
- bash test_helpers.sh
# only:
# changes:
# - helpers/*

test-helpers2.1:
extends: .test-stage
script:
- cd tests
- bash test_helpers.sh 2.1

test-domains:
extends: .test-stage
Expand Down
3 changes: 1 addition & 2 deletions .gitlab/ci/translation.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ test-i18n-keys:

autofix-translated-strings:
stage: translation
image: "before-install"
image: "build-and-lint"
needs: []
before_script:
- apt-get update -y && apt-get install git hub -y
- git config --global user.email "yunohost@yunohost.org"
- git config --global user.name "$GITHUB_USER"
- hub clone --branch ${CI_COMMIT_REF_NAME} "https://$GITHUB_TOKEN:x-oauth-basic@github.com/YunoHost/yunohost.git" github_repo
Expand Down
2 changes: 1 addition & 1 deletion bin/yunoprompt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ then
You should now proceed with YunoHost post-installation. This is where you will
be asked for:
- the main domain of your server;
- the administration password.
- the username and password for the first admin
You can perform this step:
- from your web browser, by accessing: https://yunohost.local/ or ${local_ip}
Expand Down
8 changes: 8 additions & 0 deletions conf/postfix/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,11 @@ smtp_sasl_security_options = noanonymous
# where to find sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
{% endif %}

{% if backup_mx_domains != "" %}
# Backup MX (secondary MX)
relay_domains = $mydestination {{backup_mx_domains}}
relay_recipient_maps = hash:/etc/postfix/relay_recipients
maximal_queue_lifetime = 20d
{% endif %}

2 changes: 1 addition & 1 deletion conf/slapd/slapd.default
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SLAPD_PIDFILE=
# sockets.
# Example usage:
# SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///"
SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///"
SLAPD_SERVICES="ldap://localhost:389/ ldaps:/// ldapi:///"

# If SLAPD_NO_START is set, the init script will not start or restart
# slapd (but stop will still work). Uncomment this if you are
Expand Down
4 changes: 2 additions & 2 deletions conf/ssh/sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Subsystem sftp internal-sftp

# Apply following instructions to user with sftp perm only
Match Group sftp.main,!ssh.main
ForceCommand internal-sftp
ForceCommand internal-sftp -u 0002
# We can't restrict to /home/%u because the chroot base must be owned by root
# So we chroot only on /home
# See https://serverfault.com/questions/584986/bad-ownership-or-modes-for-chroot-directory-component
Expand All @@ -97,7 +97,7 @@ Match Group sftp.main,!ssh.main
PermitUserRC no

Match Group sftp.app,!ssh.app
ForceCommand internal-sftp
ForceCommand internal-sftp -u 0002
ChrootDirectory %h
AllowTcpForwarding no
AllowStreamLocalForwarding no
Expand Down
Loading

0 comments on commit 3941471

Please sign in to comment.