From 9f77db48cec2fbee5a0ef70e08ad142b18960251 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:12 -0400 Subject: [PATCH 1/8] ilot/authentik: enable check --- ilot/authentik/APKBUILD | 67 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index 074ec7f..de114c8 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Antoine Martin (ayakael) pkgname=authentik pkgver=2024.8.2 -pkgrel=0 +pkgrel=1 pkgdesc="An open-source Identity Provider focused on flexibility and versatility" url="https://github.com/goauthentik/authentik" # s390x: missing py3-celery py3-flower and py3-kombu @@ -153,14 +153,21 @@ depends=" py3-yarl py3-zope-interface py3-zxcvbn - redis + valkey uvicorn " makedepends="go npm" -# checkdepends scooped up by poetry due to number -checkdepends="poetry py3-coverage" -# tests disabled for now -options="!check" +checkdepends=" + py3-pip + py3-coverage + py3-pytest + py3-pytest-django + py3-pytest-randomly + py3-pytest-timeout + py3-freezegun + py3-boto3 + py3-requests-mock + " install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install" source=" $pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz @@ -204,6 +211,54 @@ build() { npm run build } +check() { + msg "Setting up test environments" + export POSTGRES_DB=authentik + export POSTGRES_USER=authentik + export POSTGRES_PASSWORD="EK-5jnKfjrGRm<77" + export AUTHENTIK_POSTGRESQL__TEST__NAME=authentik + + rm -Rf "$srcdir"/tmp + initdb -D "$srcdir"/tmp + postgres -D "$srcdir"/tmp --unix-socket-directories="$srcdir" > "$srcdir"/tmp/psql.log 2>&1 & + valkey-server > "$srcdir"/tmp/valkey.log 2>&1 & + trap "pkill valkey-server; pkill postgresql" EXIT + sleep 5 + psql -h "$srcdir" -d postgres -c "CREATE ROLE $POSTGRES_USER PASSWORD '$POSTGRES_PASSWORD' INHERIT LOGIN;" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE test_$POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + + # .github/actions/setup/action.yml: Generate config + csrf + python3 -c " +from authentik.lib.generators import generate_id +from yaml import safe_dump + +with open(\"local.env.yml\", \"w\") as _config: + safe_dump( + { + \"log_level\": \"debug\", + \"secret_key\": generate_id(), + \"csrf\": { \"trusted_origins\": ['https://*']}, + }, + _config, + default_flow_style=False, + ) +" + python -m lifecycle.migrate + + # no selenium package + pip install selenium drf_jsonschema_serializer pdoc --break-system-packages + + msg "Starting tests" + make test + + # TODO: Fix go-tests + # make go-test + + pkill valkey-server + pkill postgresql +} + package() { msg "Packaging $pkgname" mkdir -p "$pkgdir"/usr/share/webapps/authentik/web From 2f0d24284f56f36f78363f156fd2ec56e74f0483 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:28 -0400 Subject: [PATCH 2/8] ilot/py3-sentry-sdk: new aport --- ilot/py3-sentry-sdk/APKBUILD | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ilot/py3-sentry-sdk/APKBUILD diff --git a/ilot/py3-sentry-sdk/APKBUILD b/ilot/py3-sentry-sdk/APKBUILD new file mode 100644 index 0000000..3162a03 --- /dev/null +++ b/ilot/py3-sentry-sdk/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: Francesco Colista +# Maintainer: Francesco Colista +pkgname=py3-sentry-sdk +pkgver=2.14.0 +pkgrel=0 +pkgdesc="The new Python SDK for Sentry.io" +url="https://sentry.io/for/python/" +arch="noarch" +license="BSD-2-Clause" +depends=" + py3-certifi + py3-urllib3 + " +makedepends=" + py3-gpep517 + py3-setuptools + py3-wheel + " +checkdepends=" + py3-executing + py3-jsonschema + py3-pytest-asyncio + py3-pytest-forked + py3-pytest-localserver + py3-pytest-xdist + py3-responses + py3-werkzeug + " +subpackages="$pkgname-pyc" +source="$pkgname-$pkgver.tar.gz::https://github.com/getsentry/sentry-python/archive/$pkgver.tar.gz" +builddir="$srcdir"/sentry-python-$pkgver +options="!check" # a bunch of deprecation-warning failures and improper shutdown.. seems to need net + +build() { + gpep517 build-wheel \ + --wheel-dir .dist \ + --output-fd 3 3>&1 >&2 +} + +check() { + python3 -m venv --clear --without-pip --system-site-packages .testenv + .testenv/bin/python3 -m installer .dist/*.whl + # gcp: pip install + # test_socket/test_requests: needs net + # wsgi: weird list errors + .testenv/bin/python3 -m pytest -n auto -p no:warnings \ + --deselect tests/integrations/gcp/test_gcp.py \ + --deselect tests/integrations/socket/test_socket.py \ + --deselect tests/integrations/requests/test_requests.py \ + --deselect tests/integrations/wsgi/test_wsgi.py +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +8667c3496cdbd6b3055f8046abcf3faa8afbda04e0551787222d44c7736deea95722251c266c21730a73afd57d4b7447ec17408672c3217af35103bba6f4b513 py3-sentry-sdk-2.14.0.tar.gz +" From 9b996c21e97432c1471be4c9cd95bf0ce256e331 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:53 -0400 Subject: [PATCH 3/8] forgejo-ci: change hostname to what is in hosts --- .forgejo/workflows/build-aarch64.yaml | 3 ++- .forgejo/workflows/build-x86_64.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build-aarch64.yaml b/.forgejo/workflows/build-aarch64.yaml index 8e19c74..0364014 100644 --- a/.forgejo/workflows/build-aarch64.yaml +++ b/.forgejo/workflows/build-aarch64.yaml @@ -19,7 +19,8 @@ jobs: steps: - name: Environment setup run: | - doas apk add nodejs git patch curl + doas apk add nodejs git patch curl net-tools + doas hostname host.docker.internal cd /etc/apk/keys doas curl -JO https://forge.ilot.io/api/packages/ilot/alpine/key - name: Repo pull diff --git a/.forgejo/workflows/build-x86_64.yaml b/.forgejo/workflows/build-x86_64.yaml index 9a7dac2..c805199 100644 --- a/.forgejo/workflows/build-x86_64.yaml +++ b/.forgejo/workflows/build-x86_64.yaml @@ -19,7 +19,8 @@ jobs: steps: - name: Environment setup run: | - doas apk add nodejs git patch curl + doas apk add nodejs git patch curl net-tools + doas hostname host.docker.internal cd /etc/apk/keys doas curl -JO https://forge.ilot.io/api/packages/ilot/alpine/key - name: Repo pull From 3f3463fcea2f0fd9addb6cef95083854004a9a94 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:59:57 -0400 Subject: [PATCH 4/8] ilot/authentik: clean-up packaging --- ilot/authentik/APKBUILD | 71 +++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index de114c8..e04ed1b 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -261,49 +261,58 @@ with open(\"local.env.yml\", \"w\") as _config: package() { msg "Packaging $pkgname" - mkdir -p "$pkgdir"/usr/share/webapps/authentik/web - mkdir -p "$pkgdir"/usr/share/webapps/authentik/website - mkdir -p "$pkgdir"/var/lib/authentik - mkdir -p "$pkgdir"/usr/share/doc - mkdir -p "$pkgdir"/usr/bin - cp -dr "$builddir"/authentik "$pkgdir"/usr/share/webapps/authentik - cp -dr "$builddir"/web/dist "$pkgdir"/usr/share/webapps/authentik/web/dist - cp -dr "$builddir"/web/authentik "$pkgdir"/usr/share/webapps/authentik/web/authentik - cp -dr "$builddir"/website/build "$pkgdir"/usr/share/doc/authentik - cp -dr "$builddir"/tests "$pkgdir"/usr/share/webapps/authentik/tests - cp -dr "$builddir"/lifecycle "$pkgdir"/usr/share/webapps/authentik/lifecycle - cp -dr "$builddir"/locale "$pkgdir"/usr/share/webapps/authentik/locale - cp -dr "$builddir"/blueprints "$pkgdir"/var/lib/authentik/blueprints - install -Dm755 "$builddir"/manage.py "$pkgdir"/usr/share/webapps/authentik/manage.py - install -Dm755 "$builddir"/server "$pkgdir"/usr/share/webapps/authentik/server - ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml + local prefix="/usr/share/webapps" + local destdir="$pkgdir"$prefix/authentik - install -Dm755 "$builddir"/proxy "$pkgdir"/usr/bin/authentik-proxy - install -Dm755 "$builddir"/ldap "$pkgdir"/usr/bin/authentik-ldap - install -Dm755 "$builddir"/radius "$pkgdir"/usr/bin/authentik-radius + # authentik install + install -d -m755 \ + "$destdir" \ + "$destdir"/web \ + "$pkgdir"/usr/bin \ + "$pkgdir"/usr/share/doc - install -Dm755 "$srcdir"/$pkgname.openrc \ - "$pkgdir"/etc/init.d/$pkgname - install -Dm755 "$srcdir"/$pkgname-worker.openrc \ - "$pkgdir"/etc/init.d/$pkgname-worker - install -Dm755 "$srcdir"/$pkgname-ldap.openrc \ - "$pkgdir"/etc/init.d/$pkgname-ldap - install -Dm640 "$srcdir"/$pkgname-ldap.conf \ - "$pkgdir"/etc/conf.d/$pkgname-ldap + cp -rl authentik lifecycle locale tests blueprints \ + "$destdir"/ + + cp -rl web/dist web/authentik \ + "$destdir"/web/ + + install -m755 -t "$destdir" \ + "$builddir"/server \ + "$builddir"/ldap \ + "$builddir"/radius \ + "$builddir"/proxy \ + "$builddir"/manage.py + + cp -rl website/build/ "$pkgdir"/usr/share/doc/authentik/ + + # symbolic bin links to usr/bin + for i in server proxy ldap radius; do + ln -s $prefix/authentik/$i "$pkgdir"/usr/bin/authentik-$i + done + + # openrc install + for i in $pkgname $pkgname-worker $pkgname-ldap; do + install -Dm755 "$srcdir"/$i.openrc "$pkgdir"/etc/init.d/$i + done + + # config file setup install -Dm640 "$builddir"/authentik/lib/default.yml \ "$pkgdir"/etc/authentik/config.yml + ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml chown root:www-data "$pkgdir"/etc/authentik/config.yml - mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css - ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css - chown root:www-data "$pkgdir"/etc/authentik/custom.css - sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml printf "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml printf "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml + # custom css location change + mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css + ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css + chown root:www-data "$pkgdir"/etc/authentik/custom.css + # Install wrapper script to /usr/bin. install -m755 -D "$srcdir"/authentik-manage.sh "$pkgdir"/usr/bin/authentik-manage } From a5f12565b41f4959029024dc4e813afb44fbbd5c Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:12 -0400 Subject: [PATCH 5/8] ilot/authentik: enable check --- ilot/authentik/APKBUILD | 67 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index 074ec7f..395e72e 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Antoine Martin (ayakael) pkgname=authentik pkgver=2024.8.2 -pkgrel=0 +pkgrel=1 pkgdesc="An open-source Identity Provider focused on flexibility and versatility" url="https://github.com/goauthentik/authentik" # s390x: missing py3-celery py3-flower and py3-kombu @@ -153,14 +153,21 @@ depends=" py3-yarl py3-zope-interface py3-zxcvbn - redis + valkey uvicorn " makedepends="go npm" -# checkdepends scooped up by poetry due to number -checkdepends="poetry py3-coverage" -# tests disabled for now -options="!check" +checkdepends=" + py3-pip + py3-coverage + py3-pytest + py3-pytest-django + py3-pytest-randomly + py3-pytest-timeout + py3-freezegun + py3-boto3 + py3-requests-mock + " install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install" source=" $pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz @@ -204,6 +211,54 @@ build() { npm run build } +check() { + msg "Setting up test environments" + export POSTGRES_DB=authentik + export POSTGRES_USER=authentik + export POSTGRES_PASSWORD="EK-5jnKfjrGRm<77" + export AUTHENTIK_POSTGRESQL__TEST__NAME=authentik + + rm -Rf "$srcdir"/tmp + initdb -D "$srcdir"/tmp + postgres -D "$srcdir"/tmp --unix-socket-directories="$srcdir" > "$srcdir"/tmp/psql.log 2>&1 & + valkey-server > "$srcdir"/tmp/valkey.log 2>&1 & + trap "pkill valkey-server; pkill postgres" EXIT + sleep 5 + psql -h "$srcdir" -d postgres -c "CREATE ROLE $POSTGRES_USER PASSWORD '$POSTGRES_PASSWORD' INHERIT LOGIN;" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE test_$POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + + # .github/actions/setup/action.yml: Generate config + csrf + python3 -c " +from authentik.lib.generators import generate_id +from yaml import safe_dump + +with open(\"local.env.yml\", \"w\") as _config: + safe_dump( + { + \"log_level\": \"debug\", + \"secret_key\": generate_id(), + \"csrf\": { \"trusted_origins\": ['https://*']}, + }, + _config, + default_flow_style=False, + ) +" + python -m lifecycle.migrate + + # no selenium package + pip install selenium drf_jsonschema_serializer pdoc --break-system-packages + + msg "Starting tests" + make test + + # TODO: Fix go-tests + # make go-test + + pkill valkey-server + pkill postgres +} + package() { msg "Packaging $pkgname" mkdir -p "$pkgdir"/usr/share/webapps/authentik/web From 69891fb74fe20d3f930096995b1d5fa9199ebc0f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:28 -0400 Subject: [PATCH 6/8] ilot/py3-sentry-sdk: new aport --- ilot/py3-sentry-sdk/APKBUILD | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ilot/py3-sentry-sdk/APKBUILD diff --git a/ilot/py3-sentry-sdk/APKBUILD b/ilot/py3-sentry-sdk/APKBUILD new file mode 100644 index 0000000..3162a03 --- /dev/null +++ b/ilot/py3-sentry-sdk/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: Francesco Colista +# Maintainer: Francesco Colista +pkgname=py3-sentry-sdk +pkgver=2.14.0 +pkgrel=0 +pkgdesc="The new Python SDK for Sentry.io" +url="https://sentry.io/for/python/" +arch="noarch" +license="BSD-2-Clause" +depends=" + py3-certifi + py3-urllib3 + " +makedepends=" + py3-gpep517 + py3-setuptools + py3-wheel + " +checkdepends=" + py3-executing + py3-jsonschema + py3-pytest-asyncio + py3-pytest-forked + py3-pytest-localserver + py3-pytest-xdist + py3-responses + py3-werkzeug + " +subpackages="$pkgname-pyc" +source="$pkgname-$pkgver.tar.gz::https://github.com/getsentry/sentry-python/archive/$pkgver.tar.gz" +builddir="$srcdir"/sentry-python-$pkgver +options="!check" # a bunch of deprecation-warning failures and improper shutdown.. seems to need net + +build() { + gpep517 build-wheel \ + --wheel-dir .dist \ + --output-fd 3 3>&1 >&2 +} + +check() { + python3 -m venv --clear --without-pip --system-site-packages .testenv + .testenv/bin/python3 -m installer .dist/*.whl + # gcp: pip install + # test_socket/test_requests: needs net + # wsgi: weird list errors + .testenv/bin/python3 -m pytest -n auto -p no:warnings \ + --deselect tests/integrations/gcp/test_gcp.py \ + --deselect tests/integrations/socket/test_socket.py \ + --deselect tests/integrations/requests/test_requests.py \ + --deselect tests/integrations/wsgi/test_wsgi.py +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +8667c3496cdbd6b3055f8046abcf3faa8afbda04e0551787222d44c7736deea95722251c266c21730a73afd57d4b7447ec17408672c3217af35103bba6f4b513 py3-sentry-sdk-2.14.0.tar.gz +" From 7566c53ff78a19e498aabe934a72113e54c8ee63 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:35:53 -0400 Subject: [PATCH 7/8] forgejo-ci: change hostname to what is in hosts --- .forgejo/workflows/build-aarch64.yaml | 3 ++- .forgejo/workflows/build-x86_64.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build-aarch64.yaml b/.forgejo/workflows/build-aarch64.yaml index 8e19c74..0364014 100644 --- a/.forgejo/workflows/build-aarch64.yaml +++ b/.forgejo/workflows/build-aarch64.yaml @@ -19,7 +19,8 @@ jobs: steps: - name: Environment setup run: | - doas apk add nodejs git patch curl + doas apk add nodejs git patch curl net-tools + doas hostname host.docker.internal cd /etc/apk/keys doas curl -JO https://forge.ilot.io/api/packages/ilot/alpine/key - name: Repo pull diff --git a/.forgejo/workflows/build-x86_64.yaml b/.forgejo/workflows/build-x86_64.yaml index 9a7dac2..c805199 100644 --- a/.forgejo/workflows/build-x86_64.yaml +++ b/.forgejo/workflows/build-x86_64.yaml @@ -19,7 +19,8 @@ jobs: steps: - name: Environment setup run: | - doas apk add nodejs git patch curl + doas apk add nodejs git patch curl net-tools + doas hostname host.docker.internal cd /etc/apk/keys doas curl -JO https://forge.ilot.io/api/packages/ilot/alpine/key - name: Repo pull From 093443e71b414706e019d3566400f792bc918a9b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 20 Sep 2024 20:59:57 -0400 Subject: [PATCH 8/8] ilot/authentik: clean-up packaging --- ilot/authentik/APKBUILD | 71 +++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index 395e72e..871bbe8 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -261,49 +261,58 @@ with open(\"local.env.yml\", \"w\") as _config: package() { msg "Packaging $pkgname" - mkdir -p "$pkgdir"/usr/share/webapps/authentik/web - mkdir -p "$pkgdir"/usr/share/webapps/authentik/website - mkdir -p "$pkgdir"/var/lib/authentik - mkdir -p "$pkgdir"/usr/share/doc - mkdir -p "$pkgdir"/usr/bin - cp -dr "$builddir"/authentik "$pkgdir"/usr/share/webapps/authentik - cp -dr "$builddir"/web/dist "$pkgdir"/usr/share/webapps/authentik/web/dist - cp -dr "$builddir"/web/authentik "$pkgdir"/usr/share/webapps/authentik/web/authentik - cp -dr "$builddir"/website/build "$pkgdir"/usr/share/doc/authentik - cp -dr "$builddir"/tests "$pkgdir"/usr/share/webapps/authentik/tests - cp -dr "$builddir"/lifecycle "$pkgdir"/usr/share/webapps/authentik/lifecycle - cp -dr "$builddir"/locale "$pkgdir"/usr/share/webapps/authentik/locale - cp -dr "$builddir"/blueprints "$pkgdir"/var/lib/authentik/blueprints - install -Dm755 "$builddir"/manage.py "$pkgdir"/usr/share/webapps/authentik/manage.py - install -Dm755 "$builddir"/server "$pkgdir"/usr/share/webapps/authentik/server - ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml + local prefix="/usr/share/webapps" + local destdir="$pkgdir"$prefix/authentik - install -Dm755 "$builddir"/proxy "$pkgdir"/usr/bin/authentik-proxy - install -Dm755 "$builddir"/ldap "$pkgdir"/usr/bin/authentik-ldap - install -Dm755 "$builddir"/radius "$pkgdir"/usr/bin/authentik-radius + # authentik install + install -d -m755 \ + "$destdir" \ + "$destdir"/web \ + "$pkgdir"/usr/bin \ + "$pkgdir"/usr/share/doc - install -Dm755 "$srcdir"/$pkgname.openrc \ - "$pkgdir"/etc/init.d/$pkgname - install -Dm755 "$srcdir"/$pkgname-worker.openrc \ - "$pkgdir"/etc/init.d/$pkgname-worker - install -Dm755 "$srcdir"/$pkgname-ldap.openrc \ - "$pkgdir"/etc/init.d/$pkgname-ldap - install -Dm640 "$srcdir"/$pkgname-ldap.conf \ - "$pkgdir"/etc/conf.d/$pkgname-ldap + cp -rl authentik lifecycle locale tests blueprints \ + "$destdir"/ + + cp -rl web/dist web/authentik \ + "$destdir"/web/ + + install -m755 -t "$destdir" \ + "$builddir"/server \ + "$builddir"/ldap \ + "$builddir"/radius \ + "$builddir"/proxy \ + "$builddir"/manage.py + + cp -rl website/build/ "$pkgdir"/usr/share/doc/authentik/ + + # symbolic bin links to usr/bin + for i in server proxy ldap radius; do + ln -s $prefix/authentik/$i "$pkgdir"/usr/bin/authentik-$i + done + + # openrc install + for i in $pkgname $pkgname-worker $pkgname-ldap; do + install -Dm755 "$srcdir"/$i.openrc "$pkgdir"/etc/init.d/$i + done + + # config file setup install -Dm640 "$builddir"/authentik/lib/default.yml \ "$pkgdir"/etc/authentik/config.yml + ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml chown root:www-data "$pkgdir"/etc/authentik/config.yml - mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css - ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css - chown root:www-data "$pkgdir"/etc/authentik/custom.css - sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml printf "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml printf "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml + # custom css location change + mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css + ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css + chown root:www-data "$pkgdir"/etc/authentik/custom.css + # Install wrapper script to /usr/bin. install -m755 -D "$srcdir"/authentik-manage.sh "$pkgdir"/usr/bin/authentik-manage }