Commit Graph

274 Commits

Author SHA1 Message Date
Alex Vandiver
af07d3ef3d entrypoint: Use DB_NAME / DB_USER for PostgreSQL database name / user. 2025-09-26 23:13:07 -05:00
Alex Vandiver
e49a16829d entrypoint: Add PROXY_ALLOW_* settings for setting outgoing proxy rules. 2025-09-18 15:27:49 -04:00
Nico Weichbrodt
140a042591 entrypoint: Add SOCIAL_AUTH_SYNC_ATTRS_DICT.
`SOCIAL_AUTH_SYNC_ATTRS_DICT` is a dict; add it to the list of settings
that are not strings.
2025-09-18 14:16:12 -04:00
Mateusz Mandera
0d712d5151 entrypoint: Fix confusing output string about migrations.
"Migrating Zulip to new version" sounds very general and unclear about
what step is actually happening - easy to even confuse with a full
server upgrade being run. This should be explicit that this is about db
migrations.
2025-03-08 16:41:11 -08:00
Anders Kaseorg
0ab4061d1b Unset HOME for supervisord.
This matches the way systemd would run supervisord, and avoids
problems with uv finding the cache location.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-05 13:20:11 -08:00
Isaac van Bakel
e9ed26ccdb entrypoint: Fix type of LDAP_SYNCHRONIZED_GROUPS_BY_REALM.
This variable value needs to be a complex array, so it needs the same
exemption as some other variables in `entrypoint.sh`.

Co-authored-by: Isaac van Bakel <isaac.vanbakel@inf.ethz.ch>
2024-09-25 15:54:44 -07:00
sev
6e0c3a8633 entrypoint.sh: Recognize SCIM_CONFIG key as array.
Technically, it's a dictionary, but that's the type used for all of
these complex settings in this file.
2024-09-25 15:52:22 -07:00
Mikael Schirén
f44200d23b entrypoint: Add app:init command to initialize with running server.
This can be useful for initializing a container as a separate step from running it
in production.
2024-09-25 15:42:45 -07:00
Alex Vandiver
d1f424b1cf Update default NGINX_MAX_UPLOAD_SIZE to match code Zulip.
See zulip/zulip@419f163906.
2024-09-11 12:08:36 -04:00
Alex Vandiver
fd2e1643af Revert "entrypoint: Remove unnecessary use of an extended glob."
This reverts commit 0d72546a4c.  The
extended glob matched when the _entire_ value was numeric, whereas
the pattern matches if it _starts_ with a number.

Fixes: #433
Fixes: #435
2024-04-18 11:01:09 -04:00
Alex Vandiver
8eb8f19619 entrypoint: Only run puppet once.
If DISABLE_HTTPS was set, puppet would run twice, unnecessarily.  Move
the `zulip.conf` and subsequent Puppet application to be grouped with
the others; this requires moving that above the nginx configuration,
as it tweaks puppet-controlled nginx files.
2024-03-15 14:02:05 -04:00
Alex Vandiver
49df507381 entrypoint: Always run puppet.
Puppet writes the current DNS servers into nginx's config, which may
vary each time the image starts up, depending on the network it is
attached to.  We can either write custom logic to mirror Puppet's
behaviour, or just always run Puppet.
2024-03-15 14:00:36 -04:00
Alex Vandiver
0d72546a4c entrypoint: Remove unnecessary use of an extended glob. 2024-03-15 13:59:15 -04:00
Rink
f71de70507 Include AUTH_LDAP_ADVANCED_REALM_ACCESS_CONTROL as dictionary environment variable 2023-07-12 15:54:28 -04:00
Alex Vandiver
6883afbd3b Support SOCIAL_AUTH_SAML_ORG_INFO setting as a dict. 2023-06-20 16:22:56 -04:00
Mursith
cb6b6ce2c2 Consider SOCIAL_AUTH_SAML_ENABLED_IDPS as array in entrypoint.sh 2023-06-20 14:20:04 -04:00
AUX
24678b6e5b Use ISO 8601 date format for backup filenames
With previous `%D` format preventable errors like

```
tar (child): /data/backups/backup-09/05/22-03-22-03.tar.gz: Cannot open: No such file or directory
```

will occur. Let's use a more sane[^1] date format where possible.

The -I flag to date(1) was added in roughly 1999[^2] and is portable across
GNU coreutils and BusyBox. Piping to tr(1) to remove colons in filenames
is largely a Windows-compatibility concern, as Win32 does not allow for
that character in filenames[^3], and it's possible that the backups target
directory could be a volume mount to a Windows host (for example on
Docker Desktop For Windows).

[^1]: https://xkcd.com/1179/
[^2]: https://unix.stackexchange.com/a/164834
[^3]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

Co-Authored-By: Josh Klar <josh@zulip.com>
2022-11-28 15:09:15 -05:00
AUX
33edaf380b Consolidate backup timestamp expressions 2022-11-28 15:09:15 -05:00
Kevin Köllmann
b824d13093 Fix missing BACKUP_FILE variable missing in basename command 2022-06-02 12:23:02 -07:00
Kevin Köllmann
454193ced5 Fix usage of date command 2022-06-02 12:23:02 -07:00
Kevin Köllmann
be5ee98004 Fix path to entrypoint script in mail command 2022-06-02 12:23:02 -07:00
Ben
e2503cd4c9 Add a setting for load balancer IPs. 2022-06-02 14:01:24 -04:00
Maarten de Waard
6300fb4700 config: Add SOCIAL_AUTH_OIDC_ENABLED_IDPS.
`SOCIAL_AUTH_OIDC_ENABLED_IDPS` is a dict; add it to the list of
settings that are not strings.
2022-03-21 11:22:02 -04:00
Alex Vandiver
9a83790bd4 Use deploy hook directory for certbot.
The change in flag name is necessary after zulip/zulip#20512.
2021-12-10 14:15:53 -08:00
Lorenzo Milesi
4b20fa5e1e Write AUTH_LDAP_GLOBAL_OPTIONS as array.
This is required for connecting to a LDAPS server without validating certificators:
```
SETTING_AUTH_LDAP_GLOBAL_OPTIONS: "{ ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER }"
```

Using `SETTING_AUTH_LDAP_CONNECTION_OPTIONS` doesn't work.
2021-12-07 15:24:33 -08:00
Flávio Siqueira Prado
ce072f459f settings: Configure LDAP group settings as arrays.
Currently LDAP group settings are being treat as string, they should be treated as array
so we could configure it correctly while executing on `docker` or `kubernetes`.
2021-05-05 10:59:48 -07:00
Jennifer Hwang
43438bf84d Add plumbing for new queue_workers_multiprocess setting. 2021-04-25 08:32:18 -07:00
ppenguin
cd02e6612d entrypoint: Add postgres port to entrypoint config script.
This is required to use docker-zulip with an existing postgres instance on a port other than 5432.

Co-authored-by: Jeroen Versteeg <jv@1nnovat.io>
2020-11-02 17:40:00 -08:00
Michal Krejčí
35d23136c2 Added REALM_HOSTS to array filter in entrypoint.sh.
Fixes #258.
2020-06-11 21:06:06 -07:00
Cybernick
cf8749c9c6 Added AUTH_LDAP_REVERSE_EMAIL_SEARCH as array to match #11715 issue changes 2019-10-30 16:09:08 -07:00
Anders Kaseorg
520f81ff30 entrypoint.sh: Fix ShellCheck warning introduced by #199.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-06-19 15:47:23 -07:00
Philip Arndt
611a7b0631 backups: Complain if legacy backups directory doesn't exist.
Currently this conditional results in `exit 1` when the backups
directory does exist.  This change flips the logic to complain
when there are no backup files which, based on the error message,
is the intended result.
2019-06-03 17:30:30 -07:00
Anders Kaseorg
c82b02aa16 entrypoint: Update for incompatible change to setup-certbot usage
https://github.com/zulip/zulip/pull/10699

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-03-11 17:48:34 -07:00
Anders Kaseorg
292cdcbfba Persist /etc/letsencrypt to the zulip data volume.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-02-24 11:35:07 -08:00
Anders Kaseorg
2acd34b212 Add trailing newline to /etc/cron.d/autobackup.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-12 17:34:24 -08:00
Anders Kaseorg
fca0be8338 entrypoint.sh: Shell script cleanup; fix ShellCheck warnings.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-11 17:52:59 -08:00
Anders Kaseorg
b471a8271b Fix /etc/cron.d/autobackup.
The previous code wrote

    MAILTO=\n30 3 * * * cd /;/entrypoint.sh app:backup

(with a literal backslash n).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-11 17:26:54 -08:00
Anders Kaseorg
c8f5aa264d Run generate_secrets.py unconditionally.
We may need to populate newly added secrets when upgrading Zulip.

Fixes #163.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-04 13:21:51 -08:00
Tim Abbott
a1ff3938ca entrypoint: Initialize settings.py files with the template.
This fixes a bug introduced in
62bf74190b, where the template
settings.py content wasn't being put in place properly.

The previous model meant that if the user exported the settings.py
file to the data directory, we'd end up appending various versions of
the users' configuration to it over time.

While those users should have been using the MANUAL_CONFIGURATION
setting, this at least is a much cleaner model for managing configuration.

Fixes #130.
Fixes #153.
Fixes #155.
2018-08-31 11:45:23 -07:00
Tim Abbott
f874136af1 entrypoint: Remove references to ZULIP_AUTO_GENERATE_CERTS. 2018-08-23 13:30:42 -07:00
Tim Abbott
1190873d0f entrypoint: Remove unnecessary directory creation logging. 2018-08-23 13:16:56 -07:00
Tim Abbott
f61b48b96f entrypoint: Remove obsolete RabbitMQ configuration.
The ignore option was removed a long time ago, and the settings style
variable for RabbitMQ is very old backwards-compatibility code that is
no longer needed.
2018-08-23 13:09:28 -07:00
Tim Abbott
78480d4de5 secrets: Use crudini to edit secrets file.
Using an actual tool designed to do this is a lot more robust and
fixes some nasty escaping issues involving secrets containing `~` that
were reported in #143.
2018-08-23 12:53:21 -07:00
Tim Abbott
081e64c46e entrypoint: Use extended globbing for integer detection.
This fixes #150, and should eliminate the possibility for future bugs
in the same vein.

I still want to eliminate this whole type-detection system, but that's
for future work.
2018-08-13 15:40:05 -07:00
jeaye
3b5d63b9ba setup: Add certbot support.
The task is to generate a self-signed cert so Zulip can be started, then
to wait until Zulip is up before using certbot to generate new certs.
Zulip needs to be up so it can meet certbot's challenge. Using a deploy
hook, certs are persisted in the data directory. The same applies to
renewal.

Tweaked by tabbott mostly to edit comments remove an unnecessary
setting before merging.

Fixes #120.
2018-07-23 22:29:10 -07:00
Sampriti Panda
d3c32ab0c1 Remove setup_files/ and related code from docker-compose.
This removes the fork of the core Zulip nginx configuration file that
we were maintaining in the docker-zulip project; doing so improves the
maintainability of this project for the future, since we don't need to
check on every Zulip upgrade whether we've made any changes to the
`nginx` package in zulip/zulip.

The only feature we were using that for was the DISABLE_HTTPS setting
in docker-zulip, and it's now possible to do that by editing
zulip.conf instead.

Fixes #114.
2018-07-10 12:22:41 +05:30
Sampriti Panda
de7b59b352 entrypoint: Add call to zulip-puppet-apply for nginx config.
First, we stop deleting the `puppet` directory, which is important for
being able to run `zulip-puppet-apply` inside the container (super
useful for debugging).

Second, we call this inside the code block for the `nginx` option, in
order to support the `DISABLE_HTTPS` option working without any copied
nginx configuration code in docker-zulip.

See #137 for how we could optimize this away.
2018-07-10 12:20:24 +05:30
Giora Guttsait
283c23fd0b Add AUTH_LDAP_CONNECTION_OPTIONS and organize conditions
fixes #127
2018-07-01 02:24:11 -07:00
Tim Abbott
fad2cf528b entrypoint: Fix writing to settings.py with MANUAL_CONFIGURATION.
The database configuration should not have been running in this
configuration model.
2018-05-31 09:14:26 -07:00
Tim Abbott
2e0d92f6b2 sample configs: Remove some obsolete settings.
These former settings no longer do anything in Zulip.
2018-05-27 17:02:57 -07:00