Compare commits
17 commits
alpine-pac
...
illegal-ca
Author | SHA1 | Date | |
---|---|---|---|
|
6250b07f6a | ||
|
94f2792d99 | ||
|
737f9b9788 | ||
|
942308ea57 | ||
|
8ccdec6516 | ||
|
80da18a325 | ||
|
531170594d | ||
|
1aafd1163d | ||
|
a9d9580aa4 | ||
|
1518ce0878 | ||
|
2e8abe1071 | ||
|
0c09c3651b | ||
|
0c5e4fdc20 | ||
|
2c043cfabf | ||
|
ebfbca59a7 | ||
|
78c2a07524 | ||
|
1c8ca527db |
8 changed files with 22 additions and 170 deletions
|
@ -1,49 +0,0 @@
|
||||||
on:
|
|
||||||
- workflow-dispatch
|
|
||||||
- push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: alpine:edge
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: set up dependencies
|
|
||||||
run: |
|
|
||||||
apk update
|
|
||||||
apk upgrade
|
|
||||||
apk add nodejs git alpine-sdk
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
name: checkout the alpine dir
|
|
||||||
with:
|
|
||||||
sparse-checkout: "alpine/"
|
|
||||||
|
|
||||||
# - uses: actions/checkout@v4
|
|
||||||
# name: checkout the rest in the alpine dir
|
|
||||||
# with:
|
|
||||||
# path: 'alpine/continuwuity'
|
|
||||||
- name: set up user
|
|
||||||
run: adduser -DG abuild ci
|
|
||||||
|
|
||||||
- name: set up keys
|
|
||||||
run: |
|
|
||||||
pwd
|
|
||||||
mkdir ~/.abuild
|
|
||||||
echo "${{ secrets.abuild_privkey }}" > ~/.abuild/ci@continuwuity.rsa
|
|
||||||
echo "${{ secrets.abuild_pubkey }}" > ~/.abuild/ci@continuwuity.rsa.pub
|
|
||||||
echo $HOME
|
|
||||||
echo 'PACKAGER_PRIVKEY="/root/.abuild/ci@continuwuity.rsa"' > ~/.abuild/abuild.conf
|
|
||||||
ls ~/.abuild
|
|
||||||
|
|
||||||
- name: go go gadget abuild
|
|
||||||
run: |
|
|
||||||
cd alpine
|
|
||||||
# modify the APKBUILD to use the current branch instead of the release
|
|
||||||
# note that it seems to require the repo to be public (as you'll get
|
|
||||||
# a 404 even if the token is provided)
|
|
||||||
export ARCHIVE_URL="${{ github.server_url }}/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz"
|
|
||||||
echo $ARCHIVE_URL
|
|
||||||
sed -i '/^source=/c\source="'"$ARCHIVE_URL" APKBUILD
|
|
||||||
abuild -F checksum
|
|
||||||
abuild -Fr
|
|
|
@ -1,63 +0,0 @@
|
||||||
# Contributor: magmaus3 <maia@magmaus3.eu.org>
|
|
||||||
# Maintainer: magmaus3 <maia@magmaus3.eu.org>
|
|
||||||
pkgname=continuwuity
|
|
||||||
|
|
||||||
# abuild doesn't like the format of v0.5.0-rc.5, so i had to change it
|
|
||||||
# see https://wiki.alpinelinux.org/wiki/Package_policies
|
|
||||||
pkgver=0.5.0_rc5
|
|
||||||
pkgrel=0
|
|
||||||
pkgdesc="a continuwuation of a very cool, featureful fork of conduit"
|
|
||||||
url="https://continuwuity.org/"
|
|
||||||
arch="all"
|
|
||||||
license="Apache-2.0"
|
|
||||||
depends="liburing"
|
|
||||||
|
|
||||||
# cargo version on alpine v3.21 is too old to use the 2024 edition
|
|
||||||
# i recommend either building everything on edge, or adding
|
|
||||||
# the edge repo as a tag
|
|
||||||
makedepends="cargo liburing-dev clang-dev linux-headers"
|
|
||||||
checkdepends=""
|
|
||||||
install="$pkgname.pre-install"
|
|
||||||
subpackages="$pkgname-openrc"
|
|
||||||
source="https://forgejo.ellis.link/continuwuation/continuwuity/archive/v0.5.0-rc.5.tar.gz
|
|
||||||
continuwuity.initd
|
|
||||||
continuwuity.confd
|
|
||||||
"
|
|
||||||
builddir="$srcdir/continuwuity"
|
|
||||||
options="net !check"
|
|
||||||
|
|
||||||
prepare() {
|
|
||||||
default_prepare
|
|
||||||
cd $srcdir/continuwuity
|
|
||||||
|
|
||||||
# add the default database path to the config (commented out)
|
|
||||||
cat conduwuit-example.toml \
|
|
||||||
| sed '/#database_path/ s:$: "/var/lib/continuwuity":' \
|
|
||||||
> "$srcdir"/continuwuity.toml
|
|
||||||
|
|
||||||
cargo fetch --target="$CTARGET" --locked
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
|
||||||
cargo build --frozen --release --all-features
|
|
||||||
}
|
|
||||||
|
|
||||||
check() {
|
|
||||||
# TODO: make sure the tests work
|
|
||||||
#cargo test --frozen
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
|
||||||
cd $srcdir
|
|
||||||
install -Dm755 continuwuity/target/release/conduwuit "$pkgdir"/usr/bin/continuwuity
|
|
||||||
install -Dm644 "$srcdir"/continuwuity.toml -t "$pkgdir"/etc/continuwuity
|
|
||||||
install -Dm755 "$srcdir"/continuwuity.initd "$pkgdir"/etc/init.d/continuwuity
|
|
||||||
install -Dm644 "$srcdir"/continuwuity.confd "$pkgdir"/etc/conf.d/continuwuity
|
|
||||||
}
|
|
||||||
|
|
||||||
sha512sums="
|
|
||||||
66f6da5e98b6f7bb8c1082500101d5c87b1b79955c139b44c6ef5123919fb05feb0dffc669a3af1bc8d571ddb9f3576660f08dc10a6b19eab6db9e391175436a v0.5.0-rc.5.tar.gz
|
|
||||||
0482674be24740496d70da256d4121c5a5e3b749f2445d2bbe0e8991f1449de052724f8427da21a6f55574bc53eac9ca1e47e5012b4c13049b2b39044734d80d continuwuity.initd
|
|
||||||
38e2576278b450d16ba804dd8f4a128f18cd793e6c3ce55aedee1e186905755b31ee23baaa6586b1ab0e25a1f29bf1ea86bfaae4185b0cb1a29203726a199426 continuwuity.confd
|
|
||||||
"
|
|
|
@ -1,7 +0,0 @@
|
||||||
# building
|
|
||||||
|
|
||||||
1. [set up your build
|
|
||||||
environment](https://wiki.alpinelinux.org/wiki/Include:Setup_your_system_and_account_for_building_packages)
|
|
||||||
|
|
||||||
2. run `abuild` (or `abuild -K` if you want to keep the source directory to make
|
|
||||||
rebuilding faster)
|
|
|
@ -1,3 +0,0 @@
|
||||||
supervisor=supervise-daemon
|
|
||||||
export CONTINUWUITY_CONFIG=/etc/continuwuity/continuwuity.toml
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/sbin/openrc-run
|
|
||||||
|
|
||||||
command="/usr/bin/continuwuity"
|
|
||||||
command_user="continuwuity:continuwuity"
|
|
||||||
command_args="--config ${CONTINUWUITY_CONFIG=/etc/continuwuity/continuwuity.toml}"
|
|
||||||
command_background=true
|
|
||||||
pidfile="/run/$RC_SVCNAME.pid"
|
|
||||||
|
|
||||||
output_log="/var/log/continuwuity.log"
|
|
||||||
error_log="/var/log/continuwuity.log"
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need net
|
|
||||||
}
|
|
||||||
|
|
||||||
start_pre() {
|
|
||||||
checkpath -d -m 0755 -o "$command_user" /var/lib/continuwuity
|
|
||||||
checkpath -f -m 0644 -o "$command_user" "$output_log"
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
addgroup -S continuwuity 2>/dev/null
|
|
||||||
adduser -S -D -H -h /var/lib/continuwuity -s /sbin/nologin -G continuwuity -g continuwuity continuwuity 2>/dev/null
|
|
||||||
exit 0
|
|
|
@ -121,7 +121,9 @@ where
|
||||||
.map(|(key, val)| (key, val.collect()))
|
.map(|(key, val)| (key, val.collect()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if !populate {
|
if populate {
|
||||||
|
rooms.push(summary_to_chunk(summary.clone()));
|
||||||
|
} else {
|
||||||
children = children
|
children = children
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
|
@ -144,10 +146,8 @@ where
|
||||||
.collect();
|
.collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if populate {
|
if !populate && queue.is_empty() && children.is_empty() {
|
||||||
rooms.push(summary_to_chunk(summary.clone()));
|
break;
|
||||||
} else if queue.is_empty() && children.is_empty() {
|
|
||||||
return Err!(Request(InvalidParam("Room IDs in token were not found.")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parents.insert(current_room.clone());
|
parents.insert(current_room.clone());
|
||||||
|
|
|
@ -306,28 +306,25 @@ impl super::Service {
|
||||||
|
|
||||||
#[tracing::instrument(name = "srv", level = "debug", skip(self))]
|
#[tracing::instrument(name = "srv", level = "debug", skip(self))]
|
||||||
async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> {
|
async fn query_srv_record(&self, hostname: &'_ str) -> Result<Option<FedDest>> {
|
||||||
let hostnames =
|
self.services.server.check_running()?;
|
||||||
[format!("_matrix-fed._tcp.{hostname}."), format!("_matrix._tcp.{hostname}.")];
|
|
||||||
|
|
||||||
for hostname in hostnames {
|
debug!("querying SRV for {hostname:?}");
|
||||||
self.services.server.check_running()?;
|
|
||||||
|
|
||||||
debug!("querying SRV for {hostname:?}");
|
let hostname_suffix = format!("_matrix-fed._tcp.{hostname}.");
|
||||||
let hostname = hostname.trim_end_matches('.');
|
let hostname = hostname_suffix.trim_end_matches('.');
|
||||||
match self.resolver.resolver.srv_lookup(hostname).await {
|
match self.resolver.resolver.srv_lookup(hostname).await {
|
||||||
| Err(e) => Self::handle_resolve_error(&e, hostname)?,
|
| Err(e) => Self::handle_resolve_error(&e, hostname)?,
|
||||||
| Ok(result) => {
|
| Ok(result) => {
|
||||||
return Ok(result.iter().next().map(|result| {
|
return Ok(result.iter().next().map(|result| {
|
||||||
FedDest::Named(
|
FedDest::Named(
|
||||||
result.target().to_string().trim_end_matches('.').to_owned(),
|
result.target().to_string().trim_end_matches('.').to_owned(),
|
||||||
format!(":{}", result.port())
|
format!(":{}", result.port())
|
||||||
.as_str()
|
.as_str()
|
||||||
.try_into()
|
.try_into()
|
||||||
.unwrap_or_else(|_| FedDest::default_port()),
|
.unwrap_or_else(|_| FedDest::default_port()),
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(None)
|
Ok(None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue