Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Aug 20, 2023
1 parent 6fe235c commit 9609e0c
Show file tree
Hide file tree
Showing 44 changed files with 634 additions and 525 deletions.
26 changes: 23 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,29 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
block_comment_start = /*
block_comment = *
block_comment_end = */
eclint_block_comment_start = /*
eclint_block_comment = *
eclint_block_comment_end = */

[*.md]
trim_trailing_whitespace = false
max_line_length = 300

[*.xml]
max_line_length = 300

[*.patch]
indent_size = unset
trim_trailing_whitespace = false

[.gitconfig]
indent_style = tab

[.gitmodules]
indent_style = tab

[mail/extract-attachments/save_all_attachments.py]
indent_style = tab

[webserver/wp-install/wordpress-autoloader.php]
indent_style = tab
22 changes: 7 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,17 @@ concurrency:
cancel-in-progress: true

jobs:
markdown_link:
name: "Markdown link"
links:
name: "Links"
runs-on: "ubuntu-22.04"
timeout-minutes: 10
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
uses: "actions/checkout@v3.5.3"
-
name: "Cache NPM"
uses: "actions/cache@v3"
name: "Run Lychee"
uses: "lycheeverse/lychee-action@v1.8.0"
with:
path: "~/.npm"
key: "${{ runner.os }}-npm-markdown-link-check"
-
name: "Install markdown-link-check"
run: "npm install --global markdown-link-check"
-
name: "Check Markdown links"
run: |
git ls-files -z -- '*\.md' \
| xargs -0 -- npm exec -- markdown-link-check -p -c markdown-link-check.json
output: "${{ runner.temp }}/lychee/out.md"
fail: true
149 changes: 75 additions & 74 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,60 @@
# https://github.com/travis-ci/travis-build/tree/master/lib/travis/build/bash

_shared_script_check_author: &script_check_author |
Check_author()
{
local author="$1"
local github_api_url="https://api.github.com/search/users"
echo "Checking ${author} ..."
test "${author%@users.noreply.github.com}" == "${author}" || return 0
curl -s -G --data-urlencode "q=type:user in:email ${author}" "${github_api_url}" \
| grep -F -x ' "total_count": 1,'
}
test -z "${TRAVIS_COMMIT_RANGE}" \
|| git show --no-patch --pretty="format:%ae" "${TRAVIS_COMMIT_RANGE}" \
| sort -u \
| while read -r author; do Check_author "${author}"; done
Check_author()
{
local author="$1"
local github_api_url="https://api.github.com/search/users"
echo "Checking ${author} ..."
test "${author%@users.noreply.github.com}" == "${author}" || return 0
curl -s -G --data-urlencode "q=type:user in:email ${author}" "${github_api_url}" \
| grep -F -x ' "total_count": 1,'
}
test -z "${TRAVIS_COMMIT_RANGE}" \
|| git show --no-patch --pretty="format:%ae" "${TRAVIS_COMMIT_RANGE}" \
| sort -u \
| while read -r author; do Check_author "${author}"; done

_shared_script_check_executable: &script_check_executable |
# Scripts should be executable, all other files should not be executable
test -z "$(find bin/ -type f -name "*.sh" -not -executable)"
test -z "$(find . -type f -not -path "./.git/*" -not -path "./bin/*.sh" -executable)"
# Scripts should be executable, all other files should not be executable
test -z "$(find bin/ -type f -name "*.sh" -not -executable)"
test -z "$(find . -type f -not -path "./.git/*" -not -path "./bin/*.sh" -executable)"

_shared_script_verify_exported_files: &script_verify_exported_files |
EXPECTED_FILES="CONTRIBUTING.md,LICENSE,README.md,composer.json,phpcs.xml.dist,phpstan.neon.dist,phpunit.xml.dist"
mkdir -p tests/ourselves
echo '{"repositories":[{"type":"path","url":"../../../","options":{"symlink":false}}],"minimum-stability":"dev"}' >tests/ourselves/composer.json
composer require --working-dir=tests/ourselves 'vendor/name:*'
CURRENT_FILES="$(find tests/ourselves/vendor/vendor/name/ -type f -not -path 'tests/ourselves/vendor/vendor/name/src/*' -printf '%f\0'|LC_ALL=C sort -z|paste -s -z -d ','|tr -d '\000')"
echo "$EXPECTED_FILES"
echo "$CURRENT_FILES"
test "$EXPECTED_FILES" == "$CURRENT_FILES"
EXPECTED_FILES="CONTRIBUTING.md,LICENSE,README.md,composer.json,phpcs.xml.dist,phpstan.neon.dist,phpunit.xml.dist"
mkdir -p tests/ourselves
echo '{"repositories":[{"type":"path","url":"../../../","options":{"symlink":false}}],"minimum-stability":"dev"}' >tests/ourselves/composer.json
composer require --working-dir=tests/ourselves 'vendor/name:*'
CURRENT_FILES="$(find tests/ourselves/vendor/vendor/name/ -type f -not -path 'tests/ourselves/vendor/vendor/name/src/*' -printf '%f\0'|LC_ALL=C sort -z|paste -s -z -d ','|tr -d '\000')"
echo "$EXPECTED_FILES"
echo "$CURRENT_FILES"
test "$EXPECTED_FILES" == "$CURRENT_FILES"

_shared_script_install_phive: &script_install_phive |
# Install PHIVE (cached)
if [ ! -r "${HOME}/.phive/phive.phar" ]; then
mkdir -p "${HOME}/bin" "${HOME}/.phive"
if [ "$(phpenv version-name)" == 7.1 ]; then
# PHIVE v0.13.3 last version supporting PHP 7.1
travis_retry wget -O "${HOME}/.phive/phive.phar" \
"https://github.com/phar-io/phive/releases/download/0.13.3/phive-0.13.3.phar"
travis_retry wget -O "${HOME}/.phive/phive.phar.asc" \
"https://github.com/phar-io/phive/releases/download/0.13.3/phive-0.13.3.phar.asc"
else
travis_retry wget -O "${HOME}/.phive/phive.phar" "https://phar.io/releases/phive.phar"
travis_retry wget -O "${HOME}/.phive/phive.phar.asc" "https://phar.io/releases/phive.phar.asc"
# Install PHIVE (cached)
if [ ! -r "${HOME}/.phive/phive.phar" ]; then
mkdir -p "${HOME}/bin" "${HOME}/.phive"
if [ "$(phpenv version-name)" == 7.1 ]; then
# PHIVE v0.13.3 last version supporting PHP 7.1
travis_retry wget -O "${HOME}/.phive/phive.phar" \
"https://github.com/phar-io/phive/releases/download/0.13.3/phive-0.13.3.phar"
travis_retry wget -O "${HOME}/.phive/phive.phar.asc" \
"https://github.com/phar-io/phive/releases/download/0.13.3/phive-0.13.3.phar.asc"
else
travis_retry wget -O "${HOME}/.phive/phive.phar" "https://phar.io/releases/phive.phar"
travis_retry wget -O "${HOME}/.phive/phive.phar.asc" "https://phar.io/releases/phive.phar.asc"
fi
travis_retry gpg --batch --keyserver keys.openpgp.org --keyserver-options timeout=30 \
--recv-keys 0x9D8A98B29B2D5D79
if ! gpg --batch --verify "${HOME}/.phive/phive.phar.asc" "${HOME}/.phive/phive.phar"; then
echo "Invalid phive signature" 1>&2
rm -f "${HOME}/.phive/phive.phar"
exit 11
fi
rm "${HOME}/.phive/phive.phar.asc"
fi
travis_retry gpg --batch --keyserver keys.openpgp.org --keyserver-options timeout=30 \
--recv-keys 0x9D8A98B29B2D5D79
if ! gpg --batch --verify "${HOME}/.phive/phive.phar.asc" "${HOME}/.phive/phive.phar"; then
echo "Invalid phive signature" 1>&2
rm -f "${HOME}/.phive/phive.phar"
exit 11
fi
rm "${HOME}/.phive/phive.phar.asc"
fi
install --verbose --mode=0755 --no-target-directory -D "${HOME}/.phive/phive.phar" "${HOME}/bin/phive"
export PATH="${HOME}/bin:${PATH}"
install --verbose --mode=0755 --no-target-directory -D "${HOME}/.phive/phive.phar" "${HOME}/bin/phive"
export PATH="${HOME}/bin:${PATH}"

# On CI-s without "travis_retry"
# gpg --batch --keyserver keys.openpgp.org --keyserver-options timeout=30 --recv-keys 0x9D8A98B29B2D5D79 \
Expand All @@ -70,7 +70,7 @@ if: "branch = master"

language: "php"
os:
- "linux"
- "linux"
# 12.04 Precise: 5.2 - 7.3
# 14.04 Trusty: 5.4 - 7.4
# 16.04 Xenial: 5.6 - 8.1
Expand All @@ -80,40 +80,41 @@ os:
dist: "bionic"

stages:
- "commits"
- "test"
- "commits"
- "test"

env:
global:
global:
- APP_ENV: "testing"

jobs:
include:
- stage: "commits"
name: "Check committers have a GitHub account"
before_install: "skip"
install: "skip"
before_script: "skip"
script: *script_check_author
after_script: "skip"

- stage: "commits"
name: "Check file permissions"
before_install: "skip"
install: "skip"
before_script: "skip"
script: *script_check_executable
after_script: "skip"
include:
-
stage: "commits"
name: "Check committers have a GitHub account"
before_install: "skip"
install: "skip"
before_script: "skip"
script: *script_check_author
after_script: "skip"
-
stage: "commits"
name: "Check file permissions"
before_install: "skip"
install: "skip"
before_script: "skip"
script: *script_check_executable
after_script: "skip"

cache:
directories:
directories:
- "${HOME}/.phive"
- "${HOME}/.composer/cache"

before_install:
- "phpenv config-rm xdebug.ini"
- *script_install_phive
- "travis_retry phive install --force-accept-unsigned --trust-gpg-keys TRUSTED-KEY1,TRUSTED-KEY2"
# Use Composer v1
- "composer self-update --1"
- "composer validate --strict"
- "phpenv config-rm xdebug.ini"
- *script_install_phive
- "travis_retry phive install --force-accept-unsigned --trust-gpg-keys TRUSTED-KEY1,TRUSTED-KEY2"
# Use Composer v1
- "composer self-update --1"
- "composer validate --strict"
4 changes: 0 additions & 4 deletions Onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ Verify your URL
- My email address: `webmaster@`
- Teamwork in one Gmail inbox: [Drag](https://www.dragapp.com/)

<!--
- Email 2.0 for work: [Consider](https://consider.co/) (Gmail only)
-->

### Infrastructure setup

- Document in hosting.yml and server.yml (Skype, `Ugyfelek.yml`, KeePass)
Expand Down
2 changes: 1 addition & 1 deletion backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ openstack --os-cloud ${CLOUD_NAME} object list ${CONTAINER_NAME}
- https://www.exoscale.ch/object-storage/
- https://www.profitbricks.de/
- https://auro.io/public_cloud_hosting/product
- https://www.pcextreme.com/aurora/objects
- `https://www.pcextreme.com/aurora/objects`
- https://zetta.io/en/products/object-storage/
- https://www.e24cloud.com/en/cloud-features/files-in-the-cloud/
- https://dunkel.de/s3
Expand Down
4 changes: 2 additions & 2 deletions debian-setup/debian-convert-ext3-ext4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cat > /etc/initramfs-tools/hooks/tune2fs <<"EOF"
PREREQ=""
prereqs() {
echo "$PREREQ"
echo "$PREREQ"
}
case "$1" in
Expand All @@ -43,7 +43,7 @@ cat > /etc/initramfs-tools/scripts/init-premount/ext4 <<"EOF"
PREREQ=""
prereqs() {
echo "$PREREQ"
echo "$PREREQ"
}
case "$1" in
Expand Down
27 changes: 18 additions & 9 deletions debian-setup/debian-image-normalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Info "Mark dependencies of standard packages as automatic"

set +x
for DEP in $(${APTI_SEARCH} \
'?and(?installed, ?not(?automatic), ?not(?essential), ?not(?priority(required)), ?not(?priority(important)), ?not(?priority(standard)))'); do
'?and(?installed, ?not(?automatic), ?not(?essential), ?not(?priority(required)), ?not(?priority(important)), ?not(?priority(standard)))')
do
REGEXP="$(sed -e 's#\([^a-z0-9]\)#[\1]#g' <<<"$DEP")"
if aptitude why "$DEP" 2>&1 | grep -q -E "^i.. \\S+\\s+(Pre)?Depends( | .* )${REGEXP}( |\$)"; then
apt-mark auto "$DEP" || echo "[ERROR] Marking package ${DEP} failed." 1>&2
Expand All @@ -102,26 +103,34 @@ set -x

Info "Install standard packages"

STANDARD_PACKAGES="$(${APTI_SEARCH} \
'?and(?archive(stable), ?or(?essential, ?priority(required), ?priority(important), ?priority(standard)), ?architecture(native))' \
| grep -Evx "$STANDARD_BLACKLIST")"
STANDARD_PACKAGES="$(
${APTI_SEARCH} \
'?and(?archive(stable), ?or(?essential, ?priority(required), ?priority(important), ?priority(standard)), ?architecture(native))' \
| grep -Evx "$STANDARD_BLACKLIST"
)"
# shellcheck disable=SC2086
apt-get -qq install ${STANDARD_PACKAGES}

Info "Install missing recommended packages"

MISSING_RECOMMENDS="$(${APTI_SEARCH} \
'?and(?reverse-recommends(?installed), ?version(TARGET), ?not(?installed), ?architecture(native))' | grep -Evx "$STANDARD_BLACKLIST" || true)"
MISSING_RECOMMENDS="$(
${APTI_SEARCH} \
'?and(?reverse-recommends(?installed), ?version(TARGET), ?not(?installed), ?architecture(native))' \
| grep -Evx "$STANDARD_BLACKLIST" || true
)"
# shellcheck disable=SC2086
apt-get -qq install ${MISSING_RECOMMENDS}
echo "$MISSING_RECOMMENDS" | xargs -r -L 1 apt-mark auto

Info "Remove non-standard packages"

# See override.${CODENAME}.main.gz at http://ftp.debian.org/debian/indices/
MANUALLY_INSTALLED="$(${APTI_SEARCH} \
'?and(?installed, ?not(?automatic), ?not(?essential), ?not(?priority(required)), ?not(?priority(important)), ?not(?priority(standard)))' \
| grep -Evx "$BOOT_PACKAGES" | tee removed.pkgs || true)"
MANUALLY_INSTALLED="$(
${APTI_SEARCH} \
'?and(?installed, ?not(?automatic), ?not(?essential), ?not(?priority(required)), ?not(?priority(important)), ?not(?priority(standard)))' \
| grep -Evx "$BOOT_PACKAGES" \
| tee removed.pkgs || true
)"
# shellcheck disable=SC2086
apt-get purge -qq ${MANUALLY_INSTALLED}

Expand Down
4 changes: 2 additions & 2 deletions debian-setup/debian-setup-baremetal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ grep "^ARRAY" /etc/mdadm/mdadm.conf|cut -d' ' -f2

cat <<EOF > /etc/monit/monitrc.d/mdadm-fs
check filesystem dev_md0 with path /dev/md/0
group mdadm
if space usage > 80% for 5 times within 15 cycles then alert
group mdadm
if space usage > 80% for 5 times within 15 cycles then alert
EOF

apt-get install -y ipmitool
Expand Down
2 changes: 1 addition & 1 deletion debian-setup/packages/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# ? time synchronization to hypervisor, no ntpd (tsc_mode=2)
# http://xenbits.xen.org/docs/4.3-testing/misc/tscmode.txt
# ? Will there be PV guests?
#
#
# ? local services: DNS resolver, email forwarding for monitoring, NTP=179.43.191.2
# ? default PTR: IPhex.client.privatelayer.com
# ? docs on gateway IP
Expand Down
6 changes: 3 additions & 3 deletions debian-setup/packages/adduser
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ cat >/root/.profile <<"EOF"
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n
Expand Down
10 changes: 5 additions & 5 deletions debian-setup/providers/atw-bix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ virtualization: kvm
networking:
method: static
name: eth0
ipv4:
ipv4: ?
netmask: 255.255.255.0
gateway:
gateway: ?
resolver:
- 88.151.96.15
# With DNSSEC
- 88.151.96.16
inet6:
method: static
name: eth0
ipv6:
netmask:
gateway:
ipv6: ?
netmask: ?
gateway: ?
resolver:
- 2a01:270::15
# With DNSSEC
Expand Down
Loading

0 comments on commit 9609e0c

Please sign in to comment.