Commit Graph

4315 Commits

Author SHA1 Message Date
Alex Vandiver 87a109e3e0 puppet: Pull in pinned puppet modules.
Using puppet modules from the puppet forge judiciously will allow us
to simplify the configuration somewhat; this specifically pulls in the
stdlib module, which we were already using parts of.
2021-05-27 21:14:48 -07:00
Gilbert Bishop-White b43cab3e3b install-shfmt: Add aarch64 support.
This fixes a problem provisioning on an ARM64 computer. Tested by
running on M1 Mac.

Fixes part of #18614
2021-05-27 16:01:42 -07:00
Gilbert Bishop-White 11257933b3 provision: Add support for aarch64 ubuntu/debian.
Install prerequisite needed on aarch64, as pip package has to build
from scratch.Tested by running on M1 Mac.

Fixes part of #18614
2021-05-27 16:01:42 -07:00
Gilbert Bishop-White d808dca28f install-shellcheck: Add aarch64 support.
This fixes a problem provisioning on an ARM64 computer. Tested by
running on M1 Mac.

Fixes part of #18614
2021-05-27 16:01:42 -07:00
Steve Howell 2dd7a8864c node tests: Get 100% coverage on rendered_markdown. 2021-05-25 15:30:40 -07:00
Adam Birds 9aab03654e ci: Update CI to test once with custom db name and user.
Update CI to test once with a custom db name and user so we can test
both scenarios of a custom dbname/user and the default "zulip".
2021-05-25 13:56:05 -07:00
Adam Birds 73b4ac5793 debugging: Print process_fts_updates log in CI. 2021-05-25 13:56:05 -07:00
Alex Vandiver 4f017614c5 nagios: Replace check_fts_update_log with a process_fts_updates flag.
This avoids having to duplicate the connection logic from
process_fts_updates.

Co-authored-by: Adam Birds <adam.birds@adbwebdesigns.co.uk>
2021-05-25 13:56:05 -07:00
Sumanth V Rao 83a2479a5a build_pygments_data: Reprioritize and categorize pygment language codes.
We now organize the pygment language codes into meaningful categories
- default, custom and aliases.

Further the `lang.json` list now contains a dataset extracted from the
"language" section of https://insights.stackoverflow.com/survey/2020
and is prioritized based on current language trends.
2021-05-24 23:15:39 -07:00
Anders Kaseorg 9d0340c7a8 rundjangoserver: Filter stdout instead of forking the code.
We failed to update this fork for the Django 3.2 upgrade.  Unfork it
so that’s not something we need to remember to do.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-24 18:54:47 -07:00
Alex Vandiver 48a56f8b9a aws: Turn on detailed monitoring by default. 2021-05-23 13:29:23 -07:00
Alex Vandiver 6ef497f002 aws: Let us pull all defaults from an ASG and launch template. 2021-05-23 13:29:23 -07:00
Alex Vandiver 2198dbb8c1 aws: Allow per-role overrides of config. 2021-05-23 13:29:23 -07:00
Alex Vandiver 2a247391ab aws: Shorten the tag names. 2021-05-23 13:29:23 -07:00
Riken Shah 51e24519b8 refactor: Rename `panels.js` to `navbar_alerts.js` as it better explains it. 2021-05-21 17:49:12 -07:00
Alex Vandiver e2d8c97463 update-prod-static: Ensure that it is run as the zulip user. 2021-05-21 16:52:49 -07:00
Abhijeet Prasad Bodas 0ec905ed52 custom_check: Enforce use of assert_length helper. 2021-05-19 11:55:56 -07:00
Tim Abbott 3af0485d84 ci: Unpack installation tarball under /root/.
This ensures that we exercise the fact that the Zulip installer may be
unpacked to a directory that may not be world-readable.

bc45525369 fixed a recent regression in
this behavior that would have been caught by this commit.
2021-05-14 14:31:00 -07:00
Anders Kaseorg e015f3ed7d docs: Correct “webapp” to “web app”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-14 13:15:38 -07:00
Tim Abbott 4fd9a971ed lint: Allow changelog link to latest changelog. 2021-05-13 12:36:56 -07:00
Anders Kaseorg 668b5137b0 version: Display Zulip version in About Zulip dialog.
We record Git details about the merge-base with upstream branches in
the zulip-git-version file, if the upstream repository is available.

Note that the first Git upgrade after merging the parent commit will
not include the merge-base details, since the upstream repository will
not have been available.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-13 11:36:12 -07:00
PIG208 9b48a36b91 tools: Add support to generating bot avatars for non-webhook integrations.
New bot avatars are generated with this tool. Having the avatars generated,
we can run generate-integration-docs-screenshot to generate the doc
screenshots.

Fixes: #17792
2021-05-10 17:50:32 -07:00
PIG208 540072e860 tools: Support sending mock messages for non-webhook integrations.
Non-webhook integrations should have fixtures containing mock messages
in json format with fields "subject" and "body" indicating the topic
and content respectively.
2021-05-10 17:50:32 -07:00
Riken Shah cf9fb1cf80 puppeteer_tests: Show filename when failed for quicker debugging. 2021-05-10 15:08:11 -07:00
Anders Kaseorg 544bbd5398 docs: Fix capitalization mistakes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 09:57:26 -07:00
Tim Abbott 1d9b5ffa92 lint: Fix badly quoted strings tagged for translation.
We also remove an aria-label on a placeholder that matches the input
element's actual label field.
2021-05-09 20:16:28 -07:00
Anders Kaseorg 9e243c74ed shell: Replace ‘which’ utility with ‘command -v’ shell builtin.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-07 08:54:41 -07:00
Anders Kaseorg 405bc8dabf requirements: Remove Thumbor.
Thumbor and tc-aws have been dragging their feet on Python 3 support
for years, and even the alphas and unofficial forks we’ve been running
don’t seem to be maintained anymore.  Depending on these projects is
no longer viable for us.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-06 20:07:32 -07:00
LoopThrough-i-j adc646adb8 lint: Set repository variable in tools/commit-message-lint. 2021-05-06 08:13:41 -07:00
Flávio Prado 0c78131139 settings: Import LDAP settings in prod_settings_template.
Currently users that try to deploy Zulip through docker has errors
because LDAP group search configuration can't be automated.

Reverts a hunk of f5197518a9.
2021-05-05 10:55:27 -07:00
Tim Abbott 638ffb36a4 refactor: Move click handlers to compose_closed_ui.js. 2021-05-04 20:55:58 -07:00
Sumanth V Rao a510dac024 settings_playground: Add UI to create a new playground.
The design of the form is similar to the linkifiers page
and is styled similarly.

The introduction text for "Code playgrounds" is improved
with more details and examples.

Also, we can remove the hardcoded playground and the fix
we had previously done to prevent breaking the hardcoded
playground.
2021-05-04 11:39:33 -07:00
Alex Vandiver eda9ce2364 locale: Use `C.UTF-8` rather than `en_US.UTF-8`.
The `en_US.UTF-8` locale may not be configured or generated on all
installs; it also requires that the `locales` package be installed.
If users generate the `en_US.UTF-8` locale without adding it to the
permanent set of system locales, the generated `en_US.UTF-8` stops
working when the `locales` package is updated.

Switch to using `C.UTF-8` in all cases, which is guaranteed to be
installed.

Fixes #15819.
2021-05-04 08:51:46 -07:00
Mateusz Mandera 1d9fb4f988 django: Upgrade Zulip to Django 3.2 LTS.
This is a straightforward upgrade in terms of changes needed.

Necessary changes were:
- Set `DEFAULT_AUTO_FIELD`
  https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys

- `The default_app_config application configuration variable is deprecated, due
  to the now automatic AppConfig discovery.`
  https://docs.djangoproject.com/en/3.2/releases/3.2/#automatic-appconfig-discovery

To handle this one, we can remove default_app_config from
zerver/__init__.py because it satisfies what release notes describe in
https://docs.djangoproject.com/en/3.2/releases/3.2/#automatic-appconfig-discovery:
"Most pluggable applications define an AppConfig subclass in an apps.py
submodule. Many define a default_app_config variable pointing to this
class in their __init__.py.  When the apps.py submodule exists and
defines a single AppConfig subclass, Django now uses that configuration
automatically, so you can remove default_app_config."

An important note is that rebuild-test-database needs to be run after
this upgrade in dev environment - if tests are run with test db that was
built on the previous version, they will fail due to a mysterious bug
(?), where changing attributes of a user and .save()ing after logging in
in the test via self.login_user, causes getting logged out - the next
requests via self.client_get etc. are unauthed for some reason,
unless self.login_user is called again. This behavior is no longer
exhibited upon rebuilding the test db - and I can't reproduce it in
production or dev db. So this can likely be reasonably dismissed as some
quirk of the test client system that won't be relevant in the future and
doesn't impact production.
2021-05-03 08:36:22 -07:00
pilgrim2308 a74b52db22 UI: Add Zulip version in gear menu.
Currently only enabled in development, since the exact details don't
seem right..

Co-Author-By: Signior-X <b19188@students.iitmandi.ac.in>
Co-Author-By: Aman Agrawal <amanagr@zulip.com>

Implements UI for #8005.
2021-04-30 17:58:08 -07:00
Tim Abbott 3116f72894 tools/i18n: Add support for branch parameters.
One could do other things with this, but what I expect us to do is
pass `-b {branch}`.
2021-04-30 16:37:01 -07:00
Anders Kaseorg bf447a726f test-documentation: Clean up fixed HTML validation ignore patterns.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-30 15:49:30 -07:00
Greg Price da8763d889 tools: Avoid `readlink -f` in *-pull-request scripts.
This is a feature of GNU readlink that isn't in the BSD readlink
found on macOS.

For using this and other GNU coreutils features in our scripts in
general, we could use a solution like mobile's tools/lib/ensure-coreutils.sh
to get GNU coreutils on the PATH -- check if it's there already,
if not then try to find a Homebrew install of it and use that, if not
then print a helpful message.

But even then there'd be a bootstrapping problem of how to find
ensure-coreutils.sh .  That involves exactly the same problem as we
have for finding git-tools.sh in these lines.  So in fact in mobile
for the task of finding ensure-coreutils.sh in the first place, we
do without `readlink -f` anyway.

The one consequence of this behavior-wise is that if you make a
symlink somewhere that points directly at that script (say in your
`~/bin/`), and try to run it using that symlink, it won't work.
(It'll still work just fine if there are symlinks somewhere higher
up in the paths involved -- just not for the script itself.)
An ideal CLI program really should support that, I think, but
lacking a better idea, this seems an acceptable compromise.
2021-04-30 14:57:13 -07:00
tushar912 c6671a67dd tools: Add tools/build-docs --clean option.
Currently the tools/build-docs was slow
because the clean option was rebulding everything.
But this is only required if one wants the left
sidebar to update.

So now set the default to exclude clean and
add clean option only if --clean is passed.

Also a warning is displayed if clean option is
not passed that the left sidebar won't update.

Fixes #17961.
2021-04-29 21:01:28 -07:00
tushar912 94afc72764 docs: Rewrite tools/build-docs in python.
Change the script to python. This is done
for the following reasons.
* It enables us to use the sanity_check.
* Later when we add warning to include
--clean flag we can use the pre-existing
WARNING from zulip_tools rather than using
terminal color codes.

TODO: Currently this script is slow as the
clean option is expensive so instead use only
html by default and clean only if --clean
option is passed.

Part of #17961.
2021-04-29 21:01:14 -07:00
100RABHpy 21be0ef445 openapi: Refactor hacky openAPI curl test.
Fixes #17795

In PR #17014, we added support for deactivate-own-user.
And while doing so, we first deactivated the client and
then reactivated it. But this implementation is a bit
hacky.

So, to fix this, we're now deactivating a test_user so that
we don't have to reactivate it. We did so by changing the value
of authentication_line.

As we want to keep endpoint code out of the
“test_curl_examples”, we changed the value of
authentication_line in `curl_param_value_generators.py`.

To work this out, we create a new global variable named
AUTHENTICATION_LINE in “curl_param_value_generators.py”
and change its value in function “deactivate_own_user” and
to use this change in “test_curl_examples,” we import
AUTHENTICATION_LINE.

AUTHENTICATION_LINE is of list data type because we want a
pointer to original mutable object so that changes made during
run time show across the module. Another way to do this is to change
the way we import variable, but that will be inconsistent to
the way we had in all other files.

To remove confusion between AUTHENTICATION_LINE and
authentication_line we renamed authentication_line
to default_authentication_line.
2021-04-28 15:49:35 -07:00
Tim Abbott 2d9631191e tools: Fix mypy errors with generate-integration-docs-screenshot.
3f4d0f72fd adjusted the types in
preparation for extending the functionality, but only in later commits
that are not merged yet did it make these updates to the types.
2021-04-28 08:47:38 -07:00
PIG208 3f4d0f72fd tools: Create get_fixture_info to support non-webhook integrations. 2021-04-28 08:16:51 -07:00
Abhijeet Prasad Bodas 2c4505d322 settings/muted-topic: Move list-create code to designated file.
This code better fits in `settings_muted_topics`.
2021-04-27 17:53:06 -07:00
Anders Kaseorg 6060d0d364 docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.

Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg 178736c8eb docs: Fix spelling errors caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-26 09:31:08 -07:00
Anders Kaseorg bf056c8990 js: Extract password_quality module; remove zxcvbn from globals.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 84f1e27516 js: Consistently use main jquery-validation module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Anders Kaseorg 41dd50948a js: Consistently use ES module from SimpleBar.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-24 13:08:52 -07:00
Riken Shah 0e5f6c21ad refactor: Split dev related code from `auth.py` into `dev_login.py`.
This refactor will help us make our development-related authentication
code to avoid production security impact.
2021-04-23 15:11:44 -07:00