Commit graph

37 commits

Author SHA1 Message Date
Mac Siri
74be076907
Add Algoliasearch-rails gem (#20866)
* Add Algoliasearch-rails gem

* Remove comment

* Add specs

* Add cache gem
2024-04-16 13:45:54 +00:00
Mac Siri
ca6e635549
Improve docker local development (#19996) 2023-09-01 14:13:40 -04:00
Josh Puetz
fc1031f52a
Add Google Analytics 4 Support (#18124) 2022-07-21 09:26:13 -05:00
Daniel Uber
659ddb8829
Add a safe default value for cloudinary secure (#16989)
* Add a comment, and a safe default value for cloudinary

When moving a site from imgproxy to cloudinary, we observed that
wrapping the cloud name in quotes caused off-looking urls (with the
user name in %22 escaped quotes).

Additionally, if cloudinary is enabled, cloudinary secure should
be set to true. We leave the others blank to prevent conditionally enabling this
service (we check for ENV var presence) mistakenly, but the secure
flag won't turn it on or off and is safe to keep a default value.

* remove unnecessary comment

quoting the env vars had no effect when tested.
2022-03-24 09:29:07 -05:00
Jamie Gaskins
ebdaaaf15b
Revert "Support alternate S3 endpoints" (#16173) 2022-01-18 14:11:18 -05:00
Jamie Gaskins
8bdb2b6d8b
Support alternate S3 endpoints (#15445)
* Support alternate S3 endpoints

* Add missing comma

This is why we should use trailing commas

* Provide sample S3 endpoint config

* Comment out S3 image-storage config in .env_sample

See https://github.com/forem/forem/pull/15445#discussion_r754525723
2022-01-18 11:34:42 -05:00
Jeremy Friesen
bde5064c9c
Skip google analytics when ga_tracking_id is nil (#15967)
* Skip google analytics when ga_tracking_id is nil

This commit involves short-circuiting Google Analytics calls when the
Forem has not configured a `Settings::General.ga_tracking_id`.  Note,
depending on your local `.env` file (or configured ENV variables) you
may have a `GA_TRACKING_ID` value set; I did, it was set to "Optional"
which overrode the database setting.

We set the HTML data properites in two places: [admin.html.erb][1] and
[application.html.erb][2].

In addition, I'm short-circuiting the local fallback analytics call (via
[Stacato][https://github.com/tpitale/staccato]).  My understanding of
Stacato, based on a cursory read, requires a Google Analytics Tracking
ID to work.

And last, we have a one off of javascript for Google Analytics tracking.

This closes #15962.

[1]:528bd2baa6/app/views/layouts/admin.html.erb (L31)
[2]:528bd2baa6/app/views/layouts/application.html.erb (L55)

How to test?

- Check your .env file to see if you have set GA_TRACKING_ID.  If so,
  unset it.
- Start with a fresh Forem instance.

- Open your browser and open the developer tools to inspect the Network
  activity.
- Open the homepage of your local Forem instance (http://localhost:3000)
- Filter your Network results for analytics.  You shouldn't see any.

Also, make sure you're disabling any blockers you might have as that
influences things.

* Commenting out GA_TRACKING_ID

Related to https://github.com/forem/forem/pull/15967

* Favor empty GA_TRACKING_ID env variable
2022-01-06 12:21:07 -05:00
Michael Kohl
09828853f6
✂✂✂ Remove Connect (#14734)
* Remove Connect

* Remove more Connect specs

* Remove a lot more Connect code

* 🚮

* It all has to go

* Explicitly add httpclient

* Update application layout

* Remove messages association from User

* Start fixing specs

* reintroduce util function and refactor references

* Remove Connect Cypress test

* Fix more specs

* Remove Connect from listings

* Ignore contact_via_connect column on listings

* Remove contact_via_connect usages

* Ignore mod_chat_channel_id on tags

* Drop Connect tables

* Remove email_connect_messages from user notification settings

* Re-add httpclient 2.8.3

This was mistakenly removed as a merge conflict

* Don't need to exclude removed chat channel file

* Remove unneeded style for chat channels

* Remove unneeded channel list prop type

* Remove chat channels index/connect-link from getPageEntries

* Re-add comment from httpclient in Gemfile

* Remove connect references from mailers

Tag Moderators no longer have a chat channel

No longer will users be notified about new messages (there won't be
any)

No longer will users be notified about channel invites (you can't
invite anyone anymore)

* Don't configure Pusher and remove PUSHER_* from .env_sample

since it's removed from gemfile, the Pusher constant will not resolve, if this is
configured in the environment variables we'll fail to boot.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Dan Uber <dan@forem.com>
2021-11-18 08:21:00 -06:00
Daniel Uber
682ea4473e
When AWS_ID is the placeholder value, act as though AWS not setup (#13850)
* When AWS_ID is the placeholder value, act as though AWS not setup

We have "Optional" as the placeholder in the .env_sample

When that's the "final" value in the .env file, assume we're actually
going to use local storage instead.

* Clear placeholder AWS values from env_sample

Revert the change to the carrierwave initializer (don't hardcode the
placeholder value).

Mimics choices we made for Cloudinary in #13767
2021-05-26 13:54:16 -05:00
rhymes
a798bd2f7d
[15 min fix] Fallback to the image URL if Cloudinary/Imgproxy are not configured (#13767)
* Fallback to the image URL if neither Cloudinary nor Imgproxy are configured

* Fix specs

* Cloudinary api_secret is required

* Update spec/models/message_spec.rb

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

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-05-19 15:03:20 +02:00
rhymes
de488f331d
Remove inline comments and variable substitution from .env_sample (#13685)
* Remove inline comments from .env_sample

* Remove variable substitution as it's not supported by Foreman
2021-05-06 18:01:52 +02:00
Fernando Valverde
121603a44b
Replace Pusher Beams with Rpush PN delivery ✂️ ✂️ (#13588)
* Remove feature flag

* Remove Pusher Beams implementation

* Remove Pusher Beams require from initializer

* Adds consumer apps to sidebar + consider :admin_restructure

* Fix routes + PN target URL

* Remove old file that sneaked in

* Adds docs

* docs tweaks

* Apply suggestions from code review

Co-authored-by: rhymes <rhymes@hey.com>

Co-authored-by: rhymes <rhymes@hey.com>
2021-05-05 08:37:20 -06:00
Mac Siri
25f6b3e9ed
Convert SMTP configs into environments vars (#13542)
Co-authored-by: rhymes <rhymes@hey.com>
2021-05-03 16:32:15 -04:00
Alex
393ba00221
Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606)
* Attempt number 1

* Fix rack_attack specs

* Fix users_searches_users spec

* Fix display_users_search_spec

* Fix comment typo

* Remove search:destroy task from cypress

* Remove port 9300 from gitpod

* Stub response in attack_spec
2021-05-03 11:09:45 -04:00
Daniel Uber
91b99fce7a
Add and document COVERAGE environment variable in the sample (#13013)
Running coverage is great, but it's definitely something I don't want
to do when interactively using the test suite (running a single file
or single example, this adds 20+ seconds for me).
2021-03-17 10:27:59 -05:00
Nick Taylor
7c1343be9e
Revert "Revert "Removed service worker (#12974)" (#13014)" (#13015)
This reverts commit 2416387fb4.
2021-03-17 10:57:56 -04:00
Molly Struve
2416387fb4
Revert "Removed service worker (#12974)" (#13014)
This reverts commit 4fb6230606.
2021-03-16 18:10:01 -05:00
Nick Taylor
4fb6230606
Removed service worker (#12974) 2021-03-16 15:55:31 -04:00
Fernando Valverde
cf3bde4259
Add mobile push notifications to Forem (#12419)
* First commit with iOS PN working

* RPush cleanup worker + unique jobs config

* Remove rpush tables from schema.rb

* PR feedback

* Feature flag and test for route

* Tests and feature flag PushNotification ::Send

* Update app/controllers/devices_controller.rb

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

* Update spec/routing/devices_routes_spec.rb

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

* Update spec/services/push_notifications/send_spec.rb

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

* PR feedback

* Set Rpush driver and url

* More PR feedback

* Apply suggestions from code review

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* PR feedback from Rhymes

* Don’t double render

* Sure

Co-authored-by: Josh Puetz <hi@joshpuetz.com>
Co-authored-by: Josh Puetz <josh@dev.to>
Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>
2021-03-12 14:08:18 -06:00
Daniel Uber
f1d85e666b
Add SENDGRID_API_KEY to .env_sample (#12982)
This is only useful in production, but helpful to see there is such an
environment variable needed.

Closes #12977
2021-03-12 10:58:08 -06:00
killua
218fa47f09
Update .env_sample to remove exports (#11778)
* Update .env_sample

* Update .env_sample

Co-authored-by: ty schnoor <75553731+ty-schnoor@users.noreply.github.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Michael Kohl <me@citizen428.net>
2021-03-01 11:10:08 +01:00
Alexis Hope
e8fb17ca78
Update database config (#11308) 2021-02-23 17:41:34 -05:00
Ridhwana
ebfe0ead2d
Add application deployment information to the admin page (#12149)
* WIP: release footprint in the admin UI

* feat: show the commit ID and the date

* chore: change env optional to empty string

* fix: change the FOREM_BUILD_DATE to RELEASE_FOOTPRINT

* feat: add Not Available as a last option

* test: last deployed time and latest commit id

* feat: update the way we change the env variable!

* fix: we need to set the RELEASE FOOTPRINT so that this clause is not hit - `return path if release_footprint.blank?`
2021-01-08 16:36:12 +02:00
Vicente G. Reyes
3fadc8543b
Update .env_sample (#12062)
Typo on # Google analytics
2021-01-04 18:07:58 -05:00
rhymes
c0ac718642
Disable Google reCAPTCHA in env file sample (#11863)
* Disable Google reCAPTCHA in env file sample

* Update .env_sample

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2020-12-11 18:17:48 +01:00
Oskar Janusz
397f426b87
Add Github environments keys to .env_sample file (#11591) 2020-11-24 15:05:17 +01:00
Vaidehi Joshi
97d5bc47b6
Use OPENRESTY_URL over protocol + domain (#11289)
* Use OPENRESTY_URL over protocol + domain

* Prefer OpenResty over Openresty
2020-11-06 08:58:59 -08:00
Vaidehi Joshi
429d9fb947
Use APP_NAME rather than APP_DOMAIN in chat channels (#11029)
* Use APP_NAME rather than APP_DOMAIN in chat channels

APP_NAME may not always be set (it is not "required" per se), which can
cause issues while deriving the pusher_channels. We should use APP_DOMAIN,
which is more common and always has a default value.

* Add TODO to make pusher channels more unique
2020-10-22 19:22:19 -04:00
Ben Halpern
b800b81c45
Skip service workers in development by default (#10617) 2020-10-07 14:23:11 +07:00
Ben Halpern
7ba7d9fc46
Add logic for asking for FOREM_OWNER_SECRET to be present on first user sign up if set by system (#10108)
* Add logic for requiring FOREM_OWNER_SECRET to be present

* Fix test logic
2020-08-31 16:41:30 -04:00
Ben Halpern
e41a4f8968
[deploy] Include APP_NAME in Pusher channels (#10001)
* Backgend adjustments

* Fix keys

* Fix key

* Adjust style

* Fix typos

* Fix typo

* Refactor

* Fix syntax error
2020-08-31 08:28:46 -04:00
Ben Halpern
bd6a996bce
[deploy] Remove AWS SDK and private endpoints completely (#9978)
* Initial work to remove aws_sdk

* More work

* Add tests

* Typos and cleanup

* Fixed typo and misc

* Fix test typos

* Update spec

* Remove functioncaller code

* Add comment to bump tests :)

* Fix spaminess calc
2020-08-26 10:30:31 -04:00
Ben Halpern
17df627f0d
Mark Buffer as legacy (#9907)
* Mark Buffer as legacy

* Fix logic
2020-08-24 08:48:15 -04:00
Vaidehi Joshi
9e40e68682
Allow Nginx cached static content to be purged (#9857) [deploy]
* Only bust_fastly_cache if fastly is enabled

* Conditionally bust nginx cache from CacheBuster#bust

* Don't _actually_ call out to openresty

* Remove redundant check for FASTLY_API_KEY in CacheBuster

* Clean up and add a spec

* Do not call .purge_ methods if fastly is not configured

* Add OPENRESTY_ ENV vars to .env_sample

* Remove extra / prepending path

* Remove ConfigurationError, clean up Purgeable concern

* Use raise instead of fail like fastly-ruby

* No longer check for Rails.env.production?

* Use let! to create article in BustMultipleCachesWorker spec
2020-08-21 09:31:23 -07:00
Ben Halpern
36ccfd55dd
[deploy] Add Twitter and GitHub keys to SiteConfig (#9899)
* Add Twitter and GitHub keys to SiteConfig

* Change docs

* Add notice about not taking affect right away
2020-08-20 15:58:15 -04:00
Ben Halpern
e76f6cbbba
Set Stripe dynamically instead of at boot (#9862)
* Set Stripe dynamically instead of at boot

* Add stripe SiteConfig

* Fix capitalization
2020-08-19 21:24:19 -04:00
Vaidehi Joshi
1531c182cc
Move .env_sample out of /config directory (#9868)
The `.env` file shouldn't live in the `/config` directory when it is created, but
currently, the `.env_sample` file lives within `/config`. This can be confusing and
cause ENV var issues if someone duplicates `.env_sample` and renames it to `.env`,
because none of their ENV variables will get picked up, since their `.env` file will
mistakenly end up in `/config`.

This change moves `.env_sample` out of `/config`, and updates the documentation/relevant
.yml files accordingly.
2020-08-19 18:18:30 +02:00
Renamed from config/.env_sample (Browse further)