Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions build/agent/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,52 @@ conflicts=(
)
source=(
"service-discover.service"
"service-discover-legacy.service"
)
sha256sums=(
'217caccf9ecbb4c607dc9aadd2ba47b39de0c71aee5bb496bc84a4f99159fb22'
'05d8118237df2a745c3eec4678b38a4b31920e043298d9a733eba77326b42c92'
'e0e17bae0bfb978dd52718a03079eaf30c2bf5dba080ca98c2964eb42e02bf14'
)

build() {
cd "$(dirname "$(find / -name "yap.json" -print -quit)")/.."
CGO_ENABLED=0 go build \
-o "${srcdir}/agent" \
cmd/agent/agent.go
_package_legacy() {
cd "${srcdir}"
install -Dm 755 agent \
"${pkgdir}/usr/bin/service-discover"
install -Dm 644 service-discover-legacy.service \
"${pkgdir}/lib/systemd/system/service-discover.service"
}

package() {
_package_systemd() {
cd "${srcdir}"
install -Dm 755 agent \
"${pkgdir}/usr/bin/service-discover"
install -Dm 644 service-discover.service \
"${pkgdir}/lib/systemd/system/service-discover.service"
}

build() {
cd "$(dirname "$(find / -name "yap.json" -print -quit)")/.."
CGO_ENABLED=0 go build \
-o "${srcdir}/agent" \
cmd/agent/agent.go
}

package__rocky_8() {
_package_legacy
}

package__rocky_9() {
_package_systemd
}

package__ubuntu_jammy() {
_package_legacy
}

package__ubuntu_noble() {
_package_systemd
}

postinst__apt() {
# Automatically added by dh_systemd_enable/11.1.6ubuntu2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ]; then
Expand Down
23 changes: 23 additions & 0 deletions build/agent/service-discover-legacy.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2021-2022, 2024-2025 Zextras <https://www.zextras.com>
#
# SPDX-License-Identifier: AGPL-3.0-only

[Unit]
Description=Zextras Service Discover Agent
Documentation=https://docs.zextras.com/
Requires=network-online.target
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/service-discoverd agent
Restart=on-failure
RestartSec=15s
KillMode=process
LimitNOFILE=65536
ExecReload=/usr/bin/consul reload
TimeoutSec=120s
TimeoutStopSec=120s

[Install]
WantedBy=multi-user.target
12 changes: 6 additions & 6 deletions build/agent/service-discover.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
# SPDX-License-Identifier: AGPL-3.0-only

[Unit]
Description=Service discover agent for Zextras
Description=Zextras Service Discover Agent
Documentation=https://docs.zextras.com/
Requires=network-online.target
After=network-online.target
PartOf=carbonio.target
PartOf=carbonio-appserver.target carbonio-mta.target carbonio-proxy.target carbonio.target

[Service]
Type=notify
ExecStart=/usr/bin/service-discoverd agent
Restart=on-failure
RestartSec=15
RestartSec=15s
KillMode=process
LimitNOFILE=65536
ExecReload=/usr/bin/consul reload
TimeoutSec=120
TimeoutStopSec=120
TimeoutSec=120s
TimeoutStopSec=120s

[Install]
WantedBy=multi-user.target
WantedBy=carbonio-appserver.target carbonio-mta.target carbonio-proxy.target carbonio.target
40 changes: 33 additions & 7 deletions build/server/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,52 @@ depends=(
conflicts=("service-discover-agent")
source=(
"service-discover.service"
"service-discover-legacy.service"
)
sha256sums=(
'66f5ebdf2a93fdbf7a155daecfebb0c8d72ab0bce8148eb1c7a346d3658f7e60'
'b7d5be9bb79a5afb5784ddfe302db4fadbc60668c44f0f1aafd8f450819c63c7'
'5780163ac614276da1c812580686eb8adfdbfe9eebe62397d6a354ca461db1a9'
)

build() {
cd "$(dirname "$(find / -name "yap.json" -print -quit)")/.."
CGO_ENABLED=0 go build \
-o "${srcdir}/server" \
cmd/server/server.go
_package_legacy() {
cd "${srcdir}"
install -Dm 755 server \
"${pkgdir}/usr/bin/service-discover"
install -Dm 644 service-discover-legacy.service \
"${pkgdir}/lib/systemd/system/service-discover.service"
}

package() {
_package_systemd() {
cd "${srcdir}"
install -Dm 755 server \
"${pkgdir}/usr/bin/service-discover"
install -Dm 644 service-discover.service \
"${pkgdir}/lib/systemd/system/service-discover.service"
}

build() {
cd "$(dirname "$(find / -name "yap.json" -print -quit)")/.."
CGO_ENABLED=0 go build \
-o "${srcdir}/server" \
cmd/server/server.go
}

package__rocky_8() {
_package_legacy
}

package__rocky_9() {
_package_systemd
}

package__ubuntu_jammy() {
_package_legacy
}

package__ubuntu_noble() {
_package_systemd
}

postinst__apt() {
# Automatically added by dh_systemd_enable/11.1.6ubuntu2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ]; then
Expand Down
23 changes: 23 additions & 0 deletions build/server/service-discover-legacy.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2021-2022, 2024-2025 Zextras <https://www.zextras.com>
#
# SPDX-License-Identifier: AGPL-3.0-only

[Unit]
Description=Zextras Service Discover Server
Documentation=https://docs.zextras.com/
Requires=network-online.target
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/service-discoverd server
Restart=on-failure
RestartSec=15s
KillMode=process
LimitNOFILE=65536
ExecReload=/usr/bin/consul reload
TimeoutSec=120s
TimeoutStopSec=120s

[Install]
WantedBy=multi-user.target
12 changes: 6 additions & 6 deletions build/server/service-discover.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
# SPDX-License-Identifier: AGPL-3.0-only

[Unit]
Description=Service discover server for Zextras
Description=Zextras Service Discover Server
Documentation=https://docs.zextras.com/
Requires=network-online.target
After=network-online.target
PartOf=carbonio.target
PartOf=carbonio-directory-server.target

[Service]
Type=notify
ExecStart=/usr/bin/service-discoverd server
Restart=on-failure
RestartSec=15
RestartSec=15s
KillMode=process
LimitNOFILE=65536
ExecReload=/usr/bin/consul reload
TimeoutSec=120
TimeoutStopSec=120
TimeoutSec=120s
TimeoutStopSec=120s

[Install]
WantedBy=multi-user.target
WantedBy=carbonio-directory-server.target
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.5

require (
github.com/ProtonMail/go-crypto v1.3.0
github.com/alecthomas/kong v1.13.0
github.com/alecthomas/kong v1.14.0
github.com/coreos/go-systemd/v22 v22.6.0
github.com/docker/docker v28.5.2+incompatible
github.com/docker/go-units v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBi
github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE=
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/kong v1.13.0 h1:5e/7XC3ugvhP1DQBmTS+WuHtCbcv44hsohMgcvVxSrA=
github.com/alecthomas/kong v1.13.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I=
github.com/alecthomas/kong v1.14.0 h1:gFgEUZWu2ZmZ+UhyZ1bDhuutbKN1nTtJTwh19Wsn21s=
github.com/alecthomas/kong v1.14.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I=
github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs=
github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down