uclibs / ucrate

Scholar@UC: University of Cincinnati's self-submission institutional repository
https://scholar.uc.edu
Other
5 stars 3 forks source link

Remove code for clamav gem #1092

Closed crowesn closed 11 months ago

crowesn commented 11 months ago

Fixes #1076

Remove all references to ClamAV. Previously we have done work to replace ClamAV with Clammy, leaving behind some conditional code which throws deprecations as well as specs. This PR eliminates all references to ClamAV.

Changes proposed in this pull request:

crowesn commented 11 months ago

Successful test on local with clamby gem installed in development group.

Started POST "/uploads/" for ::1 at 2023-11-01 08:50:44 -0400
Processing by Hyrax::UploadsController#create as JSON
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0j3L1biZ0BqBG+NwFJDQovYIe0q3SJGNyf5ETFI2ryVT4xT9OfB9/Ww/ghCSR6xzqyaMtI08Rtr+JGlkPDYuUQ==", "article"=>{"title"=>"asdf", "creator"=>["asdf"], "college"=>"Pharmacy", "department"=>"Unknownasdf", "description"=>"asdf", "license"=>"http://creativecommons.org/licenses/by/4.0/", "publisher"=>[""], "date_created"=>"", "alternate_title"=>[""], "journal_title"=>[""], "issn"=>[""], "subject"=>[""], "geo_subject"=>[""], "time_period"=>[""], "language"=>[""], "required_software"=>"", "note"=>"", "related_url"=>[""], "existing_identifier"=>"", "doi_assignment_strategy"=>"not_now", "member_of_collection_ids"=>"", "visibility"=>"open", "visibility_during_embargo"=>"restricted", "embargo_release_date"=>"2023-11-02", "visibility_after_embargo"=>"open"}, "new_user_name_skel"=>"", "new_user_permission_skel"=>"none", "agreement"=>"1", "files"=>[#<ActionDispatch::Http::UploadedFile:0x00007fa1b64c41b8 @tempfile=#<Tempfile:/var/folders/2h/c1xp9_mx573gb5w66cpz21000000gp/T/RackMultipart20231101-66934-1biq1sm.txt>, @original_filename="eicar.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"eicar.txt\"\r\nContent-Type: text/plain\r\n">]}
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ?  [["id", 1], ["LIMIT", 1]]
  Role Load (0.1ms)  SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ?  [["user_id", 1]]
Usergroups are ["public", "admin", "registered"]
  Role Exists (0.2ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.0ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.0ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.6ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  Hyrax::Feature Load (0.1ms)  SELECT  "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = ? ORDER BY "hyrax_features"."id" ASC LIMIT ?  [["key", "transfer_works"], ["LIMIT", 1]]
  Hyrax::Feature Load (0.1ms)  SELECT  "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = ? ORDER BY "hyrax_features"."id" ASC LIMIT ?  [["key", "proxy_deposit"], ["LIMIT", 1]]
   (0.1ms)  begin transaction
/private/tmp/cache/hyrax/uploaded_file/file/1698843044-66934-0001-0692/eicar.txt: Eicar-Signature FOUND
A virus was found in /tmp/cache/hyrax/uploaded_file/file/1698843044-66934-0001-0692/eicar.txt
   (0.1ms)  rollback transaction
Completed 200 OK in 22136ms (Views: 0.3ms | ActiveRecord: 1.6ms)
Janell-Huyck commented 11 months ago

Successful test on local with clamby gem installed in development group.

Started POST "/uploads/" for ::1 at 2023-11-01 08:50:44 -0400
Processing by Hyrax::UploadsController#create as JSON
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0j3L1biZ0BqBG+NwFJDQovYIe0q3SJGNyf5ETFI2ryVT4xT9OfB9/Ww/ghCSR6xzqyaMtI08Rtr+JGlkPDYuUQ==", "article"=>{"title"=>"asdf", "creator"=>["asdf"], "college"=>"Pharmacy", "department"=>"Unknownasdf", "description"=>"asdf", "license"=>"http://creativecommons.org/licenses/by/4.0/", "publisher"=>[""], "date_created"=>"", "alternate_title"=>[""], "journal_title"=>[""], "issn"=>[""], "subject"=>[""], "geo_subject"=>[""], "time_period"=>[""], "language"=>[""], "required_software"=>"", "note"=>"", "related_url"=>[""], "existing_identifier"=>"", "doi_assignment_strategy"=>"not_now", "member_of_collection_ids"=>"", "visibility"=>"open", "visibility_during_embargo"=>"restricted", "embargo_release_date"=>"2023-11-02", "visibility_after_embargo"=>"open"}, "new_user_name_skel"=>"", "new_user_permission_skel"=>"none", "agreement"=>"1", "files"=>[#<ActionDispatch::Http::UploadedFile:0x00007fa1b64c41b8 @tempfile=#<Tempfile:/var/folders/2h/c1xp9_mx573gb5w66cpz21000000gp/T/RackMultipart20231101-66934-1biq1sm.txt>, @original_filename="eicar.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"eicar.txt\"\r\nContent-Type: text/plain\r\n">]}
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ?  [["id", 1], ["LIMIT", 1]]
  Role Load (0.1ms)  SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ?  [["user_id", 1]]
Usergroups are ["public", "admin", "registered"]
  Role Exists (0.2ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.0ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.0ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  CACHE Role Exists (0.6ms)  SELECT  1 AS one FROM "roles" INNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" = ? AND "roles"."name" = ? LIMIT ?  [["user_id", 1], ["name", "admin"], ["LIMIT", 1]]
  Hyrax::Feature Load (0.1ms)  SELECT  "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = ? ORDER BY "hyrax_features"."id" ASC LIMIT ?  [["key", "transfer_works"], ["LIMIT", 1]]
  Hyrax::Feature Load (0.1ms)  SELECT  "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = ? ORDER BY "hyrax_features"."id" ASC LIMIT ?  [["key", "proxy_deposit"], ["LIMIT", 1]]
   (0.1ms)  begin transaction
/private/tmp/cache/hyrax/uploaded_file/file/1698843044-66934-0001-0692/eicar.txt: Eicar-Signature FOUND
A virus was found in /tmp/cache/hyrax/uploaded_file/file/1698843044-66934-0001-0692/eicar.txt
   (0.1ms)  rollback transaction
Completed 200 OK in 22136ms (Views: 0.3ms | ActiveRecord: 1.6ms)

Did you... just try to upload a virus to Scholar? 😆

Janell-Huyck commented 11 months ago

Do we want to remove references to ClamAV from the Docker setup as well? It is part of that.

crowesn commented 11 months ago

Did we agree to strip docker? If so, I think we can ignore the ClamAV references there and proceed.

From: Janell Huyck @.> Date: Friday, November 3, 2023 at 2:29 PM To: uclibs/ucrate @.> Cc: Crowe, Sean (crowesn) @.>, Author @.> Subject: Re: [uclibs/ucrate] Remove code for clamav gem (PR #1092)

External Email: Use Caution

Do we want to remove references to ClamAV from the Docker setup as well? It is part of that.

— Reply to this email directly, view it on GitHubhttps://github.com/uclibs/ucrate/pull/1092#issuecomment-1792940578, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIFEFAPNDMYBBANQIPZTZDYCUZ2JAVCNFSM6AAAAAA6YCXZ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHE2DANJXHA. You are receiving this because you authored the thread.Message ID: @.***>

Janell-Huyck commented 11 months ago

Issue here to remove Docker: https://github.com/uclibs/ucrate/issues/1091

scherztc commented 11 months ago

Coverage report generated for RSpec to /Users/scherztc/Workspaces/ucrate/coverage. 3192 / 3364 LOC (94.89%) covered.