Anders Kaseorg
2665a3ce2b
python: Elide unnecessary list wrappers.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-13 12:41:23 -07:00
Anders Kaseorg
e932e2ce52
ruff: Fix UP032 Use f-string instead of `format` call.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-02 15:58:55 -07:00
Anders Kaseorg
bca5564c1e
ruff: Fix UP032 Use f-string instead of `format` call.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-23 15:18:18 -07:00
Anders Kaseorg
43b4f10578
run-dev: Drop .py from script name.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-03 18:02:37 -08:00
Anders Kaseorg
4eda29bd86
ruff: Fix RUF005 Consider spread instead of concatenation.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-01-26 10:16:30 -08:00
Alex Vandiver
b5bcc5f1b4
droplets: Switch to Ubuntu 20.04 base image.
2022-04-28 11:30:47 -07:00
Alex Vandiver
702807829f
droplets: Add IPv6 addresses to droplets.
2022-04-28 11:30:47 -07:00
Alex Vandiver
738d21f24b
droplets: Allow specifying the region for the droplet.
2022-04-28 11:30:47 -07:00
Alex Vandiver
b18b9d25e1
droplets: Add a script to do the provisioning.
2022-04-28 11:30:47 -07:00
Alex Vandiver
2fc7054a09
droplet: Fix printed instructions to have the right username/hostname.
2022-03-10 12:25:05 -08:00
Alex Vandiver
72b10937fc
droplet: Factor out common droplet_domain_name.
2022-03-10 12:25:05 -08:00
Alex Vandiver
5086241361
droplet: Set a secure erlang cookie at startup.
2022-03-10 12:25:05 -08:00
Alex Vandiver
aa9039d83e
droplet: Switch to a new Debian 10 template snapshot.
2022-03-10 12:25:05 -08:00
Alex Vandiver
d8c77eafb4
droplet: Always create with the "dev" tag.
...
This allows the firewall to be enforced on new hosts.
2022-03-10 12:25:05 -08:00
Alex Vandiver
25d753889b
droplet: Allow overriding the subdomain.
2022-03-10 12:25:05 -08:00
Anders Kaseorg
b0ce4f1bce
docs: Fix many spelling mistakes.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-07 18:51:06 -08:00
Anders Kaseorg
544bbd5398
docs: Fix capitalization mistakes.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 09:57:26 -07:00
Vishnu KS
965a71a332
droplets: Remove obvious comments from create.py.
2021-03-23 14:05:34 -07:00
Vishnu KS
b1a26c7123
droplets: Rename get_keys to get_ssh_public_keys_from_github.
2021-03-23 14:05:34 -07:00
Vishnu KS
36ba00f65a
droplets: Rename fork_exists to assert_user_forked_zulip_server_repo.
2021-03-23 14:05:34 -07:00
Vishnu KS
c1d80561a6
droplets: Add support for creating prod droplets.
2021-03-23 14:05:34 -07:00
Vishnu KS
fa623dbd62
droplets: Make assert_droplet_does_not_exist take droplet_name as argument.
2021-03-23 14:05:34 -07:00
Vishnu KS
13b9cf200b
droplets: Make print_completion take droplet_domain_name instead of username.
2021-03-23 14:05:34 -07:00
Vishnu KS
33f51305eb
droplets: Rename username argument to record_name in create_dns_record.
2021-03-23 14:05:34 -07:00
Vishnu KS
3407627c46
droplets: Rename exit_if_droplet_exists to assert_droplet_does_not_exist.
2021-03-23 14:05:34 -07:00
Vishnu KS
ca9d82fc06
droplets: Rename user_exists to assert_github_user_exists.
2021-03-23 14:05:34 -07:00
Vishnu KS
656fa15da1
droplets: Make create_droplet take droplet name instead of username.
2021-03-23 14:05:34 -07:00
Vishnu KS
4ba16d6ed9
droplets: Create get_ssh_keys_string_from_github_ssh_key_dicts function.
2021-03-23 14:05:34 -07:00
Anders Kaseorg
6e4c3e41dc
python: Normalize quotes with Black.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg
11741543da
python: Reformat with Black, except quotes.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg
72d6ff3c3b
docs: Fix more capitalization issues.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-23 11:46:55 -07:00
Anders Kaseorg
b4597a8ca8
python: Elide default for store_{true,false} argparse arguments.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-03 16:17:14 -07:00
Anders Kaseorg
a5dbab8fb0
python: Remove redundant dest for argparse arguments.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-02 11:04:10 -07:00
Anders Kaseorg
7ee974729b
docs: Replace Digital Ocean with DigitalOcean.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-30 11:30:43 -07:00
Anders Kaseorg
57a80856a5
python: Convert more "".format to Python 3.6 f-strings.
...
Generated by pyupgrade --py36-plus --keep-percent-format.
Now including %d, %i, %u, and multi-line strings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-13 15:39:00 -07:00
Anders Kaseorg
365fe0b3d5
python: Sort imports with isort.
...
Fixes #2665 .
Regenerated by tabbott with `lint --fix` after a rebase and change in
parameters.
Note from tabbott: In a few cases, this converts technical debt in the
form of unsorted imports into different technical debt in the form of
our largest files having very long, ugly import sequences at the
start. I expect this change will increase pressure for us to split
those files, which isn't a bad thing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-11 16:45:32 -07:00
Anders Kaseorg
8dd83228e7
python: Convert "".format to Python 3.6 f-strings.
...
Generated by pyupgrade --py36-plus --keep-percent-format, but with the
NamedTuple changes reverted (see commit
ba7906a3c6
, #15132 ).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-08 15:31:20 -07:00
Vishnu KS
9442835386
droplets: Make sure the username is lowercase.
...
Otherwise, if someone tries to create a droplet with a mixed case username,
the existing DNS records (which are always lowercase) would not be deleted.
Also, existing droplets would not be destroyed(--recreate) if there is a mismatch
in case. Unlike DNS records, droplets are created with case sensitive
hostnames.
Plus it's neater to have lowercase hostnames.
2020-05-20 09:32:11 -07:00
Vishnu Ks
2bd0e59462
droplets: Disable SSH password authentication.
...
We cannot disable this in base droplet as DigitalOcean overrides
the file and enable password authentication during droplet creation.
2020-05-07 17:09:05 -07:00
Vishnu KS
4796206629
droplets: Use bash script instead of cloud-config as user data.
...
We use cloud-config for setting up the SSH keys and executing
some commands. When cloud-config sets the SSH key it doesn't override
the existing keys. So we need to set the SSH keys manually using a command
instead. This means we no longer require cloud config. We can instead
pass a bash script as the user data instead of cloud-config.
I also included a command to set the SSH key of the root.
2020-05-07 17:09:05 -07:00
Vishnu KS
c07fb47aab
droplets: Set template_id to the id of the new image on 18.04.
...
size_slug represents the plan the droplet should be created on.
Since the new base droplet is created on the cheaper but more
feature rich new plan we have to update the slug_size as well
to take advantage of the cheaper plan.
2020-05-07 17:09:05 -07:00
Vishnu KS
87ff8ada6d
droplets: Move git clean to setup_repo string.
2020-05-07 17:09:05 -07:00
Vishnu KS
6079c19304
droplets: Set the hostname correctly using cloud-init.
2020-05-07 17:09:05 -07:00
Anders Kaseorg
5901e7ba7e
python: Convert function type annotations to Python 3 style.
...
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and six fixes for runtime issues:
- def __init__(self, token: Token, parent: Optional[Node]) -> None:
+ def __init__(self, token: Token, parent: "Optional[Node]") -> None:
-def main(options: argparse.Namespace) -> NoReturn:
+def main(options: argparse.Namespace) -> "NoReturn":
-def fetch_request(url: str, callback: Any, **kwargs: Any) -> Generator[Callable[..., Any], Any, None]:
+def fetch_request(url: str, callback: Any, **kwargs: Any) -> "Generator[Callable[..., Any], Any, None]":
-def assert_server_running(server: subprocess.Popen[bytes], log_file: Optional[str]) -> None:
+def assert_server_running(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> None:
-def server_is_up(server: subprocess.Popen[bytes], log_file: Optional[str]) -> bool:
+def server_is_up(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> bool:
- method_kwarg_pairs: List[FuncKwargPair],
+ method_kwarg_pairs: "List[FuncKwargPair]",
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:42:48 -07:00
Anders Kaseorg
c734bbd95d
python: Modernize legacy Python 2 syntax with pyupgrade.
...
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our
Python code except `zthumbor` and `zulip-ec2-configure-interfaces`,
followed by manual indentation fixes.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-09 16:43:22 -07:00
Anders Kaseorg
39f9abeb3f
python: Convert json.loads(f.read()) to json.load(f).
...
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-24 10:46:32 -07:00
Vishnu Ks
d703e3638e
droplets: Update snapshot id.
...
The new snapshot has zulip/zulip commit till
ac0d60f577
. I have also included
the custom motd from b594708915
in base image.
2019-06-14 15:49:56 -07:00
Anders Kaseorg
2ad1a27b28
create-production-venv: Remove Python 2 support.
...
We still create a Python 2 virtualenv for thumbor but that’s
separate (/srv/zulip-thumbor-venv from
scripts/lib/create-thumbor-venv).
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-01-09 17:32:05 -08:00
Vishnu Ks
119d108da0
droplets: Update code and remove nvm settings from bashrc.
...
* Synced zulip repo to master and provisioned
* Synced python-zulip-api repo to master and provisioned.
* Removed unnecessary nvm config from bashrc
2018-08-07 13:38:18 -07:00
Vishnu Ks
861001f7b3
droplets: Update snapshot id.
...
Upgraded zulip and python-zulip-api repos.
Installed flask in python-zulip-api.
2018-05-14 08:12:43 -07:00