Compare commits

...

363 Commits

Author SHA1 Message Date
evilham 11ecb37dd9
[__jitsi_meet] Add --abort-conference-count parameter
Only has an effect if the prometheus exporter is enabled and if it is not
empty (default).
If at least this many conferences are active on the server, the type will
bail out before making any changes.
This is useful if you want to avoid service disruptions due to e.g. an SLA.

Sponsored by:	camilion.eu
2022-06-21 11:19:11 +02:00
evilham 03a9b8b333
[__jitsi_meet*] Update to 2.0.7439-1
Changelog:	https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-WEB.md#207439-2022-06-17

Sponsored by:	camilion.eu, eXO.cat
2022-06-21 11:12:27 +02:00
evilham 7a3b706b16
[__jitsi_meet*] Update to 2.0.7416-1
Changelog:	https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-WEB.md#207416-2022-06-16

Sponsored by:	camilion.eu, eXO.cat
2022-06-16 17:43:30 +02:00
evilham 756e5b17c6
[__jitsi_meet*] Update to 2.0.7287-1
Sponsored by:	camilion.eu, eXO.cat
2022-06-07 15:00:00 +02:00
evilham 797f7c8648
[__jitsi_meet] Improve manpage regarding ufw and SSH
This documents the fact that this type does not make decisions about anything
other than Jitsi-Meet itself and therefore care should be taken with the SSH
port.

Related to:	ungleich-public/cdist-contrib#23
Reported by:	@pedro
2022-05-08 21:47:26 +02:00
evilham 1791d35f84
[__jitsi_meet_domain] Add a muc_room_cache_size for jibri
@pedro is working on this and this change matched my workflow better :-)
2022-04-28 17:43:33 +02:00
evilham 8e1d0b68f1
[__jitsi_meet*] Add new parameters for heavier branding
This uses nginx' server-side includes, so each domain configured by
`__jitsi_meet_domain` can have its own customisation.

Note that the file customisation file must exist for each domain,
`__jitsi_meet_domain` takes care of that already.

Sponsored by:   camilion.eu, eXO.cat
2022-04-28 17:42:30 +02:00
evilham aa3f2eeb00
[__jitsi_meet_domain] Make shellcheck happy and fix escaping issue
The escaping issue was overlooked because it was in a comment block; it wasn't
relevant.

No functional changes intended.

Sponsored by:   camilion.eu, eXO.cat
2022-04-28 17:34:32 +02:00
evilham a63d9ec458
[__jitsi_meet] Configure jicofo so metrics are more useful
By default the REST API provided by jicofo is less useful than desired.
This is a tad under-documented, so finding the right settings was tricky :-).

Sponsored by:   camilion.eu, eXO.cat
2022-04-28 17:32:15 +02:00
evilham 0cff414884
[__jitsi_meet] Simplify exporter logic and update it to 1.2.0
This uses the newly merged __single_binary_service and:

- Fixes the bug where once added, the exporter could not be removed
- Simplifies keeping it up to date

Sponsored by:   camilion.eu, eXO.cat
2022-04-28 17:28:46 +02:00
evilham 977b530dab
[__single_binary_service] Update manpage to remove __evilham prefix 2022-04-28 17:22:19 +02:00
evilham 1865ff9dce Add 'type/__single_binary_service/' from commit '1af7e960fa882efc7202cad5cc01d3136886fa0a'
git-subtree-dir: type/__single_binary_service
git-subtree-mainline: 67bc8aa02b
git-subtree-split: 1af7e960fa
2022-04-28 17:20:02 +02:00
fnux 67bc8aa02b
__uacme_obtain: allow use of stdin with the --renew-hook parameter 2022-04-25 17:10:50 +02:00
evilham 151dc32fb5
[__jitsi_meet*] Add support for simultaneous interpretations
By using https://gitlab.com/mfmt/jsi which consists of very small and simple
static files, we enable interpretations by default.

With this commit, any DOMAIN created with __jitsi_meet_domain will serve jsi on
https://DOMAIN/i/ and any ROOM can be used with simultaneous interpretation on
https://DOMAIN/i/ROOM

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 19:46:03 +02:00
evilham 7e2ba98d36
[__jitsi_meet] Fix issue with jicofo memory adaptation
That was being a bit of a mess.

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 17:52:49 +02:00
evilham 1658121549
[__jitsi_meet*] Update to 2.0.7210
While there, make things a tad easier to maintain.

Note that in this version, jitsi switches to using nginx upstreams; it shouldn't
be relevant for instances fully managed with these types.

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 15:52:47 +02:00
evilham c5070a3a33
[__jitsi_meet] Fix adjustment of jicofo's max memory
Leftover from last commit >,<

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 14:44:10 +02:00
evilham 80bbbd3aa8
[__jitsi_meet] Adapt jicofo and videobridge memory usage
This enables us to setup smaller jitsi instances that work reliably.

We set 3 threshholds:
- < 3G RAM: use 0.75G max memory
- < 5G RAM: use 1G max memory
- < 8G RAM: use 2G max memory
- >= 8G RAM: use 3G max memory (jitsi's default)

For more information as to why and how this is done, see:
https://gitlab.com/guifi-exo/projectes/-/issues/318
https://github.com/jitsi/jitsi-meet/issues/6589
as investigated back in the day by @pedro

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 14:37:08 +02:00
evilham 87cc109bf1
[__jitsi_meet*] Make rooms on different domains not equivalent
This is a backwards-compatible change.

We switch the approach from "treat all domains as if they were the main domain"
to: "each domain has its own prosody settings".

This works perfectly fine, even with secured domains.

There is a caveat with secured domains, in that they use the main domain to log
in; this means that users are shared across all domains (as they were before
this commit).

This is due to jicofo refusing to start meetings from a domain that is not
configured, and it only accepting one domain.

Right now, this is acceptable, however we could want to authenticate against
e.g. different LDAP / IMAP servers in the future, so this would need addressing
at that stage.

Probably the best way to solve it is by patching jicofo, so it accepts starting
conferences from multiple domains and getting that patch upstream.

Sponsored by:   camilion.eu, eXO.cat
2022-04-21 13:20:30 +02:00
evilham a12b343660
[__jitsi_meet_domain] Add analytics settings parameter
with this, admins can take advantage of e.g. matomo to have some usage
statistics.

The parameter defaults to `disabled: true`, which is the most privacy-friendly!

Sponsored by:   camilion.eu
2022-04-21 13:13:12 +02:00
evilham 29cafd4f9a
[__jitsi_meet_domain] Simplify logic for secured domains 2022-04-16 13:22:16 +02:00
evilham fa37ede84f
[__jitsi_meet] Unconfuse jitsi-version and secured domains
Closes #14 by committing to keeping the package up to date as promptly as
possible; else weird  things happen and there are no real good solutions for
this.  E.g. we have seen in the past that due to security issues, a jitsi
dependency  needs to be upgraded, but some package that jitsi-meet depends upon
also has an upper limit on that package's version.

A note was added to the manpage in order make it explicit that maintenance of
this type can be sponsored to ensure its proper functioning.

Closes #15 by using `__file`. This will also allow us to have more control over
jicofo's settings, which might be important when we start doing recordings.

Sponsored by:	lafede.cat
2022-04-10 19:45:08 +02:00
sparrowhawk af04f7464b
[__nginx_vhost]: follow Alpine vhost default directory change.
Since nginx package version v1.10.1-r3, Alpine packagers have changed
the default vhost directory from conf.d to http.d [0]. This reflects
this change.

[0]: alpine package commit 383ba9c0a200ed1f4b11d7db74207526ad90bbe3
2022-03-14 16:15:58 +01:00
sparrowhawk a6f6a7fba8
[__jitsi_meet]: Fix deprecated usage of __debconf_set_selections.
Replace the --file parameter with the --line parameter, as recommended
since cdist 6.9.6.
2022-03-14 15:30:11 +01:00
evilham a1b3a034c7
[__jitsi_meet_domain] Support the --state parameter
This enables removing domains in a simple fashion.

Closes #3.
2022-03-10 21:28:28 +01:00
evilham ac99cd8d84
[__jitsi_meet_domain] Update to 2.0.7001-1
Obsoletes #13
2022-03-10 21:23:45 +01:00
evilham ac03f05766 [__jitsi_meet] Fix bug with secured domains
This is a leftover from when we were using __line instead of __block.

Closes #15

Reported by:  @pedro
2022-03-10 21:20:52 +01:00
evilham ecd10de2d3
[__opendkim*] FreeBSD support and minor fixes
While adding FreeBSD support to the type I noticed various issues:

- We were making sure that the KeyTable and SigningTable were created in
  __opendkim_genkey, but that was being done with the default cdist permissions
  (0400) which could result in issues when reloading the service after privilege
  drop.
  This is addressed by checking that it exists/creating it in __opendkim (just
  once, not once per __opendkim_genkey call) with laxer permissions (0444).
- In __opendkim, the service was being started after the config file was
  installed. This is insufficient as OpenDKIM will refuse to start with the
  generated config if either SigningTable or KeyTable do not exist yet.
- __opendkim_genkey had the implicit assumption that the --directory parameter
  always ended in a slash. This was not documented and error-prone; we are now
  a bit laxer and add the trailing slash if it is missing.
- __opendkim_genkey was not changing permissions for the resulting .txt file.
  This was not critical for it to function, but it was inconsistent.
- As documented in #17, __opendkim allows for a --userid parameter that might
  cause issues with keys generated by __opendkim_genkey.
  This issue has not been addressed yet, but I recommend deprecating the
  --userid parameter.
2022-03-10 20:08:51 +01:00
sparrowhawk 422b97bc1b
[systemd_resolved]: make singleton. 2022-02-28 16:18:51 +01:00
sparrowhawk f6d0cbbeb7
__systemd_resolved: initial implementation. 2022-02-28 16:18:49 +01:00
fnux 9a779aafa3
__matrix_synapse: add --disable-{displayname,3pid}-changes flag 2022-02-08 13:45:29 +01:00
sparrowhawk 727fbd55fb
[bird_radv] Add option to include MTU in RAs. 2022-02-07 13:46:08 +01:00
sparrowhawk 6310db7301
[bird_bgp]: minor cleanup. 2022-02-07 13:33:57 +01:00
sparrowhawk 3f52e758fc
__systemd-network: initial implementation. 2022-02-02 14:09:16 +01:00
sparrowhawk 4fdba43dd6
[__matrix_synapse]: typos in manpage. 2022-02-02 11:49:50 +01:00
fnux c32a1836aa
__matrix_synapse: add --sso-template-dir parameter 2022-01-24 11:23:38 +01:00
fnux 287d8df9bd
__matrix_synapse: set message min lifetime (although currently ignored
by synapse)
2022-01-24 08:56:12 +01:00
fnux 723d7ed250
__matrix_element: add more branding parameters 2022-01-16 14:14:42 +01:00
fnux 974e42e20e
__matrix_synapse: add --saml2-mapping-provider-extra-settings flag 2022-01-16 12:41:37 +01:00
fnux c198a74a34
__matrix_element: add --identity_server_url flag 2022-01-12 16:22:41 +01:00
fnux 35e1477521
__matrix_synapse: fix ignored --enable-3pid-lookups flag 2022-01-12 16:22:41 +01:00
fnux b2c1fee672
__matrix_synapse: add --saml2-mapping-provider-module flag 2022-01-12 16:22:41 +01:00
fnux eecb2b4629
__bird_ospf: ass -extra-area-configuration parameter 2022-01-11 16:12:45 +01:00
sparrowhawk 023206d3d9
borg-repo: add ubuntu as supported OS. 2022-01-11 09:24:43 +01:00
fnux c466733111
__matrix_synapse: add --enable-3pid-lookups flag, normalize indentation 2022-01-07 11:42:13 +01:00
fnux afe76af679
__matterbridge: add support for ubuntu, fix configuration via STDIN 2021-12-23 12:30:58 +01:00
fnux 35e299a5d1
__matrix_synapse: add --saml2-sp-key and --saml2-sp-cert flags 2021-12-23 10:46:21 +01:00
evilham e052178122 [__jitsi*] Update to 2.0.6726
Sponsored by: plataformess.org
2021-12-22 20:05:37 +01:00
fnux a38275f6d7
__uacme*, __nginx: allow external ACME provider, EAB authentication 2021-12-14 12:37:18 +01:00
fnux 698525fcd2
__matrix_synapse: add saml2-idp-medatada-url flag to manpage 2021-12-06 08:41:13 +01:00
fnux 7b27eb5445
__matrix_synapse: add --default-identity-server flag 2021-12-02 13:07:06 +01:00
fnux 96beae4c2f
__matrix_synapse:add --smal2-idp-metadata-uri flag 2021-12-02 11:38:26 +01:00
fnux d872f1d4f0
__matrix_synapse: add --turn-username and --turn-password flags 2021-12-01 15:55:34 +01:00
fnux 08e81d1e97
__matrix_synapse: fixe ignored registration-shared-secret parameter 2021-12-01 08:32:37 +01:00
fnux 25406ea3a0
__matrix_synapse: add support for Ubuntu 2021-11-30 13:32:03 +01:00
fnux fc6764be44
__matrix_synapse_worker: change synapse call to fit matrix.org packaging 2021-11-16 15:13:16 +01:00
fnux 18f02e24aa
__matrix_synapse: use upstream matrix.org APT repository on debian 2021-11-16 14:16:37 +01:00
evilham 1af7e960fa [__single_binary_service] Many improvements + runit support
Amongst other things compressed files can be of a type other than .tar.gz (it
remains the default) and we now properly support runit services, FreeBSD and
Devuan.
2021-10-30 15:38:26 +02:00
evilham 2038244ec4 [__runit*] Add support for Debian/Devuan
Apparently these types were only supporting FreeBSD, this brings in support for
Debian and Devuan by taking advantage of
https://packages.debian.org/bullseye/runit-run
2021-10-30 10:40:01 +02:00
evilham 30c72c1033 [__jitsi_meet] Fix shellchek of unused variable 2021-10-01 12:00:50 +02:00
evilham affd398cff [__jitsi*] Update to 2.0.6293 2021-10-01 11:51:50 +02:00
sparrowhawk c64997d8fb
__bird_ospf: add stubnets option
This commit adds the ability for the bird OSPF type to use stubnets.
2021-09-15 17:00:33 +02:00
evilham 3e77fbbb43 [__single_binary_service] Do not use echo echo echo 2021-08-04 21:02:37 +02:00
evilham afa48b1028 [__single_binary_service] Support customisation of systemd units
Requested by pedro
2021-08-04 21:00:52 +02:00
evilham c5929f397d [__single_binary_service] Adapt bug fixes proposed by pedro
there are several typos, some style issues and now there is at most one service
restart in all cases.

Submitted by:   pedro <git2021@cas.cat>
2021-08-04 20:27:08 +02:00
sparrowhawk 58ac59edb2 Merge branch 'nginx' into 'master'
nginx types

See merge request ungleich-public/cdist-contrib!40
2021-07-06 16:56:29 +02:00
fnux 735a1dddca
__nginx: add minimal usage example 2021-07-06 16:43:52 +02:00
fnux 653c85e948
__nginx_vhost: complete truncated sentence in manpage 2021-07-06 16:43:16 +02:00
fnux 080197e60c Merge branch 'newtype/networktime' into 'master'
Add __networktime type.

See merge request ungleich-public/cdist-contrib!42
2021-07-06 15:47:15 +02:00
sparrowhawk 55d832851d
Add __networktime type. 2021-07-06 14:44:07 +02:00
fnux f116272f92
__nginx_vhost: drop mention of unsupported FreeBSD from manpage 2021-06-23 10:47:21 +02:00
fnux 502cb54ce2
__nginx_vhost: make configuration reload more robust 2021-06-23 10:46:10 +02:00
fnux 8db890deb4
Unbrand nginx types from e-Durable 2021-06-22 13:50:48 +02:00
fnux 41cf480b25
Import nginx types from e-Durable's cdist repositories 2021-06-22 13:46:32 +02:00
evilham d5b552ddb4 [__single_binary_service] Add manpage, config-file and better absent
With these changes the type is good for general consumption (modulo the
limitations mentioned in the manpage under TODO).
2021-06-18 22:01:45 +02:00
evilham 51d0b817fe [__single_binary_service] Type to manage very simple services. 2021-06-18 20:52:58 +02:00
sparrowhawk af66c7e753 Merge branch 'newtype/wireguard' into 'master'
Add types to create wireguard VPN.

See merge request ungleich-public/cdist-contrib!14
2021-06-09 16:37:06 +02:00
sparrowhawk 87c43b042d newtype: __wireguard. 2021-06-09 16:37:05 +02:00
sparrowhawk 2f4c92803b
[__bird_core]: make configuration file depend on bird being installed.
This is required for correct file ownership upon a clean installation.
2021-06-08 18:52:03 +02:00
sparrowhawk c6474593df Merge branch 'newtype/opendkim' into 'master'
New type: __opendkim
New type: __opendkim_genkey

See merge request ungleich-public/cdist-contrib!37
2021-05-31 11:25:31 +02:00
sparrowhawk bcf88606ea Implement __opendkim and __opendkim_genkey type. 2021-05-31 11:25:29 +02:00
evilham 05f2bd394c Merge branch 'fix_jitsi_user_manifest' into 'master'
[__jitsi_meet_user] adds user validation and directory creation

Closes #7

See merge request ungleich-public/cdist-contrib!35
2021-05-23 19:15:14 +02:00
pedro b07ac7a732 [__jitsi_meet_user] refactor user validation
improve user validation and the corresponding docs

coauthored with evilham :D
2021-05-23 19:15:14 +02:00
evilham 8245f8f0c7 Merge branch '9_fix_multidomain' into 'master'
[__jitsi_meet_domain] fixes #9 multidomain error

Closes #9

See merge request ungleich-public/cdist-contrib!38
2021-05-23 18:33:55 +02:00
evilham 725c272e81 Merge branch '8-jitsi-meet-nginx-hash-bucket' into 'master'
[__jitsi_meet*] Relocate hash_bucket_size nginx directive

Closes #8

See merge request ungleich-public/cdist-contrib!39
2021-05-23 18:33:06 +02:00
evilham b26657426d Merge branch '6_jitsi_welcome_logo' into 'master'
[__jitsi_meet_domain] fixes #6 welcome logo

Closes #6

See merge request ungleich-public/cdist-contrib!31
2021-05-23 18:31:08 +02:00
pedro e4396500a7 [__jitsi_meet_domain] fixes #6 welcome logo
the approach is to include a new template for the interface_config.js which
will allow to add other customizations to come
2021-05-23 18:31:08 +02:00
evilham d4f303c64b [__jitsi_meet*] Relocate hash_bucket_size nginx directive
This was causing issues in multi-domain scenarios where it'd get duplicated.

Fixes #8
2021-05-23 11:45:54 +02:00
pedro 0612483115 [__jitsi_meet_domain] fixes #9 multidomain error 2021-05-21 03:26:50 +02:00
fnux 916862f7ab Merge branch 'unbound-ng' into 'master'
__unbound: create more generalized type.

See merge request ungleich-public/cdist-contrib!36
2021-05-14 08:32:26 +02:00
sparrowhawk 6eab68f081
__unbound: add missing functionality. 2021-05-12 14:48:57 +02:00
sparrowhawk a7d51bee35
__unbound: update examples. 2021-05-12 14:21:03 +02:00
sparrowhawk a3e59377df
__unbound: create more generalized type. 2021-05-12 12:33:21 +02:00
sparrowhawk 5d1c9ff1d8
Fix indentation in __bird_static. 2021-05-12 12:32:39 +02:00
sparrowhawk c4a881140c Merge branch 'newtype/bird-radv' into 'master'
Add __bird_radv type.

See merge request ungleich-public/cdist-contrib!33
2021-05-11 15:03:01 +02:00
sparrowhawk f16e452881
Add __bird_radv type. 2021-05-11 14:49:15 +02:00
evilham fbdcd8d6fc [__jitsi_meet*] Improve documentation
Also improve __jitsi_meet_user's support for removing users in that a password
is not required to remove them.
2021-05-10 17:04:44 +02:00
evilham a90c8b18e5 Merge branch 'jitsi_secured_domains' into 'master'
See merge request ungleich-public/cdist-contrib!34
2021-05-10 16:40:47 +02:00
pedro 87bc766115 [__jitsi_meet*] Add parameters for secure domains
This is done with slight adaptations from the official guide at
https://jitsi.github.io/handbook/docs/devops-guide/secure-domain

Amongst other changes, we rely on Prosody's configuration parser only overwriting the parts of a VirtualHost that are explicitly specified in "later appearing" (lexicographically speaking) files.
This allows us to let Jitsi manage the main config file and adding the few customisations on top of it.
We also use the Plaintext authenticator as this is enough atm and is the easiest to manage in an idempotent fashion; support for other authentication mechanisms is possible, see Prosody's documentation for that.
2021-05-10 16:40:46 +02:00
evilham ccd3f364e4 [__jitsi_meet_domain] Support passing the branded index in stdin 2021-05-10 12:55:12 +02:00
evilham 9de330a945 Merge branch 'jitsi-fix-versioning' into 'master'
[__jitsi_meet] Update to 2.0.5765, add versioning parameter.

See merge request ungleich-public/cdist-contrib!32
2021-05-10 12:21:58 +02:00
evilham 2a97346979 [__jitsi_meet] Update to 2.3, add versioning parameter.
Jitsi's repositories have rotated keys, this removes the previous key if
necessary and ensures the new key is present.

Can't be merged until following lands:
  https://code.ungleich.ch/ungleich-public/cdist/-/merge_requests/994
since we rely on `--use-deprecated-apt-key` and the improvements in the type to
modify the keyring in a reliable fashion.

This also updates the exporter to version 1.1.5 released on April 25th 2021.
2021-05-10 12:21:57 +02:00
sparrowhawk 92d5753414
__jool: make __start_on_boot depend on package. 2021-05-07 17:54:31 +02:00
sparrowhawk cbc91a500f
__bird_static: update to use `channel` param instead of `ipv4` switch. 2021-05-07 17:54:10 +02:00
evilham 42a44ffed6 [__jitsi_meet_domain] Stop using deprecated flags 2021-05-07 14:27:52 +02:00
evilham c3dbbc9d0d [__jitsi_meet_domain] Updated version and fixed branding issues
commit 80599bb91a63cef61c00900c97ea89d7ab8cb799
Author: Evilham <cvs@evilham.com>
Date:   Thu Apr 29 20:36:11 2021 +0200

    [__jitsi_meet_video] Fix shellcheck

commit 6d25c36c01ba76a0465f2cc676b8205f09bf1160
Author: pedrolab <531310-pedrolab@users.noreply.gitlab.com>
Date:   Wed Apr 28 22:02:31 2021 +0200

    [__jitsi_meet_domain] config.js to 2.0.5765-1

    thanks @evilham

commit e60a46f8d2124859ce2ea4a6fbe8e7d37deef3d6
Author: pedrolab <531310-pedrolab@users.noreply.gitlab.com>
Date:   Wed Apr 28 22:00:13 2021 +0200

    [__jitsi_meet_domain] fixes #4 branding
2021-04-29 20:43:22 +02:00
fnux 5581cbabf9 Merge branch 'jool' into 'master'
Implement __jool type.

See merge request ungleich-public/cdist-contrib!28
2021-04-21 16:03:43 +02:00
sparrowhawk 6a0647cd90
[__jool]: fail on unkown alpine kernel. 2021-04-21 16:01:24 +02:00
sparrowhawk 40d19f0ad6
[__jool] Use explorer to determine alpine kernel version. 2021-04-21 15:35:36 +02:00
sparrowhawk 272e4669fe
Implement __jool type. 2021-04-21 15:35:36 +02:00
sparrowhawk f181b5ddb4
Pull updates to __borg_repo from recycled.cloud types. 2021-04-21 15:27:52 +02:00
fnux ed2f891200 Merge branch 'newtype/pass' into 'master'
Initial implementation of the __pass type.

See merge request ungleich-public/cdist-contrib!19
2021-04-21 08:50:18 +02:00
fnux af9f718a19 Merge branch 'newtype/bird-xxx' into 'master'
Add bird_xxx types.

See merge request ungleich-public/cdist-contrib!27
2021-04-19 14:06:48 +02:00
sparrowhawk 3f0798d645 Add bird_xxx types. 2021-04-19 14:06:47 +02:00
fnux 2d0491dafd
[__unbound_exporter] fix chicken-egg problem for service start 2021-04-08 17:31:57 +02:00
fnux 16b5158ef5 Merge branch 'uacme' into 'master'
TLS certificates with uacme

See merge request ungleich-public/cdist-contrib!25
2021-03-27 18:18:04 +01:00
sparrowhawk 73c14825bc
Fix remarks on __uacme_obtain. 2021-03-16 13:04:26 +01:00
sparrowhawk f4caa52750
Cleanup renew.sh.sh so the output is more elegant. 2021-03-16 13:03:25 +01:00
sparrowhawk 5d9bebbdb5
Fix remarks on __uacme_account. 2021-03-16 13:02:51 +01:00
sparrowhawk 5e2a28d929
Remove -x from renew.sh script to avoid empty cron messages. 2021-03-16 11:04:26 +01:00
fnux c80d041e1c Merge branch 'wikijs-user' into 'master'
[__wikijs] run under own user

See merge request ungleich-public/cdist-contrib!26
2021-03-08 09:44:42 +01:00
fnux 859a156cef
[__wikijs] run under own user 2021-03-01 07:23:47 +01:00
fnux 71c28b9d1f Merge branch '__matrix_synapse' into 'master'
__matrix_synapse types

See merge request ungleich-public/cdist-contrib!9
2021-02-26 08:34:54 +01:00
fnux 3263c5dddd
[__matrix_synapse] add outbound-federation-worker parameter 2021-02-24 19:31:48 +01:00
fnux e10ae4d0a7
[__matrix_synapse] Wire parameters for PGSQL pool size 2021-02-24 18:50:01 +01:00
fnux 7983e341e5
[__matrix_synapse] fix yet more typos in parameter handling 2021-02-24 17:58:42 +01:00
fnux 4e37bc2245
[__matrix_synapse] fix typo in complexity threshold handling 2021-02-24 14:36:00 +01:00
fnux b3f5244cd6
__matrix_synapse: fix SMTP password handling 2021-02-22 13:59:53 +01:00
fnux d589993c6d
[__matrix_synapse] fix typo/error in LDAP configuration handling 2021-02-22 13:12:47 +01:00
fnux f27e65f8e0
[__matrix_synapse*] add --bind-address flag 2021-02-19 11:25:16 +01:00
fnux 1370abb991
[__uacme_*] Import from cdist-recycledcloud 2021-02-19 10:44:58 +01:00
fnux f1bab1e23b
[__wikijs] add missing executable bit to initd service 2021-02-19 09:19:24 +01:00
fnux 028583f096
[__matrix_synapse_worker] fix config-path parameter in systemd unit 2021-02-18 16:10:04 +01:00
fnux 467a1350bf
[__matrix_synapse_worker] bind both v6 and v4, set x_forwarded 2021-02-18 16:03:59 +01:00
fnux f3d8717e69
[__matrix_synapse] fix typo in __apt_backports call 2021-02-18 14:32:41 +01:00
fnux 6487839cf5
[__matrix_synapse_worker] various tweaks and fixes following testing 2021-02-18 14:10:19 +01:00
fnux adc335669d
[__matrix_synapse] use __apt_backport instead of __apt_source 2021-02-18 14:09:44 +01:00
fnux 12575d661b
[__matrix_synapse] add documentation for --registration-shared-secret 2021-02-18 14:09:33 +01:00
fnux e8b0ced1b1
[__matrix_synapse] various configuration fixes 2021-02-18 11:27:34 +01:00
fnux c84831331e
[__matrix_synapse_worker] add forgotten variable export 2021-02-17 14:02:02 +01:00
fnux 33bf0fd416
[__matrix_synapse] wire TLS certs, fix some templating errors 2021-02-17 14:01:06 +01:00
fnux 37762dd1ca
[__matrix_synapse_worker] initial implementation 2021-02-17 10:52:29 +01:00
fnux 2bcc815555
[__matrix_synapse] wire up worker mode 2021-02-17 10:15:01 +01:00
fnux a1ad30f0c5
[__matrix_synapse] refresh manpage, fix various parameter handling issues 2021-02-17 09:44:50 +01:00
fnux 409591f7e7
ci: do not run docs job in forks 2021-02-16 13:47:09 +01:00
fnux c4057f267f
Update cdist-recycledcloud URL in README 2021-02-16 13:36:29 +01:00
fnux b37cf58acf
Mention ungleich's cdist-ungleich repository in README 2021-02-16 08:52:53 +01:00
fnux 5b70dbd3e9
__matrix_synapse: refresh configuration template and type parameters 2021-02-15 18:50:12 +01:00
sparrowhawk 2d5b32db1c
Wrap gencode-local in a heredoc. 2021-02-13 15:45:26 +01:00
Nico Schottelius f6d79e91ff [__unbound] Add missing dns64-prefix parameter 2021-02-12 14:09:31 +01:00
fnux 25849bbda1
__matrix_synapse: use dash instead of underscore in parameter names 2021-02-12 09:58:48 +01:00
fnux ce09c402b1
__matrix_synapse: make shellcheck happy! 2021-02-11 16:17:09 +01:00
fnux 8a27e5ef22
Import __matrix_synapse type from ungleich's dot-cdist 2021-02-11 16:17:08 +01:00
fnux 0437d9b9dd Merge branch 'nextcloud' into 'master'
__nextcloud types

See merge request ungleich-public/cdist-contrib!18
2021-02-10 10:23:29 +01:00
fnux e3aa8bd592 Merge branch 'jitsi-exporter-1.1.3' into 'master'
[__jitsi_meet] Upgrade prometheus jitsi exporter to 1.1.3

See merge request ungleich-public/cdist-contrib!24
2021-02-09 11:50:35 +01:00
evilham 7b892e1332 [__jitsi_meet] Upgrade prometheus jitsi exporter to 1.1.3
This also fixes a typo in the URL that resulted in the exporter not being
installed '-.-.
2021-02-06 20:36:57 +01:00
fnux 75d901c8e4 Merge branch 'jitsi' into 'master'
Jitsi Meet (and runit) types

See merge request ungleich-public/cdist-contrib!21
2021-01-27 21:04:42 +01:00
sparrowhawk 0d431d086c
Split initializing the password store from generating passwords. 2021-01-27 16:06:28 +01:00
fnux 1a4e95c821 Merge branch 'unbound-nodns64' into 'master'
Allow non-dns64 unbound setup, normalize unbound type parameters

See merge request ungleich-public/cdist-contrib!20
2021-01-25 07:36:58 +01:00
fnux fd55a6e8dc Merge branch 'fix/__matrix_element/tarball' into 'master'
__matrix_element: fix download tarball name

See merge request ungleich-public/cdist-contrib!23
2021-01-25 07:24:53 +01:00
matze b2b2add4c6 __matrix_element: fix download tarball name
All releases after 1.7.14 have a diffrent tarball name than releases
before this. This finally takes over the new name.

The version comparement function was taken from __sensible_editor, to
provide backward compatibility to older versions (if someone needs it).

Maybe this logic can be removed in a while ..
2021-01-24 09:25:02 +01:00
fnux 87d4c33e26
Make shellcheck happy with the __jitsi_* types 2021-01-13 08:54:28 +01:00
fnux a1620e8221
__jitsi_meet: remove forgotten/invalid requirement 2021-01-12 16:32:29 +01:00
fnux 4918ef464f Merge branch 'wikijs' into 'master'
Add a type for wikijs.

See merge request ungleich-public/cdist-contrib!15
2021-01-12 08:38:21 +01:00
fnux 8929c566fc
__wikijs: remove uneeded npm install call
See https://github.com/Requarks/wiki/issues/1325.
2021-01-12 08:37:20 +01:00
fnux 7122fe1bee
__wikijs: add version management and HTTP(S) port configuration 2021-01-12 07:58:42 +01:00
sparrowhawk 647833580d
Split out service management from the installation type. 2021-01-12 07:58:42 +01:00
sparrowhawk ef748cf8e2
Fix typo and drop use of useless tempdir. 2021-01-12 07:58:42 +01:00
sparrowhawk 0e4bc443e2
Add a type for wikijs. 2021-01-12 07:58:42 +01:00
fnux f4375dbbb9 Merge branch 'dma-type' into 'master'
Add __mail_alias, __dma* types

See merge request ungleich-public/cdist-contrib!6
2021-01-12 07:15:55 +01:00
fnux 7cef989b1f
Fix run-shellcheck.sh following 'conflict resolution' from gitlab web ui 2021-01-12 07:14:24 +01:00
fnux bf90e55137 Merge branch 'master' into 'dma-type'
# Conflicts:
#   scripts/run-shellcheck.sh
2021-01-12 07:10:10 +01:00
fnux ac63762653
'unbrand' evilham's runit types 2021-01-11 14:18:41 +01:00
fnux 367cbde75b
Import evilham's runit types as it 2021-01-11 14:18:41 +01:00
fnux d3bf8512ec
'unbrand' evilham's jitsi types 2021-01-11 14:18:41 +01:00
fnux f055527735
Import evilham's jitsi types as-it 2021-01-11 14:18:41 +01:00
Dennis Camera f9f5c578f7 [type/__dma*] Fix shellcheck errors 2021-01-11 12:16:09 +01:00
fnux f01f73f33d
Remove mention to legacy mattermost room from README 2021-01-11 11:58:21 +01:00
fnux 73e31e6d1e
Mention known external cdist resources in README 2021-01-11 11:56:37 +01:00
fnux ec0dc30c87
Generate documentation homepage from README 2021-01-11 11:34:54 +01:00
fnux ec41ef3490
Patch sftp call for doc deployment in CI 2021-01-11 11:05:09 +01:00
fnux 2bedbe9687
Automatically deploy docs from master (at contrib.cdi.st) 2021-01-11 10:55:25 +01:00
fnux 5a05b87beb
__unbound: normalize flag format 2021-01-04 11:45:04 +01:00
fnux cd83336322
Use our own image for CI 2021-01-04 11:26:45 +01:00
fnux 9f4a85901e
Import html/man doc generation logic from upstream cdist 2021-01-04 11:08:55 +01:00
fnux 006987307f
__unbound: make the --dns64-prefix flag optional 2021-01-04 09:43:37 +01:00
matze 73e77f5b4d __nextcloud: add db:convert-filecache-bigint command
Looks like this command should be executed on upgrades, too.
2020-12-25 20:14:04 +01:00
matze 1a233062a5 __nextcloud: harden here-doc for su call
Because the here-doc will be evaluated again by the shell, it will was
changed to avoid this. Because the script does not depend on such
function, it will be done in faviour of special characters.
2020-12-25 11:44:32 +01:00
matze b6db7b5ca8 __nextcloud: suppress global warnings from occ
As it's the default for __nextcloud_app and __nextcloud_user, it will
now suppress global warnings, too. This will be done because nobody
cares about then, only about the errors generated from the executed
command.
2020-12-21 19:04:53 +01:00
sparrowhawk 1b2d41a34a
Initial implementation of the __pass type. 2020-12-17 13:29:03 +01:00
matze c89bb59409 __nextcloud: add database maintainer command for upgrades
After my update to 20.0.2, Nextcloud complained about missing primary
key indexes. I don't know if it existed before that version, but
adding it to make life easier .. as no one will propably install an
older version than Nextcloud 20.0.2.
2020-11-20 19:23:40 +01:00
matze c0b3f79229 __nextcloud{,_user}: Updated manpages 2020-11-16 19:32:10 +01:00
Dennis Camera 487574c865 [type/__dma] Convert AWK to loop over same file twice 2020-11-16 14:15:52 +01:00
Dennis Camera 0932c9ccde [type/{__dma,__dma_auth,__mail_alias}] Quote things properly 2020-11-16 14:10:52 +01:00
Dennis Camera 7e20d13b9f [type/__mail_alias] Use explicit line variables in update_aliases.awk 2020-11-16 13:58:05 +01:00
Dennis Camera 04076a75eb [type/__mail_alias] man.rst: Make bugs a list 2020-11-16 13:57:34 +01:00
matze ee650d88ed __nextcloud_{app,user}: Updated man cause of __nextcloud changes
Also, the `gencode-remote` scripts where marked executeable.
2020-11-15 19:14:31 +01:00
matze 3fda91ca2f __nextcloud: add comments about the maintenance mode
... because it not always work like you want it.
2020-11-15 17:40:02 +01:00
matze 32417aba34 __nextcloud: aborts at installation with pgsql/mariadb
Accidentally, there was a check for a parameter that could not exist.
The block is now streamlined as other parameters got handled, too :-)
2020-11-15 16:34:26 +01:00
matze c24aedd4db __nextcloud: remove --webroot parameter
Because the detection of the webroot is not that good, it was removed.
Now, the object id contains the full path of the nextcloud installation.

This changes the installation process a bit, as it will download the
tarball to /tmp rather the webroot.

Also, this commit contains a bit overhaul work.
2020-11-15 16:21:56 +01:00
fnux 2e02c413b6 Merge branch 'netbox' into 'master'
__netbox type

See merge request ungleich-public/cdist-contrib!12
2020-11-04 09:24:18 +01:00
fnux e8c731c384 Merge branch 'netbox' into 'netbox'
__netbox type improvements

See merge request ungleich-public/cdist-contrib!17
2020-11-04 09:23:22 +01:00
matze 7490cef49e Initial __nextcloud_app type
Overall complete, more functionalitly is currently out of scope.
2020-10-31 16:50:06 +01:00
matze 9ed1a9cbfd __nextcloud_user: fix misspelled quota parameter 2020-10-31 16:25:35 +01:00
matze d0f597b9e4 __nextcloud: added manpage notes
.. and some more.
2020-10-31 14:27:47 +01:00
matze a82a880858 __nextcloud_user: finished manpage 2020-10-31 12:26:36 +01:00
matze 30205b38ae __nextcloud_user: add --quota paramter 2020-10-31 11:44:31 +01:00
matze 82283d0b1c __nextcloud_user: new parameters to prevent changes to the user
This adds new parameters `--only-setup` and `--keep-*` to prevent
certain parameters to be changed in Nextcloud. This will not apply to
the setup.
2020-10-31 09:47:38 +01:00
matze 635f03f527 __nextcloud_user: use `occ group:` commands
Instead of the self-tinkered php code, the correct occ command is used
now.
2020-10-30 20:08:32 +01:00
matze 1e1df1016d __nextcloud_user: add manpage 2020-10-30 20:05:12 +01:00
matze b0ed6b2f18 Initial __nextcloud_user type
This type setup and updates a nextcloud user account. Currently not
finished yet, but should work in all cases.
2020-10-30 19:14:24 +01:00
matze 072ca37720 __nextcloud: stricter check configuration values
This now checks the configuration value exactly and does not say there
are equal if just the end of the string differs.

Resulting from this, it will run code the next run if the default port
was in a database migration. This was fixed by instantly correct this
configuration value.
2020-10-26 19:19:49 +01:00
matze b368102bd5 __nextcloud: misc adjustments
Mostly to the manpage, but some minor fixes, too.
2020-10-25 20:29:57 +01:00
matze 87e115da98 __netbox: some manpage fixes
Mostly invalid links ..
2020-10-25 19:13:10 +01:00
matze 77b530eefb __nextcloud: update manpage
Added webroot detection, examples and notes. Should be complete now.
2020-10-25 18:57:02 +01:00
matze 809ad7aa9d __nextcloud: migrate if the database type change
This adds a migration progess if the database type changes automaticly.
2020-10-25 14:55:11 +01:00
matze facb204749 __nextcloud: move data directory if destination changes
The type now handles the case when the data directory will be moved to
an other location. To this, adjustment to the "maintainer mode" on
setting and the manpage.
2020-10-24 21:09:35 +02:00
matze 3bda4cf0c8 __nextcloud: respect installer default values
To do not override default values from the nextcloud installer script,
they are accepted as default values if the user did not set any value.
2020-10-24 17:29:38 +02:00
matze f5c988c0f2 __nextcloud: make some db parameters mandatory
Some database parameters are required if the type is `mysql` or `pgsql`.
Also, the variants of the parameter --database-type decreased to those
that work with the configuration, as it is directly mapped to the
parameter.

The functions in `map-conf-changes.sh` where extended to support the
conditional mandatory argument to throw an error if this parameter is
set.
2020-10-24 16:46:19 +02:00
matze b6f4da7692 __nextcloud: completly respect --install-only parameter
This commit changes the manifest to do not check for too low versions
and does not download and unpack a tarball if available if the parameter
--install-only is set. This should make it useable now.

Also, a short message change to match the manual.
2020-10-24 15:39:54 +02:00
matze ea58f98ecb __nextcloud: added initial manpage
Still somehow a draft ..
2020-10-24 13:36:26 +02:00
matze 3db4dcc6ea __nextcloud: add --data-directory to config 2020-10-24 12:56:06 +02:00
matze 0a0e4d26b4 __nextcloud: fix shellcheck
Mostly simply because of php inline code .. also because of the argument
generation for the installation setup.
2020-10-24 10:10:30 +02:00
matze 979398e398 Initial __nextcloud type
This type should work, but there are still many things to do here to
work nice and well.

Things that currently not work (well):
  - not all parameters work for now
  - nextcloud installations in subfolders (e.g. slashes in the object id)
2020-10-24 09:24:49 +02:00
matze c1d5d5b088 __netbox: remove dependency to package virtualenv
This is not required any more because it was completly replaced by
`python3-venv`. The venv handling is already given to `__pyvenv`.
2020-10-24 08:52:43 +02:00
matze 46bff41f6d __netbox{,_uwsgi}: updated manpages
Mostly added notes of what does not work that well.
2020-10-17 11:22:47 +02:00
matze 558021d2ee __netbox: reorder generated code for shorter transition
Now, the venv and pip things are done before the program files are
replaced, which should minimize the outage where the application is not
available.
2020-10-17 11:08:11 +02:00
matze 9def5700c8 __netbox: replace redis DEFAULT_TIMEOUT with RQ_DEFAULT_TIMEOUT
The first one was deprecated by the second one.
2020-10-17 10:21:52 +02:00
matze 144cae3b79 __netbox: use __pyenv and remove obsolete netbox stop
Now, the python venv is now created via `pyvenv` or `python3 -m venv`
instead of the legacy `virtualenv`. For this, not all python processes
from the venv need to be stopped.

Migration from previous versions of this type may be difficult, but
solvable if the venv will be recreated.
2020-10-17 10:16:25 +02:00
matze 72f2996c50 __netbox*: fix shellcheck SC2162 2020-10-11 16:56:54 +02:00
matze 32c95ccb22 __netbox: don't call `pip3 uninstall` if nothing available
To avoid an error from pip, it will be checked if there are packages to
uninstall. This is better than just doing `|| true`.
2020-10-11 16:50:22 +02:00
matze 13e97d171b __netbox*: added systemd socket support
The Gunicorn type now supports systemd sockets only. With uWSGI, you can
choose between it and the native sockets based on the parameters chosen.
This is done because it could not be implemented to have multiple
protocols with the systemd sockets (so you may choose).

The systemd socket unit file is generally available, so both types use
the same script to generate the socket unit file.
2020-10-11 16:39:19 +02:00
matze 3b780c4794 __netbox: fixup small bugs and venv process killing
Changed flag (force to ignore a non-existant directory), typo and
swapped arguments are done. Also, the process to stop all processes from
the virtal environment has changed: Now, it stops all potential services
and ignore errors (because a service doesn't exist).

After that, it sends a kill signal to all processes and then gracefully
wait since there is no option to do that with systemd.
2020-10-08 19:54:48 +02:00
matze 0b3bc14530 __netbox: adjusted command flags
Mostly added -q to the pip calls. Also forced the temp directory removal.
2020-10-06 17:29:31 +02:00
matze 8f1b56026c __netbox: force link creation for config files
This adds the force flag to `ln` to avoid aborts cause the link already
exists and so forth. It also adds robustness to the execution.
2020-10-05 19:02:05 +02:00
matze 0c85b2d3fd __netbox: uninstall not anymore required packages
This code tries to remove packages not needed anymore. As it presumably
not removing dependencies, it's not that perfect pice of script.
2020-10-05 18:26:47 +02:00
matze 14f7cf8839 __netbox: set --data-root default value
The default value is set to preserve all data saved by netbox. As
explained in the manpage, it sets the directory for all data directories
to `~netbox/data/` (would resolve to `/opt/netbox/data/`), so upgrades
will not remove this data.
2020-10-04 17:40:01 +02:00
Dennis Camera f76bcd3574 [type/__dma_auth] Update man.rst 2020-10-01 17:21:19 +02:00
Dennis Camera 1c9ab6e07b [type/__dma] Update man.rst 2020-10-01 17:18:01 +02:00
Dennis Camera f202d11124 [type/__mail_alias] Fix continuation line processing 2020-10-01 13:54:46 +02:00
Dennis Camera c6b795b3f9 [type/__mail_alias] Update man.rst and make --alias required 2020-10-01 13:31:00 +02:00
Dennis Camera 161e1e85f4 [scripts/run-shellcheck.sh] Do not shellcheck AWK and Python scripts 2020-10-01 13:31:00 +02:00
Dennis Camera 231f96de18 Error if expected environment variables are unset 2020-10-01 13:31:00 +02:00
matze 050812305b __netbox: add mange.py calls recommended from upstream
Calls where added because there are used upstream in the
`upgrade.sh`-Script, too.

Upgrade-Script:
  https://github.com/netbox-community/netbox/blob/develop/upgrade.sh
2020-09-28 20:04:22 +02:00
matze b55186544f __netbox: adding seperate /opt/netbox/cdist/ directory
Adding a place to keep all configuration stuff for cdist seperated from
the installation directory. For safety reasons.
2020-09-28 19:49:29 +02:00
Dennis Camera 2270c32ddb [type/__dma] Add missing license headers 2020-09-28 17:30:53 +02:00
Dennis Camera b48b48e404 [type/__mail_alias] Externalise AWK update script to separate file 2020-09-28 17:29:41 +02:00
Dennis Camera 6ae0808560 [type/__dma] Externalise AWK update script to separate file 2020-09-28 16:54:21 +02:00
Marko Seric 3feaea1d96 [type/__dma_auth] Externalise AWK update script to separate file 2020-09-28 16:43:31 +02:00
Dennis Camera d693bf5f90 Move auth_conf explorer from __dma_auth to __dma 2020-09-28 16:34:12 +02:00
Dennis Camera 445bc75deb [type/__dma_auth] Drop --server parameter
Currently, dma does not differentiate between login users on the SMTP server.
It will pick whatever entry it finds first
(https://github.com/corecode/dma/blob/v0.13/net.c#L531).
As a result, the --server parameter only adds confusion.
2020-09-28 15:35:58 +02:00
matze e800f42a6d __netbox: consistency with __systemd_unit --restart
This commit brings consistency into the --restart parameter for systemd
units. All units except the netbox wrapper service will be restarted on
unit change.
2020-09-09 20:33:20 +02:00
matze dd167f075d __netbox*: fix service restart order
Cause of corrupt databases if the services are restarted incorrectly,
the order and dependencies are adjusted. Now, the `netbox-rq` service
will be included in restarts of `netbox` and required for the WSGI
servers that it must running.

For these changes, the restart command of `__netbox` was adjusted. The
other ones where edited too, to use the same command.

All services now require redis and postgresql to be started before them
to prevent any start order issues.

If someone asked for what the RQ worker is required, see here:
 https://netbox.readthedocs.io/en/stable/additional-features/webhooks/#webhook-processing
2020-09-09 19:08:46 +02:00
matze 5d437839f6 __netbox: replaced secret key character set
The used character set should now only contain characters used by the
`netbox/generate_secret_key.py` program. Finially got correct escaping.
2020-09-08 19:52:03 +02:00
matze 549feb87f9 __netbox: fix --update-notify
Template script for the `configuration.py` interpreted the boolean flag
incorrectly and did the thing the user do not wanted.
2020-09-08 19:20:22 +02:00
matze 398a3da10e __netbox: fix gerneration random generated secret key
Because `/dev/random` was used, the `cdist config` could hang a long
time to get real random values. The pseudo-generated values through
`/dev/urandom` are fully enought for the secret key.
2020-09-08 18:10:15 +02:00
matze 3389752dec __netbox: fix detection of the secret-key to use
Mixed up a parameter. Should be correct now.
2020-09-07 17:23:22 +02:00
matze eed3515424 __netbox: add --ldap-staff-group parameter
Required to get "admin access".
2020-09-07 17:10:59 +02:00
matze 0afc7136f8 __netbox_uwsgi: fix if only --bind-to given
If the here-document is empty because no file could be found, an empty
line will be read. The new line of code will skip in those cases.
2020-09-06 18:39:07 +02:00
matze c9e4e8d7dc __netbox_{gunicorn,uwsgi}: add state parameter
Adds the --state parameter to both types. With it, the transition
between both types can be done smothly.
2020-09-06 13:44:03 +02:00
matze 3b07a660b3 __netbox_uwsgi: add hint to the --serve-static parameter 2020-09-05 22:55:43 +02:00
matze b10f6b71d0 __netbox: avoid useless generated code-remote
Because `set -e` got printed all the time, the type __netbox always had
some generated code for the remote side. This line was removed because
this is already done by cdist when executing the code-remote script.

Rather, the exit-on-error option was set to some scirpts (two ..).
2020-09-05 22:34:14 +02:00
matze 9d330a91bc __netbox_{gunicorn,uwsgi}: add netbox ownership to config file 2020-09-05 22:27:42 +02:00
matze 090a8f015e __netbox_uwsgi: fix uwsgi netbox service file
Revert working directory changes as the configuration file still needs
to be accessable. An absolute path would work, too, but it is not the
preferred way.

To still work with the python wsgi application, `--chdir` is used.
2020-09-05 22:08:37 +02:00
matze ffba3ae776 __netbox_uwsgi: add --serve-static parameter
New option to directly serve static content via uWSGI.
2020-09-05 22:01:15 +02:00
matze 5a403de057 __netbox_uwsgi: fix shellcheck
Fixed shellcheck cause of the find command. This required a bigger
change due to variables and subshell. Now, input is used through a
here-document.
2020-09-05 19:09:34 +02:00
matze 755bd9098e __netbox*: update systemd service files
The `uwsgi-netbox` service now works, also the `netbox` wrapper service.
The PID file was removed from the Gunicorn service as it is not required
and a bit more efford to move it to `/run/` due to permissions.

Generally, all depend on `network.target` instead of
`network-online.target` now, and signals for reload, stop and kill were
added (especially required the uwsgi service).
2020-09-05 15:18:49 +02:00
matze 314a0d4d8e __netbox: kill all running venv processes
To avoid aborts because of the python venv could not be updated by
killing all processes that uses the venv.

It will be done all times to prevent any error, because it could not be
reliably detected if the type installs or updates NetBox.
2020-09-05 13:53:05 +02:00
matze af91b6e3a1 __netbox_uwsgi: mark as singleton
This should have been done much earlier .. :/
2020-09-05 11:26:15 +02:00
matze 243e34f0a5 __netbox_uwsgi: enable further protocols to bind to
Enables multiple protocols like fastcgi or HTTP to bind to. This makes
it more flexible to use.

Also, a little fix for __netbox was done: correctly output a error msg.
2020-09-05 11:20:20 +02:00
matze 2805b6beff __netbox{,_gunicorn}: fix shellcheck directives 2020-09-02 09:15:45 +02:00
matze dbc91cb339 __netbox*: updated man pages 2020-09-02 07:50:12 +02:00
matze facb5a64d3 __netbox{,_gunicorn}: disabled shellcheck warnings
Shellcheck warned about creating content for a python array. As the
string will be printed literally into the config, the warning does not
match to the current case.
2020-09-01 13:20:31 +02:00
matze 9d8b3ebe74 __netbox: add wrapper service to manage the wsgi services
The wrapper service will "control" the services added from the
__netbox_* types to provide a general interface. This is more dynamic
than the alias approach used previously. Through this, it is possible
to handle multiple wsgi services for netbox - if this works ..

See as a reference:
  http://alesnosek.com/blog/2016/12/04/controlling-a-multi-service-application-with-systemd/
2020-09-01 10:02:08 +02:00
matze 1ef4420c53 __netbox_uwsgi: new type to handle uwsgi for netbox 2020-08-27 19:46:09 +02:00
matze bbce0030ab __netbox: enable ldap usage via configuration.py
The REMOTE_AUTH_BACKEND must be set to use LDAP.

It now exports USE_LDAP to generally say if LDAP is being used in the
configuration or not.
2020-08-26 21:07:31 +02:00
matze e0a1b4f663 __netbox_gunicorn: extract gunicorn setup from __netbox
Because someone *want* to use something other than just gunicorn, it was
extracted to a own type. Because gunicorn is a bit deep in the netbox
installation process, it's a bit harder to isolate it.

`__netbox_uwsgi` will come, too.
2020-08-26 20:08:37 +02:00
Dennis Camera 49d39eaee5 [type/__mail_alias] Fix error with some AWK implementations
Some AWK implementations seem to have a problem with parameters named default.

    awk: cmd. line:2: function sepafter(f, default,    _) {
    awk: cmd. line:2:                      ^ syntax error
    awk: cmd. line:5: 	return _ ? _ : default
    awk: cmd. line:5: 	               ^ syntax error

In addition the temp file is removed if an error occurs.
2020-08-26 18:56:02 +02:00
matze eaf639790b __netbox: remove ldap pip3 package if not required 2020-08-26 17:39:19 +02:00
matze 8ff7a4616d __netbox: allow multiple hostnames 2020-08-25 19:30:32 +02:00
matze 7d694342ff __netbox: new parameter for automatic release checks 2020-08-24 19:31:49 +02:00
matze 95fd7d872e __netbox: fix ldap config short-circuit
Forgot to negotate if statement .. works now :/
2020-08-24 18:57:27 +02:00
matze 863c95059e __netbox: fix REMOTE_AUTH_BACKEND module not found
Updated with the backend from the current upstream configuration.
2020-08-23 19:48:56 +02:00
matze 4e90c93eef __netbox: updated copyright
Added me to the copyright after there are some more changes :-)
2020-08-23 17:15:32 +02:00
matze 49bb527dea __netbox: autogen secretkey and store at remote
The secret key is generated if it is not set via parameter and the
explorer does not return any. It will be saved in the netbox home
directory to easily read the key for the config generation.
2020-08-23 16:52:02 +02:00
matze f5c8c26db6 __netbox: new config parameters for data paths
.. to move them to an other partition.
2020-08-23 16:41:58 +02:00
matze 88ddebd040 __netbox: fix deprecated configuration option
Fixes error message `/opt/netbox/netbox/netbox/settings.py:141:
UserWarning: REMOTE_AUTH_DEFAULT_PERMISSIONS should be a dictionary.
Backward compatibility will be removed in v2.10.`
2020-08-22 22:47:15 +02:00
matze 584e0bbda8 __netbox: fix netbox version save
The cdist directory needs to be created to write there. This is done
directly after the new tarball is installed.
2020-08-22 22:24:17 +02:00
matze 0b261070d3 __netbox: man note regards creating a superuser 2020-08-22 22:04:33 +02:00
matze 4a04a2c472 __netbox: repalace tabs with whitespaces
Doing `s/\t/    /g` to have all times the same indents.
2020-08-22 21:58:44 +02:00
matze ce47cec2e7 __netbox: silence curl progress bar
.. but still showing errors if any.
2020-08-22 21:50:54 +02:00
matze ae7ffac6bb __netbox: force virtualenv to be python3
Set a flag to be sure it is python3. Else, you may get an ugly error if
python2 is not installed (and netbox requires python3.6 at minimum).
2020-08-22 21:29:30 +02:00
matze ee3db10ecf __netbox: auto-install sudo as dependency
There are may be systems does not have `sudo` preinstalled like
debian-minimal. Else, `su` could be used as alternative.
2020-08-22 20:55:35 +02:00
matze 9fb3c7f52e __netbox: fix manpage indents 2020-08-22 16:00:15 +02:00
matze 987393942b __netbox: add more database parameters 2020-08-22 15:53:24 +02:00
matze ce77cc4527 __netbox: note + link to find NetBox versions 2020-08-22 14:40:07 +02:00
matze 855843ea34 __netbox: small code and config handling improvements
fixed codestyle and detection if config files need to be copied.
2020-08-22 09:19:12 +02:00
matze e6e6dbcd00 __netbox: added some netbox configuration options
Those who might be useful are added ..
2020-08-21 23:50:24 +02:00
matze a05cb214e1 __netbox: fix shellcheck by changing parameter checks
The working `ls | grep .` like solution was dropped based on the
shellcheck warning. Rather a solution with `find(1)` is used.

As alternative, it could be simply checked if the glob succeeds or not
by test all given arguments if there are existing files. It was dropped
in question if it's really better than the `find(1)` solution.
2020-08-20 19:37:09 +02:00
matze 0281b2c804 __netbox: no ldap config if no ldap parameters
The ldap config file will be empty (only comments) if no parameter
name set matches `^ldap-*`.

It still generate a ldap config if one or more ldap parameters are set,
but not all basic parameters.
2020-08-20 17:53:25 +02:00
matze e47cead637 __netbox: add manpage explanation of the type 2020-08-16 15:31:38 +02:00
matze efab6ac23e __netbox: add version memorisation
This saves the installed version and checks if a new version must be
installed. If no update required, it updates the configuration files
if required.
2020-08-16 15:18:47 +02:00
fnux ce20c67602 Merge branch 'newtype/borg-repo' into 'master'
Add a type to create a borg repository.

See merge request ungleich-public/cdist-contrib!13
2020-08-12 09:23:07 +02:00
fnux dfd9f108b1 __netbox: add minimal manpage 2020-08-12 09:15:18 +02:00
fnux 240b8f1615 __netbox: make shellcheck happy 2020-08-12 09:01:05 +02:00
fnux 47584d6da6 __netbox: use __systemd_unit, do not recreate existing directory 2020-08-12 08:58:29 +02:00
sparrowhawk bf5f85068d
Add a type to create a borg repository. 2020-08-07 10:39:38 +02:00
fnux f73bf49e4b Remove manual / outdated CHANGELOG 2020-07-28 14:23:30 +02:00
fnux 521433f875 Merge branch '__matrix_riot' into 'master'
__matrix_element

See merge request ungleich-public/cdist-contrib!10
2020-07-28 14:21:03 +02:00
fnux 7eecc99c73 __unbound: fix typo in gencode-remote / service start 2020-07-27 14:53:45 +02:00
fnux 1ff5ad8534 Merge branch 'unbound-local-data' into 'master'
__unbound: add --local_data flag

See merge request ungleich-public/cdist-contrib!11
2020-07-27 14:45:18 +02:00
fnux 5960356e7b __unbound: add --local_data flag 2020-07-27 14:37:22 +02:00
fnux e2f01bbb3b __matrix_riot: rename to __matrix_element 2020-07-22 17:14:06 +02:00
fnux ef7a214dae __netbox: support basic LDAP group mapping 2020-07-21 08:30:09 +02:00
fnux ab2c826cc3 __netbox: add minimal LDAP support 2020-07-21 07:46:45 +02:00
fnux 70047d10b1 Initial __netbox type 2020-07-20 17:20:33 +02:00
fnux c3a7e62953 Merge branch 'unbound-monitoring' into 'master'
__unbound_exporter: prometheus exporter for unbound

See merge request ungleich-public/cdist-contrib!8
2020-07-20 07:49:43 +02:00
fnux 3314612193 __matrix_riot: improve friendship with shellcheck 2020-07-11 09:21:37 +02:00
fnux 10ccc77803 Merge branch '__matterbridge' into 'master'
__matterbridge type

See merge request ungleich-public/cdist-contrib!3
2020-07-11 08:53:54 +02:00
Dennis Camera 43c59985d0 [type/__mail_alias] Fallback to /etc/aliases instead of /etc/mail/aliases 2020-06-25 18:07:51 +02:00
fnux f6a36a60c0 Import __matrix_riot from ungleich's dot-cdist 2020-06-25 11:15:23 +02:00
Dennis Camera aa605cada4 [type/__mail_aliases] Add support for Alpine Linux
Alpine's DMA package has a typo and installs "newailases" instead of
"newaliases".
I adjusted the code-remote to only run newaliases if it is available.
Otherwise, tough luck, user gotta either fix his system or run manually.
2020-06-22 14:03:53 +02:00
Dennis Camera 27b832f212 [type/__dma] Add support for Alpine Linux
requires the testing repository, currently.
2020-06-22 14:02:13 +02:00
Dennis Camera 0f81b89f70 [type/__dma] Make --smarthost optional 2020-06-22 13:29:28 +02:00
Dennis Camera c777a2b1c2 [type/__mail_alias] Some fixes in continuation line processing 2020-06-11 21:58:58 +02:00
Dennis Camera 27102340de [type/__mail_alias] Add bug notice about commas 2020-06-11 20:54:31 +02:00
Dennis Camera b293c42b5a [type/__dma] Use EQS to split config lines 2020-06-11 19:12:52 +02:00
Dennis Camera 5513485097 [type/__dma] Improve documentation 2020-06-11 19:12:52 +02:00
Dennis Camera 193b1780de Improve error message when invalid --state is used. 2020-06-11 19:12:52 +02:00
Dennis Camera 5b8ae33b4e [type/__dma_auth] Improve documentation and handle duplicate lines better
The state explorer gained a new value "multiple" (it is not used anywhere, just
informative).
The code will only write a "should" line once and drop duplicate lines.
2020-06-11 19:12:52 +02:00
Dennis Camera ca9e011d50 [type/__dma_auth] Fix off-by-one error 2020-06-11 19:03:41 +02:00
Dennis Camera 96fcccf529 [type/__mail_alias] Improve documentation 2020-06-09 21:57:47 +02:00
Dennis Camera 67b989a717 [type/__dma_auth] Simplify code and add more comments 2020-06-09 20:53:01 +02:00
Dennis Camera 45b10f3e09 [type/__dma] Update parameters to match config names in DMA 2020-06-09 14:51:11 +02:00
Dennis Camera 0cd19b3a5d [type/__dma] Use "smarthost" spelling to be consistent with DMA 2020-06-09 14:44:54 +02:00
fnux 4ff703e6aa Fine tuning prometheus exporter for unbound 2020-06-07 10:34:35 +02:00
fnux bffc38ad52 __unbound_exporter: make shellcheck happy again 2020-06-07 08:58:14 +02:00
fnux 17f6a4dd47 Only shellcheck .sh files in type/*/files/ 2020-06-07 08:57:51 +02:00
fnux d14011c50b Sync CHANGELOG with __unbound* changes 2020-06-07 08:55:47 +02:00
fnux 1e45d85d4d Add new __unbound_exporter type 2020-06-07 08:53:56 +02:00
fnux 7b9ffb4a41 __unbound: wire remote control configuration 2020-06-07 08:46:18 +02:00
Dennis Camera de4508cb06 Mark __dma_auth and __mail_alias as nonparallel
Both types modify a single file, so they shouldn't be run at the same time.
2020-06-06 21:45:40 +02:00
Dennis Camera bf822f3f8c [type/__dma] Fix SC2154 2020-06-01 20:26:52 +02:00
Dennis Camera 77e8a93daa [type/__dma_auth] Fix SC2162 2020-06-01 20:25:10 +02:00
Dennis Camera 7183bb3cd1 [type/__dma] Fixes for FreeBSD 2020-06-01 19:24:45 +02:00
Dennis Camera 0657ac4f11 [type/__dma] Fix mailname 2020-06-01 19:21:41 +02:00
Dennis Camera 99d58672c4 [type/__dma_auth] Add semicolon 2020-06-01 19:20:05 +02:00
Dennis Camera 4fdddfd738 [type/__dma] Add --defer, --full-bounce, and --null-client 2020-06-01 17:23:31 +02:00
Dennis Camera c8efbf4825 [type/__dma] Detect AUTHPATH 2020-06-01 17:16:04 +02:00
Dennis Camera 4dfa24723a [type/__dma] Implement config file updates 2020-06-01 17:09:47 +02:00
Dennis Camera b87b67597e [type/__dma] Remove mail aliases functionality 2020-05-31 15:26:52 +02:00
Dennis Camera 3f72ca1341 [type/__dma_auth] Send messages 2020-05-31 15:24:54 +02:00
Dennis Camera b848fca929 [type/__dma_auth] Finish code to rewrite auth.conf 2020-05-31 15:01:40 +02:00
Dennis Camera 59059a200a [type/__dma_auth] Use host as key 2020-05-31 12:00:09 +02:00
Dennis Camera 988f277ad6 [type/__mail_alias] Fixes (mostly mawk compatibility) 2020-05-31 12:00:09 +02:00
Dennis Camera a5f3f3cdaf [type/__dma_auth] Implement type 2020-05-31 12:00:06 +02:00
Dennis Camera 3adc4f1609 [type/__mail_alias] Implement type 2020-05-30 18:08:05 +02:00
Dennis Camera 98496aa8e5 Add __mail_alias type 2020-05-29 17:33:52 +02:00
Dennis Camera a491e8739e Add __dma_auth type 2020-05-29 17:33:40 +02:00
Dennis Camera f4671691be Rename __root_mail_dma to __dma to prepare for new types 2020-05-29 17:33:23 +02:00
evilham 6b1e055d3d [__root_mail_dma] Add new role to manage local root mail.
This type has been tested in FreeBSD and Debian-like systems (Debian, Devuan,
Ubuntu).
2020-05-27 18:34:06 +02:00
fnux 43562ff09c Make __matterbridge shellcheck-friendly 2020-05-15 08:08:45 +02:00
fnux 05a6b8aa42 Import __matterbridge type from ungleich's dot-cdist 2020-05-15 07:57:16 +02:00
434 changed files with 21324 additions and 1118 deletions

View File

@ -1,14 +1,29 @@
stages:
- test
- doc
image: code.ungleich.ch:5050/ungleich-public/cdist/cdist-ci:latest
image: code.ungleich.ch:5050/ungleich-public/cdist-contrib/ci-container:latest
shellcheck:
stage: test
script:
- ./scripts/run-shellcheck.sh
- make lint
manpages:
stage: test
script:
- ./scripts/run-manpage-checks.sh
- make check-manpages
docs:
stage: doc
only:
- master@ungleich-public/cdist-contrib
before_script:
- eval $(ssh-agent -s)
- echo "$CD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- make html
- sftp fnux@staticwebhosting.ungleich.ch:public_html/cdist-contrib <<< "put -r docs/dist/html/*"

View File

@ -1,4 +0,0 @@
# cdist-contrib changes
* 2020-06-03: New type: __unbound (Timothée Floure)
* 2020-04-28: New type: __find_exec (Ander Punnar)

70
Makefile Normal file
View File

@ -0,0 +1,70 @@
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo "man build only man user documentation"
@echo "html build only html user documentation"
@echo "docs build both man and html user documentation"
@echo "check-manpages check for manpage in types"
@echo "lint run shellcheck on types"
@echo "check run both type manpage checks and linting"
@echo "clean clean"
DOCS_SRC_DIR=./docs/src
TYPEDIR=./type
SPHINXM=make -C $(DOCS_SRC_DIR) man
SPHINXH=make -C $(DOCS_SRC_DIR) html
SPHINXC=make -C $(DOCS_SRC_DIR) clean
################################################################################
# Manpages
#
MAN7DSTDIR=$(DOCS_SRC_DIR)/man7
# Use shell / ls to get complete list - $(TYPEDIR)/*/man.rst does not work
# Using ls does not work if no file with given pattern exist, so use wildcard
MANTYPESRC=$(wildcard $(TYPEDIR)/*/man.rst)
MANTYPEPREFIX=$(subst $(TYPEDIR)/,$(MAN7DSTDIR)/cdist-type,$(MANTYPESRC))
MANTYPES=$(subst /man.rst,.rst,$(MANTYPEPREFIX))
# Link manpage: do not create man.html but correct named file
$(MAN7DSTDIR)/cdist-type%.rst: $(TYPEDIR)/%/man.rst
mkdir -p $(MAN7DSTDIR)
ln -sf "../../../$^" $@
DOCSINDEX=$(MAN7DSTDIR)/index.rst
DOCSINDEXH=$(DOCS_SRC_DIR)/index.rst.sh
$(DOCSINDEX): $(DOCSINDEXH)
$(DOCSINDEXH)
# Manpages: .cdist Types
DOT_CDIST_PATH=${HOME}/.cdist
DOTMAN7DSTDIR=$(MAN7DSTDIR)
DOTTYPEDIR=$(DOT_CDIST_PATH)/type
# Link manpage: do not create man.html but correct named file
$(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst
ln -sf "$^" $@
man: $(MANTYPES) $(DOCSINDEX)
$(SPHINXM)
html: $(MANTYPES) $(DOCSINDEX)
$(SPHINXH)
docs: man html
check-manpages:
./scripts/run-manpage-checks.sh
lint:
./scripts/run-shellcheck.sh
check: check-manpages lint
clean:
$(SPHINXC)
rm -f docs/src/index.rst
rm -rf docs/src/man7/
rm -rf docs/src/__pycache__/

View File

@ -5,8 +5,9 @@ tool with community-maitained types which are either too specific to fit/be
maintained in cdist itself or were not accepted in code cdist but could still
be useful.
This project does not have releases and is continously updated: see
`CHANGELOG.md` for details.
This project does not have releases and is continously updated: see git history
for change log. You will find HTML documentation at
[contrib.cdi.st](https://contrib.cdi.st).
## Using cdist-contrib
@ -32,14 +33,11 @@ And you would run [cdist][cdist] from the same directory as follows:
## Participating in the [cdist][cdist] community
Join us on [#cdist:ungleich.ch][cdistmatrix] on matrix or on
[#cdist over mattermost][cdistmattermost].
Join us on [#cdist:ungleich.ch][cdistmatrix] on matrix!
[cdist]: https://www.cdi.st/
[cdistconfig]: https://www.cdi.st/manual/latest/cdist-configuration.html
[cdistmatrix]: https://matrix.to/#/#cdist:ungleich.ch
[cdistmattermost]: https://chat.ungleich.ch/ungleich/channels/cdist
## Contributing
@ -53,3 +51,12 @@ Every type in cdist-contrib must:
* Have a `man.rst` documentation page.
* Pass [shellcheck](http://shellcheck.net/) without errors.
## Other resources
Some people/organizations are known to keep some cdist types that might be of
interest to others:
* [cdist-evilham](https://git.sr.ht/~evilham/cdist-evilham): Evilham's cdist-types
* [cdist-recycledcloud](https://code.recycled.cloud/RecycledCloud/cdist-recycledcloud): e-Durable SA / Recycled Cloud public types
* [cdist-ungleich](https://code.ungleich.ch/ungleich-public/cdist-ungleich): ungleich public types

235
docs/src/Makefile Normal file
View File

@ -0,0 +1,235 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
PAPER ?=
BUILDDIR ?= ../dist
# for cache, etc.
_BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(_BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
rm -rf $(_BUILDDIR)/*
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cdist-docs.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/cdist-docs.qhc"
.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/cdist-docs"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/cdist-docs"
@echo "# devhelp"
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b cman $(ALLSPHINXOPTS) $(BUILDDIR)/man
mkdir -p $(BUILDDIR)/man/man7
mv -f $(BUILDDIR)/man/*.7 $(BUILDDIR)/man/man7/
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
.PHONY: dummy
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."

101
docs/src/conf.py Normal file
View File

@ -0,0 +1,101 @@
#!/usr/bin/env python3
import sys
import os
import sphinx_rtd_theme
from datetime import date
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(os.path.realpath(__file__)), "..", "..")))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'docs.src.manpage',
'sphinx.ext.extlinks',
]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst']
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'cdist-contrib'
copyright = 'cdist-contrib contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version = str(date.today())
release = os.popen('git rev-parse HEAD').read()
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Output file base name for HTML help builder.
htmlhelp_basename = 'cdistcontribdoc'
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
root_mandir = os.path.dirname(os.path.realpath(__file__))
mandirs = []
for mansubdir in ('man7',):
mandirs.append((os.path.join(root_mandir, mansubdir), mansubdir[-1]))
man_pages = []
for mandir, section in mandirs:
for root, dirs, files in os.walk(mandir):
for fname in files:
froot, fext = os.path.splitext(fname)
if fext == '.rst':
man_page = (os.path.join('man' + str(section), froot),
froot, '', [], section)
man_pages.append(man_page)
# man_pages = [
# ('cdist-type', 'cdist-type', 'cdist-type documentation',
# [author], 1),
# ('man7/cdist-type__file', 'cdist-type__file',
# '', [], 1),
# ('cdist-type__directory', 'cdist-type__directory',
# 'cdist-type__directory documentation', [author], 1),
# ]
# If true, show URL addresses after external links.
# man_show_urls = False

40
docs/src/index.rst.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh
__cdist_pwd="$(pwd -P)"
__cdist_mydir="${0%/*}";
__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)"
__cdist_myname=${0##*/};
__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
filename="${__cdist_myname%.sh}"
dest="$__cdist_abs_mydir/$filename"
if ! command -v pandoc > /dev/null; then
echo "Pandoc is required to generate HTML index from README." >&2
exit 1
fi
cd "$__cdist_abs_mydir"
exec > "$dest"
pandoc -f markdown -t rst ../../README.md
cat << EOF
.. toctree::
:hidden:
EOF
# If there is no such file then ls prints error to stderr,
# so redirect stderr to /dev/null.
for type in $(ls man7/cdist-type__*.rst 2>/dev/null | LC_ALL=C sort); do
no_dir="${type#man7/}";
no_type="${no_dir#cdist-type}";
name="${no_type%.rst}";
manref="${no_dir%.rst}"
man="${manref}(7)"
echo " $name" "<man7/${manref}>"
done

87
docs/src/manpage.py Normal file
View File

@ -0,0 +1,87 @@
import sphinx.builders.manpage
import sphinx.writers.manpage
from docutils.frontend import OptionParser
from sphinx.util.console import bold, darkgreen
from six import string_types
from docutils.io import FileOutput
from os import path
from sphinx.util.nodes import inline_all_toctrees
from sphinx import addnodes
from sphinx.util import logging
"""
Extension based on sphinx builtin manpage.
It does not write its own .SH NAME based on config,
but leaves everything to actual reStructuredText file content.
"""
logger = logging.getLogger(__name__)
class ManualPageTranslator(sphinx.writers.manpage.ManualPageTranslator):
def header(self):
tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\""
" \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n")
return tmpl % self._docinfo
class ManualPageWriter(sphinx.writers.manpage.ManualPageWriter):
def __init__(self, builder):
super().__init__(builder)
self.translator_class = (
self.builder.get_translator_class() or ManualPageTranslator)
class ManualPageBuilder(sphinx.builders.manpage.ManualPageBuilder):
name = 'cman'
default_translator_class = ManualPageTranslator
def write(self, *ignored):
docwriter = ManualPageWriter(self)
docsettings = OptionParser(
defaults=self.env.settings,
components=(docwriter,),
read_config_files=True).get_default_values()
logger.info(bold('writing... '), nonl=True)
for info in self.config.man_pages:
docname, name, description, authors, section = info
if isinstance(authors, string_types):
if authors:
authors = [authors]
else:
authors = []
targetname = '%s.%s' % (name, section)
logger.info(darkgreen(targetname) + ' { ', nonl=True)
destination = FileOutput(
destination_path=path.join(self.outdir, targetname),
encoding='utf-8')
tree = self.env.get_doctree(docname)
docnames = set()
largetree = inline_all_toctrees(self, docnames, docname, tree,
darkgreen, [docname])
logger.info('} ', nonl=True)
self.env.resolve_references(largetree, docname, self)
# remove pending_xref nodes
for pendingnode in largetree.traverse(addnodes.pending_xref):
pendingnode.replace_self(pendingnode.children)
largetree.settings = docsettings
largetree.settings.title = name
largetree.settings.subtitle = description
largetree.settings.authors = authors
largetree.settings.section = section
docwriter.write(largetree, destination)
logger.info("")
def setup(app):
app.add_builder(ManualPageBuilder)

View File

@ -0,0 +1,7 @@
# This image is used in the cdist-contrib CI for linting and generating the
# documentation.
FROM fedora:latest
MAINTAINER Timothée Floure <fnux@ungleich.ch>
RUN dnf install -y git findutils make python3-sphinx python3-sphinx_rtd_theme \
ShellCheck openssh-clients pandoc

View File

@ -1,21 +1,29 @@
#!/bin/sh
#!/bin/sh -eu
SHELLCHECKCMD="shellcheck -s sh -f gcc -x"
SHELLCHECKCMD='shellcheck -s sh -f gcc -x'
# Skip SC2154 for variables starting with __ since such variables are cdist
# environment variables.
SHELLCHECK_SKIP=': __.*is referenced but not assigned.*\[SC2154\]'
SHELLCHECKTMP=".shellcheck.tmp"
SHELLCHECKTMP='.shellcheck.tmp'
# Move to top-level cdist-contrib directory.
cd $(dirname $0)/..
cd "$(dirname $0)"/..
check () {
find type/ -type f $1 $2 -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" > "${SHELLCHECKTMP}"
test ! -s "${SHELLCHECKTMP}" || { cat "${SHELLCHECKTMP}"; exit 1; }
check() {
find type/ -type f "$@" -exec ${SHELLCHECKCMD} {} + \
| grep -v "${SHELLCHECK_SKIP}" >>"${SHELLCHECKTMP}" || true
}
check -path "*/explorer/*"
check -path "*/files/*"
rm -f "${SHELLCHECKTMP}"
check -path '*/explorer/*'
check -path '*/files/*' -name '*.sh'
check -name manifest
check -name gencode-local
check -name gencode-remote
if test -s "${SHELLCHECKTMP}"
then
cat "${SHELLCHECKTMP}" >&2
exit 1
fi

View File

@ -0,0 +1,45 @@
#!/bin/sh
# Template to generate a bgp protocol configuration file for bird(1).
# Required non-empty variables:
# __object_id, local_{ip,as}, neighbor_{ip,as}
#
# Required defined variables:
# description, password, ipv{4,6}_{import,export}
# Header
echo "protocol bgp ${__object_id:?} {"
# Optional description
[ -n "${description?}" ] && printf "\tdescription \"%s\";\n" "${description?}"
# Mandatory session information
cat << EOF
local ${local_ip?} as ${local_as:?};
neighbor ${neighbor_ip:?} as ${neighbor_as:?};
EOF
# Direct connection ?
[ -n "${direct?}" ] && printf "\tdirect;\n"
# Password-protected session ?
[ -n "${password?}" ] && printf "\tpassword \"%s\";\n" "${password?}"
if [ -n "${ipv4_import?}" ] || [ -n "${ipv4_export?}" ] || "${ipv4_extended_next_hop?}";
then
printf "\tipv4 {\n"
[ -n "${ipv4_import?}" ] && printf "\t\timport %s;\n" "${ipv4_import:?}"
[ -n "${ipv4_export?}" ] && printf "\t\texport %s;\n" "${ipv4_export:?}"
[ -n "${ipv4_extended_next_hop?}" ] && printf "\t\textended next hop;\n"
printf "\t};\n"
fi
if [ -n "${ipv6_import?}" ] || [ -n "${ipv6_export?}" ] || "${ipv6_extended_next_hop?}";
then
printf "\tipv6 {\n"
[ -n "${ipv6_import?}" ] && printf "\t\timport %s;\n" "${ipv6_import:?}"
[ -n "${ipv6_export?}" ] && printf "\t\texport %s;\n" "${ipv6_export:?}"
[ -n "${ipv6_extended_next_hop?}" ] && printf "\t\textended next hop;\n"
printf "\t};\n"
fi
# Header close
echo "}"

105
type/__bird_bgp/man.rst Normal file
View File

@ -0,0 +1,105 @@
cdist-type__bird_bgp(7)
=======================
NAME
----
cdist-type__bird_bgp - configure an instance of the BGP protocol.
DESCRIPTION
-----------
This type writes the configuration for an instance of the BGP protocol to be
ran by the bird internet routing daemon. It **expects** to depend on the
`cdist-type__bird_core(7)` type.
REQUIRED PARAMETERS
-------------------
local-as
The number for the AS in which the daemon is running.
neighbor-as
The number of the AS with which we are peering.
neighbor-ip
The IP address of the peer we are opening a session with.
OPTIONAL PARAMETERS
-------------------
description
An instance desciption to be printed when `birdc show protocols` is called.
local-ip
The IP address used as a source address for the BGP session.
password
A password for the BGP session.
ipv4-import
A string suitable for the bird `import` directive. Usually `all`, `none` or
a filter definition.
ipv4-export
See ipv4-import.
ipv4-extended-next-hop
Allow IPv6 next hop in IPv4 NLRI.
ipv6-import
See ipv4-import.
ipv6-export
See ipv4-import.
ipv6-extended-next-hop
Allow IPv4 next hop in IPv6 NLRI.
BOOLEAN PARAMETERS
------------------
direct
Specify that the two routers are directly connected.
EXAMPLES
--------
.. code-block:: sh
# Setup bird and open a BGP session.
__bird_core --router-id 198.51.100.4
require='__bird_core' __bird_bgp bgp4 \
--description "a test IPv4 BGP instance" \
--ipv4-export all \
--ipv4-import all \
--ipv6-export none \
--ipv6-import none \
--local-as 1234 \
--local-ip 198.51.100.4 \
--neighbor-as 4321 \
--neighbor-ip 198.51.100.3 \
--password hunter01
SEE ALSO
--------
cdist-type__bird_core(7)
cdist-type__bird_filter(7)
cdist-type__bird_kernel(7)
cdist-type__bird_ospf(7)
cdist-type__bird_static(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

122
type/__bird_bgp/manifest Executable file
View File

@ -0,0 +1,122 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
"alpine"|"debian"|"ubuntu")
confdir="/etc/bird.d"
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_bgp\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
# Required parameters
local_as="$(cat "${__object:?}"/parameter/local-as)"
export local_as
neighbor_as="$(cat "${__object:?}"/parameter/neighbor-as)"
export neighbor_as
neighbor_ip="$(cat "${__object:?}"/parameter/neighbor-ip)"
export neighbor_ip
# Optional parameters
description=
if [ -f "${__object:?}"/parameter/description ];
then
description="$(cat "${__object:?}"/parameter/description)"
fi
export description
direct=
if [ -f "${__object:?}"/parameter/direct ];
then
direct="true"
fi
export direct
ipv4_extended_next_hop=
if [ -f "${__object:?}"/parameter/ipv4-extended-next-hop ];
then
ipv4_extended_next_hop="true"
fi
export ipv4_extended_next_hop
ipv6_extended_next_hop=
if [ -f "${__object:?}"/parameter/ipv6-extended-next-hop ];
then
ipv6_extended_next_hop="true"
fi
export ipv6_extended_next_hop
local_ip=
if [ -f "${__object:?}"/parameter/local-ip ];
then
local_ip="$(cat "${__object:?}"/parameter/local-ip)"
fi
export local_ip
password=
if [ -f "${__object:?}"/parameter/password ];
then
password="$(cat "${__object:?}"/parameter/password)"
fi
export password
ipv4_import=
if [ -f "${__object:?}"/parameter/ipv4-import ];
then
ipv4_import="$(cat "${__object:?}"/parameter/ipv4-import)"
fi
export ipv4_import
ipv4_export=
if [ -f "${__object:?}"/parameter/ipv4-export ];
then
ipv4_export="$(cat "${__object:?}"/parameter/ipv4-export)"
fi
export ipv4_export
ipv6_import=
if [ -f "${__object:?}"/parameter/ipv6-import ];
then
ipv6_import="$(cat "${__object:?}"/parameter/ipv6-import)"
fi
export ipv6_import
ipv6_export=
if [ -f "${__object:?}"/parameter/ipv6-export ];
then
ipv6_export="$(cat "${__object:?}"/parameter/ipv6-export)"
fi
export ipv6_export
# Run template
"${__type:?}"/files/template.sh > "${__files:?}/bgp-${__object_id:?}.conf"
# Install resulting configuration
__file "${confdir:?}"/bgp-"${__object_id:?}".conf \
--mode 0640 --owner root --group bird \
--source "${__files:?}/bgp-${__object_id:?}.conf"

View File

@ -0,0 +1,3 @@
direct
ipv4-extended-next-hop
ipv6-extended-next-hop

View File

@ -0,0 +1,7 @@
description
ipv4-export
ipv4-import
ipv6-export
ipv6-import
local-ip
password

View File

@ -0,0 +1,3 @@
local-as
neighbor-as
neighbor-ip

65
type/__bird_core/man.rst Normal file
View File

@ -0,0 +1,65 @@
cdist-type__bird-core(7)
========================
NAME
----
cdist-type__bird-core - setup a skeleton bird configuration.
DESCRIPTION
-----------
The `bird`_ daemon is an internet routing daemon, running protocols such as
OSPF and BGP. This type creates a skeleton configuration file suitable for
running a no-op bird. It is then intended to be combined - and depended on - by
types specific to the instances of the various protocols that bird should run.
.. _bird: https://bird.network.cz/
OPTIONAL PARAMETERS
-------------------
router-id
This parameter follows the format of an IPv4 address, and will be used by
bird as its router id. See `the documentation for router id`_.
.. _the documentation for router id: https://bird.network.cz/?get_doc&v=20&f=bird-3.html#opt-router-id
log-params
This parameter expects a string suitable to follow the `log` bird
configuration key. If this parameter is not include, the value `syslog all`
is used. See `the documentation for log`_.
.. _the documentation for log: https://bird.network.cz/?get_doc&v=20&f=bird-3.html#opt-log
EXAMPLES
--------
.. code-block:: sh
__bird-core --router-id 198.51.100.4
require='__bird-core' __bird_bgp <...>
require='__bird-core' __bird_ospf <...>
SEE ALSO
--------
cdist-type__bird_bgp(7)
cdist-type__bird_filter(7)
cdist-type__bird_kernel(7)
cdist-type__bird_ospf(7)
cdist-type__bird_static(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

72
type/__bird_core/manifest Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
package=
conffile=
confdir=
case "$os" in
"alpine")
package=bird
conffile=/etc/bird.conf
confdir=/etc/bird.d
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_core\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
router_id=
if [ -f "${__object:?}/parameter/router-id" ];
then
router_id="router id $(cat "${__object:?}"/parameter/router-id);"
fi
log_params="syslog all"
if [ -f "${__object:?}/parameter/log-params" ];
then
log_params="$(cat "${__object:?}"/parameter/log-params)"
fi
__package "$package"
export require="__package/$package"
__directory "$confdir"
__file "$conffile" \
--mode 0640 --owner root --group bird \
--source - << EOF
# $conffile - bird(1) configuration file.
# Managed by cdist. Do not edit by hand.
${router_id}
log ${log_params};
# Always include this "protocol": all it does is expose the available
# interfaces to bird.
protocol device {
description "Obtain a list of device interfaces.";
}
include "$confdir/*.conf";
EOF

View File

@ -0,0 +1 @@
log-params

View File

@ -0,0 +1 @@
router-id

View File

@ -0,0 +1,63 @@
cdist-type__bird_filter(7)
==========================
NAME
----
cdist-type__bird_filter - Create a named filter to use in configuring bird.
DESCRIPTION
-----------
This type writes a configuration file defining a filter named `__object_id` for
the bird internet routing daemon. It is guaranteed that all filters defined
through this type will be loaded before any other protocol defined using the
cdist __bird_xxx types, except functions. However, note that if two filters
have a dependency, they will be loaded in alphabetical order, so some care may
need to be taken in the naming.
This type takes it's input through stdin, expecting valid filter statements as
per the bird configuration file syntax. The standard input will be printed out
between a `filter __object_id {\n ... \n}`, so only the inner statements are
needed.
EXAMPLES
--------
.. code-block:: sh
# Setup bird, a filter and open a BGP session.
__bird_core --router-id 198.51.100.4
require='__bird_core' __bird_filter bgp_export <<- EOF
if (source = RTS_DEVICE) then accept;
reject;
EOF
require='__bird_core' __bird_bgp bgp4 \
--description "a test IPv4 BGP instance" \
--ipv4-export "filter bgp_export" \
--[...]
SEE ALSO
--------
cdist-type__bird_core(7)
cdist-type__bird_bgp(7)
cdist-type__bird_function(7)
cdist-type__bird_kernel(7)
cdist-type__bird_ospf(7)
cdist-type__bird_static(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

44
type/__bird_filter/manifest Executable file
View File

@ -0,0 +1,44 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
'alpine'|'debian'|'ubuntu')
confdir=/etc/bird.d
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_filter\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
# Filters start with 1 because bird loads the config in alphanumerical order
# and we need them to be defined to be used in the rest of the stuff, but after
# functions.
__file "$confdir/1-filter-${__object_id:?}.conf" \
--owner root --group bird --mode 0640 \
--source - << EOF
filter ${__object_id:?} {
$(cat "${__object:?}"/stdin)
}
EOF

View File

@ -0,0 +1,58 @@
cdist-type__bird_function(7)
============================
NAME
----
cdist-type__bird_function - Create a named function to use in configuring bird.
DESCRIPTION
-----------
This type writes a configuration file for the bird internet routing daemon. It
is guaranteed that all functions defined through this type will be loaded
before any other protocol defined using the cdist __bird_xxx types. However,
note that if two functions have a dependency, they will be loaded in
alphabetical order, so some care may need to be taken in the naming.
This type takes it's input through stdin, expecting a valid function definition
as per the bird configuration file syntax.
EXAMPLES
--------
.. code-block:: sh
# Setup bird, a function and open a BGP session.
__bird_core --router-id 198.51.100.4
require='__bird_core' __bird_function is_device <<- EOF
function is_device (enum source)
{
if (source = RTS_DEVICE) then return true;
return false;
}
EOF
SEE ALSO
--------
cdist-type__bird_core(7)
cdist-type__bird_bgp(7)
cdist-type__bird_filter(7)
cdist-type__bird_kernel(7)
cdist-type__bird_ospf(7)
cdist-type__bird_static(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

41
type/__bird_function/manifest Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
'alpine'|'debian'|'ubuntu')
confdir=/etc/bird.d
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_filter\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
# Functions start with 0 because bird loads the config in alphanumerical order
# and we need them to be defined to be used in the rest of the stuff.
__file "$confdir/0-function-${__object_id:?}.conf" \
--owner root --group bird --mode 0640 \
--source - << EOF
$(cat "${__object:?}"/stdin)
EOF

View File

@ -0,0 +1,73 @@
cdist-type__bird_kernel(7)
==========================
NAME
----
cdist-type__bird_kernel - configure syncing of routes with the kernel.
DESCRIPTION
-----------
This type writes the configuration for an instance of the kernel protocol to be
ran by the bird internet routing daemon. It **expects** to depend on the
`cdist-type__bird_core(7)` type.
OPTIONAL PARAMETERS
-------------------
description
An instance desciption to be printed when `birdc show protocols` is called.
persist
Instruct bird to leave routes in kernel table after exiting. See the bird
`persist` keyword.
learn
Learn routes added externally to the kernel routing table. See the bird
`learn` keyword.
channel
The channel to connect the protocol to. Usually `ipv4` or `ipv6`.
import
A string suitable for the bird `import` directive. Usually `all`, `none` or
a filter definition.
export
See import.
EXAMPLES
--------
.. code-block:: sh
# Setup bird and open a BGP session.
__bird_core --router-id 198.51.100.4
require='__bird_core' __bird_kernel k4 \
--learn --persist --channel ipv4 \
--import all \
--export all
SEE ALSO
--------
cdist-type__bird_bgp(7)
cdist-type__bird_core(7)
cdist-type__bird_filter(7)
cdist-type__bird_ospf(7)
cdist-type__bird_static(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

83
type/__bird_kernel/manifest Executable file
View File

@ -0,0 +1,83 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
"alpine"|"debian"|"ubuntu")
confdir="/etc/bird.d"
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_kernel\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
# Required parameters
channel="$(cat "${__object:?}/parameter/channel")"
# Boolean switches
persist=
if [ -f "${__object:?}"/parameter/persist ];
then
persist=true
fi
learn=
if [ -f "${__object:?}"/parameter/learn ];
then
learn=true
fi
# Optional parameters
description=
if [ -f "${__object:?}"/parameter/description ];
then
description="$(cat "${__object:?}/parameter/description")"
fi
import=
if [ -f "${__object:?}"/parameter/import ];
then
import="$(cat "${__object:?}/parameter/import")"
fi
_export=
if [ -f "${__object:?}"/parameter/export ];
then
_export="$(cat "${__object:?}/parameter/export")"
fi
# Install resulting configuration
__file "${confdir:?}"/kernel-"${__object_id:?}".conf \
--mode 0640 --owner root --group bird \
--source - << EOF
protocol kernel ${__object_id:?} {
$([ -n "${description?}" ] && printf "\tdescription \"%s\";\n" "${description?}")
$([ -n "${persist?}" ] && printf "\tpersist;\n")
$([ -n "${learn?}" ] && printf "\tlearn;\n")
${channel:?} {
import ${import:?};
export ${_export:?};
};
}
EOF

View File

@ -0,0 +1,2 @@
learn
persist

View File

@ -0,0 +1 @@
description

View File

@ -0,0 +1,3 @@
channel
import
export

63
type/__bird_ospf/man.rst Normal file
View File

@ -0,0 +1,63 @@
cdist-type__bird-ospf(7)
========================
NAME
----
cdist-type__bird-ospf - Configure an instance of the OSPF protocol
DESCRIPTION
-----------
This type is an *extremely rudimentary* method to configure a simple OSPF
protocol instance for bird, the internet routing daemon. Even this manpage is
pretty crude and will be fixed and expanded.
REQUIRED PARAMETERS
-------------------
channel
The channel the protocol should connect to. Usually `ipv4` or `ipv6`.
import
The keyword or filter to decide what to import in the above channel.
export
The keyword or filter to decide what to export in the above channel.
OPTIONAL PARAMETERS
-------------------
description
A description given with `show protocol all`
instance-id
An OSPF instance ID, allowing several OSPF instances to run on the same
links.
extra-area-configuration
Configuration string added to the `area` section of the OSPF configuration.
OPTIONAL MULTIPLE PARAMETERS
----------------------------
stubnet
Add an optionless stubnet definition to the configuration.
interface
An interface to include in OSPF area 0. Is required unless
extra-area-configuration is set.
SEE ALSO
--------
cdist-type__bird_core(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

81
type/__bird_ospf/manifest Executable file
View File

@ -0,0 +1,81 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
'alpine'|'debian'|'ubuntu')
confdir='/etc/bird.d'
;;
*)
printf "Your operating system (%s) is currently not supported by this __bird_ospf\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
description=
if [ -f "${__object:?}/parameter/description" ];
then
description="$(cat "${__object:?}/parameter/description")"
fi
instance_id=
if [ -f "${__object:?}/parameter/instance-id" ];
then
instance_id="$(cat "${__object:?}/parameter/instance-id")"
fi
extra_area_configuration=
if [ -f "${__object:?}/parameter/extra-area-configuration" ];
then
extra_area_configuration="$(cat "${__object:?}/parameter/extra-area-configuration")"
if [ "$extra_area_configuration" = "-" ]; then
extra_area_configuration=$(cat "$__object/stdin")
fi
fi
if [ ! -f "${__object:?}/parameter/interface" ] && [ -z "$extra_area_configuration" ]; then
echo "Either --interface or --extra-area-configuration must be set." >&2
exit 1
fi
__file "${confdir:?}/ospf-${__object_id:?}.conf" \
--mode 0640 --owner root --group bird \
--source - << EOF
protocol ospf v3 ${__object_id:?} {
$([ -n "${description?}" ] && printf "\tdescription \"%s\";\n" "${description?}")
$([ -n "${instance_id?}" ] && printf "\tinstance id %s;\n" "${instance_id?}")
$(cat "${__object:?}/parameter/channel") {
import $(cat "${__object:?}/parameter/import");
export $(cat "${__object:?}/parameter/export");
};
area 0 {
$(sed -e 's/^/\t\tinterface "/' -e 's/$/";/' "${__object:?}/parameter/interface")
$(sed -e 's/^/\t\tsubnet /' -e 's/$/;/' "${__object:?}/parameter/subnet")
$extra_area_configuration
};
}
EOF

View File

@ -0,0 +1,3 @@
description
instance-id
extra-area-configuration

View File

@ -0,0 +1,2 @@
stubnet
interface

View File

@ -0,0 +1,3 @@
channel
import
export

71
type/__bird_radv/man.rst Normal file
View File

@ -0,0 +1,71 @@
cdist-type__bird_radv(7)
========================
NAME
----
cdist-type__bird_radv - Configure the Bird Internet Router Daemon to send RAdvs.
DESCRIPTION
-----------
The Bird Internet Router Daemon knows about a bunch of internet routing
protocols. In particular, it can send Router Advertisements to help
autoconfigure IPv6 hosts, this type is a rudimentary implementation to generate
configuration for Bird to do so.
REQUIRED PARAMETERS
-------------------
interface
The interfaces to activate the protocol on. RAs will be sent using the
prefixes configured on these interfaces.
OPTIONAL PARAMETERS
-------------------
mtu
An optional MTU setting to include in the router advertisements.
OPTIONAL MULTIPLE PARAMETERS
----------------------------
route
Routes to be added to the RA for hosts.
ns
Recursive DNS servers given to the hosts through RAs.
dnssl
Search domain to be given to the hosts through RAs.
EXAMPLES
--------
.. code-block:: sh
__bird_radv datacenter \
--interface eth1 \
--mtu 9000 \
--route ::/0 \
--ns 2001:DB8:cafe::4 \
--ns 2001:DB8:cafe::14 \
--dnssl "example.com"
SEE ALSO
--------
`__bird_core(7)`
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

89
type/__bird_radv/manifest Executable file
View File

@ -0,0 +1,89 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
'alpine'|'debian'|'ubuntu')
confdir='/etc/bird.d'
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_radv\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
have_routes=no
if [ -f "${__object:?}/parameter/route" ];
then
have_routes=yes
fi
RDNS=
if [ -f "${__object:?}/parameter/ns" ];
then
RDNS=$(cat << EOF
rdnss {
$(sed -e 's/^/\t\tns /' -e 's/$/;/' "${__object:?}/parameter/ns")
};
EOF
)
fi
DNSSL=
if [ -f "${__object:?}/parameter/dnssl" ];
then
DNSSL=$(sed -e 's/^/\tdnssl "/' -e 's/$/";/' "${__object:?}/parameter/dnssl")
fi
MTU=
if [ -f "${__object:?}/parameter/mtu" ];
then
MTU="link mtu $(cat "${__object:?}/parameter/mtu")"
fi
__file "${confdir:?}/radv-${__object_id:?}.conf" \
--mode 0640 --owner root --group bird \
--source - << EOF
ipv6 table radv_routes;
protocol static {
description "Routes advertised via RAs";
ipv6 { table radv_routes; };
$(sed -e 's/^/\troute /' -e 's/$/ unreachable;/' "${__object:?}/parameter/route")
}
protocol radv ${__object_id:?} {
propagate routes ${have_routes:?};
ipv6 { table radv_routes; export all; };
interface "$(cat "${__object:?}/parameter/interface")" {
$MTU
};
$RDNS
$DNSSL
}
EOF

View File

@ -0,0 +1 @@
mtu

View File

@ -0,0 +1,3 @@
dnssl
ns
route

View File

@ -0,0 +1 @@
interface

View File

@ -0,0 +1,25 @@
#!/bin/sh
# Template to generate a static protocol configuration file for bird(1).
# Required non-empty variables:
# __object_id, object
#
# Required defined variables:
# description
# Header
printf "protocol static %s {\n" "${__object_id:?}"
# Optional description
[ -n "${description?}" ] && printf "\tdescription \"%s\";\n" "${description:?}"
# Channel choice
printf "\t%s;\n" "$(cat "${__object:?}/parameter/channel")"
# Routes
while read -r route
do
printf "\troute %s;\n" "${route?}"
done < "${__object:?}/parameter/route"
# Header close
printf "}\n"

View File

@ -0,0 +1,69 @@
cdist-type__bird_static(7)
==========================
NAME
----
cdist-type__bird_static - configure an instance of the bird static protocol.
DESCRIPTION
-----------
This type write the configuration file for an instance of the static protocl to
be ran bu the bird internet routing daemon, allowing an administrator to inject
static routes into the daemon's routing tables. This protocol allows for only
one of two channels to be used, either `ipv4` or `ipv6`, by default `ipv6` is
used unless the `ipv4` flag is passed. This type **expects** to depend on the
`cdist-type__bird_core(7)` type.
REQUIRED PARAMETERS
-------------------
channel
The channel to use between the protocol and the table.
REQUIRED MULTIPLE PARAMETERS
----------------------------
route
This flag expects a valid route to be inserted between the bird `route`
keyword and the end of line. It may be specified as many times as necessary.
OPTIONAL PARAMETERS
-------------------
description
An instance desciption to be printed when `birdc show protocols` is called.
EXAMPLES
--------
.. code-block:: sh
# Setup bird and open a BGP session.
__bird_core --router-id 198.51.100.4
require='__bird_core' __bird_static static4 \
--description "static ipv4 routes plugged into bird" \
--route "198.51.0.0/16 via 192.51.100.1" \
--route "192.52.0.0/16 via 192.51.100.1"
SEE ALSO
--------
cdist-type__bird_core(7)
cdist-type__bird_bgp(7)
cdist-type__bird_kernel(7)
cdist-type__bird_ospf(7)
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2021 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

51
type/__bird_static/manifest Executable file
View File

@ -0,0 +1,51 @@
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
case "$os" in
'alpine'|'debian'|'ubuntu')
confdir=/etc/bird.d
;;
*)
printf "Your operating system (%s) is currently not supported by __bird_static\n" "$os" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
# Required parameter route is directly accessed in template.
# Boolean parameter ipv4 is directly accessed in template.
# Optional parameter description
description=
if [ -f "${__object:?}/parameter/description" ];
then
description="$(cat "${__object:?}/parameter/description")"
fi
export description
# Run template
"${__type:?}"/files/template.sh > "${__files:?}/static-${__object_id:?}.conf"
# Install resulting configuration
__file "${confdir:?}"/static-"${__object_id:?}".conf \
--mode 0640 --owner root --group bird \
--source "${__files:?}/static-${__object_id:?}.conf"

View File

@ -0,0 +1 @@
description

View File

@ -0,0 +1 @@
channel

View File

@ -0,0 +1 @@
route

View File

@ -0,0 +1,41 @@
#!/bin/sh
passphrase=
appendonly=
case "$(cat "${__object:?}/parameter/encryption")" in
none)
enc=none
;;
repokey)
enc=repokey
if [ -f "${__object:?}/parameter/passphrase" ];
then
passphrase="$(cat "${__object:?}/parameter/passphrase")"
else
echo "__borg_repo cannot use repokey encryption with no passphrase. Aborting." >&2;
exit 1;
fi
;;
*)
echo "$enc is not a known encryption mode for __borg_repo. Aborting." >&2
exit 1;
esac
if [ -f "${__object:?}/parameter/append-only" ];
then
appendonly='--append-only'
fi
if [ -f "${__object:?}/parameter/owner" ];
then
doas="sudo -u '$(cat "${__object:?}/parameter/owner")'"
fi
cat <<- EOF
set -x
if [ ! -d "/${__object_id:?}" ]; then
$doas BORG_NEW_PASSPHRASE=$passphrase borg init -e ${enc:?} $appendonly /${__object_id:?}
fi
EOF

46
type/__borg_repo/man.rst Normal file
View File

@ -0,0 +1,46 @@
cdist-type__borg_repo(7)
========================
NAME
----
cdist-type__borg_repo - Configure a borg repository on host
DESCRIPTION
-----------
Initializes a borg repository at the location specified in the
`${__object_id}`. Nothing is done if the repository already exists.
Currently, only `none` and `repokey` are supported as encryption modes;
`repokey` requires the `passphrase` argument to be given. The default is
`none`.
REQUIRED PARAMETERS
-------------------
encryption
The encryption to use.
OPTIONAL PARAMETERS
-------------------
passphrase
The passphrase to encrypt the keyfile with.
owner
Remote user owning the repository.
BOOLEAN PARAMETERS
------------------
append-only
If the repository is append-only
AUTHORS
-------
Joachim Desroches <joachim.desroches@epfl.ch>
COPYING
-------
Copyright \(C) 2020 Joachim Desroches. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

20
type/__borg_repo/manifest Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
os="$(cat "${__global:?}"/explorer/os)"
case "$os" in
"alpine"|"ubuntu")
borg_package=borgbackup
;;
*)
echo "__borg_repo is not yet implemented for os $os. Aborting." >&2;
exit 1;
esac
__package "$borg_package"
if [ -f "${__object:?}/parameter/owner" ];
then
__package sudo
fi

View File

@ -0,0 +1 @@
append-only

View File

@ -0,0 +1 @@
none

View File

@ -0,0 +1,2 @@
passphrase
owner

View File

@ -0,0 +1 @@
encryption

49
type/__dma/explorer/auth_conf Executable file
View File

@ -0,0 +1,49 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
# This explorer determines the path of dma's auth.conf file
# No dma.conf -> use default
test -f /etc/dma/dma.conf || {
echo /etc/dma/auth.conf
exit 0
}
test -r /etc/dma/dma.conf || {
echo 'Cannot read /etc/dma/dma.conf' >&2
exit 1
}
# Get AUTHPATH from dma.conf
awk -F'[ \t]' '
{
sub(/#.*$/, "", $0) # remove comments
if (!$0) next # ignore empty lines
}
$1 == "AUTHPATH" {
# Store authpath. In dma conf parsing last wins.
if ($2) authpath = substr($0, index($0, " ") + 1)
}
END {
if (authpath) {
print authpath
exit 0
} else exit 1
}
' /etc/dma/dma.conf \
|| echo /etc/dma/auth.conf # default

34
type/__dma/explorer/conf Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
# This explorer returns a sorted list of "active" (= non-commented) lines
# in the dma.conf file.
# "Trailing" line comments are stripped off.
#
# NOTE: This explorer assumes that the sort(1) utility supports the non-POXIX
# -s (stable sort) option.
CONF_PATH=/etc/dma # set in Makefile
dma_conf="${CONF_PATH:?}/dma.conf"
test -f "${dma_conf}" || exit 0
grep -v -e '^[ \t]*#\|^$' "${dma_conf}" \
| sed -e 's/[ \t]*#.*$//' \
| sort -s -k 1,1

View File

@ -0,0 +1,178 @@
#!/usr/bin/awk -f
#
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
function comment_line(line) {
# returns the position in line at which the comment's text starts
# (0 if the line is not a comment)
match(line, /^[ \t]*\#+[ \t]*/)
return RSTART ? (RLENGTH + 1) : 0
}
function empty_line(line) { return line ~ /^[ \t]*$/ }
function is_word(s) { return s ~ /^[A-Z_]+$/ } # "looks like a plausible word"
function first(line, sep_re) {
# returns the part of the line until sep is found
# (or the whole line if sep is not found)
if (!sep_re) sep_re = "[" SUBSEP "]"
match(line, sep_re)
return RSTART ? substr(line, 1, RSTART - 1) : line
}
function rest(line, sep_re) {
# returns the part of the line after the first occurrence of sep is found.
# (or nothing if sep is not found)
if (!sep_re) sep_re = "[" SUBSEP "]"
if (match(line, sep_re))
return substr(line, RSTART + RLENGTH)
}
function conf_pop(word, value) {
# returns the next value for the config `word` and delete it from the list.
# if value is set, this function will only return value if it is the first
# option in the list, otherwise it returns 0.
if (!(word in conf)) return 0
if (!value) {
if (index(conf[word], SUBSEP)) # more than one element?
value = substr(conf[word], 1, index(conf[word], SUBSEP) - 1)
else
value = conf[word]
}
if (index(conf[word], SUBSEP)) {
if (index(conf[word], value SUBSEP) != 1) return 0
conf[word] = substr(conf[word], length(value) + 2)
} else {
if (conf[word] != value) return 0
delete conf[word]
}
return value
}
function print_conf(word, value) {
# print a config line with the given parameters
printf "%s", word
if (value) printf " %s", value
printf "\n"
}
function print_confs(word, value) {
# print config lines for all values stored in conf[word].
if (!(word in conf)) return
if (conf[word]) {
while (value = conf_pop(word))
print_conf(word, value)
} else {
print_conf(word)
delete conf[word]
}
}
BEGIN {
FS = "\n"
EQS = "[ \t]" # copied from dma/conf.c
if (ARGV[2]) exit (e=1)
# Loop over file twice!
ARGV[2] = ARGV[1]
ARGC++
# read the "should" state into the `conf` array.
while (getline < "/dev/stdin") {
word = first($0, EQS)
if ((word in conf))
conf[word] = conf[word] SUBSEP rest($0, EQS)
else
conf[word] = rest($0, EQS)
}
}
# first pass, gather information about where which information is stored in the
# current config file. This information will be used in the second pass.
NR == FNR {
if (comment_line($0)) {
# comment line
word = first(substr($0, comment_line($0)), " ")
if (is_word(word)) last_occ["#" word] = FNR
} else {
word = first($0, EQS)
if (is_word(word)) last_occ[word] = FNR
}
}
# before second pass prepare hashes containing location information to be used
# in the second pass.
NR > FNR && FNR == 1 {
# First we drop the locations of commented-out options if a non-commented
# option is available. If a non-commented option is available, we will
# append new config options there to have them all at one place.
for (k in last_occ)
if (k ~ /^\#/ && (substr(k, 2) in last_occ))
delete last_occ[k]
# Reverse the option => line mapping. The line_map allows for easier lookups
# in the second pass.
for (k in last_occ) line_map[last_occ[k]] = k
}
# second pass, generate and output new config
NR > FNR {
if (comment_line($0) || empty_line($0)) {
# comment or empty line
print
if ((FNR in line_map)) {
if (line_map[FNR] ~ /^\#/) {
# This line contains a commented config option. If the conf hash
# contains options to be set, we output them here because this
# option is not used in the current config.
k = substr(line_map[FNR], 2)
if ((k in conf)) print_confs(k)
}
if (("INSECURE" in conf) && line_map[FNR] ~ /^\#?SECURE$/) {
# INSECURE goes where SECURE comment is.
print_confs("INSECURE")
}
}
} else {
word = first($0, EQS)
value = rest($0, EQS)
sub(/[ \t]*\#.*$/, "", value) # ignore comments in value
if ((word in conf) && value == first(conf[word])) {
# keep config options we want
conf_pop(word)
print
}
if ((FNR in line_map) && line_map[FNR] == word) {
# rest of config options should be here
print_confs(word)
}
}
}
END {
if (e) exit
# print rest of config options (
for (word in conf) print_confs(word)
}

177
type/__dma/gencode-remote Executable file
View File

@ -0,0 +1,177 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera@ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
quote() { printf "'%s'" "$(printf '%s' "$*" | sed -e "s/'/'\\\\''/g")"; }
drop_awk_comments() { quote "$(sed '/^[[:blank:]]*#.*$/d;/^$/d' "$@")"; }
CONF_PATH=/etc/dma # set in Makefile
# Determine mailname
if test -f "${__object:?}/parameter/mailname"
then
mailname=$(cat "${__object:?}/parameter/mailname")
else
case $(cat "${__global:?}/explorer/os")
in
(debian|devuan|ubuntu)
# On Debian-like systems use /etc/mailname unless --mailname is used
mailname='/etc/mailname'
;;
(*)
mailname=${__target_fqdn:?}
;;
esac
fi
# Generate "should" values for config
conf_should=$(
if test -s "${__object:?}/parameter/smarthost"
then
printf 'SMARTHOST %s\n' "$(cat "${__object:?}/parameter/smarthost")"
fi
printf 'MAILNAME %s\n' "${mailname}"
if test -s "${__object:?}/explorer/auth_conf"
then
printf "AUTHPATH %s\n" "$(cat "${__object:?}/explorer/auth_conf")"
fi
case $(cat "${__object:?}/parameter/security")
in
(ssl|tls)
default_smtp_port=465
echo 'SECURETRANSFER'
;;
(starttls)
default_smtp_port=587
echo 'SECURETRANSFER'
echo 'STARTTLS'
;;
(opportunistic)
default_smtp_port=25
echo 'SECURETRANSFER'
echo 'STARTTLS'
echo 'OPPORTUNISTIC_TLS'
;;
(insecure)
default_smtp_port=25
echo 'INSECURE'
;;
esac
if test -s "${__object:?}/parameter/port"
then
printf 'PORT %u\n' "$(cat "${__object:?}/parameter/port")"
elif test "${default_smtp_port}" -ne 25 # DMA uses port 25 by default
then
printf 'PORT %u\n' "${default_smtp_port}"
fi
if test -f "${__object:?}/parameter/masquerade"
then
while read -r line
do
printf 'MASQUERADE %s\n' "${line}"
done <"${__object:?}/parameter/masquerade"
fi
if test -f "${__object:?}/parameter/defer"
then
echo 'DEFER'
fi
if test -f "${__object:?}/parameter/fullbounce"
then
echo 'FULLBOUNCE'
fi
if test -f "${__object:?}/parameter/nullclient"
then
test -s "${__object:?}/parameter/smarthost" || {
echo '--nullclient requires a --smarthost to be defined' >&2
exit 1
}
echo 'NULLCLIENT'
fi
)
# Sort conf_should to compare against "conf_is"
conf_should=$(echo "${conf_should}" | sort -s -k 1,1)
config_updated=false
if ! echo "${conf_should}" | cmp -s "${__object:?}/explorer/conf" -
then
# config needs to be updated
dma_conf="${CONF_PATH:?}/dma.conf"
# The following AWK script will output the new config file to be stored on
# disk. To do so it reads the current dma.conf file and the config options
# that should be set (from stdin).
# Note that the path to the current dma.conf is passed to AWK twice, because
# the new file cannot be generated in one pass.
# The logic tries to place options at a sensible location, that is:
# a) if the option is already used in the config file:
# group all similar options (e.g. MASQUERADE) at one place in the order
# they are listed in stdin.
# b) if it is a new option and a "default comment" (e.g. "#PORT 25") exists:
# place options grouped directly after the comment (the comment is left
# alone)
# c) otherwise:
# options are grouped by word (the first word in the line) and appended
# at the end of the file.
cat <<-CODE
awk $(drop_awk_comments "${__type:?}/files/update_dma_conf.awk") $(quote "${dma_conf}") <<'EOF' >$(quote "${dma_conf}.tmp") \
&& cat $(quote "${dma_conf}.tmp") >$(quote "${dma_conf}")
${conf_should}
EOF
rm $(quote "${dma_conf}.tmp")
CODE
config_updated=true
echo 'config updated' >>"${__messages_out:?}"
fi
# Send a test email if enabled and necessary (=configuration changed)
if test -f "${__object:?}/parameter/send-test-mail"
then
if grep -q '^__mail_alias/root:' "${__messages_in:?}" \
|| grep -q '^__dma_auth/' "${__messages_in:?}" \
|| ${config_updated}
then
cat <<-CODE
sendmail root <<'EOF'
Subject: [cdist] Test mail from '${__target_fqdn:?}'
Hi,
you can ignore this message.
Its sole purpose is to notify you that root mail on ${__target_fqdn:?}
will be redirected to you.
Enjoy!
EOF
CODE
fi
fi

112
type/__dma/man.rst Normal file
View File

@ -0,0 +1,112 @@
cdist-type__dma(7)
============================
NAME
----
cdist-type__dma - Setup the DragonFly Mail Agent as the MTA.
DESCRIPTION
-----------
This (singleton) type uses DMA, a small Mail Transport Agent (MTA), to accept
mails from locally installed Mail User Agents (MUA) and either deliver the mails
to a remote smart host for delivery or communicate with remote SMTP servers
directly.
REQUIRED PARAMETERS
-------------------
None.
BOOLEAN PARAMETERS
------------------
defer
If enabled, mail will not be sent immediately, but stored in a queue.
To flush the queue and send the mails, ```dma -q`` has to be run
periodically (e.g. using a cron job.)
This type does not manage such a cron job, but some operating systems ship
such a cron job with the package.
fullbounce
Enable if bounce messages should include the complete original message,
not just the headers.
nullclient
Enable to bypass aliases and local delivery, and instead forward all mails
to the defined ``--smarthost``.
send-test-mail
If set, this type will send a test email to root after setup, to check if
the configured settings work.
OPTIONAL PARAMETERS
-------------------
mailname
If present, this will be the hostname used to identify this host and the
remote part of the sender addresses.
If not defined, it defaults to ``/etc/mailname`` on Debian derivatives and
to ``__target_fqdn`` otherwise.
See `dma(8)` for more information.
Note: on Debian derivatives the ``/etc/mailname`` file should be updated
instead of using this parameter.
masquerade
Masquerade the envelope-from addresses with this address/hostname.
Use this setting if mails are not accepted by destination mail servers
because your sender domain is invalid.
This option can be used multiple times.
For more information see the `dma(8)` man page.
port
The port on which to deliver email.
If not provided, a sensible default port will be used based on the
``--security`` argument.
security
Configures whether and how DMA should use secure connections.
ssl/tls
Enable TLS/SSL secured transfer.
starttls
Use STARTTLS to establish a secure connection.
opportunistic (default)
Will try to establish a secure connection using STARTTLS, but allow
unencrypted transfer if STARTTLS fails.
Most useful when dma is used without a smarthost, delivering remote
messages directly to the outside mail exchangers.
insecure
allow plain text SMTP login over an insecure connection.
Should really *not* be used anymore!
smarthost
The mail server used to send email.
It must be configured to act as a relay for the host being configured by
this type so that mail can be sent to users non-local to the smarthost.
EXAMPLES
--------
.. code-block:: sh
# Install DMA and use the smarthost mx1.domain.tld to send mail.
__dma --smarthost mx1.domain.tld --send-test-mail
# Install DMA in a default configuration.
__dma
SEE ALSO
--------
- `DragonFly Mail Agent <https://github.com/corecode/dma>`_
- `DragonFly Handbook MTA <https://www.dragonflybsd.org/handbook/mta/>`_
AUTHORS
-------
Evilham <contact@evilham.com>
Dennis Camera <dennis.camera@ssrq-sds-fds.ch>
COPYING
-------
Copyright \(C) 2020 Evilham and Dennis Camera. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

66
type/__dma/manifest Executable file
View File

@ -0,0 +1,66 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera@ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os=$(cat "${__global:?}/explorer/os")
# Install DMA
case ${os}
in
(alpine)
__package dma --state present
export require='__package/dma'
;;
(debian|devuan|ubuntu)
__package dma --state present
export require='__package/dma'
;;
(freebsd)
# Stop sendmail if necessary
__process 'sendmail' --name 'sendmail.*' --state absent \
--stop '/etc/rc.d/sendmail onestop'
# ... and disable it
__key_value 'rcconf-sendmail-enable' --file '/etc/rc.conf' \
--key 'sendmail_enable' --delimiter '=' --value '"NONE"' \
--exact_delimiter
# Setup mailwrapper accordingly
__file '/etc/mail/mailer.conf' --mode 0644 --source - <<-'EOF'
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
sendmail /usr/libexec/dma
send-mail /usr/libexec/dma
mailq /usr/libexec/dma
newaliases /usr/libexec/dma
rmail /usr/libexec/dma
EOF
;;
(*)
cat <<EOF >&2
Your OS (${os}) is not supported yet.
Maybe adding support is as simple as adapting the packages or allowing it,
we highly encourage you to open a PR with the necessary changes.
See: https://code.ungleich.ch/ungleich-public/cdist-contrib/
EOF
exit 1
;;
esac

View File

@ -0,0 +1,4 @@
defer
fullbounce
nullclient
send-test-mail

View File

@ -0,0 +1 @@
opportunistic

View File

@ -0,0 +1,4 @@
mailname
port
security
smarthost

View File

@ -0,0 +1 @@
masquerade

0
type/__dma/singleton Normal file
View File

View File

@ -0,0 +1 @@
../../__dma/explorer/auth_conf

91
type/__dma_auth/explorer/state Executable file
View File

@ -0,0 +1,91 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
# This explorer looks for a line matching the server parameter
# in dma's auth.conf and reports:
# present: a line matching login + host + password exists
# absent: no line matching login + host exists
# different_login: a line exists but with a different login user
# different_password: a line exists but with a different password
# multiple: multiple lines matching host exist (should not happen)
auth_conf=$("${__type_explorer:?}/auth_conf")
test -r "${auth_conf}" || exit 0
awk -F'\n' '
function getvalue(path) {
# Reads the first line of the file located at path and returns it.
getline < path
close(path)
return $0
}
BEGIN {
DP = "[: \t]" # copied from dma/conf.c
parameter_dir = ENVIRON["__object"] "/parameter/"
# Read the parameters of this object
host_param = ENVIRON["__object_id"]
login_param = getvalue(parameter_dir "login")
passwd_param = getvalue(parameter_dir "password")
state = "absent"
}
/^#/ || /^$/ {
# skip comments and empty lines
next
}
{
# parse line
login = substr($0, 1, index($0, "|") - 1)
if (!login) { login = $0 } # if no "|" found
host = substr($0, length(login) + 2)
if (match(host, DP)) {
passwd = substr(host, RSTART + 1)
host = substr(host, 1, RSTART - 1)
} else {
passwd = ""
}
}
host == host_param {
# a match…
if (state == "absent") {
if (login != login_param)
state = "different_login"
else if (passwd != passwd_param)
state = "different_password"
else
state = "present"
} else {
# report "multiple" to that the type can remove the duplicates.
state = "multiple"
}
}
END {
print state
}
' "${auth_conf}"

View File

@ -0,0 +1,93 @@
#!/usr/bin/awk -f
#
# 2020 Dennis Camera (dennis.camera@ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
function getvalue(path) {
# Reads the first line of the file located at path and returns it.
getline < path
close(path)
return $0
}
function print_should() {
printf "%s|%s:%s\n", login_param, host_param, passwd_param
}
BEGIN {
FS = "\n"
DP = "[: \t]" # copied from dma/conf.c
parameter_dir = ENVIRON["__object"] "/parameter/"
mode = (getvalue(parameter_dir "state") != "absent")
host_param = ENVIRON["__object_id"]
login_param = getvalue(parameter_dir "login")
passwd_param = getvalue(parameter_dir "password")
}
# skip comments and empty lines
/^#/ || /^$/ {
print
next
}
{
# parse line (like dma/conf.c would)
login = substr($0, 1, index($0, "|") - 1)
if (!login) { login = $0 } # if no "|" found
host = substr($0, length(login) + 2)
if (match(host, DP)) {
passwd = substr(host, RSTART + 1)
host = substr(host, 1, RSTART - 1)
} else {
passwd = ""
}
}
host == host_param {
if (mode) {
# state_should == present
if (!written) {
# replace first line if host matches (but only if no line has
# been written already -> no duplicates)
print_should()
written = 1
}
next
} else {
# state_should == absent
next
}
}
# leave other lines alone
{
print
}
END {
if (mode && !written) {
# append line if no match to replace was found
print_should()
}
}

72
type/__dma_auth/gencode-remote Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh -e
#
# 2020 Dennis Camera (dennis.camera@ssrq-sds-fds.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
quote() { printf "'%s'" "$(printf '%s' "$*" | sed -e "s/'/'\\\\''/g")"; }
drop_awk_comments() { quote "$(sed '/^[[:blank:]]*#.*$/d;/^$/d' "$@")"; }
state_is=$(cat "${__object:?}/explorer/state")
state_should=$(cat "${__object:?}/parameter/state")
server=${__object_id:?}
login=$(cat "${__object:?}/parameter/login")
auth_conf=$(cat "${__object:?}/explorer/auth_conf")
test -n "${auth_conf}" || {
echo 'Cannot determine path of dma auth.conf' >&2
exit 1
}
if test "${state_is}" = "${state_should}"
then
# state is as it should
exit 0
fi
case ${state_should}
in
(present)
test -n "${login}" || { echo '--login must be non-empty' >&2; exit 1; }
if test "${state_is}" = 'absent'
then
printf 'add authuser %s on %s\n' "${login}" "${server}" >>"${__messages_out:?}"
else
printf 'set authuser %s on %s\n' "${login}" "${server}" >>"${__messages_out:?}"
fi
;;
(absent)
printf 'delete authuser %s on %s\n' "${login}" "${server}" >>"${__messages_out:?}"
;;
(*)
printf 'Invalid --state: %s.\n' "${state_should}" >&2
printf 'Acceptable values are: present, absent.\n' >&2
exit 1
;;
esac
cat <<EOF
test -f $(quote "${auth_conf}") || touch $(quote "${auth_conf}")
awk $(drop_awk_comments "${__type:?}/files/update_dma_auth.awk") <$(quote "${auth_conf}") >$(quote "${auth_conf}.tmp") \
&& cat $(quote "${auth_conf}.tmp") >$(quote "${auth_conf}")
rm -f $(quote "${auth_conf}.tmp")
EOF

66
type/__dma_auth/man.rst Normal file
View File

@ -0,0 +1,66 @@
cdist-type__dma_auth(7)
=======================
NAME
----
cdist-type__dma_auth - Configure SMTP logins for the DragonFly Mail Agent MTA.
DESCRIPTION
-----------
This cdist type allows you to set up credentials to log in to remote SMTP
servers.
NB: dma currently (v0.13) does not differentiate between users on a host.
It will use whatever user it finds in the ``auth.conf`` first.
Thus, this type will use the ``__object_id`` as the host specifier.
REQUIRED PARAMETERS
-------------------
login
The user's LOGIN name on the SMTP server.
password
The user's password (in plain text.)
OPTIONAL PARAMETERS
-------------------
state
Either ``present`` or ``absent``. Defaults to ``present``.
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# Set the password for smarthost
__dma_auth smarthost.example.com --login joe --password hunter2
# Set credentials for user at an external provider
__dma_auth mail.provider.com --login paul@example.com --password letmein
# Delete credentials for example.com (for all users)
__dma_auth example.com --login '' --password '' --state absent
SEE ALSO
--------
:strong:`cdist-type__dma`\ (7), :strong:`dma`\ (8)
AUTHORS
-------
Dennis Camera <dennis.camera@ssrq-sds-fds.ch>
COPYING
-------
Copyright \(C) 2020 Dennis Camera. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

View File

View File

@ -0,0 +1 @@
present

View File

@ -0,0 +1 @@
state

View File

@ -0,0 +1,2 @@
login
password

View File

@ -0,0 +1,15 @@
#!/bin/sh -eu
JICOFO="/usr/share/jicofo/jicofo.sh"
VIDEOBRIDGE="/usr/share/jitsi-videobridge/lib/videobridge.rc"
if [ -f "${JICOFO:?}" ]; then
jicofo_memory="$(grep JICOFO_MAX_MEMORY= "${JICOFO:?}" | cut -d= -f 2 | cut -d ";" -f 1)"
fi
if [ -f "${VIDEOBRIDGE:?}" ]; then
vb_memory="$(grep VIDEOBRIDGE_MAX_MEMORY= "${VIDEOBRIDGE:?}" | cut -d= -f 2)"
fi
cat <<EOF
jicofo ${jicofo_memory:-n/a}
videobridge ${vb_memory:-n/a}
EOF

View File

@ -0,0 +1,6 @@
#!/bin/sh -eu
if [ ! -f "${__object}/parameter/disable-prometheus-exporter" ]; then
# TODO: detect curl / depend on it?
curl -s localhost:9888/metrics
fi

View File

@ -0,0 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGB4bEkBEADffHELs6RBZEEgme2L6KXyO5XThI5ROFCMZ+4X1mZTKPyihuMX
u1IQeaLQhUKEw60NZH1HyvH11L33LYcimlyLDG7N6s/MjWtLAI+wkgb6iYY2mArM
3TqPTzVgZUcJl5Strft2U8QNq9N2qslbF7hm3g35M78r5CJmlVQYO298rz6ybovO
9TTB/C3KbDMHohEXIdVlAIKAtu+/5dWQtP7NR3RZHpfMoOvf65NiZRsudZ5SZcd1
8G7n0nv6NF5Ul+cuLsOMh7r2KiPjpHuQwobwEJpc8Nags6xTqQ8riyJsv8KXJNZh
51OQWYyQhMz/O3mVSbfdfmS4u4HUb3pheUmjq2Lx4vTlSzyCRniRC4VIhViRawTL
QyIpdw85CN7iJPN+2ZYOU4knZgSv9CDmuKFqxGSd/j4QHtL/K4e3wFE/kwD+4SWL
+xAsCZQPnZu9RNdmTfaSfsPqSwQFErTGWyuGJBzN0EFGRFIMI3m3AJSC6OOFycDV
4KPJHBQKcTH4oVF3opAJj3X45oa6886TAjwAsPG1R5FapqhWRzWsq8Cn3rr6EKJ/
8xf9Ep/KIMNJtZoout7f2AEmP/oQTNft+wWEejprd0aJMX4O6NOSG4UNxRbm32gf
rBEajiLUA0cJW+se40ACZXri36Ea8HnKnYsCaXZba9FMy9Te0OkySJpQYwARAQAB
tBVKaXRzaSA8ZGV2QGppdHNpLm9yZz6JAk4EEwEIADgWIQT/1loNor6963PUTIu0
0tIW8f14BgUCYHhsSQIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC00tIW
8f14Bt8eEADPmi1X9ycjevFR82sGo0qTUEgndu9tWiGQzS3E7SG1wIkRqiwSk7X2
J1Mrxa5kIEkl0KctpYQjhEJWV8TfATOekKhoxtanZef9q9EvpNLBJGifXAHt9b2o
Dzk7437cytW71jlByrbjUe7tVQtaEJZuOczjZGnHw70Yv6H0DUQuRDlJmocHzzU3
AgpXJ+XoS1p8gI64OgIzXVOhvyZVyNqbn0PyqeroRbxC0DPwGsTA8MYgf3ujowAI
ntVtSv0kzbZP0xU/3zpmuD+Lw0Msq4idnE0e+nApfThF28w+MAF4EikXovwr+FEh
6Czt3KGrUuoCUY1YmLqSpLQaHYvF1oRsnZIVEecXBY/sRxxOvLk4HsJtIV6jJ3qS
XAGPsxAJJBlsT0nvPC+x46wvOxBYv2WgmVRrnrz7vpp1C8yRYAaab10lUq+PufYr
S4wQXvbTKAelpOZhR00qJ1Ati7y1TFv3xFhlhEjg/r2TUc2oFEYdlIPpfkiCPeCz
kcTXB6iwuUn59Qm6ksGCL/ITo3sWZSDbOQIG63hb0FRZkF8mWnmPcGoPmR5kmvr7
QzHKmfomaORyLofXqrXf3zfhDpe5kSxfLbTsRnHCx46XJWXMFh70T19j4ILnWaGj
bnA9OWWtEyMCp9GeJPtmWKsBhP8ywt0jbbfHzczBfWRO06n47/BLSLkCDQRgeGxJ
ARAA1pi0AZ0kcW1aW9sKZNYJ2JXjsefqnqtUUDI0xOSSl5+Lzjtj1lPA1Xr2L9V4
FyUGG6N8BeQcyfl7ZAFp6EWS/RATaOze/rKxImArHdY0L48rEQNBCg6lDsvvPJYd
cMFuNFm9e+2vggKU+o0zpDiV0WIjar/I5aVyObQ77EBOJlEPDSjz2essTbZZ5Bpr
w6pRSQ8CjpOpSrNwoDDhNfHPEcokkccmPlE8xdmXn1oM5Zj/LKOEKBqJUh1Ucykh
EE9g/Mch6GV6AnuFrtAeWYzx5kfNlBvz1Y7w3TXnboQP8b9IeQwNyZTWaMMstn8z
nt8RKnrTA2eOGO61ySgtMU3fEJSN0mqH3cjpAzPX9rcdipMLe3ZDGYlixFAXpctc
dhKvEqxd+bxtvFTQlSsSSQe9DvXQOfb9pp+6SjejhTvsWhWwhPzWIOLX4IBiX13q
D5ct/IxsLwhk23+r9zpk74xwRplX4FTc3o1m+NpoWXRRAekcKd5AgnlAhY9O7Tv+
31ORR6X/hCYcs1vnxbHJgWrzv01Gx8mcOj/+7aCctsQ32oQWM6FQY/vcpSxTjJsb
npiS3ZIUYNXf32UnAuZUyCaqrpLAVAwNGBxmpwQb1SUx7HBA8e2lHbEqKW/qnUQG
bnRv0g/oSkkimADazkwojNcVdgkrF91zkUtzIya+NOiGO7cAEQEAAYkCNgQYAQgA
IBYhBP/WWg2ivr3rc9RMi7TS0hbx/XgGBQJgeGxJAhsMAAoJELTS0hbx/XgGEyQQ
ALAHIiRoFkhypGpFt3+bt3ZLQf6OD+H0ZiOcy43DlBAUz7PbNlW4bDvINkgTaGRa
+cIMwdW5lWO9fsChsEoDVnjl9rcNcTJcN5Fc/L+XnW6k9RzW1nK+mj3NiGfR7OI1
V6eNM346+EpA2ZnqVTfr14+Vu49TV7vSsfnZg6brl+t1qNzJLHcsnVxxACw95OOK
joGu56ozuxEWjsGwnvvkH7dR/HLGtk+XP0NWSBOoEpHj7bF+6h81MpcMcj4BYoaZ
AJfQyfx8rP2JQC/HNrY0bAW0ahN2x+fE9Vd6iPkrPGSGibWRv6Db/KLk1R8/8W4B
YKti313EXV8g0gc0TdwqbhLWOinCjtLW+anXsqxmVFNG1cS1CvsFi2WDRtjHP3eY
aEdnXHcnPL4gKPTeXlHf3HGDCeboGOWFeim2bHwOzbzg9Kp+lGYyi/qJW496n+Yp
wBWDVHgVlS51Y8hS7xB4FY71S4OY4W9S8XX0KUQihqoh3E44eow+Z8OE1g0CosPz
2cRioAiEeVPNra0IgD2iD7LKuEVd6zJ7RbxzWCWko+sOgCm0lqz87R5IQibEFbRV
ATvmI/B3DPYHjk7toPT5+jgcgY0QPq9JYSORbgXvoWG0f83TFIfFV6yGgmaG1DMX
YPNx6EOVTWjMMoXNbskDkw3HdcVdVz41ZnW/1lJZejvW
=uIZN
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,56 @@
#!/bin/sh -e
# This can be obtained with debconf-get-selections on a host with jitsi
# (and also analysing the deb-src)
if false; then
# We are currently not using these, just here as documentation
DEBCONF_SETTINGS="$(cat <<EOF
# Jicofo user password:
jicofo jicofo/jicofo-authpassword password STH
jitsi-meet-prosody jicofo/jicofo-authpassword password STH
# The secret used to connect to xmpp server as component
jitsi-meet-prosody jitsi-videobridge/jvbsecret password STH
jitsi-videobridge jitsi-videobridge/jvbsecret password STH
jitsi-videobridge2 jitsi-videobridge/jvbsecret password STH
# Jicofo Component secret:
jicofo jicofo/jicofosecret password STH
jitsi-meet-prosody jicofo/jicofosecret password STH
# Jicofo username:
jicofo jicofo/jicofo-authuser string focus
jitsi-meet-prosody jicofo/jicofo-authuser string focus
# The hostname of the current installation:
jitsi-meet-turnserver jitsi-meet-turnserver/jvb-hostname string ${JITSI_HOST}
# Full local server path to the SSL certificate file:
jitsi-meet-web-config jitsi-meet/cert-path-crt string
# Full local server path to the SSL key file:
jitsi-meet-web-config jitsi-meet/cert-path-key string
EOF
)"
fi
DEBCONF_SETTINGS="$(cat <<EOF
# The hostname of the current installation:
jitsi-meet-web-config jitsi-meet/jvb-hostname string ${JITSI_HOST}
# Hostname:
jicofo jitsi-videobridge/jvb-hostname string ${JITSI_HOST}
jitsi-meet-prosody jitsi-videobridge/jvb-hostname string ${JITSI_HOST}
jitsi-meet-turnserver jitsi-videobridge/jvb-hostname string ${TURN_SERVER}
jitsi-meet-web-config jitsi-videobridge/jvb-hostname string ${JITSI_HOST}
jitsi-videobridge jitsi-videobridge/jvb-hostname string ${JITSI_HOST}
jitsi-videobridge2 jitsi-videobridge/jvb-hostname string ${JITSI_HOST}
# The hostname of the current installation:
jitsi-meet-prosody jitsi-meet-prosody/jvb-hostname string ${JITSI_HOST}
# SSL certificate for the Jitsi Meet instance
# Choices: Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate), I want to use my own certificate
jitsi-meet-web-config jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)
EOF
)"
if [ -n "${TURN_SECRET}" ]; then
DEBCONF_SETTINGS="$(cat <<EOF
${DEBCONF_SETTINGS}
# The turn server secret
jitsi-meet-prosody jitsi-meet-prosody/turn-secret string ${TURN_SECRET}
EOF
)"
fi

View File

@ -0,0 +1,34 @@
#!/bin/sh -eu
# Start
cat <<EOF
# Managed remotely, changes will be lost
# Jicofo HOCON configuration. See /usr/share/jicofo/jicofo.jar/reference.conf for
#available options, syntax, and default values.
jicofo {
xmpp: {
client: {
client-proxy: focus.${JITSI_HOST:?}
}
trusted-domains: [ "recorder.${JITSI_HOST:?}" ]
}
bridge: {
brewery-jid: "JvbBrewery@internal.auth.${JITSI_HOST:?}"
}
EOF
# Secured domains if needed
if [ "${SECURED_DOMAINS_STATE:?}" = "present" ]; then
cat <<EOF
authentication: {
enabled: true
type: XMPP
login-url: ${JITSI_HOST:?}
}
EOF
fi
# End
echo '}'

View File

@ -0,0 +1 @@
../../__jitsi_meet_domain/files/jitsi-version

View File

@ -0,0 +1 @@
../../__jitsi_meet_domain/files/prosody.cfg.lua.sh

View File

@ -0,0 +1,10 @@
#!/bin/sh -e
# Setup firewall
__ufw
# Allow jitsi ports
require="__ufw" __ufw_rule http --rule 'allow 80/tcp'
require="__ufw" __ufw_rule https --rule 'allow 443/tcp'
require="__ufw" __ufw_rule jitsi_prom --rule 'allow 9888/tcp'
require="__ufw" __ufw_rule avfallback --rule 'allow 4443/tcp'
require="__ufw" __ufw_rule avdefault --rule 'allow 10000/udp'

View File

@ -0,0 +1,44 @@
#!/bin/sh -e
memory="$(cat "${__global}/explorer/memory")"
G="000000" # Will totally eff up the zero-count otherwise
# MAX_MEMORY will affect jicofo and videobridge
# As a rule of thumb, the machine's RAM should be more than 2.5 * MAX_MEMORY
if [ "${memory}" -lt "3${G}" ]; then
# If you use this, let us know how it works!
MAX_MEMORY="768m"
elif [ "${memory}" -lt "5${G}" ]; then
MAX_MEMORY="1024m"
elif [ "${memory}" -lt "8${G}" ]; then
MAX_MEMORY="2048m"
else
# Jitsi recommends running on 8G RAM and these are the defaults
MAX_MEMORY="3072m"
fi
if cut -f 2 "${__object}/explorer/configured-memory" | grep -qvE "^${MAX_MEMORY}$"; then
# At least one service has different memory settings
RESTART_SERVICES="YES"
cat <<-EOF
sed -i.tmp -E \
-e 's!^(#[[:space:]]*)?(VIDEOBRIDGE_MAX_MEMORY)=.*\$!\2=${MAX_MEMORY}!' \
/usr/share/jitsi-videobridge/lib/videobridge.rc
sed -i.tmp -E \
-e 's!(JICOFO_MAX_MEMORY)[^";]+;!\1=${MAX_MEMORY};!' \
/usr/share/jicofo/jicofo.sh
EOF
fi
if grep -qE "^__file/etc/nginx" "${__messages_in}"; then
echo "service nginx reload"
fi
if grep -qE "^(__line/jitsi_jicofo_secured_domains|(__file|__link)/etc/prosody/conf.d/|__file/etc/jitsi/(jicofo/jicofo.conf|videobridge/jvb.conf))" "${__messages_in}"; then
RESTART_SERVICES="YES"
fi
if [ -n "${RESTART_SERVICES}" ]; then
echo "systemctl restart prosody"
echo "systemctl restart jicofo"
echo "systemctl restart jitsi-videobridge2"
fi

111
type/__jitsi_meet/man.rst Normal file
View File

@ -0,0 +1,111 @@
cdist-type__jitsi_meet(7)
=========================
NAME
----
cdist-type__jitsi_meet - Setup the server-side of Jitsi-Meet.
DESCRIPTION
-----------
This (singleton) type installs and configures jitsi-meet automatically.
It does so by following loosely the official quick-install instructions and
eXO's notes for installing and managing Jitsi Meet instances.
This type also sets up nginx in a way that is compatible with
`__letsencrypt_cert` and assumes that it will only serve Jitsi instances.
You will also need the `__jitsi_meet_domain` type in order to finish setting up
the web frontend (including TLS certificates) and its settings.
You may want to use the `files/ufw` example manifest for a `__ufw`-based
firewall compatible with this type that allows all ports needed by Jitsi-Meet.
Note however that this will not deal with rules for SSH or for TCP port 9888,
which exposes the prometheus exporter if not disabled.
Remember to apply your own rules here, particularly regarding SSH.
This type only works on De{bi,vu}an systems.
It is very important for this type to stay up to date with the software, as
otherwise new deployments or maintenance of existing instances might be
negatively affected.
If you can, please contribute updates to `__jitsi_meet` and
`__jitsi_meet_domain` promptly and regularly.
Alternatively, you can help finance that work; get in touch with the type
authors for that (see below).
This type takes care of adapting the maximum memory used by jicofo and
videobridge in function of the hosts installed memory.
NOTE: This type currently does not deal with setting up coturn.
For that, you might want to check `__coturn` in
https://code.ungleich.ch/ungleich-public/cdist-contrib
In that case, this type should run *after* `__coturn`.
OPTIONAL PARAMETERS
-------------------
abort-conference-count
Only has an effect if the prometheus exporter is enabled and if it is not
empty (default).
If at least this many conferences are active on the server, the type will
bail out before making any changes.
This is useful if you want to avoid service disruptions due to e.g. an SLA.
turn-secret
The shared secret for the TURN server.
turn-server
The hostname of the TURN server.
This will assume that it is listening with TLS on port 443.
BOOLEAN PARAMETERS
------------------
disable-prometheus-exporter
This type enables a prometheus exporter for jitsi by default, if you would
rather not have that, pass this parameter.
The explorer is based on:
https://github.com/systemli/prometheus-jitsi-meet-exporter
secured-domains
If this flag is present, all domains that use this Jitsi instance will
require that an authenticated user starts a meeting.
For information on how this is achieved, see
https://jitsi.github.io/handbook/docs/devops-guide/secure-domain .
You will need to create the users with `__jitsi_meet_user(7)`.
EXAMPLES
--------
.. code-block:: sh
# Setup the firewall for Jitsi-Meet
. "${__global}/type/__jitsi_meet/files/ufw"
export require="__ufw"
# Setup firewall SSH rules as necessary
__ufw_rule ssh --rule 'allow 22/tcp from 10.0.0.0/24'
# Setup Jitsi on this host
__jitsi_meet \
--turn-server "turn.exo.cat" \
--turn-secret "WeNeedGoodSecurity"
SEE ALSO
--------
- `__jitsi_meet_domain(7)`
- `__jitsi_meet_user(7)`
AUTHORS
-------
Evilham <contact@evilham.com>
COPYING
-------
Copyright \(C) 2022 Evilham.

309
type/__jitsi_meet/manifest Executable file
View File

@ -0,0 +1,309 @@
#!/bin/sh -e
os="$(cat "${__global}/explorer/os")"
case "${os}" in
devuan|debian)
;;
*)
echo "Your OS '${os}' is currently not supported." > /dev/stderr
exit 1
;;
esac
current_conferences="$(cat "${__object}/explorer/jitsi-status" | grep -E "^jitsi_conferences[[:space:]]" | cut -d ' ' -f 2)"
ABORT_CONFERENCE_COUNT="$(cat "${__object}/parameter/abort-conference-count")"
if [ -n "${current_conferences}" ] && [ -n "${ABORT_CONFERENCE_COUNT}" ] && \
[ "${ABORT_CONFERENCE_COUNT}" -le "${current_conferences}" ]; then
cat <<-EOF
Early bail out was requested when at least ${ABORT_CONFERENCE_COUNT} conferences are taking place.
There are currently ${current_conferences} active conferences.
Try again at a later time or remove or increase --abort-conference-count
EOF
exit 1
fi
JITSI_HOST="${__target_host}"
if [ -f "${__object}/parameter/jitsi-version" ]; then
# This has been deprecated and will be removed 'soon'
JITSI_VERSION="$(cat "${__object}/parameter/jitsi-version")"
else
# Note this won't be a parameter anymore, we won't let users stay behind
JITSI_VERSION="$(cat "${__type}/files/jitsi-version")"
fi
TURN_SERVER="$(cat "${__object}/parameter/turn-server")"
TURN_SECRET="$(cat "${__object}/parameter/turn-secret")"
if [ -z "${TURN_SERVER}" ]; then
TURN_SERVER="${JITSI_HOST}"
fi
# The rest is loosely based on Jitsi's documentation
# https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart
# Setup repositories
## First the signing keys
### Remove old signing key
__apt_key "jitsi_meet_2016" \
--keyid "66A9 CD05 95D6 AFA2 4729 0D3B EF8B 479E 2DC1 389C" \
--use-deprecated-apt-key \
--state "absent"
### Add new signing key
require="__apt_key/jitsi_meet_2016" __apt_key jitsi_meet_2021 \
--source "${__type}/files/apt_2021.gpg" \
--state "present"
## Now the repositories (they are a tad weird, so distribution is 'stable/')
require="__apt_key/jitsi_meet_2021" __apt_source jitsi_meet \
--uri 'https://download.jitsi.org' \
--distribution 'stable/' \
--state present
## Ensure apt cache is up-to-date
require="__apt_source/jitsi_meet" __apt_update_index
export require="${require} __apt_source/jitsi_meet __apt_update_index"
# Pre-feed debconf settings, so Jitsi's installation has a good config
# shellcheck source=type/__jitsi_meet/files/debconf_settings.sh
. "${__type}/files/debconf_settings.sh" # This defines DEBCONF_SETTINGS
__debconf_set_selections jitsi_meet --line "${DEBCONF_SETTINGS}"
export require="${require} __debconf_set_selections/jitsi_meet"
# Install and upgrade packages as needed
# NOTE: we are doing version pinning again, but it breaks sometimes when
# the version is not the latest.
# This happens because dependencies might not be properly resolved.
# To avoid this, this type must be maintained up to date.
# If we don't use this, keeping Jitsi's up to date is very difficult.
__package_apt jitsi-meet --version "${JITSI_VERSION}"
# Proceed only after installation/upgrade has finished
export require="__package_apt/jitsi-meet"
# TODO: generalise and move out
# Prep nginx for acme settings
NGINX_ETC="/etc/nginx"
#
# Setup the acme-challenge snippet
#
__directory "${NGINX_ETC}/snippets" --state present
require="__directory${NGINX_ETC}/snippets" __file "${NGINX_ETC}/snippets/acme-challenge.conf" \
--mode 644 \
--source - << EOF
# This file is managed remotely, all changes will be lost
# This was heavily inspired by debops.org.
# Automatic Certificate Management Environment (ACME) support.
# https://tools.ietf.org/html/draft-ietf-acme-acme-01
# https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment
# Return the ACME challenge present in the server public root.
# If not found, switch to global web server root.
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
try_files \$uri @well-known-acme-challenge;
}
# Return the ACME challenge present in the global server public root.
# If not present, redirect request to a specified domain.
location @well-known-acme-challenge {
root /usr/share/jitsi-meet;
default_type "text/plain";
try_files \$uri @redirect-acme-challenge;
}
# Redirect the ACME challenge to a different host. If a redirect loop is
# detected, return 404.
location @redirect-acme-challenge {
if (\$arg_redirect) {
return 404;
}
return 307 \$scheme://${ACME_DOMAIN}\$request_uri?redirect=yes;
}
# Return 404 if ACME challenge well known path is accessed directly.
location = /.well-known/acme-challenge/ {
return 404;
}
EOF
__directory "${NGINX_ETC}/sites-available" --state present
require="__directory${NGINX_ETC}/sites-available" __file "${NGINX_ETC}/sites-available/default" \
--mode 644 \
--source - << EOF
# This file is managed remotely, all changes will be lost
server_names_hash_bucket_size 64;
types {
# nginx's default mime.types doesn't include a mapping for wasm
application/wasm wasm;
}
server {
# Listen on IPv4
listen 80;
# Note: there is an ipv6only=off flag, but it is Linux-only
# incidentally, that defaults to "on", which is what causes
# not having the double listen to listen on IPv6-only
listen [::]:80;
server_name welcome;
root /srv/www/sites/welcome/public;
include snippets/acme-challenge.conf;
location / {
return 301 https://\$host\$request_uri;
}
}
EOF
# Starting from 2.0.7210, jitsi defines following nginx upstreams
__directory "${NGINX_ETC}/conf.d" --state present
require="__directory${NGINX_ETC}/conf.d" __file "${NGINX_ETC}/conf.d/prosody.conf" \
--mode 644 \
--source - << EOF
upstream prosody {
zone upstreams 64K;
server 127.0.0.1:5280;
keepalive 2;
}
EOF
require="__directory${NGINX_ETC}/conf.d" __file "${NGINX_ETC}/conf.d/jvb1.conf" \
--mode 644 \
--source - << EOF
upstream jvb1 {
zone upstreams 64K;
server 127.0.0.1:9090;
keepalive 2;
}
EOF
if [ -f "${__object}/parameter/secured-domains" ]; then
SECURED_DOMAINS_STATE='present'
else
SECURED_DOMAINS_STATE='absent'
fi
# This is the main host config
PROSODY_MAIN_CONFIG="YES"
# Prosody settings for common components (jvb, focus, ...)
# shellcheck source=type/__jitsi_meet/files/prosody.cfg.lua.sh
. "${__type}/files/prosody.cfg.lua.sh" # This defines PROSODY_CONFIG
__file "/etc/prosody/conf.d/00_jitsi_base.cfg.lua" \
--group prosody \
--mode 0440 \
--source - <<EOF
${PROSODY_CONFIG}
EOF
# Clean up zauth.cfg.lua file, which we don't use now
__file "/etc/prosody/conf.d/${JITSI_HOST}.zauth.cfg.lua" \
--state absent
export SECURED_DOMAINS_STATE
export JITSI_HOST
"${__type}/files/jicofo.conf.sh" | \
__file /etc/jitsi/jicofo/jicofo.conf --mode 0444 --source '-'
# Enable the private colibri REST API end point for better stats
__file "/etc/jitsi/videobridge/jvb.conf" --mode 0444 --source '-' <<EOFJVB
videobridge {
http-servers {
public {
port = 9090
}
private {
port = 8080
}
}
websockets {
enabled = true
domain = "${JITSI_HOST}:443"
tls = true
}
apis {
rest {
enabled = true
}
}
}
EOFJVB
# Enable simple per-domain body customisation
__file "/usr/share/jitsi-meet/body.html" \
--mode 0644 \
--source '-' <<EOF
<!--#include virtual="body-\${host}.html" -->
EOF
# These two should be changed on new release
EXPORTER_VERSION="1.2.0"
EXPORTER_CHECKSUM="sha256:6377ffa7be0c7deb66545616add7245da96f8b7746d6712f41cfa9fe72c935ce"
EXPORTER_URL="https://github.com/systemli/prometheus-jitsi-meet-exporter/releases/download/${EXPORTER_VERSION}/prometheus-jitsi-meet-exporter_${EXPORTER_VERSION}_linux_amd64.tar.gz"
if [ -f "${__object}/parameter/disable-prometheus-exporter" ]; then
EXPORTER_STATE="absent"
else
EXPORTER_STATE="present"
fi
__evilham_single_binary_service prometheus-jitsi-meet-exporter \
--state "${EXPORTER_STATE}" \
--do-not-manage-user \
--user "nobody" \
--group "nogroup" \
--version "${EXPORTER_VERSION}" \
--checksum "${EXPORTER_CHECKSUM}" \
--url "${EXPORTER_URL}" \
--unpack \
--service-args "-videobridge-url 'http://localhost:8080/colibri/stats' -web.listen-address ':9888'"
#
# Setup interpreter assets if requested
# See: https://gitlab.com/mfmt/jsi/
#
jsi_updated_on="2022-04-21"
__link "/usr/share/jitsi-meet/interpreters.html" \
--type symbolic \
--source "/opt/jsi/static/index.html.sample"
__directory /opt/jsi --mode 0755
export require="__directory/opt/jsi"
__download /opt/jsi/jsi.tar.gz \
--url 'https://gitlab.com/mfmt/jsi/-/archive/1d2cceaf615ee61c0bba80e5bddc61c5d1018303/jsi-1d2cceaf615ee61c0bba80e5bddc61c5d1018303.tar.gz' \
--sum "sha256:b020141093daa9937507b098f358d0be994834c3e23866a457fc5140415a0c53"
export require="__download/opt/jsi/jsi.tar.gz"
__unpack /opt/jsi/jsi.tar.gz \
--preserve-archive \
--tar-strip 1 \
--destination /opt/jsi/static \
--onchange "$(cat <<EOF
# Patch style.css to be served on /i/
sed -i.tmp -E \
-e 's!url[(]/img/welcome-background.png[)]!url(/i/img/welcome-background.png)!' \
/opt/jsi/static/style.css
# Patch jsi.js to be served on /i/
# and so it always uses the domain it's served from
# and so it uses /i/ROOM for the form
sed -i.tmp -E \
-e 's!substr[(][0-9]+[)]!substr(3)!' \
-e 's!config[.]jitsimeet_url!url.host!' \
-e 's!(window[.]location[.]href)[[:space:]]*=[[:space:]]*"/"!\1 = "/i/"!' \
/opt/jsi/static/jsi.js
# Patch the sample index.html, so it loads external_api.js from same host
# and to easen up on the branding
# and to enable browser cache
sed -i.tmp -E \
-e "s!src=[^>]*(/external_api.js).!src='\1'!" \
-e "s!<h1>[^<]*</h1>!<h1>Jitsi Meetings with interpreter</h1>!" \
-e "s!https://meet.mayfirst.org!/!" \
-e "s!(style.css|jsi.js)([^?])!\1?v=${jsi_updated_on:?}\2!" \
/opt/jsi/static/index.html.sample
EOF
)"

View File

@ -0,0 +1,2 @@
disable-prometheus-exporter
secured-domains

View File

@ -0,0 +1,4 @@
Supporting different versions lead to strange issues in the life-time of a
Jitsi instance. Chiefly: difficulties upgrading.
If you are specifying this for a valid reason, please get in touch.

View File

@ -0,0 +1,4 @@
abort-conference-count
jitsi-version
turn-secret
turn-server

View File

View File

@ -0,0 +1 @@
secured-domains

View File

@ -0,0 +1,35 @@
#!/bin/sh -eu
# This is a helper to update the '.sh.orig' files for jitsi's
# configuration files.
# Then the changes must be propagated to their corresponding .sh
# files by the type maintainer or a contributor
# We could automate this, but are using it as an indicator for the
# latest branch with which we conciliated changes.
BRANCH="jitsi-meet_7439"
REPO="https://github.com/jitsi/jitsi-meet"
get_url() {
file="${1}"
printf "%s/raw/stable/%s/%s" "${REPO}" "${BRANCH}" "${file}"
}
download_file() {
file="${1}"
destination="${2:-${file}.sh.orig}"
url="$(get_url "${file}")"
echo "Downloading ${destination}"
curl -L "${url}" > "${destination}"
echo
}
download_file config.js
download_file interface_config.js
download_file doc/debian/jitsi-meet/jitsi-meet.example nginx.sh.orig
download_file doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example prosody.cfg.lua.sh.orig
# Change the version file, maintainers should check that it matches
# the deb version
printf "2.0.%s-1" "${BRANCH#*_}" > jitsi-version

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,281 @@
#!/bin/sh -e
# default jitsi logo in svg
BRANDING_WATERMARK_PATH='images/watermark.svg'
# overrides default jitsi logo with the provided custom png logo
if [ -n "${BRANDING_WATERMARK}" ]; then
BRANDING_WATERMARK_PATH='images/watermark.png'
fi
# shellcheck disable=SC2034 # This is intended to be included
JITSI_INTERFACE_CONFIG_JS="$(cat <<EOF
/* eslint-disable no-unused-vars, no-var, max-len */
/* eslint sort-keys: ["error", "asc", {"caseSensitive": false}] */
/**
* !!!IMPORTANT!!!
*
* This file is considered deprecated. All options will eventually be moved to
* config.js, and no new options should be added here.
*/
var interfaceConfig = {
APP_NAME: '${BRANDING_APP_NAME}',
AUDIO_LEVEL_PRIMARY_COLOR: 'rgba(255,255,255,0.4)',
AUDIO_LEVEL_SECONDARY_COLOR: 'rgba(255,255,255,0.2)',
/**
* A UX mode where the last screen share participant is automatically
* pinned. Valid values are the string "remote-only" so remote participants
* get pinned but not local, otherwise any truthy value for all participants,
* and any falsy value to disable the feature.
*
* Note: this mode is experimental and subject to breakage.
*/
AUTO_PIN_LATEST_SCREEN_SHARE: 'remote-only',
BRAND_WATERMARK_LINK: '',
CLOSE_PAGE_GUEST_HINT: false, // A html text to be shown to guests on the close page, false disables it
DEFAULT_BACKGROUND: '#040404',
DEFAULT_LOGO_URL: '${BRANDING_WATERMARK_PATH}',
DEFAULT_WELCOME_PAGE_LOGO_URL: '${BRANDING_WATERMARK_PATH}',
DISABLE_DOMINANT_SPEAKER_INDICATOR: false,
/**
* If true, notifications regarding joining/leaving are no longer displayed.
*/
DISABLE_JOIN_LEAVE_NOTIFICATIONS: false,
/**
* If true, presence status: busy, calling, connected etc. is not displayed.
*/
DISABLE_PRESENCE_STATUS: false,
/**
* Whether the ringing sound in the call/ring overlay is disabled. If
* {@code undefined}, defaults to {@code false}.
*
* @type {boolean}
*/
DISABLE_RINGING: false,
/**
* Whether the speech to text transcription subtitles panel is disabled.
* If {@code undefined}, defaults to {@code false}.
*
* @type {boolean}
*/
DISABLE_TRANSCRIPTION_SUBTITLES: false,
/**
* Whether or not the blurred video background for large video should be
* displayed on browsers that can support it.
*/
DISABLE_VIDEO_BACKGROUND: false,
DISPLAY_WELCOME_FOOTER: true,
DISPLAY_WELCOME_PAGE_ADDITIONAL_CARD: false,
DISPLAY_WELCOME_PAGE_CONTENT: false,
DISPLAY_WELCOME_PAGE_TOOLBAR_ADDITIONAL_CONTENT: false,
ENABLE_DIAL_OUT: true,
ENABLE_FEEDBACK_ANIMATION: false, // Enables feedback star animation.
FILM_STRIP_MAX_HEIGHT: 120,
GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
/**
* Hide the logo on the deep linking pages.
*/
HIDE_DEEP_LINKING_LOGO: false,
/**
* Hide the invite prompt in the header when alone in the meeting.
*/
HIDE_INVITE_MORE_HEADER: false,
JITSI_WATERMARK_LINK: 'https://jitsi.org',
LANG_DETECTION: true, // Allow i18n to detect the system language
LIVE_STREAMING_HELP_LINK: 'https://jitsi.org/live', // Documentation reference for the live streaming feature.
LOCAL_THUMBNAIL_RATIO: 16 / 9, // 16:9
/**
* Maximum coefficient of the ratio of the large video to the visible area
* after the large video is scaled to fit the window.
*
* @type {number}
*/
MAXIMUM_ZOOMING_COEFFICIENT: 1.3,
/**
* Whether the mobile app Jitsi Meet is to be promoted to participants
* attempting to join a conference in a mobile Web browser. If
* {@code undefined}, defaults to {@code true}.
*
* @type {boolean}
*/
MOBILE_APP_PROMO: true,
/**
* Specify custom URL for downloading android mobile app.
*/
MOBILE_DOWNLOAD_LINK_ANDROID: 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
/**
* Specify custom URL for downloading f droid app.
*/
MOBILE_DOWNLOAD_LINK_F_DROID: 'https://f-droid.org/en/packages/org.jitsi.meet/',
/**
* Specify URL for downloading ios mobile app.
*/
MOBILE_DOWNLOAD_LINK_IOS: 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905',
NATIVE_APP_NAME: 'Jitsi Meet',
// Names of browsers which should show a warning stating the current browser
// has a suboptimal experience. Browsers which are not listed as optimal or
// unsupported are considered suboptimal. Valid values are:
// chrome, chromium, edge, electron, firefox, nwjs, opera, safari
OPTIMAL_BROWSERS: [ 'chrome', 'chromium', 'firefox', 'nwjs', 'electron', 'safari' ],
POLICY_LOGO: null,
PROVIDER_NAME: 'Jitsi',
/**
* If true, will display recent list
*
* @type {boolean}
*/
RECENT_LIST_ENABLED: true,
REMOTE_THUMBNAIL_RATIO: 1, // 1:1
SETTINGS_SECTIONS: [ 'devices', 'language', 'moderator', 'profile', 'calendar', 'sounds' ],
/**
* Specify which sharing features should be displayed. If the value is not set
* all sharing features will be shown. You can set [] to disable all.
*/
// SHARING_FEATURES: ['email', 'url', 'dial-in', 'embed'],
SHOW_BRAND_WATERMARK: false,
/**
* Decides whether the chrome extension banner should be rendered on the landing page and during the meeting.
* If this is set to false, the banner will not be rendered at all. If set to true, the check for extension(s)
* being already installed is done before rendering.
*/
SHOW_CHROME_EXTENSION_BANNER: false,
SHOW_DEEP_LINKING_IMAGE: false,
SHOW_JITSI_WATERMARK: true,
SHOW_POWERED_BY: false,
SHOW_PROMOTIONAL_CLOSE_PAGE: false,
/*
* If indicated some of the error dialogs may point to the support URL for
* help.
*/
SUPPORT_URL: 'https://community.jitsi.org/',
// Browsers, in addition to those which do not fully support WebRTC, that
// are not supported and should show the unsupported browser page.
UNSUPPORTED_BROWSERS: [],
/**
* Whether to show thumbnails in filmstrip as a column instead of as a row.
*/
VERTICAL_FILMSTRIP: true,
// Determines how the video would fit the screen. 'both' would fit the whole
// screen, 'height' would fit the original video height to the height of the
// screen, 'width' would fit the original video width to the width of the
// screen respecting ratio, 'nocrop' would make the video as large as
// possible and preserve aspect ratio without cropping.
VIDEO_LAYOUT_FIT: 'both',
/**
* If true, hides the video quality label indicating the resolution status
* of the current large video.
*
* @type {boolean}
*/
VIDEO_QUALITY_LABEL_DISABLED: false,
/**
* How many columns the tile view can expand to. The respected range is
* between 1 and 5.
*/
// TILE_VIEW_MAX_COLUMNS: 5,
/**
* Specify Firebase dynamic link properties for the mobile apps.
*/
// MOBILE_DYNAMIC_LINK: {
// APN: 'org.jitsi.meet',
// APP_CODE: 'w2atb',
// CUSTOM_DOMAIN: undefined,
// IBI: 'com.atlassian.JitsiMeet.ios',
// ISI: '1165103905'
// },
/**
* Specify mobile app scheme for opening the app from the mobile browser.
*/
// APP_SCHEME: 'org.jitsi.meet',
/**
* Specify the Android app package name.
*/
// ANDROID_APP_PACKAGE: 'org.jitsi.meet',
// List of undocumented settings
/**
INDICATOR_FONT_SIZES
PHONE_NUMBER_REGEX
*/
// -----------------DEPRECATED CONFIGS BELOW THIS LINE-----------------------------
// Connection indicators (
// CONNECTION_INDICATOR_AUTO_HIDE_ENABLED,
// CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT,
// CONNECTION_INDICATOR_DISABLED) got moved to config.js.
// Please use disableModeratorIndicator from config.js
// DISABLE_FOCUS_INDICATOR: false,
// Please use defaultLocalDisplayName from config.js
// DEFAULT_LOCAL_DISPLAY_NAME: 'me',
// Please use defaultRemoteDisplayName from config.js
// DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
// Moved to config.js as \`toolbarConfig.initialTimeout\`.
// INITIAL_TOOLBAR_TIMEOUT: 20000,
// Moved to config.js as \`toolbarConfig.alwaysVisible\`.
// TOOLBAR_ALWAYS_VISIBLE: false,
// This config was moved to config.js as \`toolbarButtons\`.
// TOOLBAR_BUTTONS: [],
// Moved to config.js as \`toolbarConfig.timeout\`.
// TOOLBAR_TIMEOUT: 4000,
// Allow all above example options to include a trailing comma and
// prevent fear when commenting out the last value.
// eslint-disable-next-line sort-keys
makeJsonParserHappy: 'even if last key had a trailing comma'
// No configuration value should follow this line.
};
/* eslint-enable no-unused-vars, no-var, max-len */
EOF
)"

View File

@ -0,0 +1,268 @@
/* eslint-disable no-unused-vars, no-var, max-len */
/* eslint sort-keys: ["error", "asc", {"caseSensitive": false}] */
/**
* !!!IMPORTANT!!!
*
* This file is considered deprecated. All options will eventually be moved to
* config.js, and no new options should be added here.
*/
var interfaceConfig = {
APP_NAME: 'Jitsi Meet',
AUDIO_LEVEL_PRIMARY_COLOR: 'rgba(255,255,255,0.4)',
AUDIO_LEVEL_SECONDARY_COLOR: 'rgba(255,255,255,0.2)',
/**
* A UX mode where the last screen share participant is automatically
* pinned. Valid values are the string "remote-only" so remote participants
* get pinned but not local, otherwise any truthy value for all participants,
* and any falsy value to disable the feature.
*
* Note: this mode is experimental and subject to breakage.
*/
AUTO_PIN_LATEST_SCREEN_SHARE: 'remote-only',
BRAND_WATERMARK_LINK: '',
CLOSE_PAGE_GUEST_HINT: false, // A html text to be shown to guests on the close page, false disables it
DEFAULT_BACKGROUND: '#040404',
DEFAULT_LOGO_URL: 'images/watermark.svg',
DEFAULT_WELCOME_PAGE_LOGO_URL: 'images/watermark.svg',
DISABLE_DOMINANT_SPEAKER_INDICATOR: false,
/**
* If true, notifications regarding joining/leaving are no longer displayed.
*/
DISABLE_JOIN_LEAVE_NOTIFICATIONS: false,
/**
* If true, presence status: busy, calling, connected etc. is not displayed.
*/
DISABLE_PRESENCE_STATUS: false,
/**
* Whether the ringing sound in the call/ring overlay is disabled. If
* {@code undefined}, defaults to {@code false}.
*
* @type {boolean}
*/
DISABLE_RINGING: false,
/**
* Whether the speech to text transcription subtitles panel is disabled.
* If {@code undefined}, defaults to {@code false}.
*
* @type {boolean}
*/
DISABLE_TRANSCRIPTION_SUBTITLES: false,
/**
* Whether or not the blurred video background for large video should be
* displayed on browsers that can support it.
*/
DISABLE_VIDEO_BACKGROUND: false,
DISPLAY_WELCOME_FOOTER: true,
DISPLAY_WELCOME_PAGE_ADDITIONAL_CARD: false,
DISPLAY_WELCOME_PAGE_CONTENT: false,
DISPLAY_WELCOME_PAGE_TOOLBAR_ADDITIONAL_CONTENT: false,
ENABLE_DIAL_OUT: true,
ENABLE_FEEDBACK_ANIMATION: false, // Enables feedback star animation.
FILM_STRIP_MAX_HEIGHT: 120,
GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
/**
* Hide the logo on the deep linking pages.
*/
HIDE_DEEP_LINKING_LOGO: false,
/**
* Hide the invite prompt in the header when alone in the meeting.
*/
HIDE_INVITE_MORE_HEADER: false,
JITSI_WATERMARK_LINK: 'https://jitsi.org',
LANG_DETECTION: true, // Allow i18n to detect the system language
LIVE_STREAMING_HELP_LINK: 'https://jitsi.org/live', // Documentation reference for the live streaming feature.
LOCAL_THUMBNAIL_RATIO: 16 / 9, // 16:9
/**
* Maximum coefficient of the ratio of the large video to the visible area
* after the large video is scaled to fit the window.
*
* @type {number}
*/
MAXIMUM_ZOOMING_COEFFICIENT: 1.3,
/**
* Whether the mobile app Jitsi Meet is to be promoted to participants
* attempting to join a conference in a mobile Web browser. If
* {@code undefined}, defaults to {@code true}.
*
* @type {boolean}
*/
MOBILE_APP_PROMO: true,
/**
* Specify custom URL for downloading android mobile app.
*/
MOBILE_DOWNLOAD_LINK_ANDROID: 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
/**
* Specify custom URL for downloading f droid app.
*/
MOBILE_DOWNLOAD_LINK_F_DROID: 'https://f-droid.org/en/packages/org.jitsi.meet/',
/**
* Specify URL for downloading ios mobile app.
*/
MOBILE_DOWNLOAD_LINK_IOS: 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905',
NATIVE_APP_NAME: 'Jitsi Meet',
// Names of browsers which should show a warning stating the current browser
// has a suboptimal experience. Browsers which are not listed as optimal or
// unsupported are considered suboptimal. Valid values are:
// chrome, chromium, edge, electron, firefox, nwjs, opera, safari
OPTIMAL_BROWSERS: [ 'chrome', 'chromium', 'firefox', 'nwjs', 'electron', 'safari' ],
POLICY_LOGO: null,
PROVIDER_NAME: 'Jitsi',
/**
* If true, will display recent list
*
* @type {boolean}
*/
RECENT_LIST_ENABLED: true,
REMOTE_THUMBNAIL_RATIO: 1, // 1:1
SETTINGS_SECTIONS: [ 'devices', 'language', 'moderator', 'profile', 'calendar', 'sounds' ],
/**
* Specify which sharing features should be displayed. If the value is not set
* all sharing features will be shown. You can set [] to disable all.
*/
// SHARING_FEATURES: ['email', 'url', 'dial-in', 'embed'],
SHOW_BRAND_WATERMARK: false,
/**
* Decides whether the chrome extension banner should be rendered on the landing page and during the meeting.
* If this is set to false, the banner will not be rendered at all. If set to true, the check for extension(s)
* being already installed is done before rendering.
*/
SHOW_CHROME_EXTENSION_BANNER: false,
SHOW_DEEP_LINKING_IMAGE: false,
SHOW_JITSI_WATERMARK: true,
SHOW_POWERED_BY: false,
SHOW_PROMOTIONAL_CLOSE_PAGE: false,
/*
* If indicated some of the error dialogs may point to the support URL for
* help.
*/
SUPPORT_URL: 'https://community.jitsi.org/',
// Browsers, in addition to those which do not fully support WebRTC, that
// are not supported and should show the unsupported browser page.
UNSUPPORTED_BROWSERS: [],
/**
* Whether to show thumbnails in filmstrip as a column instead of as a row.
*/
VERTICAL_FILMSTRIP: true,
// Determines how the video would fit the screen. 'both' would fit the whole
// screen, 'height' would fit the original video height to the height of the
// screen, 'width' would fit the original video width to the width of the
// screen respecting ratio, 'nocrop' would make the video as large as
// possible and preserve aspect ratio without cropping.
VIDEO_LAYOUT_FIT: 'both',
/**
* If true, hides the video quality label indicating the resolution status
* of the current large video.
*
* @type {boolean}
*/
VIDEO_QUALITY_LABEL_DISABLED: false,
/**
* How many columns the tile view can expand to. The respected range is
* between 1 and 5.
*/
// TILE_VIEW_MAX_COLUMNS: 5,
/**
* Specify Firebase dynamic link properties for the mobile apps.
*/
// MOBILE_DYNAMIC_LINK: {
// APN: 'org.jitsi.meet',
// APP_CODE: 'w2atb',
// CUSTOM_DOMAIN: undefined,
// IBI: 'com.atlassian.JitsiMeet.ios',
// ISI: '1165103905'
// },
/**
* Specify mobile app scheme for opening the app from the mobile browser.
*/
// APP_SCHEME: 'org.jitsi.meet',
/**
* Specify the Android app package name.
*/
// ANDROID_APP_PACKAGE: 'org.jitsi.meet',
// List of undocumented settings
/**
INDICATOR_FONT_SIZES
PHONE_NUMBER_REGEX
*/
// -----------------DEPRECATED CONFIGS BELOW THIS LINE-----------------------------
// Connection indicators (
// CONNECTION_INDICATOR_AUTO_HIDE_ENABLED,
// CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT,
// CONNECTION_INDICATOR_DISABLED) got moved to config.js.
// Please use disableModeratorIndicator from config.js
// DISABLE_FOCUS_INDICATOR: false,
// Please use defaultLocalDisplayName from config.js
// DEFAULT_LOCAL_DISPLAY_NAME: 'me',
// Please use defaultRemoteDisplayName from config.js
// DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',
// Moved to config.js as `toolbarConfig.initialTimeout`.
// INITIAL_TOOLBAR_TIMEOUT: 20000,
// Moved to config.js as `toolbarConfig.alwaysVisible`.
// TOOLBAR_ALWAYS_VISIBLE: false,
// This config was moved to config.js as `toolbarButtons`.
// TOOLBAR_BUTTONS: [],
// Moved to config.js as `toolbarConfig.timeout`.
// TOOLBAR_TIMEOUT: 4000,
// Allow all above example options to include a trailing comma and
// prevent fear when commenting out the last value.
// eslint-disable-next-line sort-keys
makeJsonParserHappy: 'even if last key had a trailing comma'
// No configuration value should follow this line.
};
/* eslint-enable no-unused-vars, no-var, max-len */

View File

@ -0,0 +1 @@
2.0.7439-1

View File

@ -0,0 +1,204 @@
#!/bin/sh -e
# shellcheck disable=SC2034 # This is intended to be included
JITSI_NGINX_CONFIG="$(cat <<EOF
# Jitsi uses following lines by default, in our cdist types they must be commented
# out as we already set it with __jitsi_meet in the default server config.
#server_names_hash_bucket_size 64;
#
#types {
## nginx's default mime.types doesn't include a mapping for wasm
# application/wasm wasm;
#}
# These upstreams are managed by __jitsi_meet
#upstream prosody {
# zone upstreams 64K;
# server 127.0.0.1:5280;
# keepalive 2;
#}
#upstream jvb1 {
# zone upstreams 64K;
# server 127.0.0.1:9090;
# keepalive 2;
#}
server {
listen 80;
listen [::]:80;
server_name ${DOMAIN};
include snippets/acme-challenge.conf;
location / {
return 301 https://\$host\$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name ${DOMAIN};
include snippets/acme-challenge.conf;
# Mozilla Guideline v5.4, nginx 1.17.7, OpenSSL 1.1.1d, intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m; # about 40000 sessions
ssl_session_tickets off;
add_header Strict-Transport-Security "max-age=63072000" always;
set \$prefix "";
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
root /usr/share/jitsi-meet;
# ssi on with javascript for multidomain variables in config.js
ssi on;
ssi_types application/x-javascript application/javascript;
# Try the custom page for this domain, fallback to default page
index index-${DOMAIN}.html index.html index.htm;
error_page 404 /static/404.html;
gzip on;
gzip_types text/plain text/css application/javascript application/json image/x-icon application/octet-stream application/wasm;
gzip_vary on;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 512;
# We expect this domain to be properly configured, the file should exist
location = /config.js {
alias /etc/jitsi/meet/${DOMAIN}-config.js;
}
# We expect this domain to be properly configured, the file should exist
location = /interface_config.js {
alias /etc/jitsi/meet/${DOMAIN}-interface_config.js;
}
# This may or may not exist; it will be set up in config.js if needed
location = /branding.json {
alias /etc/jitsi/meet/${DOMAIN}-branding.json;
}
# Try custom image and fallback to default
location = /images/watermark.png {
try_files /images/watermark-${DOMAIN}.png \$uri;
}
location = /external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js;
}
# ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)\$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/\$1/\$2;
# cache all versioned files
if (\$arg_v) {
expires 1y;
}
}
# Paths for jsi / interpreters
location ~ ^/i/(img/[^./]*.png|jsi.js|style.css)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /opt/jsi/static/\$1;
# cache all versioned files
if (\$arg_v) {
expires 1y;
}
}
location ~ ^/i/
{
try_files /${DOMAIN}-interpreters.html /interpreters.html \$uri;
}
# BOSH
location = /http-bind {
proxy_pass http://prosody/http-bind?prefix=\$prefix&\$args;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For \$remote_addr;
# Prevision for 'multi-domain' jitsi instances
# https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391
proxy_set_header Host ${DOMAIN};
proxy_set_header Connection "";
}
# xmpp websockets
location = /xmpp-websocket {
proxy_pass http://prosody/xmpp-websocket?prefix=\$prefix&\$args;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
# Prevision for 'multi-domain' jitsi instances
# https://community.jitsi.org/t/same-jitsi-meet-instance-with-multiple-domain-names/17391
proxy_set_header Host ${DOMAIN};
tcp_nodelay on;
}
# colibri (JVB) websockets for jvb1
location ~ ^/colibri-ws/default-id/(.*) {
proxy_pass http://jvb1/colibri-ws/default-id/\$1\$is_args\$args;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
# load test minimal client, uncomment when used
#location ~ ^/_load-test/([^/?&:'"]+)\$ {
# rewrite ^/_load-test/(.*)\$ /load-test/index.html break;
#}
#location ~ ^/_load-test/libs/(.*)\$ {
# add_header 'Access-Control-Allow-Origin' '*';
# alias /usr/share/jitsi-meet/load-test/libs/\$1;
#}
location ~ ^/([^/?&:'"]+)\$ {
try_files \$uri @root_path;
}
location @root_path {
rewrite ^/(.*)\$ / break;
}
location ~ ^/([^/?&:'"]+)/config.js\$
{
set \$subdomain "\$1.";
set \$subdir "\$1/";
alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
}
# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set \$subdomain "\$1.";
set \$subdir "\$1/";
set \$prefix "\$1";
rewrite ^/(.*)\$ /http-bind;
}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set \$subdomain "\$1.";
set \$subdir "\$1/";
set \$prefix "\$1";
rewrite ^/(.*)\$ /xmpp-websocket;
}
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)\$ {
set \$subdomain "\$1.";
set \$subdir "\$1/";
rewrite ^/([^/?&:'"]+)/(.*)\$ /\$2;
}
}
EOF
)"

View File

@ -0,0 +1,165 @@
server_names_hash_bucket_size 64;
types {
# nginx's default mime.types doesn't include a mapping for wasm
application/wasm wasm;
}
upstream prosody {
zone upstreams 64K;
server 127.0.0.1:5280;
keepalive 2;
}
upstream jvb1 {
zone upstreams 64K;
server 127.0.0.1:9090;
keepalive 2;
}
server {
listen 80;
listen [::]:80;
server_name jitsi-meet.example.com;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /usr/share/jitsi-meet;
}
location = /.well-known/acme-challenge/ {
return 404;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name jitsi-meet.example.com;
# Mozilla Guideline v5.4, nginx 1.17.7, OpenSSL 1.1.1d, intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m; # about 40000 sessions
ssl_session_tickets off;
add_header Strict-Transport-Security "max-age=63072000" always;
set $prefix "";
ssl_certificate /etc/jitsi/meet/jitsi-meet.example.com.crt;
ssl_certificate_key /etc/jitsi/meet/jitsi-meet.example.com.key;
root /usr/share/jitsi-meet;
# ssi on with javascript for multidomain variables in config.js
ssi on;
ssi_types application/x-javascript application/javascript;
index index.html index.htm;
error_page 404 /static/404.html;
gzip on;
gzip_types text/plain text/css application/javascript application/json image/x-icon application/octet-stream application/wasm;
gzip_vary on;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 512;
location = /config.js {
alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
}
location = /external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js;
}
# ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/$1/$2;
# cache all versioned files
if ($arg_v) {
expires 1y;
}
}
# BOSH
location = /http-bind {
proxy_pass http://prosody/http-bind?prefix=$prefix&$args;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Connection "";
}
# xmpp websockets
location = /xmpp-websocket {
proxy_pass http://prosody/xmpp-websocket?prefix=$prefix&$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
tcp_nodelay on;
}
# colibri (JVB) websockets for jvb1
location ~ ^/colibri-ws/default-id/(.*) {
proxy_pass http://jvb1/colibri-ws/default-id/$1$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
# load test minimal client, uncomment when used
#location ~ ^/_load-test/([^/?&:'"]+)$ {
# rewrite ^/_load-test/(.*)$ /load-test/index.html break;
#}
#location ~ ^/_load-test/libs/(.*)$ {
# add_header 'Access-Control-Allow-Origin' '*';
# alias /usr/share/jitsi-meet/load-test/libs/$1;
#}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
location @root_path {
rewrite ^/(.*)$ / break;
}
location ~ ^/([^/?&:'"]+)/config.js$
{
set $subdomain "$1.";
set $subdir "$1/";
alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
}
# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /http-bind;
}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /xmpp-websocket;
}
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
}

View File

@ -0,0 +1,228 @@
#!/bin/sh -eu
# Source:
# https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example
FOCUS_USER="focus"
JITSI_DOMAIN="${JITSI_DOMAIN:-${JITSI_HOST:?}}"
# PROSODY_MAIN_CONFIG: defined in __jitsi_meet, empty in __jitsi_meet_domain
PROSODY_SECUREDOMAIN_START="--[["
PROSODY_SECUREDOMAIN_END="--]]"
if [ -n "${PROSODY_MAIN_CONFIG}" ]; then
PROSODY_MAIN_START=""
PROSODY_MAIN_END=""
PROSODY_DOMAIN_START="--[["
PROSODY_DOMAIN_END="--]]"
else
PROSODY_MAIN_START="--[["
PROSODY_MAIN_END="--]]"
PROSODY_DOMAIN_START=""
PROSODY_DOMAIN_END=""
if [ -n "${SECURED_DOMAINS}" ]; then
PROSODY_SECUREDOMAIN_START=""
PROSODY_SECUREDOMAIN_END=""
fi
fi
# Websockets haven't been fully tested in this type and don't work reliably
PROSODY_WEBSOCKET="-- "
# shellcheck disable=SC2034 # This is intended to be included
PROSODY_CONFIG="$(cat <<EOFPROSODY
-- Managed remotely, changes will be lost
${PROSODY_MAIN_START}
-- This will be managed by __jitsi_meet
plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }
-- domain mapper options, must at least have domain base set to use the mapper
muc_mapper_domain_base = "${JITSI_HOST:?}";
external_service_secret = "${TURN_SECRET:-TurnSecret}";
external_services = {
{ type = "stun", host = "${JITSI_HOST:?}", port = 3478 },
{ type = "turn", host = "${JITSI_HOST:?}", port = 3478, transport = "udp", secret = true, ttl = 86400, algorithm = "turn" },
{ type = "turns", host = "${JITSI_HOST:?}", port = 5349, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
};
cross_domain_bosh = false;
consider_bosh_secure = true;
-- Use websockets
-- https://community.jitsi.org/t/how-to-how-to-enable-websockets-xmpp-websocket-and-smacks-for-prosody/87920
${PROSODY_WEBSOCKET}consider_websocket_secure = true;
-- https_ports = { }; -- Remove this line to prevent listening on port 5284
-- by default prosody 0.12 sends cors headers, if you want to disable it uncomment the following (the config is available on 0.12.1)
--http_cors_override = {
-- bosh = {
-- enabled = false;
-- };
-- websocket = {
-- enabled = false;
-- };
--}
-- https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.0g&guideline=5.4
ssl = {
protocol = "tlsv1_2+";
ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
}
unlimited_jids = {
"${FOCUS_USER:?}@auth.${JITSI_HOST:?}",
"jvb@auth.${JITSI_HOST:?}"
}
${PROSODY_MAIN_END}
${PROSODY_DOMAIN_START}
-- This will be managed by __jitsi_meet_domain
VirtualHost "${JITSI_DOMAIN:?}"
-- enabled = false -- Remove this line to enable this host
authentication = "anonymous"
-- Properties below are modified by jitsi-meet-tokens package config
-- and authentication above is switched to "token"
--app_id="example_app_id"
--app_secret="example_app_secret"
-- Assign this host a certificate for TLS, otherwise it would use the one
-- set in the global section (if any).
-- Note that old-style SSL on port 5223 only supports one certificate, and will always
-- use the global one.
ssl = {
key = "/etc/prosody/certs/${JITSI_DOMAIN:?}.key";
certificate = "/etc/prosody/certs/${JITSI_DOMAIN:?}.crt";
}
av_moderation_component = "avmoderation.${JITSI_DOMAIN:?}"
speakerstats_component = "speakerstats.${JITSI_DOMAIN:?}"
conference_duration_component = "conferenceduration.${JITSI_DOMAIN:?}"
-- we need bosh
modules_enabled = {
"bosh";
"pubsub";
"ping"; -- Enable mod_ping
"speakerstats";
"external_services";
"conference_duration";
"muc_lobby_rooms";
"muc_breakout_rooms";
"av_moderation";
${PROSODY_WEBSOCKET} "websocket";
${PROSODY_WEBSOCKET} "smacks";
}
smacks_max_unacked_stanzas = 5;
smacks_hibernation_time = 60;
smacks_max_hibernated_sessions = 1;
smacks_max_old_sessions = 1;
c2s_require_encryption = false
lobby_muc = "lobby.${JITSI_DOMAIN:?}"
breakout_rooms_muc = "breakout.${JITSI_DOMAIN:?}"
main_muc = "conference.${JITSI_DOMAIN:?}"
-- muc_lobby_whitelist = { "recorder.${JITSI_DOMAIN:?}" } -- Here we can whitelist jibri to enter lobby enabled rooms
Component "conference.${JITSI_DOMAIN:?}" "muc"
restrict_room_creation = true
storage = "memory"
modules_enabled = {
"muc_meeting_id";
"muc_domain_mapper";
"polls";
--"token_verification";
"muc_rate_limit";
}
admins = { "${FOCUS_USER:?}@auth.${JITSI_HOST:?}" }
muc_room_locking = false
muc_room_default_public_jids = true
Component "breakout.${JITSI_DOMAIN:?}" "muc"
restrict_room_creation = true
storage = "memory"
modules_enabled = {
"muc_meeting_id";
"muc_domain_mapper";
--"token_verification";
"muc_rate_limit";
"polls";
}
admins = { "${FOCUS_USER:?}@auth.${JITSI_HOST:?}" }
muc_room_locking = false
muc_room_default_public_jids = true
-- internal muc component
Component "internal.auth.${JITSI_DOMAIN:?}" "muc"
storage = "memory"
modules_enabled = {
"ping";
}
admins = { "${FOCUS_USER:?}@auth.${JITSI_HOST:?}", "jvb@auth.${JITSI_HOST:?}" }
muc_room_locking = false
muc_room_default_public_jids = true
-- https://prosody.im/doc/modules/mod_muc
muc_room_cache_size = 1000
${PROSODY_DOMAIN_END}
${PROSODY_MAIN_START}
-- This will be managed by __jitsi_meet
VirtualHost "auth.${JITSI_DOMAIN:?}"
ssl = {
key = "/etc/prosody/certs/auth.${JITSI_DOMAIN:?}.key";
certificate = "/etc/prosody/certs/auth.${JITSI_DOMAIN:?}.crt";
}
modules_enabled = {
"limits_exception";
}
authentication = "internal_hashed"
${PROSODY_MAIN_END}
${PROSODY_DOMAIN_START}
-- This will be managed by __jitsi_meet_domain
-- Proxy to jicofo's user JID, so that it doesn't have to register as a component.
Component "focus.${JITSI_DOMAIN:?}" "client_proxy"
-- Single focus user for the whole instance
target_address = "${FOCUS_USER:?}@auth.${JITSI_HOST:?}"
Component "speakerstats.${JITSI_DOMAIN:?}" "speakerstats_component"
muc_component = "conference.${JITSI_DOMAIN:?}"
Component "conferenceduration.${JITSI_DOMAIN:?}" "conference_duration_component"
muc_component = "conference.${JITSI_DOMAIN:?}"
Component "avmoderation.${JITSI_DOMAIN:?}" "av_moderation_component"
muc_component = "conference.${JITSI_DOMAIN:?}"
Component "lobby.${JITSI_DOMAIN:?}" "muc"
storage = "memory"
restrict_room_creation = true
muc_room_locking = false
muc_room_default_public_jids = true
modules_enabled = {
"muc_rate_limit";
"polls";
}
${PROSODY_DOMAIN_END}
--[[
-- Enables dial-in for Jitsi meet components customers
-- Note: make sure you have the following packages installed: lua-basexx, liblua5.3-dev, libssl-dev, luarocks
-- and execute $ sudo luarocks install luajwtjitsi 3.0-0
VirtualHost "jigasi.meet.jitsi"
enabled = false -- Jitsi meet components customers remove this line
modules_enabled = {
"ping";
"bosh";
}
authentication = "token"
app_id = "jitsi";
asap_key_server = "https://jaas-public-keys.jitsi.net/jitsi-components/prod-8x8"
asap_accepted_issuers = { "jaas-components" }
asap_accepted_audiences = { "jigasi.jitmeet.example.com" }
--]]
${PROSODY_SECUREDOMAIN_START}
-- Only used on secured domains
VirtualHost "${JITSI_DOMAIN}"
authentication = "internal_plain"
VirtualHost "guest.${JITSI_DOMAIN}"
authentication = "anonymous"
c2s_require_encryption = false
${PROSODY_SECUREDOMAIN_END}
EOFPROSODY
)"

Some files were not shown because too many files have changed in this diff Show More