Browse Source

Initial snapcraft metadata

merge-requests/8/head
Christopher James Halse Rogers 5 years ago
parent
commit
a1af588246
No known key found for this signature in database
GPG Key ID: D4DB4A9F5D044F1A
  1. 19
      snap/hooks/configure
  2. 23
      snap/local/set-environment
  3. 40
      snap/snapcraft.yaml

19
snap/hooks/configure vendored

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
#!/bin/sh
base_url="$(snapctl get base-url)"
enabled="$(snapctl get enabled)"
if [ -n ${enabled} -a \( "${enabled}" != "true" -a "${enabled}" != "false" \) ]
then
echo "Invalid 'enabled' setting: ${enabled}. Valid values are 'true' or 'false'"
exit 1
fi
if [ -n ${base_url} -a \( -z "${enabled}" -o "${enabled}" = "false" \) ]
then
echo "All required configuration available."
echo "Conduit can now be enabled by setting 'snap set conduit enabled=true' and restarting the service \
with 'snap restart conduit'"
fi
exit 0

23
snap/local/set-environment

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
#!/bin/sh
enabled="$(snapctl get enabled)"
if [ -z "${enabled}" -o "${enabled}" != "true" ]
then
echo "Conduit not yet enabled"
exit 0
fi
export ROCKET_SERVER_NAME="$(snapctl get base-url)"
listen_address="$(snapctl get listen.address)"
if [ -n "${listen_address}" ]
then
export ROCKET_ADDRESS="$(snapctl get listen.address)"
export ROCKET_PORT="$(snapctl get listen.port)"
fi
export ROCKET_ENV="production"
export ROCKET_DATABASE_PATH=${SNAP_DATA}
cd ${SNAP}
exec $@

40
snap/snapcraft.yaml

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
name: conduit
base: core20
version: git
summary: A Matrix homeserver written in Rust
description: |
A fast Matrix homeserver that's easy to set up and just works. You can
install it on a mini-computer like the Raspberry Pi to host Matrix for
your family, friends or company.
Conduit is under heavy development, and many features of a fully-functional
Matrix server are incomplete or missing, but
What are the biggest things still missing?
* Appservices (Bridges and Bots)
* Most federation features (invites, e2ee)
* Push notifications on mobile
* Notification settings
* Lots of testing
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
apps:
conduit:
daemon: simple
command: set-environment bin/conduit
plugs:
- network
- network-bind
parts:
conduit:
plugin: rust
source: .
build-packages:
- libssl-dev
- pkg-config
snap-helper:
plugin: dump
source: snap/local/
Loading…
Cancel
Save