Skip to content

Commit

Permalink
changed dropbox to smb for digifeeds reports
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Jan 29, 2025
1 parent ac6e181 commit d6cd568
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
10 changes: 1 addition & 9 deletions .config/rclone/rclone.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ host = YOUR_HOST
user = YOUR_USERNAME
port = YOUR_PORT
pass = YOUR_ENCRYPTED_HASH
shell_type = cmd

[digifeeds_reports]
type = alias
remote = digifeeds_dropbox:YOUR_REPORTS_FOLDER

[digifeeds_dropbox]
type = dropbox
token = {"access_token":"YOUR_ACCESS_TOKEN","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
shell_type = cmd
2 changes: 1 addition & 1 deletion aim/cli/digifeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ def generate_barcodes_in_s3_report():
"""
Generates a report of barcodes that have been moved to the google pickup
location in the last two weeks. It is based on the files in the processed
location in the s3 bucket. This report is sent to a dropbox folder.
location in the s3 bucket. This report is sent to a folder on Mayhem.
"""
functions.generate_barcodes_added_in_last_two_weeks_report()
4 changes: 2 additions & 2 deletions aim/digifeeds/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def generate_barcodes_added_in_last_two_weeks_report():
write_barcodes_added_in_last_two_weeks_report(rf)

today = datetime.today().strftime("%Y-%m-%d")
S.logger.info("writing report to dropbox")
S.logger.info("writing google delivery report")
rclone.copyto(
in_path=report_file.name,
out_path=f"{S.digifeeds_reports_rclone_remote}:{today}_barcodes_in_s3_processed.tsv",
out_path=f"{S.digifeeds_google_delivery_reports_rclone_remote}:{today}_barcodes_in_s3_processed.tsv",
)
8 changes: 5 additions & 3 deletions aim/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class Services:
#: The name of the rclone remote for the place where google pickups up the digifeeds files
digifeeds_pickup_rclone_remote: str

#: The name of the rclone remote where reports from digifeeds are sent
digifeeds_reports_rclone_remote: str
#: The name of the rclone remote where reports about what has been sent to google are sent
digifeeds_google_delivery_reports_rclone_remote: str

#: file path to store of the hathi_file_list update items
hathifiles_store_path: str
Expand Down Expand Up @@ -129,7 +129,9 @@ class Services:
or "digifeeds_bucket",
digifeeds_pickup_rclone_remote=os.getenv("DIGIFEEDS_PICKUP_RCLONE_REMOTE")
or "digifeeds_pickup",
digifeeds_reports_rclone_remote=os.getenv("DIGIFEEDS_REPORTS_RCLONE_REMOTE")
digifeeds_google_delivery_reports_rclone_remote=os.getenv(
"DIGIFEEDS_GOOGLE_DELIVERY_REPORTS_RCLONE_REMOTE"
)
or "digifeeds_reports",
hathifiles_store_path=os.getenv("HATHIFILES_STORE_PATH")
or "tmp/hathi_file_list_store.json",
Expand Down
9 changes: 9 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ UID=YOUR_UID
GID=YOUR_GID
POETRY_VERSION=1.5.1
DEV=true

RCLONE_CONFIG_CHAOS_TYPE=smb
RCLONE_CONFIG_CHAOS_HOST=your_smb_host
RCLONE_CONFIG_CHAOS_USER=your_smb_user
RCLONE_CONFIG_CHAOS_PASS=your_smb_password
RCLONE_CONFIG_CHAOS_DOMAIN=your_smb_domain

RCLONE_CONFIG_DIGIFEEDS_GOOGLE_DELIVERY_REPORTS_TYPE=alias
RCLONE_CONFIG_DIGIFEEDS_GOOGLE_DELIVERY_REPORTS_REMOTE=chaos:your_reports_path

0 comments on commit d6cd568

Please sign in to comment.