Compare commits

...

463 commits

Author SHA1 Message Date
Mouse Reeve 14e73d18dd Merge branch 'main' into production 2022-05-31 10:41:58 -07:00
Mouse Reeve 02a315be00 Merge branch 'main' into production 2022-05-30 08:23:26 -07:00
Mouse Reeve 3a8aff938b Merge branch 'main' into production 2022-05-19 14:24:55 -07:00
Mouse Reeve e915335932 Merge branch 'main' into production 2022-05-16 14:42:47 -07:00
Mouse Reeve b1f3253aa7 Merge branch 'main' into production 2022-05-16 10:00:19 -07:00
Mouse Reeve 12a5eaba3e Merge branch 'main' into production 2022-05-14 08:48:07 -07:00
Mouse Reeve dc0dede105 Merge branch 'main' into production 2022-05-09 12:41:27 -07:00
Mouse Reeve 05cf3ce344 Merge branch 'main' into production 2022-04-29 15:42:39 -07:00
Mouse Reeve 3ad09308b5 Merge branch 'main' into production 2022-04-26 08:30:35 -07:00
Mouse Reeve c10c14b2c9 Merge branch 'main' into production 2022-04-26 07:50:39 -07:00
Mouse Reeve f64a909751 Merge branch 'main' into production 2022-04-08 14:05:32 -07:00
Mouse Reeve f27fe05008 Merge branch 'main' into production 2022-03-26 12:56:11 -07:00
Mouse Reeve 4308137390 Merge branch 'main' into production 2022-03-26 08:58:11 -07:00
Mouse Reeve 588d2da2c6 Merge branch 'main' into production 2022-03-24 09:46:32 -07:00
Mouse Reeve c1c0eed92c Merge branch 'main' into production 2022-03-19 07:25:18 -07:00
Mouse Reeve bb89766de0 Merge branch 'main' into production 2022-03-18 07:41:45 -07:00
Mouse Reeve e2197b3e7d Merge branch 'main' into production 2022-03-17 10:36:43 -07:00
Mouse Reeve 4a0e1bdd46 Merge branch 'main' into production 2022-03-17 10:07:27 -07:00
Mouse Reeve 67bb154008 Merge branch 'main' into production 2022-03-17 08:56:15 -07:00
Mouse Reeve 6f9488f7a8 Merge branch 'main' into production 2022-03-15 12:43:11 -07:00
Mouse Reeve 35e27a4443 Merge branch 'main' into production 2022-03-13 13:33:00 -07:00
Mouse Reeve 3ebdd432ec Merge branch 'main' into production 2022-03-13 12:09:47 -07:00
Mouse Reeve a54a8b7573 Merge branch 'main' into production 2022-03-11 16:06:02 -08:00
Mouse Reeve 91e8a9ac19
Merge pull request #1995 from bookwyrm-social/revert-broken-themes
Revert broken themes commit
2022-03-04 18:36:01 -08:00
Mouse Reeve 394f6fea87 Revert "Adds custom compile management command"
This reverts commit b0c0af9617.
2022-03-04 18:14:46 -08:00
Mouse Reeve 4baba480c5 Merge branch 'main' into production 2022-03-04 17:59:09 -08:00
Mouse Reeve 64b5a18d7b Merge branch 'main' into production 2022-03-01 14:53:11 -08:00
Mouse Reeve dfba63f977 Merge branch 'main' into production 2022-03-01 12:20:27 -08:00
Mouse Reeve 8de5a44181 Merge branch 'main' into production 2022-02-24 17:53:29 -08:00
Mouse Reeve 3e78164039 Include packaging dep 2022-02-18 18:19:28 -08:00
Mouse Reeve abfd094337 Merge branch 'main' into production 2022-02-18 18:17:43 -08:00
Mouse Reeve 0e8fffe001 Merge branch 'main' into production 2022-02-12 10:29:49 -08:00
Mouse Reeve 0f1757b278 Merge branch 'main' into production 2022-02-12 10:14:47 -08:00
Mouse Reeve f1381341b4 Merge branch 'main' into production 2022-02-09 12:41:23 -05:00
Mouse Reeve 6bf9fe7295 Merge branch 'main' into production 2022-02-04 20:23:35 -08:00
Mouse Reeve 657d7b04c1 Merge branch 'main' into production 2022-02-04 19:52:16 -08:00
Mouse Reeve 0a6c14dc8a Merge branch 'main' into production 2022-02-04 18:13:00 -08:00
Mouse Reeve 771435168b Merge branch 'main' into production 2022-02-04 15:45:20 -08:00
Mouse Reeve 36dbf64b12 Merge branch 'main' into production 2022-02-03 14:09:09 -08:00
Mouse Reeve 75726460d7 Merge branch 'main' into production 2022-02-03 11:14:19 -08:00
Mouse Reeve d04345ec08 Merge branch 'main' into production 2022-02-02 13:25:42 -08:00
Mouse Reeve bf573a0871 Merge branch 'main' into production 2022-02-02 12:41:05 -08:00
Mouse Reeve 43ca5f466c Merge branch 'main' into production 2022-02-02 11:06:10 -08:00
Mouse Reeve 47be375de3 Merge branch 'main' into production 2022-01-30 07:19:44 -08:00
Mouse Reeve cc1496cf8f Merge branch 'main' into production 2022-01-30 07:13:11 -08:00
Mouse Reeve dd16ccd093 Merge branch 'main' into production 2022-01-30 06:33:08 -08:00
Mouse Reeve 4a81786236 Merge branch 'main' into production 2022-01-20 17:20:29 -08:00
Mouse Reeve b46ec147da Merge branch 'main' into production 2022-01-20 16:46:45 -08:00
Mouse Reeve 589a743cfb Merge branch 'main' into production 2022-01-20 15:25:41 -08:00
Mouse Reeve 2dd39517c3 Merge branch 'main' into production 2022-01-18 13:46:53 -08:00
Mouse Reeve 4fad83e910 Merge branch 'main' into production 2022-01-18 06:58:13 -08:00
Mouse Reeve 56c6ee8879 Merge branch 'main' into production 2022-01-17 11:09:01 -08:00
Mouse Reeve 3d036386f9 Merge branch 'main' into production 2022-01-17 08:23:50 -08:00
Mouse Reeve 53754546c2 Merge branch 'main' into production 2022-01-13 11:10:41 -08:00
Mouse Reeve 6a7c38003d Removes duplicate update command 2022-01-13 09:25:43 -08:00
Mouse Reeve 584da682ee Merge branch 'main' into production 2022-01-13 09:24:05 -08:00
Mouse Reeve c102106dc2
Merge pull request #1803 from cincodenada/run-rm-update
Use run --rm in `update` command
2022-01-13 08:49:45 -08:00
Mouse Reeve 9fb7280366
Merge pull request #1751 from cincodenada/open-telemetry
Adds OpenTelemetry exporter for use with various monitoring tools
2022-01-12 17:28:47 -08:00
Mouse Reeve 26482232c9 Merge branch 'main' into production 2022-01-11 13:32:59 -08:00
Joel Bradshaw 1dc5467969 Drop --no-cache as well
Since several of our services share the same image, this should speed up
building a good bit, and --no-cache shouldn't be necessary - if we're
still having issues with things not updating, we should figure out how
to arrange the Dockerfile, but I think it should be fine as-is.
2022-01-10 23:22:12 -08:00
Joel Bradshaw 83964f4e2b Merge branch 'production' into open-telemetry 2022-01-10 23:20:05 -08:00
Joel Bradshaw 320ac617cb Add default values for OTEL settings 2022-01-10 23:17:22 -08:00
Joel Bradshaw 7ab8209046 Use runweb to update, and up -d instead of restart
Partial fix for #1785 - preivously we would run the migrate and collect
commands with exec, which would run them in the running (and thus old)
contianers, but with the new code. This caused issues when, for example,
new dependencies were introduced, which weren't built into the old
containers.

Instead, use run --rm to spin up temporary instances of the new
containers to do the commands.
2022-01-10 00:04:51 -08:00
Mouse Reeve cbfa99a95b Merge branch 'main' into production 2022-01-09 12:36:44 -08:00
Mouse Reeve 2fccb8ef83 Merge branch 'main' into production 2022-01-09 11:12:43 -08:00
Mouse Reeve 49bef9a7c5 Merge branch 'main' into production 2022-01-08 18:55:37 -08:00
Mouse Reeve 2b07e9c485 Merge branch 'main' into production 2022-01-08 16:43:07 -08:00
Mouse Reeve c32e5b78ac Fixes merge error in requirements 2022-01-07 10:28:01 -08:00
Mouse Reeve 637600763b Merge branch 'main' into production 2022-01-07 10:25:39 -08:00
Mouse Reeve 17d4b60275 Merge branch 'main' into production 2022-01-07 08:18:48 -08:00
Mouse Reeve 55aa26d2ba Merge branch 'main' into production 2022-01-06 18:56:49 -08:00
Mouse Reeve a806264497 Merge branch 'main' into production 2022-01-06 13:13:05 -08:00
Mouse Reeve d650585858 Merge branch 'main' into production 2022-01-06 12:23:07 -08:00
Mouse Reeve 4416ce5069 Merge branch 'main' into production 2022-01-05 16:11:19 -08:00
Joel Bradshaw f5f861ce25 Make it black 🎸 2022-01-01 14:51:01 -08:00
Joel Bradshaw 5b3ff0cf82 Instrument celery, move init into apps.py 2022-01-01 14:48:58 -08:00
Joel Bradshaw 40bec83833 Add versions to requirements.txt 2022-01-01 14:48:58 -08:00
Joel Bradshaw 3d7f73d73c Document OTLP in env, only load if env vars exist
Also move telemetry into its own file, all those imports seemed like
unnecessary clutter
2022-01-01 14:48:58 -08:00
Joel Bradshaw 7cb7063da5 Add more route names, and format
I think these show up in telemetry, and nicer names are nice
2022-01-01 14:48:46 -08:00
Mouse Reeve 93e1beda6e Merge branch 'main' into production 2022-01-01 07:02:40 -08:00
Joel Bradshaw 8b4f93dd4e Integrate open telemetry
This allows us to export to anyone that takes OTLP, which is most of the
major players, I think! Nifty!

Kinda like the S3 config but for tracing, you can slot in any provider
that supports it via environment variables

This uses the Django instrumentation, which gets us a bunch of nifty
stuff right out of the box.
2021-12-31 03:47:21 -08:00
Mouse Reeve 82513197fd Merge branch 'main' into production 2021-12-30 09:30:57 -08:00
Mouse Reeve 2c5265a117 Merge branch 'main' into production 2021-12-29 16:21:28 -08:00
Mouse Reeve 8b42d58caf Remove prettier in prod branch 2021-12-29 09:37:08 -08:00
Mouse Reeve e8c1ca68d1 Merge branch 'production' of github.com:bookwyrm-social/bookwyrm into production 2021-12-29 09:36:53 -08:00
Mouse Reeve 638352ba26 Merge branch 'main' into production 2021-12-29 09:35:08 -08:00
Mouse Reeve 5cc4f9d381
Merge pull request #1717 from cincodenada/no-more-fedireads
Remove last lingering traces of fedireads name
2021-12-29 09:33:13 -08:00
Joel Bradshaw 2e9574d53c Add database to filename, don't install recommends
Cron comes with just a metric ton of recommended dependencies including
mariadb-common which is just a bunch of unneccessary weight. Just
install what's necessary for cron.
2021-12-28 14:18:57 -08:00
Joel Bradshaw 879a410808 Attempt to use env variable for backup script
This should be available via docker, and we shouldn't have the database
name hardcoded anywhere
2021-12-28 13:45:55 -08:00
Joel Bradshaw d44a900e0c Fix typo while we're here 2021-12-28 13:35:27 -08:00
Joel Bradshaw cd9acef30a Remove last traces of fedireads 2021-12-28 13:35:27 -08:00
Mouse Reeve 1c48605418 Merge branch 'main' into production 2021-12-28 07:28:34 -08:00
Mouse Reeve 4ca0834b43 Merge branch 'main' into production 2021-12-27 14:56:45 -08:00
Mouse Reeve 2a5012470b Merge branch 'main' into production 2021-12-27 14:33:30 -08:00
Mouse Reeve 07c190d717 Merge branch 'main' into production 2021-12-27 13:41:45 -08:00
Mouse Reeve bdf617d005 Merge branch 'main' into production 2021-12-14 19:01:49 -08:00
Mouse Reeve b53d45a19a Merge branch 'main' into production 2021-12-07 15:37:22 -08:00
Mouse Reeve 4c73e53b9a Merge branch 'main' into production 2021-12-06 13:42:55 -08:00
Mouse Reeve c52689c4b8 Merge branch 'main' into production 2021-12-05 10:29:23 -08:00
Mouse Reeve 620a22bde0 Merge branch 'main' into production 2021-12-04 16:58:07 -08:00
Mouse Reeve 58b88ef71e Merge branch 'main' into production 2021-11-28 09:41:13 -08:00
Mouse Reeve 25a7ab7b84 Merge branch 'main' into production 2021-11-23 15:01:30 -08:00
Mouse Reeve eff6591727 Merge branch 'main' into production 2021-11-19 09:44:37 -08:00
Mouse Reeve db5ec248ef Merge branch 'main' into production 2021-11-17 10:44:19 -08:00
Mouse Reeve d62a4e7aa0 Merge branch 'main' into production 2021-11-16 09:43:53 -08:00
Mouse Reeve ab06180e41 Merge branch 'main' into production 2021-11-15 13:47:32 -08:00
Mouse Reeve 02ea4020ea Merge branch 'main' into production 2021-11-15 10:43:19 -08:00
Mouse Reeve 17294abc13 Merge branch 'main' into production 2021-10-25 11:32:55 -07:00
Mouse Reeve 327a616779 Merge branch 'main' into production 2021-10-25 10:59:46 -07:00
Mouse Reeve 9a1ca982c8 Merge branch 'main' into production 2021-10-15 14:56:41 -07:00
Mouse Reeve 382d98a2e0 Merge branch 'main' into production 2021-10-15 14:31:13 -07:00
Mouse Reeve 1bc09485ee Merge branch 'main' into production 2021-10-14 16:28:35 -07:00
Mouse Reeve b15744cc37 Merge branch 'main' into production 2021-10-14 14:32:14 -07:00
Mouse Reeve 62b62b5057 Merge branch 'main' into production 2021-10-11 10:35:16 -07:00
Mouse Reeve 7cb377da6f Merge branch 'main' into production 2021-10-11 10:22:22 -07:00
Mouse Reeve 9b1a9ec1d4 Merge branch 'main' into production 2021-10-06 18:24:24 -07:00
Mouse Reeve 8aa920e357 Merge branch 'main' into production 2021-10-04 12:00:23 -07:00
Mouse Reeve 34e45f3113 Merge branch 'main' into production 2021-10-03 13:38:13 -07:00
Mouse Reeve e9f60f93b2 Merge branch 'main' into production 2021-10-03 12:12:34 -07:00
Mouse Reeve 1b987542a4 Merge branch 'main' into production 2021-10-02 18:26:38 -07:00
Mouse Reeve 57396499ff Merge branch 'main' into production 2021-09-29 11:25:09 -07:00
Mouse Reeve 755a6569c6 Merge branch 'main' into production 2021-09-22 17:11:20 -07:00
Mouse Reeve 7744b9a117 Merge branch 'main' into production 2021-09-22 12:34:22 -07:00
Mouse Reeve 697924ebc6 Merge branch 'main' into production 2021-09-21 07:09:19 -07:00
Mouse Reeve cfc6528d0c Merge branch 'main' into production 2021-09-19 09:40:48 -07:00
Mouse Reeve 5d19d33a01 Merge branch 'main' into production 2021-09-18 16:41:03 -07:00
Mouse Reeve 620d3ab804 Merge branch 'main' into production 2021-09-18 06:41:30 -07:00
Mouse Reeve 2d7047b833 Merge branch 'main' into production 2021-09-12 11:58:59 -07:00
Mouse Reeve c03db63bb3 Merge branch 'main' into production 2021-09-12 10:53:16 -07:00
Mouse Reeve b5c0c0b52c Merge branch 'main' into production 2021-09-11 17:56:56 -07:00
Mouse Reeve 75ca011f92 Merge branch 'main' into production 2021-09-11 12:18:10 -07:00
Mouse Reeve 074a9113e6 Merge branch 'main' into production 2021-09-11 09:44:36 -07:00
Mouse Reeve b2bd655a00 Merge branch 'main' into production 2021-09-11 07:43:24 -07:00
Mouse Reeve 3fb2584c03 Merge branch 'main' into production 2021-09-10 16:03:56 -07:00
Mouse Reeve 78edfa142e Merge branch 'main' into production 2021-09-10 15:12:25 -07:00
Mouse Reeve 4515cec7d2 Merge branch 'main' into production 2021-09-10 12:27:09 -07:00
Mouse Reeve 4c5f5d90ba Merge branch 'main' into production 2021-09-09 17:38:24 -07:00
Mouse Reeve 5e88e893c7 Merge branch 'main' into production 2021-09-08 17:55:35 -07:00
Mouse Reeve 2022b3a035 Merge branch 'main' into production 2021-09-08 12:18:35 -07:00
Mouse Reeve 8f50f8758c Merge branch 'main' into production 2021-09-08 09:09:09 -07:00
Mouse Reeve 276bded337 Merge branch 'main' into production 2021-09-07 09:55:38 -07:00
Mouse Reeve 9aa1201cbe Merge branch 'main' into production 2021-09-07 06:50:43 -07:00
Mouse Reeve 7284a4efad Merge branch 'main' into production 2021-09-06 13:17:46 -07:00
Mouse Reeve ed6d35ef72 Merge branch 'main' into production 2021-09-05 16:47:02 -07:00
Mouse Reeve 8dc8ea2f59 Merge branch 'main' into production 2021-09-03 10:50:38 -07:00
Mouse Reeve fad1b8db94 Merge branch 'main' into production 2021-08-30 13:38:01 -07:00
Mouse Reeve 642ebec5ff Merge branch 'main' into production 2021-08-24 14:52:14 -07:00
Mouse Reeve b6b4e36e94 Merge branch 'main' into production 2021-08-23 16:27:06 -07:00
Mouse Reeve 48c78a9d0e Merge branch 'main' into production 2021-08-23 15:29:00 -07:00
Mouse Reeve 0f419d2b06 Merge branch 'main' into production 2021-08-21 12:10:06 -07:00
Mouse Reeve 1d6f30c2df Merge branch 'main' into production 2021-08-20 14:15:46 -07:00
Mouse Reeve b0751d0555 Merge branch 'main' into production 2021-08-19 17:49:25 -07:00
Mouse Reeve 376adc0a9a Merge branch 'main' into production 2021-08-17 15:09:38 -07:00
Mouse Reeve 6bad4abd63 Merge branch 'main' into production 2021-08-16 14:10:11 -07:00
Mouse Reeve a8dbecde57 Merge branch 'main' into production 2021-08-16 11:00:27 -07:00
Mouse Reeve 470fe576a1 Merge branch 'main' into production 2021-08-13 06:37:35 -07:00
Mouse Reeve 638bc17724 Merge branch 'main' into production 2021-08-12 07:19:13 -07:00
Mouse Reeve 8c3b170812 Merge branch 'main' into production 2021-08-10 19:56:33 -07:00
Mouse Reeve 47b5f8c4f8 Merge branch 'main' into production 2021-08-10 14:43:38 -07:00
Mouse Reeve fee03191e8 Merge branch 'main' into production 2021-08-08 16:24:53 -07:00
Mouse Reeve 847c4b49b4 Merge branch 'main' into production 2021-08-08 15:10:21 -07:00
Mouse Reeve 5ce86d7b52 Merge branch 'main' into production 2021-08-07 15:19:35 -07:00
Mouse Reeve e363d1af11 Merge branch 'main' into production 2021-08-07 15:18:15 -07:00
Mouse Reeve c105490178 Merge branch 'main' into production 2021-08-07 08:34:05 -07:00
Mouse Reeve 3d1f4e3452 Merge branch 'main' into production 2021-08-06 11:27:21 -07:00
Mouse Reeve fe0def3de8 Merge branch 'main' into production 2021-08-05 18:30:48 -07:00
Mouse Reeve cc9c6ce76c Merge branch 'main' into production 2021-08-05 16:15:19 -07:00
Mouse Reeve 8f73cd9d89 Merge branch 'main' into production 2021-08-04 13:59:46 -07:00
Mouse Reeve c7443c9749 Merge branch 'main' into production 2021-08-02 20:30:54 -07:00
Mouse Reeve 9bf79bf9b9 Merge branch 'main' into production 2021-08-02 07:32:22 -07:00
Mouse Reeve 870cf3b60c
Merge pull request #1229 from bookwyrm-social/postgres-version
Pin Postgres version number
2021-07-28 09:51:24 -06:00
Mouse Reeve 375385ea6c Pin Postgres version number
Fixes #1218 (maybe?)
2021-07-27 16:33:11 -07:00
Mouse Reeve c0fc0431e7 Fixes merge block 2021-07-17 18:23:18 -07:00
Mouse Reeve 036463c8d9 Merge branch 'main' into production 2021-07-17 18:21:03 -07:00
Mouse Reeve 29044517a1
Merge pull request #1205 from bookwyrm-social/build-cache
Fix installing image dependencies
2021-06-29 10:26:46 -07:00
Mouse Reeve b0a8d6c9fb Fix installing image dependencies 2021-06-29 06:45:10 -07:00
Mouse Reeve 8534e49f96 Merge branch 'main' into production 2021-06-27 08:05:08 -07:00
Mouse Reeve c4e66d44c9 Merge branch 'main' into production 2021-06-18 14:30:23 -07:00
Mouse Reeve fd0e4c6e13 Merge branch 'main' into production 2021-06-17 19:17:43 -07:00
Mouse Reeve 7e3627f787 Merge branch 'main' into production 2021-06-14 12:55:15 -07:00
Mouse Reeve c3f938d500 Merge branch 'main' into production 2021-06-05 12:53:03 -07:00
Mouse Reeve 90021ab0e4
Merge pull request #1161 from bookwyrm-social/fix-certbot
Reverts to functional certbot configuration
2021-06-05 10:53:40 -07:00
Mouse Reeve 65333b258b Removes certbot init .env config variable 2021-06-05 10:51:02 -07:00
Mouse Reeve 8086b9bca5 Reverts to functional certbot configuration 2021-06-05 10:46:41 -07:00
Mouse Reeve 730b6fabc4 Merge branch 'main' into production 2021-05-24 07:21:43 -07:00
Mouse Reeve 802d28b4a7 Merge branch 'main' into production 2021-05-23 08:36:26 -07:00
Mouse Reeve 5f9e80ac1d Merge branch 'main' into production 2021-05-22 07:04:50 -07:00
Mouse Reeve 832a9494b1 Merge branch 'main' into production 2021-05-21 07:37:17 -07:00
Mouse Reeve 5ba6d8321f Merge branch 'main' into production 2021-05-20 18:48:57 -07:00
Mouse Reeve 8bb815d5b3 Merge branch 'main' into production 2021-05-20 18:21:58 -07:00
Mouse Reeve 1e71cf980c Merge branch 'main' into production 2021-05-18 14:40:54 -07:00
Mouse Reeve 30a67a0221
Merge pull request #1089 from bcj/bcj/non-standard-ports
Allow BookWyrm Services on Non-Standard Ports
2021-05-18 11:28:16 -07:00
bcj 9302aa6ce4 Add POSTGRES_PORT to .env.dev 2021-05-18 13:21:19 -05:00
bcj 238862a4cf Have redis_* grab port information from .env 2021-05-18 00:54:15 -05:00
bcj bad39aef55 Remove the redis_activity ports listing
It is misleading, it isn't binding to that port
2021-05-17 00:07:59 -05:00
bcj 83078cd424 Combine duplicate redis_* volumes in compose file.
I _think_ yaml handles duplicates by overwriting so the conf file was not being added
2021-05-17 00:05:11 -05:00
bcj 892d338adc Read flower port from .env 2021-05-17 00:03:51 -05:00
bcj e8124806b1 Don't hardcode postres port in bookwyrm.settings
Have bookwyrm.settings check for an alternative postgres port.
2021-05-17 00:03:11 -05:00
Mouse Reeve f508b4eb33 Merge branch 'main' into production 2021-05-10 16:25:25 -07:00
Mouse Reeve 0ff7c84a14 Merge branch 'main' into production 2021-05-05 08:39:21 -07:00
Mouse Reeve 4fc230ec8b Merge branch 'main' into production 2021-05-04 09:16:20 -07:00
Mouse Reeve 5ed4dfdb63 Removes aria-hidden from covers 2021-05-02 07:12:50 -07:00
Mouse Reeve b3e369cdba Merge branch 'main' into production 2021-05-01 07:32:30 -07:00
Mouse Reeve 4cc2eccaa4 Merge branch 'main' into production 2021-04-30 15:59:24 -07:00
Mouse Reeve 7aff486a59 Merge branch 'main' into production 2021-04-30 14:05:20 -07:00
Mouse Reeve d80623d88d Merge branch 'main' into production 2021-04-30 13:09:44 -07:00
Mouse Reeve 8761357905 Merge branch 'main' into production 2021-04-30 06:54:05 -07:00
Mouse Reeve 3d2a56090c Merge branch 'main' into production 2021-04-26 14:07:57 -07:00
Mouse Reeve d7a662a39a Merge branch 'main' into production 2021-04-25 11:37:17 -07:00
Mouse Reeve b30fab0597 Merge branch 'main' into production 2021-04-25 11:33:04 -07:00
Mouse Reeve 72f3aff024 Merge branch 'main' into production 2021-04-22 10:43:48 -07:00
Mouse Reeve 92d58411b9 Merge branch 'main' into production 2021-04-22 09:04:13 -07:00
Mouse Reeve 834bc08f34 Merge branch 'main' into production 2021-04-22 07:54:50 -07:00
Mouse Reeve 09ae418881 Merge branch 'main' into production 2021-04-21 14:30:26 -07:00
Mouse Reeve b54979d39c Merge branch 'dropdown-style' of https://github.com/joachimesque/bookwyrm into production 2021-04-21 12:49:35 -07:00
Mouse Reeve 85f1c38ba6 Merge branch 'main' into production 2021-04-18 07:11:50 -07:00
Mouse Reeve 238e88c9dc Merge branch 'main' into production 2021-04-17 18:06:17 -07:00
Mouse Reeve 8a1bfc5ffc Merge branch 'main' into production 2021-04-17 15:29:52 -07:00
Mouse Reeve 1a939ed913 Merge branch 'main' into production 2021-04-17 11:57:19 -07:00
Mouse Reeve 9d26c0e824 Merge branch 'main' into production 2021-04-17 10:57:55 -07:00
Mouse Reeve 107d56c494 Merge branch 'main' into production 2021-04-16 14:31:36 -07:00
Mouse Reeve 9ad369203f Merge branch 'main' into production 2021-04-15 16:41:50 -07:00
Mouse Reeve 37c5c4979f Merge branch 'main' into production 2021-04-15 11:35:30 -07:00
Mouse Reeve 5f783e4fd1 Merge branch 'main' into production 2021-04-13 18:39:45 -07:00
Mouse Reeve d54286b571 Merge branch 'main' into production 2021-04-13 13:12:44 -07:00
Mouse Reeve 64e721fb0b Merge branch 'main' into production 2021-04-08 19:37:09 -07:00
Mouse Reeve 4ee738ae52 Merge branch 'main' into production 2021-04-08 09:22:24 -07:00
Mouse Reeve 3795d682aa Merge branch 'main' into production 2021-04-07 11:19:12 -07:00
Mouse Reeve c33eacaf3d Merge branch 'main' into production 2021-04-07 11:17:16 -07:00
Mouse Reeve e35befb6a2 Merge branch 'main' into production 2021-04-05 11:11:06 -07:00
Mouse Reeve 411dd1b14d Adds password to production stream erase command 2021-04-05 08:50:50 -07:00
Mouse Reeve 8a0db114d8 Fixes stream length 2021-04-04 21:01:20 -07:00
Mouse Reeve a3d5d352a7 Merge branch 'main' into production 2021-04-04 21:00:26 -07:00
Mouse Reeve a8052c2dd0 Merge branch 'main' into production 2021-04-04 16:44:46 -07:00
Mouse Reeve c50edc9d3f Merge branch 'main' into production 2021-04-02 10:09:33 -07:00
Mouse Reeve d55dafd9be Merge branch 'main' into production 2021-04-02 07:42:37 -07:00
Mouse Reeve a5aab26986 Merge branch 'main' into production 2021-04-02 07:22:33 -07:00
Mouse Reeve 406c94354f Merge branch 'main' into production 2021-04-01 18:07:54 -07:00
Mouse Reeve afa831d140 Merge branch 'main' into production 2021-04-01 14:36:32 -07:00
Mouse Reeve 01f598a951 Merge branch 'main' into production 2021-04-01 14:32:21 -07:00
Mouse Reeve 32cd7ec32d Merge branch 'main' into production 2021-04-01 13:24:32 -07:00
Mouse Reeve 5e6b9e44c9 Merge branch 'main' into production 2021-04-01 12:31:09 -07:00
Mouse Reeve fd91a79558 Merge branch 'main' into production 2021-03-31 15:19:40 -07:00
Mouse Reeve 877c90b087 Merge branch 'main' into production 2021-03-31 11:28:52 -07:00
Mouse Reeve af92e3e9a4 Merge branch 'main' into production 2021-03-30 11:01:32 -07:00
Mouse Reeve d77eb5381d Merge branch 'main' into production 2021-03-29 18:57:48 -07:00
Mouse Reeve 9189ae2f2d Merge branch 'main' into production 2021-03-29 15:24:05 -07:00
Mouse Reeve 79fc286ef8 Merge branch 'main' into production 2021-03-29 13:41:16 -07:00
Mouse Reeve 211bf318c4 Merge branch 'main' into production 2021-03-29 13:21:56 -07:00
Mouse Reeve 7439adb8e6 Merge branch 'main' into production 2021-03-29 12:00:50 -07:00
Mouse Reeve 17b289e6e2 Merge branch 'main' into production 2021-03-28 19:04:23 -07:00
Mouse Reeve 145ea053cb Merge branch 'main' into production 2021-03-28 18:08:01 -07:00
Mouse Reeve 7730c9f9a7 Merge branch 'main' into production 2021-03-28 14:49:58 -07:00
Mouse Reeve bc1a782541 Merge branch 'main' into production 2021-03-28 11:02:38 -07:00
Mouse Reeve 0abd4e7fc8 Merge branch 'main' into production 2021-03-27 13:17:19 -07:00
Mouse Reeve fae72977b6 Merge branch 'main' into production 2021-03-26 10:51:50 -07:00
Mouse Reeve 18557af41a Merge branch 'main' into production 2021-03-25 20:09:19 -07:00
Mouse Reeve e01581c28d Merge branch 'main' into production 2021-03-25 16:56:50 -07:00
Mouse Reeve 78467190a6
Merge pull request #797 from mouse-reeve/auth-prod-redis-management
Authentication for redis in prod management command
2021-03-25 11:36:48 -07:00
Mouse Reeve b8695ae3b7 Authentication for redis in prod management command 2021-03-25 11:34:49 -07:00
Mouse Reeve 6f37a43d33 Merge branch 'main' into production 2021-03-25 11:14:37 -07:00
Mouse Reeve 34fb1d2526 Revert "Revert "Prod redis activitystream""
This reverts commit 127881f56a.
2021-03-25 11:00:37 -07:00
Mouse Reeve 3cac69cd2c Updates tests 2021-03-25 06:44:50 -07:00
Mouse Reeve f546dfb005 Adds privacy fields to boost activities 2021-03-25 06:43:52 -07:00
Mouse Reeve c3a750f5da Adds published date field to boost activity 2021-03-25 06:43:52 -07:00
Mouse Reeve 4b44ce691e Return activities for existing objs in resolve_remote_id 2021-03-25 06:43:52 -07:00
Mouse Reeve 9dbd1c674c Hotfix for serializing review names 2021-03-24 11:23:26 -07:00
Mouse Reeve 80893dd5fd Python formatting 2021-03-24 11:12:53 -07:00
Mouse Reeve 4ca76ec58d Updates tests to catch decimal/float/int errors in status serialization 2021-03-24 10:50:54 -07:00
Mouse Reeve e3350e58d0 Fixes formatting rating value in template 2021-03-24 10:49:39 -07:00
Mouse Reeve 8b9528ae95 Fixes decimaal formatting 2021-03-24 10:49:36 -07:00
Mouse Reeve a26bf2859b Python formatting 2021-03-24 10:48:32 -07:00
Mouse Reeve 94ef9cdd3e
Merge pull request #789 from mouse-reeve/revert-787-prod-redis-activitystream
Revert "Prod redis activitystream"
2021-03-24 08:13:13 -07:00
Mouse Reeve 127881f56a
Revert "Prod redis activitystream" 2021-03-24 08:12:03 -07:00
Mouse Reeve 8e4db60f46
Merge pull request #787 from mouse-reeve/prod-redis-activitystream
Prod redis activitystream
2021-03-24 07:40:27 -07:00
Mouse Reeve 8277c9e42e python formatting 2021-03-23 20:15:03 -07:00
Mouse Reeve af72488cd9 Production config for new redis image 2021-03-23 20:05:45 -07:00
Mouse Reeve f97efc2f86 Merge branch 'main' into production 2021-03-23 18:29:39 -07:00
Mouse Reeve d72dc842bd Merge branch 'main' into production 2021-03-22 13:05:23 -07:00
Mouse Reeve e37bb809e0
Merge pull request #778 from mouse-reeve/update-instructions
Instructions for updating an instance
2021-03-21 14:31:13 -07:00
Mouse Reeve eca1a87294 Remove development requirements for prod installs 2021-03-21 14:23:36 -07:00
Mouse Reeve 97697ce5d5 Adds build step to update command 2021-03-21 14:23:26 -07:00
Mouse Reeve c9f7ab6389 Adds documentation on how to update an instance 2021-03-21 14:23:05 -07:00
Mouse Reeve bb8cac021b Merge branch 'main' into production 2021-03-21 12:54:00 -07:00
Mouse Reeve 94d18f6c24 Merge branch 'main' into production 2021-03-20 20:47:53 -07:00
Mouse Reeve 5f1694a7b0 Merge branch 'main' into production 2021-03-19 20:35:29 -07:00
Mouse Reeve 08cf9b5b40 Merge branch 'main' into production 2021-03-19 16:07:57 -07:00
Mouse Reeve 8586f0fe75 Merge branch 'main' into production 2021-03-19 11:01:32 -07:00
Mouse Reeve a868e6c6fd Merge branch 'main' into production 2021-03-18 09:24:55 -07:00
Mouse Reeve fd4b2adb8b Merge branch 'main' into production 2021-03-16 14:21:02 -07:00
Mouse Reeve 52905a3668 Merge branch 'main' into production 2021-03-15 17:04:21 -07:00
Mouse Reeve d202bd1d1d Merge branch 'main' into production 2021-03-15 16:02:53 -07:00
Mouse Reeve 42ba3753d6
Merge pull request #719 from mouse-reeve/certbot-install
Certbot install
2021-03-15 14:25:35 -07:00
Mouse Reeve 52cf9c67b9 Merge branch 'main' into production 2021-03-15 10:29:29 -07:00
Mouse Reeve e8b89eee73 Merge branch 'main' into production 2021-03-13 18:25:15 -08:00
Mouse Reeve a04511ccf7 Merge branch 'main' into production 2021-03-13 16:15:42 -08:00
Mouse Reeve fd3c6d1d21 Merge branch 'main' into production 2021-03-13 15:48:13 -08:00
Mouse Reeve 6a14529893 Merge branch 'main' into production 2021-03-13 14:06:08 -08:00
Mouse Reeve 36088554e8
Merge branch 'production' into certbot-install 2021-03-13 11:02:27 -08:00
Mouse Reeve 59cc5c112f
Merge pull request #720 from bcj/bcj/reverse-proxy
Add instructions for handling port conflicts
2021-03-13 09:57:13 -08:00
bcj b0f78e6d0b Add instructions for handling port conflicts
Add information on how to handle port conflicts when building Bookwyrm, and specifically instructions for handling conflicts caused by another webserver
2021-03-12 22:21:24 -06:00
Mouse Reeve 28160137d0 Comments out https part of nginx config to certbot can run 2021-03-12 14:34:00 -08:00
Mouse Reeve 4bf61e0ef0 Updates production install instructions 2021-03-12 14:15:53 -08:00
Mouse Reeve f6366e1c4a Merge branch 'main' into production 2021-03-11 10:29:34 -08:00
Mouse Reeve 593d5d309a
Merge pull request #714 from bcj/bcj/automatic-backups
Turn on Automatic backups for the DB
2021-03-09 10:28:51 -08:00
bcj 84b525f83e Add a script for pruning old backup files
Adds a pruning script which is installed but not set to run by default.
Also adds for that script that can be run in a container that replicates the db container's conditions
2021-03-08 23:16:34 -06:00
bcj 015d45ef99 Start cron on db service start
init.d isn't run when docker containers are run so we need to modify the entrypoint.
This commit makes the ugly choice of injecting the command in automatically in order to avoid the need to manually maintain the images entrypoint.
2021-03-08 23:09:54 -06:00
Mouse Reeve 6c7fcb0dd1 Merge branch 'main' into production 2021-03-08 10:02:46 -08:00
Mouse Reeve 6f6ca40ce7 Merge branch 'main' into production 2021-03-07 13:21:31 -08:00
Mouse Reeve c770b369d2 Merge branch 'main' into production 2021-03-07 09:00:20 -08:00
Mouse Reeve 88879207b9 Don't install gettext in production 2021-03-03 15:18:06 -08:00
Mouse Reeve 8ac2315cc6 Merge branch 'main' into production 2021-03-03 15:17:47 -08:00
Mouse Reeve e5283f9576 Merge branch 'main' into production 2021-03-02 20:31:34 -08:00
Mouse Reeve 6ecda991d9 Merge branch 'main' into production 2021-03-02 13:52:19 -08:00
Mouse Reeve cabb486cb8 Merge branch 'main' into production 2021-03-02 13:43:50 -08:00
Mouse Reeve a1428a6030 Merge branch 'main' into production 2021-03-01 11:44:13 -08:00
Mouse Reeve 489ac29761 Merge branch 'main' into production 2021-02-27 12:12:24 -08:00
Mouse Reeve df4def6cef Merge branch 'main' into production 2021-02-24 13:32:44 -08:00
Mouse Reeve e36ddb3f9b Merge branch 'main' into production 2021-02-24 07:16:46 -08:00
Mouse Reeve 396cb30c3a Merge branch 'main' into production 2021-02-23 20:21:47 -08:00
Mouse Reeve 98f35929b4 Merge branch 'main' into production 2021-02-22 09:50:40 -08:00
Mouse Reeve 888987f19d Merge branch 'main' into production 2021-02-22 08:40:24 -08:00
Mouse Reeve ac80df7ee0 Merge branch 'main' into production 2021-02-20 11:25:03 -08:00
Mouse Reeve 70bdac3706 Merge branch 'main' into production 2021-02-12 16:23:27 -08:00
Mouse Reeve 355b2fad35 Merge branch 'main' into production 2021-02-12 10:11:16 -08:00
Mouse Reeve f107e3d499 db password that more clearly indicates to change it 2021-02-10 17:25:23 -08:00
Mouse Reeve 5d7bd6a92b Merge branch 'main' into production 2021-02-10 17:24:31 -08:00
Mouse Reeve a2c7bffec9 Merge branch 'main' into production 2021-02-04 12:25:35 -08:00
Mouse Reeve d41c1b7213 Merge branch 'main' into production 2021-02-03 18:09:35 -08:00
Mouse Reeve f9da72d957 Merge branch 'main' into production 2021-02-03 17:11:32 -08:00
Mouse Reeve 6105a6921b Merge branch 'main' into production 2021-02-03 16:50:00 -08:00
Mouse Reeve a0b0edbc3e Merge branch 'main' into production 2021-02-03 16:45:44 -08:00
Mouse Reeve a3966aa807 Merge branch 'main' into production 2021-02-03 11:01:20 -08:00
Mouse Reeve a3768b52a6 Merge branch 'main' into production 2021-02-03 11:00:44 -08:00
Mouse Reeve 7e7f80d31e Merge branch 'main' into production 2021-01-30 17:53:23 -08:00
Mouse Reeve 9c5444ad7a Merge branch 'main' into production 2021-01-30 12:31:34 -08:00
Mouse Reeve 657dff7e95 Merge branch 'main' into production 2021-01-30 11:53:00 -08:00
Mouse Reeve bfdfb846da Merge branch 'main' into production 2021-01-30 09:20:19 -08:00
Mouse Reeve 00c8fab365 Merge branch 'main' into production 2021-01-27 07:38:58 -08:00
Mouse Reeve e4001aba0b Merge branch 'main' into production 2021-01-21 16:57:26 -08:00
Mouse Reeve 6545141bcf Merge branch 'main' into production 2021-01-19 09:53:54 -08:00
Mouse Reeve 7ef29bb99e Merge branch 'main' into production 2021-01-19 07:50:18 -08:00
Mouse Reeve d9d5bc4e31 Merge branch 'main' into production 2021-01-19 07:19:37 -08:00
Mouse Reeve 7eae4cdebb Merge branch 'main' into production 2021-01-18 18:56:37 -08:00
Mouse Reeve 1eb979f05d Merge branch 'main' into production 2021-01-18 16:55:28 -08:00
Mouse Reeve 28a7156f36 Merge branch 'main' into production 2021-01-18 13:52:42 -08:00
Mouse Reeve 802d12421b Merge branch 'main' into production 2021-01-18 12:55:03 -08:00
Mouse Reeve 41d9fe9d9d Merge branch 'main' into production 2021-01-18 12:01:33 -08:00
Mouse Reeve 78d358a916 Merge branch 'main' into production 2021-01-18 11:52:09 -08:00
Mouse Reeve 6d4335e05b Merge branch 'main' into production 2021-01-18 11:46:51 -08:00
Mouse Reeve 5e0cb746d4 Merge branch 'main' into production 2021-01-18 10:26:58 -08:00
Mouse Reeve c7d6273b3b Merge branch 'main' into production 2021-01-12 07:30:49 -08:00
Mouse Reeve 5abba57bfe Merge branch 'main' into production 2021-01-11 18:15:42 -08:00
Mouse Reeve 12dbd47207 Merge branch 'main' into production 2021-01-11 15:29:50 -08:00
Mouse Reeve 8156f1905d Merge branch 'main' into production 2021-01-07 09:37:08 -08:00
Mouse Reeve 14e0102694 Merge branch 'main' into production 2021-01-07 09:33:43 -08:00
Mouse Reeve aafc9654c1 Merge branch 'main' into production 2021-01-06 16:06:06 -08:00
Mouse Reeve 97f050c68e Merge branch 'main' into production 2021-01-06 14:14:43 -08:00
Mouse Reeve 5c24bb6243
Merge pull request #487 from mouse-reeve/gunicorn
Use gunicorn as production runner
2021-01-06 10:37:27 -08:00
Mouse Reeve 08cf668233 Use gunicorn as production runner 2021-01-05 19:28:13 -08:00
Mouse Reeve 0a75c33de4
Merge pull request #486 from mouse-reeve/flower-auth
uses basic auth for flower
2021-01-05 12:54:42 -08:00
Mouse Reeve a29a5dbde9 uses basic auth for flower 2021-01-05 12:52:10 -08:00
Mouse Reeve 636de3ae54 Merge branch 'main' into production 2021-01-05 11:48:15 -08:00
Mouse Reeve 0f49436475 Merge branch 'main' into production 2021-01-04 21:48:40 -08:00
Mouse Reeve 79dca312fb Merge branch 'main' into production 2021-01-03 20:08:22 -08:00
Mouse Reeve c69fdf7bb6 Merge branch 'main' into production 2021-01-03 15:47:17 -08:00
Mouse Reeve 2719332e82 Merge branch 'main' into production 2021-01-03 14:51:16 -08:00
Mouse Reeve 5b397c42f6 Merge branch 'main' into production 2021-01-03 10:14:01 -08:00
Mouse Reeve 2635d109ed Merge branch 'main' into production 2021-01-03 08:18:57 -08:00
Mouse Reeve 34ccf60868
Merge pull request #464 from mouse-reeve/certbot-renew
Fixes acme challenge path for certbot renewal
2021-01-02 16:29:26 -08:00
Mouse Reeve d3192fb1bb Fixes acme challenge path for certbot renewal 2021-01-02 12:14:51 -08:00
Mouse Reeve 042cfe2dfc Merge branch 'main' into production 2021-01-01 07:33:03 -08:00
Mouse Reeve 42d50d15f8 Merge branch 'main' into production 2020-12-31 14:37:24 -08:00
Mouse Reeve 2d21a31c13 Merge branch 'main' into production 2020-12-27 14:45:53 -08:00
Mouse Reeve 77db2e183d Merge branch 'main' into production 2020-12-21 13:21:59 -08:00
Mouse Reeve 255261dc3d Merge branch 'main' into production 2020-12-20 13:15:27 -08:00
Mouse Reeve 44f764a34a Merge branch 'main' into production 2020-12-20 11:42:28 -08:00
Mouse Reeve b910be99c3 Merge branch 'main' into production 2020-12-19 20:33:36 -08:00
Mouse Reeve f7769db99b Merge branch 'main' into production 2020-12-17 22:16:32 -08:00
Mouse Reeve b36cf5a7b8 Merge branch 'main' into production 2020-12-17 13:56:45 -08:00
Mouse Reeve c5b48f521a Merge branch 'main' into production 2020-12-17 13:26:42 -08:00
Mouse Reeve 0cd9f81431 Merge branch 'main' into production 2020-12-17 11:33:52 -08:00
Mouse Reeve ad6b2315ab Merge branch 'main' into production 2020-12-16 20:28:47 -08:00
Mouse Reeve 4c8583bfdb Merge branch 'main' into production 2020-12-16 15:59:59 -08:00
Mouse Reeve 175eab01f7 Merge branch 'main' into production 2020-12-16 15:02:23 -08:00
Mouse Reeve d5cc1d2f02 Merge branch 'main' into production 2020-12-11 17:43:40 -08:00
Mouse Reeve 4171829626 Merge branch 'main' into production 2020-12-02 15:28:01 -08:00
Mouse Reeve f3576d59d7 Merge branch 'main' into production 2020-11-24 13:46:22 -08:00
Mouse Reeve e5b850299c Merge branch 'main' into production 2020-11-22 09:38:06 -08:00
Mouse Reeve d417f1e09d Merge branch 'main' into production 2020-11-18 12:33:16 -08:00
Mouse Reeve cb124e9ba4 Merge branch 'main' into production 2020-11-17 14:28:48 -08:00
Mouse Reeve 567ea40f52 Merge branch 'main' into production 2020-11-13 12:18:30 -08:00
Mouse Reeve 8f595b6a35 Merge branch 'main' into production 2020-11-13 11:48:55 -08:00
Mouse Reeve e9ed457012 Merge branch 'main' into production 2020-11-12 14:40:49 -08:00
Mouse Reeve 5cfdc75c5f Remove more info box when it's not used 2020-11-11 11:24:46 -08:00
Mouse Reeve 0eacee02ac Merge branch 'main' into production 2020-11-11 11:10:15 -08:00
Mouse Reeve dac3c9353d Merge branch 'main' into production 2020-11-09 16:58:59 -08:00
Mouse Reeve da24241b78 Merge branch 'main' into production 2020-11-09 13:14:35 -08:00
Mouse Reeve 2d96c8a35a Merge branch 'main' into production 2020-11-08 20:17:52 -08:00
Mouse Reeve 9ac94543b9 Merge branch 'main' of github.com:mouse-reeve/bookwyrm into main 2020-11-08 20:15:57 -08:00
Mouse Reeve 00752232ff Merge branch 'jim/cli-tooling' of https://github.com/jimfingal/bookwyrm into main 2020-11-08 20:03:27 -08:00
Mouse Reeve 9db851f2d4 Merge branch 'main' into production 2020-11-08 16:47:52 -08:00
Mouse Reeve 4424acc5c2 Merge branch 'main' into production 2020-11-08 16:27:54 -08:00
Mouse Reeve eb1e4fd24c Don't show re-shelve buttons on other people's shelves
yikes
2020-11-07 20:47:17 -08:00
Mouse Reeve abd96717da Merge branch 'main' into production 2020-11-07 20:14:07 -08:00
Mouse Reeve 29e5c67f83 Merge branch 'main' into production 2020-11-07 19:15:27 -08:00
Mouse Reeve 0574e36602 Merge branch 'main' into production 2020-11-07 19:02:05 -08:00
Mouse Reeve b20de604d3 Merge branch 'main' into production 2020-11-07 19:01:25 -08:00
Mouse Reeve de95b60b0b
Merge pull request #300 from mouse-reeve/main
fixing federation of images bugs, finally
2020-11-07 11:01:07 -08:00
Mouse Reeve bc62ed231f Merge branch 'main' into production 2020-11-06 20:51:41 -08:00
Mouse Reeve c80d63d184 Merge branch 'main' into production 2020-11-06 20:40:48 -08:00
Mouse Reeve 46d9a444fd Merge branch 'main' into production 2020-11-06 15:51:31 -08:00
Mouse Reeve 6dd83d490f Merge branch 'main' into production 2020-11-06 14:53:44 -08:00
Mouse Reeve 5782961e58 Merge branch 'main' into production 2020-11-06 09:09:17 -08:00
Mouse Reeve 573bdfd56b Merge branch 'main' into production 2020-11-05 13:51:37 -08:00
Mouse Reeve 8dc350e8a1 prod-only configuration 2020-11-05 11:47:40 -08:00
Mouse Reeve 44b299b28f Merge branch 'main' into production 2020-11-05 11:45:28 -08:00
Mouse Reeve 4dc53c56d5 Merge branch 'main' into production 2020-11-05 11:44:59 -08:00
Mouse Reeve 5a051d669f Merge branch 'main' into production 2020-11-04 16:32:20 -08:00
Mouse Reeve ecca49f70a Merge branch 'main' into production 2020-11-04 14:19:27 -08:00
Mouse Reeve 004a3e5e56 Merge branch 'main' into production 2020-11-04 14:13:59 -08:00
Mouse Reeve 1a61c6eb07 Merge branch 'main' into production 2020-11-04 14:01:57 -08:00
Mouse Reeve ea672c74e2 Merge branch 'main' into production 2020-11-04 13:33:23 -08:00
Mouse Reeve 2823eca70d Merge branch 'main' into production 2020-11-04 13:13:22 -08:00
Mouse Reeve 88de4ff046 Merge branch 'main' into production 2020-11-04 12:12:58 -08:00
Mouse Reeve c577c91912 Merge branch 'main' into production 2020-11-04 11:31:01 -08:00
Mouse Reeve dd8f91a044 Merge branch 'main' into production 2020-11-02 15:40:15 -08:00
Mouse Reeve de66d77f4b Merge branch 'main' into production 2020-11-02 14:13:48 -08:00
Mouse Reeve f6026f5ed8 Merge branch 'main' into production 2020-11-02 11:55:06 -08:00
Mouse Reeve 17ea59e655 Merge branch 'main' into production 2020-11-02 09:24:26 -08:00
Mouse Reeve 6b667aa575 Merge branch 'main' into production 2020-11-02 09:07:21 -08:00
Mouse Reeve 5e2667c297 Remove option to resetdb from production helpers 2020-11-01 12:16:03 -08:00
Mouse Reeve 7db77c690e Merge branch 'main' into production 2020-11-01 12:09:59 -08:00
Mouse Reeve c7b2d7a4b9 Merge branch 'main' into production 2020-11-01 11:58:14 -08:00
Mouse Reeve bfef6f2d8a Merge branch 'main' into production 2020-11-01 11:14:01 -08:00
Mouse Reeve 875b473711 Merge branch 'main' into production 2020-11-01 11:12:02 -08:00
Mouse Reeve 2b75fd1f14 Merge branch 'main' into production 2020-10-31 13:08:29 -07:00
Mouse Reeve d6a166d9db Merge branch 'main' into production 2020-10-31 11:21:26 -07:00
Mouse Reeve 8d21cfa707 Merge branch 'main' into production 2020-10-31 11:05:53 -07:00
Mouse Reeve 7da705f87e Merge branch 'main' into production 2020-10-30 15:23:26 -07:00
Mouse Reeve 7af3afe24b Merge branch 'main' into production 2020-10-30 13:11:37 -07:00
Mouse Reeve 3cf2c4d1b0 Merge branch 'main' into production 2020-10-30 12:59:53 -07:00
Mouse Reeve 6d6a16daf3 Merge branch 'main' into production 2020-10-30 12:07:44 -07:00
Mouse Reeve 0a34cf8821 Merge branch 'main' into production 2020-10-30 11:56:05 -07:00
Mouse Reeve d19405f379 fixes backup script name 2020-10-29 23:10:40 -07:00
Mouse Reeve 59d0164911 Fixes celery access to redis 2020-10-28 17:42:01 -07:00
Mouse Reeve f23e10f8f7 Merge branch 'main' into production 2020-10-28 17:17:16 -07:00
Mouse Reeve 19f9b75c6b Merge branch 'main' into production 2020-10-28 16:54:09 -07:00
Mouse Reeve 9c68b6d430
Merge pull request #244 from mouse-reeve/cron
Adds database backup crontab
2020-10-28 16:33:49 -07:00
Mouse Reeve d3987756eb Removes hanging cron command 2020-10-28 16:10:50 -07:00
Mouse Reeve 687ff5a6d7 Gets database cron into the right image 2020-10-28 15:56:25 -07:00
Mouse Reeve 8b061d63a8 Changes perms on db backup script 2020-10-28 13:56:23 -07:00
Mouse Reeve 6826386ea3 Adds database backup crontab 2020-10-28 13:55:08 -07:00
Mouse Reeve b02a70b484 Merge branch 'main' into production 2020-10-28 13:17:44 -07:00
Mouse Reeve c5bcde0ee4 replicate password line 2020-10-28 12:07:56 -07:00
Mouse Reeve be1a26d32b Fixes redis conf location in image 2020-10-28 11:51:25 -07:00
Mouse Reeve 54b924a4e2 Secure redis.conf 2020-10-28 11:37:28 -07:00
Mouse Reeve 439feac110 Use redis password in production 2020-10-27 12:30:34 -07:00
Mouse Reeve 7dd1deb438 Merge branch 'main' into production 2020-10-27 12:18:46 -07:00
Mouse Reeve a9a40e4d69 Merge branch 'main' into production 2020-10-16 17:11:46 -07:00
Mouse Reeve 5446a5b238 Merge branch 'main' into production 2020-10-16 17:09:43 -07:00
Mouse Reeve 4b32948fd3 oops keep the .env stuff 2020-10-16 13:22:09 -07:00
Mouse Reeve 4b993fb5d6 env and config for production 2020-10-16 12:55:32 -07:00
16 changed files with 750 additions and 148 deletions

View file

@ -1,43 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Instance**
On which BookWyrm instance did you encounter this problem.
**Additional context**
Add any other context about the problem here.
---
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

View file

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -8,4 +8,3 @@ WORKDIR /app
COPY requirements.txt /app/
RUN pip install -r requirements.txt --no-cache-dir
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean

View file

@ -191,6 +191,10 @@ STATICFILES_FINDERS = [
SASS_PROCESSOR_INCLUDE_FILE_PATTERN = r"^.+\.[s]{0,1}(?:a|c)ss$"
SASS_PROCESSOR_ENABLED = True
SASS_PROCESSOR_INCLUDE_DIRS = [
os.path.join(BASE_DIR, ".css-config-sample"),
]
# minify css is production but not dev
if not DEBUG:
SASS_OUTPUT_STYLE = "compressed"

View file

@ -1,7 +1,7 @@
{% load layout %}
{% load sass_tags %}
{% load i18n %}
{% load static %}
{% load sass_tags %}
<!DOCTYPE html>
<html lang="{% get_lang %}">

63
bw-dev
View file

@ -12,11 +12,8 @@ trap showerr EXIT
source .env
trap - EXIT
function clean {
docker-compose stop
docker-compose rm -f
}
# show commands as they're executed
set -x
function runweb {
docker-compose run --rm web "$@"
}
@ -64,27 +61,9 @@ case "$CMD" in
up)
docker-compose up --build "$@"
;;
service_ports_web)
docker-compose run --rm --service-ports web
;;
initdb)
initdb "@"
;;
resetdb)
clean
# Start just the DB so no one else is using it
docker-compose up --build -d db
rundb dropdb -U ${POSTGRES_USER} ${POSTGRES_DB}
rundb createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
# Now start up web so we can run the migrations
docker-compose up --build -d web
migrate
initdb
clean
;;
makemigrations)
runweb python manage.py makemigrations "$@"
;;
migrate)
migrate "$@"
;;
@ -100,37 +79,12 @@ case "$CMD" in
restart_celery)
docker-compose restart celery_worker
;;
pytest)
runweb pytest --no-cov-on-fail "$@"
;;
collectstatic)
runweb python manage.py collectstatic --no-input
;;
makemessages)
runweb django-admin makemessages --no-wrap --ignore=venv -l en_US $@
;;
compilemessages)
runweb django-admin compilemessages --ignore venv $@
;;
update_locales)
git fetch origin l10n_main:l10n_main
git checkout l10n_main locale/de_DE
git checkout l10n_main locale/es_ES
git checkout l10n_main locale/fi_FI
git checkout l10n_main locale/fr_FR
git checkout l10n_main locale/gl_ES
git checkout l10n_main locale/it_IT
git checkout l10n_main locale/lt_LT
git checkout l10n_main locale/no_NO
git checkout l10n_main locale/pt_PT
git checkout l10n_main locale/pt_BR
git checkout l10n_main locale/ro_RO
git checkout l10n_main locale/sv_SE
git checkout l10n_main locale/zh_Hans
git checkout l10n_main locale/zh_Hant
runweb django-admin makemessages --no-wrap --ignore=venv -l en_US $@
runweb django-admin compilemessages --ignore venv
;;
build)
docker-compose build
;;
@ -231,28 +185,17 @@ case "$CMD" in
echo "Unrecognised command. Try:"
echo " setup"
echo " up [container]"
echo " service_ports_web"
echo " initdb"
echo " resetdb"
echo " makemigrations [migration]"
echo " migrate [migration]"
echo " bash"
echo " shell"
echo " dbshell"
echo " restart_celery"
echo " pytest [path]"
echo " collectstatic"
echo " makemessages"
echo " compilemessages [locale]"
echo " update_locales"
echo " compilemessages"
echo " build"
echo " clean"
echo " black"
echo " prettier"
echo " stylelint"
echo " formatters"
echo " compilescss"
echo " collectstatic_watch"
echo " populate_streams [--stream=<stream name>]"
echo " populate_lists_streams"
echo " populate_suggestions"

View file

@ -5,26 +5,40 @@ services:
image: nginx:latest
restart: unless-stopped
ports:
- 1333:80
- 80:80
- 443:443
depends_on:
- web
networks:
- main
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/nginx/ssl
- ./certbot/data:/var/www/certbot
- static_volume:/app/static
- media_volume:/app/images
certbot:
image: certbot/certbot:latest
command: certonly --webroot --webroot-path=/var/www/certbot --email ${EMAIL} --agree-tos --no-eff-email -d ${DOMAIN} -d www.${DOMAIN}
#command: renew --webroot --webroot-path /var/www/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/logs:/var/log/letsencrypt
- ./certbot/data:/var/www/certbot
db:
image: postgres
build: postgres-docker
env_file: .env
entrypoint: /bookwyrm-entrypoint.sh
command: cron postgres
volumes:
- pgdata:/var/lib/postgresql/data
- backups:/backups
networks:
- main
web:
build: .
env_file: .env
command: python manage.py runserver 0.0.0.0:8000
command: gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:8000
volumes:
- .:/app
- static_volume:/app/static
@ -105,6 +119,7 @@ services:
- .:/app
volumes:
pgdata:
backups:
static_volume:
media_volume:
redis_broker_data:

View file

@ -5,20 +5,70 @@ upstream web {
}
server {
listen [::]:80;
listen 80;
location / {
proxy_pass http://web;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
server_name your-domain.com www.your-domain.com;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/certbot;
}
location /images/ {
alias /app/images/;
}
location /static/ {
alias /app/static/;
}
# redirect http to https
# return 301 https://your-domain.com$request_uri;
# }
#
# server {
# listen [::]:443 ssl http2;
# listen 443 ssl http2;
#
# server_name your-domain.com;
#
# # SSL code
# ssl_certificate /etc/nginx/ssl/live/your-domain.com/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/live/your-domain.com/privkey.pem;
#
# location ~ /.well-known/acme-challenge {
# allow all;
# root /var/www/certbot;
# }
#
# location / {
# proxy_pass http://web;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $host;
# proxy_redirect off;
# }
#
# location /images/ {
# alias /app/images/;
# }
#
# location /static/ {
# alias /app/static/;
# }
}
# Reverse-Proxy server
# server {
# listen [::]:8001;
# listen 8001;
# server_name your-domain.com www.your-domain.com;
# location / {
# proxy_pass http://web;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $host;
# proxy_redirect off;
# }
# location /images/ {
# alias /app/images/;
# }
# location /static/ {
# alias /app/static/;
# }
# }

View file

@ -0,0 +1,20 @@
FROM postgres:13.0
# crontab
RUN mkdir /backups
COPY ./backup.sh /backups
COPY ./weed.sh /backups
COPY ./cronfile /etc/cron.d/cronfile
RUN apt-get update && apt-get -y --no-install-recommends install cron
RUN chmod 0644 /etc/cron.d/cronfile
RUN crontab /etc/cron.d/cronfile
RUN touch /var/log/cron.log
# The postgres image's entrypoint expects the docker command to only contain flags to
# pass postgres. It runs the entrypoint twice, the second times as the postgres user.
# We need to start the cron service the first time it runs, when it's still being run
# as the root user. We're going to add a check that looks at the first argument and
# if it's 'cron', starts the service and then removes that argument.
RUN awk '$0 ~ /^\t_main "\$@"$/ { print "\tif [[ $1 == cron ]]; then\n\t\tservice cron start\n\t\tshift\n\tfi" }{ print }' docker-entrypoint.sh > bookwyrm-entrypoint.sh
RUN chown postgres /bookwyrm-entrypoint.sh
RUN chmod u=rwx,go=r /bookwyrm-entrypoint.sh

7
postgres-docker/backup.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
if [ -z "$POSTGRES_DB" ]; then
echo "Database not specified, defaulting to bookwyrm"
fi
BACKUP_DB=${POSTGRES_DB:-bookwyrm}
filename=backup_${BACKUP_DB}_$(date +%F)
pg_dump -U $BACKUP_DB > /backups/$filename.sql

5
postgres-docker/cronfile Normal file
View file

@ -0,0 +1,5 @@
0 0 * * * /backups/backup.sh
# If uncommented, this script will weed the backups directory. It will keep the 14
# most-recent backups, then one backup/week for the next four backups, then one
# backup/month after that.
# 0 1 * * * /backups/weed.sh -d 14 -w 4 -m -1 /backups

View file

@ -0,0 +1,8 @@
FROM postgres:latest
RUN apt update && apt install -y shellcheck
COPY ./tests/testing-entrypoint.sh /testing-entrypoint.sh
RUN chmod u+rx,go=r /testing-entrypoint.sh
COPY ./weed.sh /weed.sh
RUN chmod u+rx,go=r /weed.sh

View file

@ -0,0 +1,9 @@
version: "3"
services:
weeding:
build:
# We need to build from the parent directory so we can access weed.sh
context: ..
dockerfile: ./tests/Dockerfile
entrypoint: /testing-entrypoint.sh

View file

@ -0,0 +1,426 @@
#!/usr/bin/env bash
# These tests are written to run in their own container, using the same image as the
# actual postgres service. To run: `docker-compose up --build`
set -euo pipefail
source /weed.sh
ERROR_COUNT=0
FAILURE_COUNT=0
# compare two sorted files
function compare_files {
local expected="$1"
local actual="$2"
declare -a missing
local missing_index=0
declare -a extra
local extra_index=0
old_ifs="$IFS"
IFS=$'\n'
for line in $(diff --suppress-common-lines "$expected" "$actual"); do
if [[ $line =~ ^\< ]]; then
missing[missing_index]=${line:1}
missing_index=$((missing_index + 1))
elif [[ $line =~ ^\> ]]; then
extra[extra_index]=${line:1}
extra_index=$((extra_index + 1))
fi
done
IFS="$old_ifs"
if [[ $((missing_index + extra_index)) -gt 0 ]]; then
echo 'fail'
if [[ missing_index -gt 0 ]]; then
echo -e "\\t$missing_index missing files:"
for index in $(seq 0 $((missing_index - 1))); do
echo -e "\\t\\t${missing[index]}"
done
fi
if [[ extra_index -gt 0 ]]; then
echo -e "\\t$extra_index extra files:"
for index in $(seq 0 $((extra_index - 1))); do
echo -e "\\t\\t${extra[index]}"
done
fi
FAILURE_COUNT=$((FAILURE_COUNT + 1))
return 1
fi
}
# This is a wrapper function that handles creating a directory with test files in it,
# running weed_directory (as the function, as a dry run, then finally actually-deleting
# files), marking the test as failed/errored as necessary, then cleaning up after
# itself. the first three arguments passed are the thresholds to pass into
# weed_directory. The remaining arguments are names of files to create for the test.
# Bash isn't great at passing arrays so instead of separately passing in a list of
# expected results, flag the files you expect to be deleted by prepending "DELETE:"
# to the path.
function perform_test {
echo "${FUNCNAME[1]}" | sed 's/^test_\(.*\)$/\1/' | tr '_\n' ' :'
echo -en '\t'
local daily_threshold="$1"
shift
local weekly_threshold="$1"
shift
local monthly_threshold="$1"
shift
# We might as well name the files we're using for running tests in as inflamatory a
# way as possible to increase the chances that bad filtering by weed_directory
# results in tests failing.
local expected="/testing/expected/backup__2020-02-02.sql"
local actual="/testing/backup__2020-02-02.sql.actual"
local remaining="/testing/remainbackup__2020-02-02.sql"
local temp="/testing/backup__2020-TE-MP.sql"
# create test files
mkdir -p /testing/expected
if [[ -e "$expected" ]]; then
rm "$expected"
fi
touch "$expected"
echo -e "$expected\\n$actual\\n$remaining\\n$temp" > "$remaining"
while [[ "$#" -gt 0 ]]; do
if [[ "$1" =~ ^DELETE: ]]; then
path="/testing/${1:7}"
echo "$path" >> "$expected"
else
path="/testing/$1"
echo "$path" >> "$remaining"
fi
directory=$(dirname "$path")
mkdir -p "$directory"
touch "$path"
shift
done
# We don't make any promise about the order files will be listed in by
# weed_directory (it is currently reverse-chronological). We should sort the output
# and the expected file instead of forcing tests to list files in that order (or
# causing tests to fail if weed_directory's order changes)
sort "$expected" > "$temp"
mv "$temp" "$expected"
sort "$remaining" > "$temp"
mv "$temp" "$remaining"
# Part one: call the function directly
set +e
(
weed_directory \
"/testing" \
"$daily_threshold" \
"$weekly_threshold" \
"$monthly_threshold" \
2> "$temp" \
| sort > "$actual"
)
local result="$?"
set -e
if [[ "$result" -ne 0 ]]; then
echo 'error'
ERROR_COUNT=$((ERROR_COUNT + 1))
if [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
else
set +e
compare_files "$expected" "$actual"
result="$?"
set -e
if [[ "$result" -eq 0 ]]; then
# Part two: as a script with the dry-run flag (-l)
set +e
(
"/weed.sh" \
"-d" "$daily_threshold" \
"-w" "$weekly_threshold" \
"-m" "$monthly_threshold" \
"-l" \
"/testing" \
2> "$temp" \
| sort > "$actual"
)
local result="$?"
set -e
if [[ "$result" -ne 0 ]]; then
echo 'error'
ERROR_COUNT=$((ERROR_COUNT + 1))
if [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
else
set +e
compare_files "$expected" "$actual"
result="$?"
set -e
if [[ "$result" -eq 0 ]]; then
# Part three: let's try actually deleting files
set +e
(
"/weed.sh" \
"-d" "$daily_threshold" \
"-w" "$weekly_threshold" \
"-m" "$monthly_threshold" \
"/testing" \
2> "$temp"
)
local result="$?"
set -e
if [[ "$result" -ne 0 ]]; then
echo 'error'
ERROR_COUNT=$((ERROR_COUNT + 1))
if [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
else
find /testing -type f | sort > "$actual"
set +e
compare_files "$remaining" "$actual"
result="$?"
set -e
if [[ "$result" -eq 0 ]]; then
echo 'pass'
elif [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
fi
elif [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
fi
elif [[ -s "$temp" ]]; then
echo 'stderr:'
cat "$temp"
fi
fi
rm -rf /testing
}
# actual tests
function test_shellcheck {
echo -en 'running shellcheck on scripts:\t'
shellcheck /weed.sh
# Test the tests too! Writing bash is hard
shellcheck -x /testing-entrypoint.sh
echo 'pass'
}
function test_empty_directory {
perform_test 1 2 3
}
function test_single_file {
perform_test 1 2 3 "backup__2021-02-02.sql"
}
function test_keep_everything {
perform_test -1 0 0 "backup__2021-02-02.sql" "backup__2021-02-01.sql" "backup__2021-01-31.sql"
}
function test_keep_one {
perform_test 1 0 0 "backup__2021-02-02.sql" "DELETE:backup__2021-02-01.sql" "DELETE:backup__2021-01-31.sql"
}
function test_weekly {
# weed.sh follows ISO 8601 and uses %W for day of week, so Monday is the first day
# of the week.
# backup__2021-03-08.sql: Monday (keep)
# backup__2021-03-07.sql: Sunday (keep)
# backup__2021-02-28.sql: Sunday (keep)
# backup__2021-02-22.sql: Monday (delete)
# backup__2021-02-20.sql: Saturday (keep)
# backup__2021-02-16.sql: Tuesday (delete)
# backup__2021-02-15.sql: Monday (delete)
# backup__2021-02-14.sql: Sunday (keep)
# backup__2020-02-14.sql: Sunday (same week of year) (keep)
perform_test 0 -1 0 \
"backup__2021-03-08.sql" \
"backup__2021-03-07.sql" \
"backup__2021-02-28.sql" \
"DELETE:backup__2021-02-22.sql" \
"backup__2021-02-20.sql" \
"DELETE:backup__2021-02-16.sql" \
"DELETE:backup__2021-02-15.sql" \
"backup__2021-02-14.sql" \
"backup__2020-02-14.sql"
}
function test_monthly {
perform_test 1 0 -1 \
"backup__2021-03-08.sql" \
"DELETE:backup__2021-03-07.sql" \
"backup__2021-02-28.sql" \
"DELETE:backup__2021-02-22.sql" \
"DELETE:backup__2021-02-20.sql" \
"DELETE:backup__2021-02-16.sql" \
"DELETE:backup__2021-02-15.sql" \
"DELETE:backup__2021-02-14.sql" \
"backup__2021-01-14.sql" \
"backup__2020-01-13.sql"
}
function test_annual {
perform_test 0 0 0 \
"backup__2021-03-08.sql" \
"DELETE:backup__2021-03-07.sql" \
"DELETE:backup__2021-02-28.sql" \
"DELETE:backup__2021-02-22.sql" \
"DELETE:backup__2021-02-20.sql" \
"DELETE:backup__2021-02-16.sql" \
"DELETE:backup__2021-02-15.sql" \
"DELETE:backup__2021-02-14.sql" \
"DELETE:backup__2021-01-14.sql" \
"backup__2020-01-13.sql" \
"backup__2019-12-31.sql" \
"DELETE:backup__2019-01-13.sql"
}
# Will not pass while maxdepth is set to 1.
function skip_test_sort_order {
perform_test 0 0 1 \
"a/backup__2021-03-08.sql" \
"DELETE:b/backup__2021-03-07.sql" \
"DELETE:a/backup__2021-02-28.sql" \
"DELETE:b/backup__2021-02-22.sql" \
"DELETE:a/backup__2021-02-20.sql" \
"DELETE:b/backup__2021-02-16.sql" \
"DELETE:a/backup__2021-02-15.sql" \
"DELETE:b/backup__2021-02-14.sql" \
"DELETE:a/backup__2021-01-14.sql" \
"b/backup__2020-01-13.sql" \
"a/backup__2019-12-31.sql" \
"DELETE:b/backup__2019-01-13.sql"
}
function test_ignore_subdirectories {
perform_test 0 0 0 "a/backup__2021-03-08.sql" "backup__2021-03-07.sql"
}
function test_standard {
perform_test 14 4 1 \
"backup__2021-03-08.sql" \
"backup__2021-03-07.sql" \
"backup__2021-03-06.sql" \
"backup__2021-03-05.sql" \
"backup__2021-03-04.sql" \
"backup__2021-03-03.sql" \
"backup__2021-03-02.sql" \
"backup__2021-03-01.sql" \
"backup__2021-02-28.sql" \
"backup__2021-02-27.sql" \
"backup__2021-02-26.sql" \
"backup__2021-02-25.sql" \
"backup__2021-02-24.sql" \
"backup__2021-02-23.sql" \
"DELETE:backup__2021-02-22.sql" \
"backup__2021-02-21.sql" \
"DELETE:backup__2021-02-20.sql" \
"DELETE:backup__2021-02-19.sql" \
"DELETE:backup__2021-02-18.sql" \
"DELETE:backup__2021-02-17.sql" \
"DELETE:backup__2021-02-16.sql" \
"DELETE:backup__2021-02-15.sql" \
"backup__2021-02-14.sql" \
"DELETE:backup__2021-02-13.sql" \
"DELETE:backup__2021-02-12.sql" \
"DELETE:backup__2021-02-11.sql" \
"DELETE:backup__2021-02-10.sql" \
"DELETE:backup__2021-02-09.sql" \
"DELETE:backup__2021-02-08.sql" \
"backup__2021-02-07.sql" \
"DELETE:backup__2021-02-06.sql" \
"DELETE:backup__2021-02-05.sql" \
"DELETE:backup__2021-02-04.sql" \
"DELETE:backup__2021-02-03.sql" \
"DELETE:backup__2021-02-02.sql" \
"DELETE:backup__2021-02-01.sql" \
"backup__2021-01-31.sql" \
"DELETE:backup__2021-01-30.sql" \
"DELETE:backup__2021-01-29.sql" \
"DELETE:backup__2021-01-28.sql" \
"DELETE:backup__2021-01-27.sql" \
"DELETE:backup__2021-01-26.sql" \
"DELETE:backup__2021-01-25.sql" \
"DELETE:backup__2021-01-24.sql" \
"DELETE:backup__2021-01-23.sql" \
"DELETE:backup__2021-01-22.sql" \
"DELETE:backup__2021-01-21.sql" \
"DELETE:backup__2021-01-20.sql" \
"DELETE:backup__2021-01-19.sql" \
"DELETE:backup__2021-01-18.sql" \
"DELETE:backup__2021-01-17.sql" \
"DELETE:backup__2021-01-16.sql" \
"DELETE:backup__2021-01-15.sql" \
"DELETE:backup__2021-01-14.sql" \
"DELETE:backup__2021-01-13.sql" \
"DELETE:backup__2021-01-12.sql" \
"DELETE:backup__2021-01-11.sql" \
"DELETE:backup__2021-01-10.sql" \
"DELETE:backup__2021-01-09.sql" \
"DELETE:backup__2021-01-08.sql" \
"DELETE:backup__2021-01-07.sql" \
"DELETE:backup__2021-01-06.sql" \
"DELETE:backup__2021-01-05.sql" \
"DELETE:backup__2021-01-04.sql" \
"DELETE:backup__2021-01-03.sql" \
"DELETE:backup__2021-01-02.sql" \
"DELETE:backup__2021-01-01.sql" \
"backup__2020-12-31.sql"
}
function tests {
# Run all functions named test_... in this file in definition order
count=0
while read -r test; do
eval "$test"
count=$((count + 1))
done < <(awk '$1 == "function" && $2 ~ "^test_" {print $2}' "${BASH_SOURCE[0]}")
echo "------------------"
echo "$((count - ERROR_COUNT - FAILURE_COUNT))/$count tests passed"
if [[ $((FAILURE_COUNT + ERROR_COUNT)) -gt 0 ]]; then
if [[ "$ERROR_COUNT" -gt 0 ]]; then
echo "$ERROR_COUNT tests errored"
fi
if [[ "$FAILURE_COUNT" -gt 0 ]]; then
echo "$FAILURE_COUNT tests failed"
fi
echo 'failure'
else
echo 'success'
fi
}
if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then
trap 'echo -e "\\terror (in ${FUNCNAME[1]} ${BASH_SOURCE[1]}:${BASH_LINENO[1]})\naborting"' EXIT
tests
trap - EXIT
if [[ $((FAILURE_COUNT + ERROR_COUNT)) -gt 0 ]]; then
exit 1
fi
fi

185
postgres-docker/weed.sh Executable file
View file

@ -0,0 +1,185 @@
#!/usr/bin/env bash
# Weed old backups. See HELP for details.
# Tests for this script can be found in:
# bookwyrm/postgres-docker/tests/testing-entrypoint.sh
set -euo pipefail
DAILY_THRESHOLD=14
WEEKLY_THRESHOLD=4
MONTHLY_THRESHOLD=-1
HELP="\
NAME
weed -- remove old backups from the backups directory
SYNOPSIS
weed.sh [-d threshold] [-w threshold] [-m threshold] [-l] backup_directory
DESCRIPTION
Reduce the number of backups by only keeping a certain number of daily backups before \
reducing the frequency to weekly, monthly, and then finaly annually.
For each threshold, setting it to 0 will skip that frequency (e.g., setting weekly to \
0 will mean backups go directly from daily to monthly), and setting it to -1 will \
never reduce backups to a lower frequency (e.g., setting weekly to -1 will mean \
backups never are reduced to monthly backups).
-d threshold: Store this many daily backups before switching to weekly \
(default $DAILY_THRESHOLD)
-w threshold: Store this many weekly backups before switching to monthly \
(default $WEEKLY_THRESHOLD)
-m threshold: Store this many monthly backups before switching to annual \
(default $MONTHLY_THRESHOLD)
-l: Dry run. List the files that would be deleted.
"
# fail <message>
# Write a message to stderr then exit
function fail {
echo -e "weed: $1" >&2
exit 1
}
# parse_threshold <hopefully-a-number>
# Thresholds should be a non-negative number (or -1 for no threshold)
function parse_threshold {
if [[ ! $1 =~ ^-?[0-9]+$ || $1 -lt -1 ]]; then
fail "Invalid threshold: $1"
fi
echo "$1"
}
# weed_directory <directory> <daily_threshold> <weekly_threshold> <monthly_threshold>
# List files to be deleted
function weed_directory {
local directory=$1
local daily_threshold=$2
local weekly_threshold=$3
local monthly_threshold=$4
local count=0
local thresholds=("$daily_threshold" "$weekly_threshold" "$monthly_threshold" -1)
local date_formats=("%Y %m %d" "%Y %W" "%Y %m" "%Y")
local index=0
local last_date=""
local last_format=""
local date=""
# We would like to loop through all the backup files in the backup directory in
# reverse-chronological order. Bookwyrm backup files are named such that
# chronological and lexical order match. So we should be safe to find all backup
# files and reverse sort them. We should be terrified of deleting a backup an
# instance maintainer wants to keep, so we will be extra cautious. We're ignoring
# any subdirectories in case someone moves an important backup into a meaningfully
# named folder. We are also prepending the date to the path before sorting so that
# the ordering would be correct even if we were allowed to find backup files in
# subdirectories where chronological and lexical order don't match.
for date_file in $(
find "$directory" \
-maxdepth 1 \
-name 'backup__[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.sql' \
| sed 's/\(^.*backup__\([0-9-]*\)\.sql$\)/\2\1/' \
| sort --reverse
); do
date="${date_file:0:10}"
file="${date_file:10}"
date="${date_file:0:10}"
file="${date_file:10}"
# We can't fall off the end because we set annual backups to unlimited. It seems
# unlikely that instance maintainers would have enough concern about the space
# one backup/year takes to warrant supporting a cutoff.
while [[ ${thresholds[index]} -ne -1 && $count -ge ${thresholds[index]} ]]; do
index=$((index + 1))
last_format=""
count=0
done
if [[ -z "$last_date" ]]; then
count=$((count + 1))
last_date=$date
last_format=""
else
if [[ -z "$last_format" ]]; then
last_format=$(date --date="$last_date" +"${date_formats[index]}")
fi
format=$(date --date="$date" +"${date_formats[index]}")
if [[ "$format" == "$last_format" ]]; then
echo "$file"
else
count=$((count + 1))
last_date="$date"
last_format="$format"
fi
fi
done
}
function main(){
local daily_threshold=$DAILY_THRESHOLD
local weekly_threshold=$WEEKLY_THRESHOLD
local monthly_threshold=$MONTHLY_THRESHOLD
local dry_run=""
while getopts "hd:w:m:l" OPTION; do
case "$OPTION" in
h)
echo "$HELP";
exit
;;
d)
daily_threshold=$(parse_threshold "$OPTARG")
;;
w)
weekly_threshold=$(parse_threshold "$OPTARG")
;;
m)
monthly_threshold=$(parse_threshold "$OPTARG")
;;
l)
dry_run="true"
;;
:)
fail "Missing argument for '$OPTARG'. To see help run: weed.sh -h"
;;
?)
fail "Unknown option '$OPTION'. To see help run: weed.sh -h"
esac
done
shift "$((OPTIND - 1))"
if [[ $# -ne 1 ]]; then
fail "expected a single argument, directory"
fi
local count=0
for file in $(weed_directory "$1" "$daily_threshold" "$weekly_threshold" "$monthly_threshold"); do
count=$((count + 1))
if [[ -n "$dry_run" ]]; then
echo "$file"
else
echo "deleting $file" >&2
rm "$file"
fi
done
if [[ -n "$dry_run" ]]; then
optional_words="would be "
else
optional_words=""
fi
echo -e "$count files ${optional_words}deleted" >&2
}
if [ "${BASH_SOURCE[0]}" -ef "$0" ]; then
main "$@"
fi

View file

@ -9,8 +9,10 @@ django-model-utils==4.0.0
django-sass-processor==1.0.1
environs==9.3.4
flower==1.0.0
gunicorn==20.0.4
libsass==0.21.0
Markdown==3.3.3
packaging==21.3
Pillow>=9.0.0
psycopg2==2.8.4
pycryptodome==3.9.4
@ -27,11 +29,3 @@ opentelemetry-sdk==1.8.0
opentelemetry-exporter-otlp-proto-grpc==1.8.0
opentelemetry-instrumentation-django==0.27b0
opentelemetry-instrumentation-celery==0.27b0
# Dev
pytest-django==4.1.0
pytest==6.1.2
pytest-cov==2.10.1
pytest-env==0.6.2
pytest-xdist==2.3.0
pytidylib==0.3.2