Compare commits

...

10 commits

33 changed files with 4992 additions and 0 deletions

196
ilot/loomio/APKBUILD Normal file
View file

@ -0,0 +1,196 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=loomio
pkgver=2.21.4
_gittag=v$pkgver
pkgrel=0
pkgdesc="A collaborative decision making tool"
url="https://github.com/loomio/loomio"
arch="x86_64"
license="MIT"
depends="
postgresql
postgresql-contrib
python3
redis
ruby3.2
ruby3.2-bundler
ruby3.2-grpc
vips
npm
procps-ng
"
makedepends="
cmd:chrpath
ruby3.2-dev
nodejs
openssl-dev
readline-dev
zlib-dev
libpq-dev
libffi-dev
imagemagick-dev
"
pkgusers="loomio"
pkggroups="loomio www-data"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-openrc"
source="
$pkgname-$pkgver.tar.gz::https://github.com/loomio/loomio/archive/refs/tags/v$pkgver.tar.gz
bin-wrapper.in
loomio.confd
loomio.logrotate
loomio.sidekiq.initd
loomio.vue.initd
loomio.initd
"
_prefix="usr/lib/webapps/loomio"
export BUNDLE_DEPLOYMENT=true
export BUNDLE_FORCE_RUBY_PLATFORM=true
export BUNDLE_FROZEN=true
export BUNDLE_JOBS=${JOBS:-2}
prepare() {
local sysgemdir=$(ruby -e 'puts Gem.default_dir')
default_prepare
# Allow use of any bundler
sed -i -e '/BUNDLED/,+1d' Gemfile.lock
# Allow use of any platform
sed -i -e 's/PLATFORMS/PLATFORMS\n ruby/' Gemfile.lock
# Some gems are broken, so we copy our fixed version
# instead of installing it from RubyGems using Bundler.
mkdir -p vendor/gems/grpc/src/ruby/lib/grpc
cp -r "$sysgemdir"/gems/grpc-*/* vendor/gems/grpc/
cp "$sysgemdir"/specifications/grpc-*.gemspec \
vendor/gems/grpc/grpc.gemspec
cp "$sysgemdir"/extensions/*/*/grpc-*/grpc/*.so \
vendor/gems/grpc/src/ruby/lib/grpc/
}
build() {
local bundle_without='exclude development test'
bundle config --local build.ffi --enable-system-libffi
bundle config --local build.vips --enable-system-libraries
bundle config --local build.nokogiri --use-system-libraries \
--with-xml2-include=/usr/include/libxml2 \
--with-xslt-include=/usr/include/libxslt
bundle config --local build.google-protobuf '-- --with-cflags=-D__va_copy=va_copy'
msg "Installing Ruby gems..."
bundle config --local without "$bundle_without"
bundle config --local path "vendor/bundle"
bundle install --no-cache
msg "Precompiling static assets..."
bundle exec bootsnap precompile --gemfile app/ lib/
# Create executables in bin/*.
# See also https://github.com/bundler/bundler/issues/6149.
bundle binstubs --force bundler puma sidekiq
# Remove faulty RPATH.
chrpath -d vendor/bundle/ruby/*/gems/*/lib/nokogiri/*/nokogiri.so
# cp grpc so
cp vendor/gems/grpc/src/ruby/lib/grpc/grpc_c.so vendor/bundle/ruby/*/gems/grpc*/src/ruby/lib/grpc/.
rm -R vendor/bundle/ruby/*/gems/grpc*/src/ruby/lib/grpc/3* vendor/bundle/ruby/*/gems/grpc*/src/ruby/lib/grpc/2*
msg "Installing npm modules..."
cd vue
# force as vite-plugin-yaml hasn't updated their peerDependencies list yet
npm ci --force
npm run build
}
package() {
local destdir="$pkgdir/$_prefix"
local datadir="$pkgdir/var/lib/loomio"
local file dest
# Make directories
install -dm 755 \
"$(dirname $destdir)" \
"$datadir"
mkdir -p "$(dirname $destdir)"
cp -R "$builddir" "$destdir"
cd "$destdir"/vendor/bundle/ruby/*/
# Remove tests, documentations and other useless files.
find gems/ \( -name 'doc' \
-o -name 'spec' \
-o -name 'test' \) \
-type d -maxdepth 2 -exec rm -fr "{}" +
find gems/ \( -name 'README*' \
-o -name 'CHANGELOG*' \
-o -name 'CONTRIBUT*' \
-o -name '*LICENSE*' \
-o -name 'Rakefile' \
-o -name '.*' \) \
-type f -delete
# Remove build logs and cache.
rm -rf build_info/ cache/
find extensions/ \( -name gem_make.out -o -name mkmf.log \) -delete
cd "$destdir"
# Install and symlink config files.
for file in database.yml.postgresql puma.rb sidekiq.yml; do
dest="$(basename "${file/.postgresql/}")"
install -m640 -g loomio -D config/$file "$pkgdir"/etc/loomio/$dest
ln -sf /etc/loomio/$dest "$pkgdir"/$_prefix/config/${file/.postgrewsql/}
done
# This file will be generated by the post-install script, just prepare symlink.
ln -sf /etc/loomio/secrets.yml config/secrets.yml
# These shouldn't be necessary, they are all configurable, but OmniBus
cat > "$datadir"/.profile <<-EOF
export RAILS_ENV=production
export NODE_ENV=production
export EXECJS_RUNTIME=Disabled
EOF
# Install wrapper scripts to /usr/bin.
local name; for name in rake rails; do
sed "s/__COMMAND__/$name/g" "$srcdir"/bin-wrapper.in \
> "$builddir"/loomio-$name
install -m755 -D "$builddir"/loomio-$name "$pkgdir"/usr/bin/loomio-$name
done
for file in $pkgname $pkgname.sidekiq $pkgname.vue; do
install -m755 -D "$srcdir"/$file.initd "$pkgdir"/etc/init.d/$file
done
install -m644 -D "$srcdir"/loomio.confd \
"$pkgdir"/etc/conf.d/loomio
install -m644 -D "$srcdir"/loomio.logrotate \
"$pkgdir"/etc/logrotate.d/loomio
}
assets() {
depends=""
amove $_prefix/public/assets
}
sha512sums="
72a1238c1eaa3b963bd20a09d4fc2e52798264779bdf06d3f32891f2880d246059c77381329d1274bfa5979a35740017f0ced324f88b205369e77335b403ffba loomio-2.21.4.tar.gz
6cd4bb030660a9f4697eeb7c6de3f7509558aab3651e68218583dfeea56634f3b9f58acb50c7c9a4188a38c19434a815dd6c347e30207c4c0ae028c8dcb6ccaf bin-wrapper.in
0f1c91fbd4b8099f0a115705d5af799e4492fa2a0fd54175f3bfbfb5be1122bd7fd73a7709695c7caf2dcc667f3b8715051c24f424472e1115753e43a38fdf50 loomio.confd
1ecb0717cd5f04b894467b21d226b98d8f83b8f62afbf8da7edd57973aeabb13d121e9061cc48aec7572b1c710e82c8b44a1cedc0a924efd4bc4a124b3afe9a8 loomio.logrotate
c5dae2b6f9a23853c3c7ac068d97a7b0269b1775f6e0169c3d8999ec67c2baf3545515ea21037e882d900b15a7abf9061dd5a584bdc82c347b54d8c134f6d7a4 loomio.sidekiq.initd
f774954d8b06aacab27af9593b1b12fbe18ec2d0593dd4f82e4d3dfbc7e325fb1a423347fd974a2ec6665776a6cfe85f255f4fd7493c97eb840f34eb7fbdb329 loomio.vue.initd
645637c4112ec91ec2ea6022713e77a8ee76c0f0a81f9adf1f9210b52a578e94b5b02f0b6244b173905f580f72dc362b5434c714aae11e3619f73af223891bb8 loomio.initd
"

View file

@ -0,0 +1,15 @@
#!/bin/sh
BUNDLE_DIR='/usr/lib/webapps/loomio'
export RAILS_ENV='production'
export NODE_ENV='production'
export EXECJS_RUNTIME='Disabled'
cd $BUNDLE_DIR
install -m 700 -o loomio -g loomio -d "$(readlink ./tmp)"
if [ "$(id -un)" != 'loomio' ]; then
exec su loomio -c '"$0" "$@"' -- bin/__COMMAND__ "$@"
else
exec bin/__COMMAND__ "$@"
fi

32
ilot/loomio/loomio.confd Normal file
View file

@ -0,0 +1,32 @@
# Configuration file for /etc/init.d/loomio and
# /etc/init.d/loomio.{vue,sidekiq}
# Specify how many processes to create using sidekiq-cluster and which queue
# they should handle. Each whitespace-separated item equates to one additional
# Sidekiq process, and comma-separated values in each item determine the queues
# it works on. The special queue name "*" means all queues.
# Example: "* gitlab_shell process_commit,post_receive"
# See https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html.
#sidekiq_queue_groups="*"
# Maximum threads to use with Sidekiq (default: 50, 0 to disable).
#sidekiq_max_concurrency=
# Minimum threads to use with Sidekiq (default: 0).
#sidekiq_min_concurrency=
# The number of seconds to wait between worker checks.
#sidekiq_interval=
# Graceful timeout for all running processes.
#sidekiq_shutdown_timeout=
# Run workers for all queues in sidekiq_queues.yml except the given ones.
#sidekiq_negate=no
# Run workers based on the provided selector.
#sidekiq_queue_selector=no
# Memory limit (in MiB) for the Sidekiq process. If the RSS (Resident Set Size)
# of the Sidekiq process exceeds this limit, a delayed shutdown is triggered.
#sidekiq_memkiller_max_rss=2000

39
ilot/loomio/loomio.initd Normal file
View file

@ -0,0 +1,39 @@
#!/sbin/openrc-run
name="Loomio"
description="Meta script for starting/stopping all the Loomio components"
subservices="loomio.sidekiq loomio.vue"
depend() {
use net
}
start() {
local ret=0
ebegin "Starting all Loomio components"
local svc; for svc in $subservices; do
service $svc start || ret=1
done
eend $ret
}
stop() {
local ret=0
ebegin "Stopping all Loomio components"
local svc; for svc in $subservices; do
service $svc stop || ret=1
done
eend $ret
}
status() {
local ret=0
local svc; for svc in $subservices; do
echo "$svc:"
service $svc status || ret=1
done
eend $ret
}

View file

@ -0,0 +1,11 @@
/var/log/loomio/*.log {
compress
copytruncate
delaycompress
maxsize 10M
minsize 1M
missingok
sharedscripts
rotate 10
weekly
}

32
ilot/loomio/loomio.post-install Executable file
View file

@ -0,0 +1,32 @@
#!/bin/sh
set -eu
group=loomio
config_file='/etc/loomio/config.yml'
#if [ $(grep '@@SECRET_KEY@@' "$config_file") ]; then
# echo "* Generating random secret in $config_file" >&2
# secret_key="$(pwgen -s 50 1)"
# sed -i "s|@@SECRET_KEY@@|$secret_key|" "$config_file"
#fi
if [ "${0##*.}" = 'post-upgrade' ]; then
cat >&2 <<-EOF
*
* To finish Loomio upgrade run:
*
*
EOF
else
cat >&2 <<-EOF
*
* 1. Adjust settings in /etc/loomio/config.yml.
*
* 2. Create database for loomio:
*
* psql -c "CREATE ROLE loomio PASSWORD 'top-secret' INHERIT LOGIN;"
* psql -c "CREATE DATABASE loomio OWNER loomio ENCODING 'UTF-8';"
*
EOF
fi

View file

@ -0,0 +1 @@
loomio.post-install

View file

@ -0,0 +1,26 @@
#!/bin/sh
# It's very important to set user/group correctly.
loomio_dir='/var/lib/loomio'
if ! getent group loomio 1>/dev/null; then
echo '* Creating group loomio' 1>&2
addgroup -S loomio
fi
if ! id loomio 2>/dev/null 1>&2; then
echo '* Creating user loomio' 1>&2
adduser -DHS -G loomio -h "$loomio_dir" -s /bin/sh \
-g "added by apk for loomio" loomio
passwd -u loomio 1>/dev/null # unlock
fi
if ! id -Gn loomio | grep -Fq redis; then
echo '* Adding user loomio to group www-data' 1>&2
addgroup loomio www-data
fi
exit 0

View file

@ -0,0 +1,32 @@
#!/sbin/openrc-run
name="Loomio background workers Service"
root="/usr/share/webapps/loomio"
pidfile="/run/loomio-sidekiq.pid"
logfile="/var/log/loomio/sidekiq.log"
depend() {
use net
need redis
}
start() {
ebegin "Starting Loomio background workers"
cd $root
start-stop-daemon --start --background \
--chdir "${root}" \
--user="loomio" \
--make-pidfile --pidfile="${pidfile}" \
-1 "${logfile}" -2 "${logfile}" \
--exec /usr/bin/env -- RAILS_ENV=production bundle exec rails s
eend $?
}
stop() {
ebegin "Stopping Loomio background workers"
start-stop-daemon --stop \
--pidfile=${pidfile} \
eend $?
}

View file

@ -0,0 +1,31 @@
#!/sbin/openrc-run
name="$RC_SVCNAME"
cfgfile="/etc/conf.d/$RC_SVCNAME.conf"
pidfile="/run/$RC_SVCNAME.pid"
working_directory="/usr/share/bundles/loomio"
command="npm"
command_args="run serve"
command_user="loomio"
command_group="loomio"
start_stop_daemon_args=""
command_background="yes"
output_log="/var/log/loomio/$RC_SVCNAME.log"
error_log="/var/log/loomio/$RC_SVCNAME.err"
depend() {
need redis
need postgresql
}
start_pre() {
cd "$working_directory"
checkpath --directory --owner $command_user:$command_group --mode 0775 \
/var/log/loomio \
/var/lib/loomio
}
stop_pre() {
ebegin "Killing child processes"
kill $(ps -o pid= --ppid $(cat $pidfile)) || true
}

81
ilot/peertube/APKBUILD Normal file
View file

@ -0,0 +1,81 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=peertube
pkgver=6.0.2
pkgrel=0
pkgdesc="ActivityPub-federated video streaming platform using P2P directly in your web browser"
arch="x86_64"
url="https://joinpeertube.org/"
license="AGPL"
depends="
nodejs
ffmpeg
postgresql
openssl
redis
npm
procps-ng
"
makedepends="
yarn
"
source="
$pkgname-$pkgver.tar.gz::https://github.com/Chocobozzz/PeerTube/archive/refs/tags/v$pkgver.tar.gz
peertube-manage.sh
peertube.conf
peertube.openrc
"
builddir="$srcdir"/PeerTube-$pkgver
install="$pkgname.post-install $pkgname.pre-install $pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-openrc"
build() {
# need to fetch devel depencencies to build
yarn install --pure-lockfile
npm run build
rm -Rf "$builddir"/node_modules
yarn install --production --pure-lockfile
}
package() {
install -dm 755 \
"$pkgdir"/usr/share/webapps \
"$pkgdir"/usr/share/doc \
"$pkgdir"/usr/share/licenses/peertube \
"$pkgdir"/etc/init.d \
"$pkgdir"/etc/conf.d
# install
cp -a "$builddir" "$pkgdir/usr/share/webapps/peertube"
# wrapper script
install -Dm755 "$srcdir"/peertube-manage.sh "$pkgdir"/usr/bin/peertube-manage
# openrc
install -Dm755 "$srcdir"/peertube.openrc "$pkgdir"/etc/init.d/peertube
install -Dm644 "$srcdir"/peertube.conf "$pkgdir"/etc/conf.d/peertube
# config file setup
rm -R "$pkgdir"/usr/share/webapps/peertube/config
install -Dm644 "$builddir"/config/production.yaml.example "$pkgdir"/etc/peertube/production.yaml
install -Dm644 "$builddir"/config/default.yaml "$pkgdir"/etc/peertube/default.yaml
sed -i "s|/var/www/peertube/storage|/var/lib/peertube|g" "$pkgdir"/etc/peertube/production.yaml "$pkgdir"/etc/peertube/default.yaml
sed -i "s| tmp:.*| tmp: '/tmp/peertube/'|" "$pkgdir"/etc/peertube/production.yaml "$pkgdir"/etc/peertube/default.yaml
sed -i "s|tmp_persistent:.*|tmp_persistent: '/var/tmp/peertube/'|" "$pkgdir"/etc/peertube/production.yaml "$pkgdir"/etc/peertube/default.yaml
sed -i "s|logs:.*|logs: '/var/log/peertube/'|" "$pkgdir"/etc/peertube/production.yaml "$pkgdir"/etc/peertube/default.yaml
sed -i "s| peertube: ''| peertube: '@@SECRET_KEY@@'|" "$pkgdir"/etc/peertube/production.yaml
# docs and licenses
mv "$pkgdir"/usr/share/webapps/peertube/support/doc "$pkgdir"/usr/share/doc/$pkgname
mv "$pkgdir"/usr/share/webapps/peertube/*.md "$pkgdir"/usr/share/doc/peertube/.
mv "$pkgdir"/usr/share/webapps/peertube/LICENSE "$pkgdir"/usr/share/licenses/peertube/.
# delete arm64 prebuild
rm "$pkgdir"/usr/share/webapps/$pkgname/node_modules/fs-native-extensions/prebuilds/linux-arm64/node.napi.node
}
sha512sums="
91bcec34902f171ffe9ab3f27ab4422319f91430cab22965a5cf9887c5293152f7f85c6fc0f355820000daea0a49327aa66f20bb4cff3850e5e3d192f347c926 peertube-6.0.2.tar.gz
92de1155410848937eeff3bef480c4a074875b4236ce0b6bf4cd7213d00173e7766d130408419c85c4432a8445a03f5d4525e4283384d906d781510cc4fd8fc0 peertube-manage.sh
494bb4daf98fcd62b354eb6fae18ccff19bef1243de083a93e438680deef1d9039e30eff8870b6955c3c7b10638e6df6cbeb4fbdb7539979466f502bcc72c843 peertube.conf
5b4d3f47d0dc2ce991971ff61c604a1566811612cff91f7e6ed19b65d0830695649ddef9afff474d916a5e6764d74bb4fa6b5c12eb5e753d8fc381cdd38ab179 peertube.openrc
"

View file

@ -0,0 +1,15 @@
#!/bin/sh
BUNDLE_DIR='/usr/share/webapps/peertube'
cd $BUNDLE_DIR
if [ "$(id -un)" != 'peertube' ]; then
source /etc/conf.d/peertube
export NODE_ENV NODE_CONFIG_DIR
exec su peertube -c '"$0" "$@"' -- npm run "$@"
else
source /etc/conf.d/peertube
export NODE_ENV NODE_CONFIG_DIR
exec npm run "$@"
fi

View file

@ -0,0 +1,2 @@
NODE_CONFIG_DIR=/etc/peertube
NODE_ENV=production

View file

@ -0,0 +1,34 @@
#!/sbin/openrc-run
name="$RC_SVCNAME"
cfgfile="/etc/conf.d/$RC_SVCNAME.conf"
pidfile="/run/$RC_SVCNAME.pid"
working_directory="/usr/share/webapps/peertube"
command="/usr/bin/node"
command_args="dist/server.js"
command_user="peertube"
command_group="peertube"
start_stop_daemon_args=""
command_background="yes"
output_log="/var/log/peertube/$RC_SVCNAME.log"
depend() {
need redis
need postgresql
}
start_pre() {
cd "$working_directory"
checkpath --directory --owner $command_user:$command_group --mode 0775 \
/var/log/peertube \
/var/lib/peertube \
/var/tmp/peertube \
/tmp/peertube
export NODE_ENV NODE_CONFIG_DIR
}
stop_pre() {
ebegin "Killing child processes"
kill $(ps -o pid= --ppid $(cat $pidfile)) || true
}

View file

@ -0,0 +1,41 @@
#!/bin/sh
set -eu
group=www-data
config_file='/etc/peertube/production.yaml'
if grep '@@SECRET_KEY@@' "$config_file" >/dev/null; then
echo "* Generating random secret in $config_file" >&2
secret_key="$(openssl rand -hex 32)"
sed -i "s|@@SECRET_KEY@@|$secret_key|" "$config_file"
fi
if [ "${0##*.}" = 'post-upgrade' ]; then
cat >&2 <<-EOF
*
* To finish Peertube upgrade run:
*
*
EOF
else
cat >&2 <<-EOF
*
* 1. Adjust settings in /etc/peertube/production.yaml
*
* 2. Create database for Peertube:
*
* psql -c "CREATE ROLE peertube PASSWORD 'top-secret' INHERIT LOGIN;"
* psql -c "CREATE DATABASE peertube OWNER peertube ENCODING 'UTF-8';"
*
* 3. Start Peertube
*
* service peertube start
*
* 4. Create admin user
*
* peertube-manage reset-password -- -u root
*
EOF
fi

View file

@ -0,0 +1 @@
peertube.post-install

View file

@ -0,0 +1,25 @@
#!/bin/sh
DATADIR='/var/lib/peertube'
if ! getent group peertube 1>/dev/null; then
echo '* Creating group peertube' 1>&2
addgroup -S peertube
fi
if ! id peertube 2>/dev/null 1>&2; then
echo '* Creating user peertube' 1>&2
adduser -DHS -G peertube -h "$DATADIR" -s /bin/sh \
-g "added by apk for peertube" peertube
passwd -u peertube 1>/dev/null # unlock
fi
if ! id -Gn peertube | grep -Fq www-data; then
echo '* Adding user peertube to group www-data' 1>&2
addgroup peertube www-data
fi
exit 0

View file

@ -0,0 +1,35 @@
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php82-pecl-inotify
_extname=inotify
pkgver=3.0.0
pkgrel=0
pkgdesc="Inotify bindings for PHP 8.3"
url="https://pecl.php.net/package/inotify"
arch="all"
license="PHP-3.01"
depends="php82-common"
makedepends="php82-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver
build() {
phpize82
./configure --prefix=/usr --with-php-config=php-config82
make
}
check() {
make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}
package() {
make INSTALL_ROOT="$pkgdir" install
local _confdir="$pkgdir"/etc/php82/conf.d
install -d $_confdir
echo "extension=$_extname" > $_confdir/70_$_extname.ini
}
sha512sums="
f8b29f8611f16b92136ab8de89181c254bba1abee1e61cac2344440567a3155aae4b9b54b10fdb1b0254fd7a96da8c14b7dc5c9f7f08a03db30ab1645aca1eee php-pecl-inotify-3.0.0.tgz
"

View file

@ -0,0 +1,35 @@
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php83-pecl-inotify
_extname=inotify
pkgver=3.0.0
pkgrel=0
pkgdesc="Inotify bindings for PHP 8.3"
url="https://pecl.php.net/package/inotify"
arch="all"
license="PHP-3.01"
depends="php83-common"
makedepends="php83-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver
build() {
phpize83
./configure --prefix=/usr --with-php-config=php-config83
make
}
check() {
make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}
package() {
make INSTALL_ROOT="$pkgdir" install
local _confdir="$pkgdir"/etc/php83/conf.d
install -d $_confdir
echo "extension=$_extname" > $_confdir/70_$_extname.ini
}
sha512sums="
f8b29f8611f16b92136ab8de89181c254bba1abee1e61cac2344440567a3155aae4b9b54b10fdb1b0254fd7a96da8c14b7dc5c9f7f08a03db30ab1645aca1eee php-pecl-inotify-3.0.0.tgz
"

View file

@ -0,0 +1,59 @@
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-rest-framework
_pkgname=django-rest-framework
pkgver=3.14.0
pkgrel=0
pkgdesc="Web APIs for Django"
url="https://github.com/encode/django-rest-framework"
arch="noarch"
license="Custom"
depends="
py3-django
py3-tz
"
makedepends="
py3-setuptools
py3-gpep517
py3-wheel
"
checkdepends="
py3-pytest-django
py3-pytest-cov
py3-core-api
py3-jinja2
py3-uritemplate
py3-django-guardian
py3-psycopg2
py3-markdown
py3-yaml
py3-inflection
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/encode/$_pkgname/archive/$pkgver.tar.gz"
options="!check" # Failing tests
builddir="$srcdir"/$_pkgname-$pkgver
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 "$builddir"/.dist/*.whl
# test_urlpatterns: AssertionError: assert [<URLPattern ''>] is not [<URLPattern ''>]
# test_markdown: rather hard to decipher assertion error
.testenv/bin/python3 -m pytest -v -k 'not test_urlpatterns and not test_markdown'
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
c1012c656b427e0318b2056e2f984ddc75a5b4e85f375c76fba165ad06e285848eee1bc6dc76c097daec57d780efb2551110199d62ce636a03951aec13ab4013 py3-django-rest-framework-3.14.0.tar.gz
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-tenants
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=django-tenants
pkgver=3.6.1
pkgrel=0
pkgdesc="Tenant support for Django using PostgreSQL schemas."
url="https://pypi.python.org/project/django-tenants"
arch="noarch"
license="KIT"
depends="py3-django py3-psycopg py3-gunicorn py3-coverage"
checkdepends="python3-dev py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
$pkgname-$pkgver.tar.gz::https://codeload.github.com/django-tenants/django-tenants/tar.gz/refs/tags/v$pkgver
997_update-from-pgclone-schema.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"
options="!check" # Requires setting up test database
subpackages="$pkgname-pyc"
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
DJANGO_SETTINGS_MODULE=tests.settings .testenv/bin/python3 -m pytest -v
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
b18afce81ccc89e49fcc4ebe85d90be602415ca898c1660a4e71e2bef6a3ed2e8c724e94b61d8c6f48f3fb19eb2a87d6a6f5bbf449b3e2f661f87e4b5638eafb py3-django-tenants-3.6.1.tar.gz
f2424bb188db2e3c7d13c15e5bdf0959c6f794e68dbc677c8b876d4faa321f78aded5565539f1bfd97583c6df0fcc19ec05abe203b08407e4446dd7194756825 997_update-from-pgclone-schema.patch
"

View file

@ -0,0 +1,38 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-scim2-filter-parser
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=scim2-filter-parser
pkgver=0.5.0
pkgrel=0
pkgdesc="A customizable parser/transpiler for SCIM2.0 filters"
url="https://pypi.python.org/project/scim2-filter-parser"
arch="noarch"
license="MIT"
depends="py3-django py3-sly"
checkdepends="py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-wheel poetry"
source="$pkgname-$pkgver.tar.gz::https://github.com/15five/scim2-filter-parser/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"
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
.testenv/bin/python3 -m pytest -v
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
5347852af6b82a764a32bc491a7e0f05f06b4f4d93dfa375668b5ca1a15ee58f488702536e350100fe5c96a5c94c492ea8cbd0e1952c5920d5a10e1453357f8c py3-scim2-filter-parser-0.5.0.tar.gz
"

View file

@ -0,0 +1,41 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-tenant-schemas-celery
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=tenant-schemas-celery
pkgver=2.2.0
pkgrel=0
pkgdesc="Celery integration for django-tenant-schemas and django-tenants"
url="https://pypi.python.org/project/tenant-schemas-celery"
arch="noarch"
license="MIT"
depends="py3-django-tenants py3-celery"
checkdepends="python3-dev py3-pytest"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
$pkgname-$pkgver.tar.gz::https://codeload.github.com/maciej-gol/tenant-schemas-celery/tar.gz/refs/tags/$pkgver
"
options="!check" # Test suite wants docker
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"
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
DJANGO_SETTINGS_MODULE=tests.settings .testenv/bin/python3 -m pytest -v
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
dad71011306936dc84d966797b113008780750e9e973513092bec892be0d1468e0a0e7e8e2fcca9765309a27767e1c72bdaad7c8aca16353ae1eef783c239148 py3-tenant-schemas-celery-2.2.0.tar.gz
"

49
ilot/uptime-kuma/APKBUILD Normal file
View file

@ -0,0 +1,49 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=uptime-kuma
pkgver=1.23.13
pkgrel=0
pkgdesc='A fancy self-hosted monitoring tool'
arch="all"
url="https://github.com/louislam/uptime-kuma"
license="MIT"
depends="nodejs"
makedepends="npm"
source="
uptime-kuma-$pkgver.tar.gz::https://github.com/louislam/uptime-kuma/archive/refs/tags/$pkgver.tar.gz
uptime-kuma.openrc
uptime-kuma.conf
"
subpackages="$pkgname-doc $pkgname-openrc"
install="$pkgname.pre-install"
build() {
npm ci
npm run build
rm -Rf "$builddir"/node_modules
npm ci --omit=dev
}
package() {
install -dm 755 \
"$pkgdir"/usr/share/webapps \
"$pkgdir"/usr/share/doc \
"$pkgdir"/usr/share/licenses/uptime-kuma \
"$pkgdir"/etc/init.d \
"$pkgdir"/etc/conf.d
# install
cp -a "$builddir" "$pkgdir/usr/share/webapps/uptime-kuma"
# openrc
install -Dm755 "$srcdir"/uptime-kuma.openrc "$pkgdir"/etc/init.d/uptime-kuma
install -Dm755 "$srcdir"/uptime-kuma.conf "$pkgdir"/etc/conf.d/uptime-kuma
# docs and licenses
mv "$pkgdir"/usr/share/webapps/uptime-kuma/LICENSE "$pkgdir"/usr/share/licenses/uptime-kuma/.
}
sha512sums="
9045cdc69d46ce34011f7866844a8d1866eee21850be6eede3226e77b9c0d3ecc0190481671f04f25da40345b29cc2d13de07bcc27e7baeff7901b4bd9c8b93f uptime-kuma-1.23.13.tar.gz
0ceddb98a6f318029b8bd8b5a49b55c883e77a5f8fffe2b9b271c9abf0ac52dc7a6ea4dbb4a881124a7857f1e43040f18755c1c2a034479e6a94d2b65a73d847 uptime-kuma.openrc
1dbae536b23e3624e139155abbff383bba3209ff2219983da2616b4376b1a5041df812d1e5164716fc6e967a8446d94baae3b96ee575d400813cc6fdc2cc274e uptime-kuma.conf
"

View file

@ -0,0 +1,47 @@
# uptime-kuma config
# for more info
# see https://github.com/louislam/uptime-kuma/wiki/Environment-Variables
# Set the directory where the data should be stored (could be relative)
# DATA_DIR=/var/lib/uptime-kuma
# Host to bind to, could be an ip.
# UPTIME_KUMA_HOST=::
# Port to listen to
# UPTIME_KUMA_PORT=3001
# Path to SSL key
# UPTIME_KUMA_SSL_KEY=
# Path to SSL certificate
# UPTIME_KUMA_SSL_CERT=
# SSL Key Passphrase
# UPTIME_KUMA_SSL_KEY_PASSPHRASE=
# Cloudflare Tunnel Token
# UPTIME_KUMA_CLOUDFLARED_TOKEN=
# By default, Uptime Kuma is not allowed in iframe if the domain name is not
# the same as the parent. It protects your Uptime Kuma to be a phishing
# website. If you don't need this protection, you can set it to true
# UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=false
# By default, Uptime Kuma is verifying that the websockets ORIGIN-Header
# matches your servers hostname. If you don't need this protection, you can
# set it to bypass. See GHSA-mj22-23ff-2hrr for further context.
# UPTIME_KUMA_WS_ORIGIN_CHECK=cors-like
# Allow to specify any executables as Chromium
# UPTIME_KUMA_ALLOW_ALL_CHROME_EXEC=0
# Add your self-signed ca certs.
# NODE_EXTRA_CA_CERTS=
# Ignore all TLS errors
# NOTE_TLS_REJECT_UNAUTHORIZED=0
# Set it to --insecure-http-parser, if you encountered error Invalid header
# value char when your website using WAF
# NODE_OPTIONS=

View file

@ -0,0 +1,48 @@
#!/sbin/openrc-run
description="Uptime Kuma self-hosted monitoring tool"
# Change $directory to path to uptime-kuma
directory=${directory:-/usr/share/webapps/uptime-kuma}
pidfile=${pidfile:-/run/$RC_SVCNAME.pid}
DATA_DIR=${DATA_DIR:-/var/lib/uptime-kuma}
log_dir="/var/log/$RC_SVCNAME"
logfile=${logfile:-$log_dir/$RC_SVCNAME.log}
output_log="${output_log:-$logfile}"
error_log="${error_log:-$logfile}"
command=${command:-/usr/bin/node}
command_args="$directory/server/server.js"
command_user=${command_user:-uptime-kuma:uptime-kuma}
command_background=true
depend() {
need net
}
start_pre() {
checkpath --owner=$command_user --directory $log_dir \
$DATA_DIR \
$DATA_DIR/upload
checkpath --owner=$command_user --file $logfile \
$DATA_DIR/error.log
[ ! -e $DATA_DIR/kuma.db ] &&
cp $directory/db/kuma.db $DATA_DIR
checkpath --owner=$command_user --mode 600 --file $DATA_DIR/kuma.db*
cd $directory
export DATA_DIR UPTIME_KUMA_HOST UPTIME_KUMA_PORT UPTIME_KUMA_SSL_KEY \
UPTIME_KUMA_SSL_CERT UPTIME_KUMA_SSL_KEY_PASSPHRASE \
UPTIME_KUMA_CLOUDFLARED_TOKEN UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN \
UPTIME_KUMA_WS_ORIGIN_CHECK UPTIME_KUMA_ALLOW_ALL_CHROME_EXEC \
NODE_EXTRA_CA_CERTS NODE_TLS_REJECT_UNAUTHORIZED NODE_OPTIONS
}
start_post() {
# Wait for the server to be started
sleep 10
}

View file

@ -0,0 +1,25 @@
#!/bin/sh
DATADIR='/var/lib/uptime-kuma'
if ! getent group uptime-kuma 1>/dev/null; then
echo '* Creating group uptime-kuma' 1>&2
addgroup -S uptime-kuma
fi
if ! id uptime-kuma 2>/dev/null 1>&2; then
echo '* Creating user uptime-kuma' 1>&2
adduser -DHS -G uptime-kuma -h "$DATADIR" -s /bin/sh \
-g "added by apk for uptime-kuma" uptime-kuma
passwd -u uptime-kuma 1>/dev/null # unlock
fi
if ! id -Gn uptime-kuma | grep -Fq www-data; then
echo '* Adding user uptime-kuma to group www-data' 1>&2
addgroup uptime-kuma www-data
fi
exit 0

60
ilot/wikijs/APKBUILD Normal file
View file

@ -0,0 +1,60 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=wikijs
pkgver=2.5.303
pkgrel=0
pkgdesc="Wiki.js | A modern, lightweight and powerful wiki app built on Node.js"
license="AGPL-3.0"
arch="!armv7 x86_64"
options="!check" # No test suite
depends="
libcap-setcap
nodejs>=10.12.0
postgresql
python3
"
makedepends="
yarn
npm
"
url="https://github.com/Requarks/wiki"
subpackages="$pkgname-openrc"
install="$pkgname.post-install $pkgname.pre-install"
builddir="$srcdir"/wiki-$pkgver
pkgusers="wikijs"
pkggroups="wikijs"
source="
$pkgname-$pkgver.tar.gz::https://github.com/requarks/wiki/archive/refs/tags/v$pkgver.tar.gz
wikijs.initd
config.sample.yml.patch
"
prepare() {
default_prepare
sed -i "s|\"version.*|\"version\": \"$pkgver\",|" "$builddir"/package.json
sed -i 's|"dev": true.*|"dev": "false",|' "$builddir"/package.json
}
build() {
yarn --frozen-lockfile --non-interactive
yarn build
rm -rf node_modules
yarn --production --frozen-lockfile --non-interactive
}
package() {
install -Dm755 "$srcdir"/wikijs.initd "$pkgdir"/etc/init.d/wikijs
install -Dm644 -o 5494 -g 5494 "$builddir"/config.sample.yml "$pkgdir"/etc/wikijs/config.yml
install -Dm644 "$builddir"/package.json -t "$pkgdir"/usr/lib/bundles/wikijs
cp -aR "$builddir"/assets "$builddir"/server "$builddir"/node_modules "$pkgdir"/usr/lib/bundles/wikijs
mkdir -p "$pkgdir"/var/lib/wikijs
chown 5494:5494 "$pkgdir"/var/lib/wikijs
}
sha512sums="
a463d79ad0d8ff15dbe568b839094d697c6de0b2e991b77a4944e2a82f9789de6840e504a4673e4e0900d61596e880ca276008de86dac4f05f5823dc0427d2fc wikijs-2.5.303.tar.gz
355131ee5617348b82681cb8543c784eea59689990a268ecd3b77d44fe9abcca9c86fb8b047f0a8faeba079c650faa7790c5dd65418d313cd7561f38bb590c03 wikijs.initd
07b536c20e370d2a926038165f0e953283259c213a80a8648419565f5359ab05f528ac310e81606914013da212270df6feddb22e514cbcb2464c8274c956e4af config.sample.yml.patch
"

View file

@ -0,0 +1,13 @@
diff --git a/config.sample.yml.orig b/config.sample.yml
index 47edd8d..458472a 100644
--- a/config.sample.yml.orig
+++ b/config.sample.yml
@@ -136,7 +136,7 @@ ha: false
# Data Path
# ---------------------------------------------------------------------
# Writeable data path used for cache and temporary user uploads.
-dataPath: ./data
+dataPath: /var/lib/wikijs/data
# ---------------------------------------------------------------------
# Body Parser Limit

24
ilot/wikijs/wikijs.initd Normal file
View file

@ -0,0 +1,24 @@
#!/sbin/openrc-run
name="$RC_SVCNAME"
cfgfile="/etc/conf.d/$RC_SVCNAME"
pidfile="/var/run/$RC_SVCNAME.pid"
command="/usr/bin/node server"
command_args=""
command_user="wikijs"
command_group="wikijs"
supervisor="supervise-daemon"
start_stop_daemon_args=""
command_background="yes"
output_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log"
error_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.err"
working_directory="/usr/lib/bundles/wikijs"
start_pre() {
checkpath --directory --owner $command_user:$command_user --mode 0775 \
/var/log/$RC_SVCNAME \
/var/lib/$RC_SVCNAME
export NODE_ENV=production
export CONFIG_FILE=/etc/wikijs/config.yml
cd "$working_directory"
}

18
ilot/wikijs/wikijs.post-install Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
set -eu
group=wikijs
config_file='/etc/wikijs/config.yml'
setcap 'cap_net_bind_service=+ep' /usr/bin/node
cat >&2 <<-EOF
*
* 1. Adjust settings in /etc/wikijs/config.yml.
*
* 2. Create database for wikijs:
*
* psql -c "CREATE ROLE wikijs PASSWORD 'top-secret' INHERIT LOGIN;"
* psql -c "CREATE DATABASE wkijs OWNER wikijs ENCODING 'UTF-8';"
*
EOF

View file

@ -0,0 +1,20 @@
#!/bin/sh
# It's very important to set user/group correctly.
wikijs_dir='/var/lib/wikijs'
if ! getent group wikijs 1>/dev/null; then
echo '* Creating group wikijs' 1>&2
addgroup -S wikijs -g 5494
fi
if ! id wikijs 2>/dev/null 1>&2; then
echo '* Creating user wikijs' 1>&2
adduser -DHS -G wikijs -h "$wikijs_dir" -u 5494 -s /bin/sh \
-g "added by apk for wikijs" wikijs
passwd -u wikijs 1>/dev/null # unlock
fi
exit 0