Commit graph

255 commits

Author SHA1 Message Date
rhymes
77f04bdf7c
Hypershield: use per column table hide for specificity (#9651) 2020-08-07 11:27:43 +02:00
Molly Struve
8f50c2246e
[deploy] Bug Fix:Hide To Email Field and Content Field on Ahoy Messages (#9634) 2020-08-05 12:02:28 -05:00
Michael Kohl
1a6c6acd45
[deploy] Activate Devise::Lockable (#9535) 2020-07-30 10:28:51 -04:00
Ben Halpern
f72eba0fe1
[deploy] Attempt to get carrierwave configured correctly for containers and tests passing (#9558)
* Attempt to get tests passing

* Hardcode region

* Move keys

* Add region vars back in

* S3DirectUpload

* Fix asset host

* Carrierwave monkeypatch

* Add condition

* remove require

* Move carrierwave monkeypatch to initializer

* Remove aws secret and key from path that doesn't need it

* Put keys back in

* File storage location ENV var

* Move carrierwave around

* Change to placeholder on jdoss track

* Use config region

* File store path

* Remove AWS keys

* Change logic slightly

* Uncomment production.rb code

* Adjust carrierwave

* Adjust carrierwave
2020-07-29 17:27:13 -04:00
rhymes
bbd56875c7
Rubocop: address feedback of #9430 and use kwargs (#9538)
* Use fetch.to_i

* Rubocop: address feedback of #9430 and use kwargs
2020-07-29 11:13:36 +02:00
Molly Struve
e2e034b910
[deploy] Refactor:Remove No Longer Needed Timber Logging (#9555) 2020-07-28 14:00:38 -05:00
dependabot-preview[bot]
3e6e7a4d1e
Bump strong_migrations from 0.6.8 to 0.7.0 (#9525)
* Bump strong_migrations from 0.6.8 to 0.7.0

Bumps [strong_migrations](https://github.com/ankane/strong_migrations) from 0.6.8 to 0.7.0.
- [Release notes](https://github.com/ankane/strong_migrations/releases)
- [Changelog](https://github.com/ankane/strong_migrations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/strong_migrations/compare/v0.6.8...v0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump strong_migrations from 0.6.8 to 0.7.0 (Update vendor/cache)

* Enable safety check on rollbacks as well

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-07-27 11:10:18 +02:00
rhymes
0b4ad49cf8
Rubocop: Enable and fix Style/OptionHash (#9430)
* Enable and fix Style/OptionHash

* Add 10 seconds default timeout to DB statements
2020-07-25 10:41:21 +02:00
rhymes
88f0a0e58a
Rubocop: re-activate Style/RegexpLiteral and fix violations (#9418)
* Rubocop: re-activate Style/RegexpLiteral and fix violations

* Add 10 seconds default timeout to DB statements
2020-07-22 16:28:27 +02:00
Ben Halpern
ee043905ef
Add new reserved words (#9422)
* Add a few extra reserved words

* Add a few extra reserved words

* Update config/initializers/reserved_words.rb

* Sort words

Co-authored-by: rhymes <rhymes@hey.com>
2020-07-22 12:16:31 +02:00
rhymes
6cd64c4071
Rubocop: enable and fix Style/Send and Style/Next (#9366)
* Enable and fix Style/Send

* Enable and fix Style/Next

* Fix private cookies send

* Fix merging indentation issues
2020-07-20 16:28:00 +02:00
Ben Halpern
da6a6739e5
[deploy] Invite users to join and create password (#9294)
* Initial invitation work

* Add more invitation code

* Add proper registration page

* Fix up tests

* Fix failings

* Fix spec

* Add self-serve auth config

* Add registered condition

* Change profile image call and registered_at test

* Change comment

* Fix copy test

* Stub emojipedia

* Linting

* Add registered at to factory

* Ensure registered for user tag

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Slight changes

* Update recover password flow

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update db/schema.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-07-15 11:37:19 -04:00
Molly Struve
66c70d38e8
[deploy] Bug Fix: Validate GIFs Frames and Add MiniMagick Timeout (#9319) 2020-07-15 09:49:24 -05:00
rhymes
8126c5c2c1
Rubocop: Address Metrics/BlockLength violations (#9246)
* Address Metrics/BlockLength violations

* Add jbuilder to package auto correct
2020-07-10 13:53:32 -04:00
rhymes
ffc96db209
Rubocop: fix additional violations in todo file (#9218) 2020-07-09 10:25:44 -04:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Mac Siri
9607549312
Use custom UglifierCompressor to enable source-maps (#9188) 2020-07-08 11:55:53 +02:00
Molly Struve
1f74836b45
Feature: Label Honeybadger Env with APP_DOMAIN (#9180) 2020-07-07 10:25:00 -04:00
dependabot-preview[bot]
56736aab15
[deploy] Bump flipper, flipper-active_record and flipper-ui (#8966)
* Bump flipper, flipper-active_record and flipper-ui

Bumps [flipper](https://github.com/jnunemaker/flipper), [flipper-active_record](https://github.com/jnunemaker/flipper) and [flipper-ui](https://github.com/jnunemaker/flipper). These dependencies needed to be updated together.

Updates `flipper` from 0.17.2 to 0.18.0
- [Release notes](https://github.com/jnunemaker/flipper/releases)
- [Changelog](https://github.com/jnunemaker/flipper/blob/master/Changelog.md)
- [Commits](https://github.com/jnunemaker/flipper/compare/v0.17.2...v0.18.0)

Updates `flipper-active_record` from 0.17.2 to 0.18.0
- [Release notes](https://github.com/jnunemaker/flipper/releases)
- [Changelog](https://github.com/jnunemaker/flipper/blob/master/Changelog.md)
- [Commits](https://github.com/jnunemaker/flipper/compare/v0.17.2...v0.18.0)

Updates `flipper-ui` from 0.17.2 to 0.18.0
- [Release notes](https://github.com/jnunemaker/flipper/releases)
- [Changelog](https://github.com/jnunemaker/flipper/blob/master/Changelog.md)
- [Commits](https://github.com/jnunemaker/flipper/compare/v0.17.2...v0.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump flipper, flipper-active_record and flipper-ui (Update vendor/cache)

* Removed outdated flipper UI configuration

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Josh Puetz <josh@dev.to>
2020-06-30 08:19:27 -05:00
Molly Struve
9fb2a7c6b2
[deploy] Remove Vault ENV variables from Envfile so they arent Required in Prod (#8895) 2020-06-24 15:02:16 -05:00
Molly Struve
0767c34379
[deploy] Feature: Setup Vault and AppSecrets Wrapper Class (#8891) 2020-06-24 14:13:37 -05:00
rhymes
40f54e317f
[deploy] Use Action Mailer parameterized syntax (#8853) 2020-06-23 13:48:41 -05:00
Andy Zhao
75e5151292
[deploy] Remove github from reserved words (#8860) 2020-06-23 13:36:12 -04:00
Vaidehi Joshi
439f92cf66
[deploy] Mask ip addresses + no cookies in ahoy (#8843) 2020-06-22 20:54:43 -04:00
Vaidehi Joshi
9fd565d71e
Only track server-side events when needed (#8839) [deploy]
Ensures that we don't create new visits for non-logged-in users, bots,
and users with cookies disabled on every site visit. This will only
allow server-side visits when there is an event to be tracked.
2020-06-22 15:57:20 -07:00
Vaidehi Joshi
c4d9c4aed9
Remove trailing slashes from URLs to improve SEO (#8836) [deploy] 2020-06-22 13:44:58 -07:00
rhymes
36786cf554
Rails 6: enable zeitwerk autoloader (#8766)
* More loading fixes

* Go back to OpenStruct

* Shuffle things around

* Remove obsolete patches and unneeded requires

* Disable config.add_autoload_paths_to_load_path

* Fix pre-require errors

* Config not reloader
2020-06-22 16:27:55 +02:00
Vaidehi Joshi
904f0dac78
Add ahoy + welcome notification tracking (#8758) [deploy]
* Set up ahoy gem, add ahoy-js

* Import ahoy.js into base.js.erb

* Add trackNotification function to notifications/index.html.erb

* Add sanitized_broadcast_id helper

* Use sanitized_broadcast_id in broadcast partial

* Add specs around tracking welcome notifications

* Remove optional fields from Ahoy::Visit migration + table

* Fiddle with trait to see if it helps with CI failures

* Disable geocode tracking in ahoy

* Stub out SiteConfig in notifications page spec
2020-06-18 13:40:14 -07:00
Dmitry Maksyoma
be07697d6d
Adapt dev env to run on a remote box (#8232)
* Adapt dev env to run on a remote box

* webpack-dev-server ignores CLI arguments, so switched to environment
  variables.
* Dynamically determine remote webpack host via APP_DOMAIN environment
  variable, defined in application.yml.
* Setup content security policy to allow connecting to webpack on a
  remote box, defined by APP_DOMAIN environment variable.

* Make Webpacker listen on 0.0.0.0

* Account for APP_DOMAIN port

* Add support for URI scheme and tests

* Fix a spec by disabling a Rubocop linter
2020-06-18 13:01:49 +02:00
rhymes
7309478420
Rails 6 autoloader: prepare liquid tags code (#8707)
* Move liquid patches to lib/liquid

* Rename classes properly
2020-06-17 16:50:14 +02:00
Andy Zhao
5f336d9aee
[deploy] Add crayons to reserved words (#8386) 2020-06-10 12:16:06 -04:00
rhymes
71d53873d1
Use Rails 6 new features in the code (#8342)
* Use pick instead of pluck first

* Use touch_all instead of update_all

* Use destroy_by instead of where.destroy_all

* Use scopes

* Fix db:seed:replant

* Remove ActiveSupport::Cache::RedisCacheStore expires_in cache
2020-06-08 16:06:29 -04:00
rhymes
9992bdfe92
Replace whitelisted_ips with permissions in Docker init (#8341) 2020-06-08 16:16:02 +02:00
Michael Kohl
387bf7c1bc
Make Devise.mailer_sender configurable (#8246)
* Make Devise.mailer_sender configurable

* Disable setting default email via internal config

* Also disallow default email param

* Fix spec
2020-06-08 12:02:07 +02:00
Mac Siri
92eca6f935
[deploy] Enable ActsAsTaggableOn.strict_case_match (#8299) 2020-06-05 13:52:01 -04:00
Mac Siri
1b839d9328
[deploy] Streamline Tag parsing for both editors (#8175) 2020-06-05 08:46:24 -04:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Michael Kohl
1c4c88f295
Generalize search.xml (#8250) 2020-06-03 08:49:25 -04:00
Joe Doss
aa49cb1cfe
Bugfix for #7663 and refactor of container setup (#7747)
* Move from Alpine Linux to Fedora Linux.

This changes the base container image away from Alpine Linux to
Fedora Linux to address some musl libc issues with some of our gems.

It also moved the main file to a Containerfile and symlinks the Dockerfile
to it. This makes our container setup less Docker-centric as Linux users
most likely will be using Podman as their container runtime.

Lastly, it moves the WORKDIR from /usr/src/app to /opt/apps/devto.
The Linux FHS states that /opt is the spot for Optional application
software packages and /usr/src is for kernel source code.

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

/opt Optional application software packages
/usr/src Source code, e.g., the kernel source code with its header files.

Also, if SELinux becomes a thing in our future, moving this makes it
easier to manage contexts out of /opt rather than /usr/src.

* Adjust the Containerfile a bit to add some missing packages, make it
more generic and move env vars to the docker-compose.

* Move the Dockerfile to a symlink to the Containerfile.

We need to be able to support more than just Docker for a container
runtime. Moving everything to a Containerfile and symlinking the
Dockerfile helps users run runtimes such as Podman.

* Add in new entrypoint files and fix the app path in docker-entrypoint.sh

* Refactor the docker-compose.yml file so it doesn't build the main
application container three times in a row. We can use the same
container for web, webpacker, and sidekiq.

Also make the volume names very explicit on what their contents and add
in SELinux context support with :Z

* Fix ELASTICSEARCH_URL.

* Remove the absolute path on ip binary and add in iproute to Containerfile.

* Symlink the Dockerfile to Containerfile and add in a container-compose.yml file
for usage with podman-compose. We are waiting for this issue to get resolved

https://github.com/containers/libpod/issues/6153

and for podman-compose to mature a bit more. A user using podman-compose can use

podman-compose -f container-compose.yml

to launch the DEV container stack with Podman.

* Update the .gitignore file to reflect the new container volumes.

* Fix the entrypoint script on the Containerfile and clean up a bunch of things.

* Rework the Containerfile to prep it to run as a non-root user. We have to wait
for this issue to get fixed:

https://github.com/containers/libpod/issues/6153

for Linux users and then we can uncomment the USER line so we are running Rails
as a non-root user. :toot:

* This reworks the compose files so each task that is needed to start the app has
a correct wait command with dockerize. It also adds in containers for doing
yarn and bundle things for development. Since we mount the code directory inside
the container we lose our pre-containerized gems and node_modules.

This means users can run:

Linux
podman-compose -f container-compose.yml up

Mac
docker-compose up

and it should correctly build the app stack with containers!

* Clean up old container related things.

* Add in some container pre-reqs and my name to the "Core team" section! :toot:

* Adjust the seed and sidekiq compose entries so they do not use the web entrypoint
and set the REDIS_URL and REDIS_SESSIONS_URL env vars for seed.

Add in some echos to the entrypoint.sh.

Also set docker-compose to use :delegated on mount points to speed things up.

https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos

* Just call yarn install --dev on the yarn container.

* Update documentation to support Docker and Podman as Container Engines and
move the page from docker to containers to reflect the fact not all users run
their containers via Docker.

There are dozens of us... DOZENS!

* Set --local on bundle config so it just impacts this Ruby app.

* Renamed bin/docker-setup to bin/container-setup to reflect the fact that that
we can use Podman as a container engine. I also refactored it so it does some
basic pre-flight checks for docker and docker-compose or podman and
podman-compose to make sure users have a container engine installed.

* Set cache_all_platforms true for bundler.

* Bump docker-compose dockerize -timeout to 45min for slower macOS hardware.

* Move to the consolidated app_initializer:setup rake task for bootstrapping the
app.

* Update docs/installation/readme.md
2020-05-28 12:11:51 -05:00
Molly Struve
14c2372ae7
[deploy] Add API Key to API Write Throttle (#8110) 2020-05-28 09:45:01 -05:00
Josh Puetz
1a1b5b544e
Add Feature Flags support to DEV (#7996)
* Create tables for Flipper gem

* Enable Flipper gem

* Remove concurrent ruby from Gemfile

* Add Flipper UI

* Codeland landing page

* Remove codeland controller and sample page

* Remove oops

* Rename Flipper-UI endpoint

* Wrap Flipper in a FeatureFlag module

* [deploy] Lock node to 12.16 (#8057)

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-05-26 15:26:33 -05:00
rhymes
1112cbf316
[deploy] Update webpacker configuration (#8004) 2020-05-25 12:03:18 -04:00
Mac Siri
1abd7cd46b
[deploy] Add async_info to ReservedWords (#8022) 2020-05-21 17:02:26 -04:00
Molly Struve
6a4a99f162
[deploy] Track Deploys In Honeycomb (#7935) 2020-05-19 09:10:41 -05:00
Molly Struve
dbb5c752ab
[deploy] Sample Noisy Honeycomb Spans (#7891) 2020-05-18 10:36:01 -05:00
Molly Struve
7293df3191
[deploy] Return if there is no ip_address from Method (#7874) 2020-05-14 18:13:24 -05:00
Molly Struve
7dd249ac21
[deploy] Add Back Tracking API-keys in Honeycomb (#7868) 2020-05-14 15:10:15 -05:00
Molly Struve
8ae486a362
[deploy] Track and Limit API writes by IP Address (#7847) 2020-05-14 14:13:56 -05:00
Mac Siri
321b24d2a0
[deploy] Create write_articles oauth scope (#7834) 2020-05-14 09:55:53 -04:00
Molly Struve
3a49d3f0d1
[deploy] Revert "filter/sample noisy spans (#7833)" (#7837)
This reverts commit 716bb099fa.
2020-05-13 17:45:49 -05:00