
r0nmlt
Members-
Posts
155 -
Joined
-
Last visited
-
Days Won
1
r0nmlt last won the day on September 19
r0nmlt had the most liked content!
About r0nmlt
- Birthday 01/25/1976
Profile Information
-
Gender
Male
-
Location
Malta
Recent Profile Visitors
3,821 profile views
r0nmlt's Achievements
-
Thanks. No. I have the free account and it works. You need to setup dropbox api to get the keys. plenty of guides around. One that comes to mind is how to setup rclone with dropbox. You would obviously use just the instructions how to setup the api and get the keys. if anyone needs help I can show how I did it.
-
r0nmlt started following Complete website backup to dropbox
-
I don't know if this exists elsewhere but trying to search for "backup" and only found loads of questions but no solutions. Krydos referenced a dead wiki in this post in 2019 https://helionet.org/index/topic/35348-backup-heliohost-account-to-a-cloud-storage/#findComment-157124 . So without a solution here is what I did: 1) Created a folder under my domain for backups. 2) Under plex backup manager, Remote Storage Settings; I set this up to save backups to this folder. 3) Again using plex, for a full backup, click on Account, backup my account and websites, and then Schedule Backup. I setup a daily full backup to save into the FTP(S). 4) In the backups folder I created under my domain, I put this python file: #!/usr/bin/python3.12 print('Content-type: text/html\r\n\r') import json import os import requests import sys session: requests.Session = requests.Session() #-------------------------------------------------------------------------- #CONSTANTS local_backup_files_folder = "." dropbox_app_key = "" dropbox_app_secret = "" dropbox_basic_token = "" dropbox_access_token = "" #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def getLocalBackupFiles(local_backup_files_folder) -> dict[str, int]: local_files = {} all_local_files = os.listdir(local_backup_files_folder) for f in all_local_files: if os.path.isfile(os.path.join(local_backup_files_folder, f)) and f.endswith('.tar'): local_files[f] = os.path.getsize(f) return local_files #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def generateHeaders(auth_method) -> dict[str, str]: if auth_method == 'basic': headers: dict[str, str] = { 'Authorization': 'Basic ' + dropbox_basic_token, 'Content-Type': 'application/json' } if auth_method == 'bearer': headers: dict[str, str] = { 'Authorization': 'Bearer ' + dropbox_access_token, 'Content-Type': 'application/json' } if auth_method == 'upload': headers: dict[str, str] = { 'Authorization': 'Bearer ' + dropbox_access_token, 'Content-Type': 'application/octet-stream' } return headers #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def checkDropboxConnection() -> bool: headers: dict[str, str] = generateHeaders("basic") url: str='https://api.dropboxapi.com/2/check/app' data = json.dumps({"query":"heliohost"}) res: requests.Response = session.post(url, data=data, headers=headers, timeout=10, allow_redirects=False) if res.status_code == 200: if res.json()['result'] == "heliohost": return True else: return False else: return False #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def listDropboxFolder() -> dict[str, int]: headers: dict[str, str] = generateHeaders("bearer") url: str='https://api.dropboxapi.com/2/files/list_folder' data = json.dumps({ "path": "" }) res: requests.Response = session.post(url, data=data, headers=headers, timeout=10, allow_redirects=False) if res.status_code == 200: if "entries" in res.text: number_of_dropbox_files = len(res.json()['entries']) if number_of_dropbox_files > 0: #print(str(number_of_dropbox_files) + ' files in Dropbox Folder') print("<br>") dropbox_tar_files = {} for f in res.json()['entries']: #print(f) print("<br>") if f['name'].endswith('.tar'): dropbox_tar_files[f['name']] = f['size'] else: print('No files in Dropbox Folder') print("<br>") dropbox_tar_files = [] return dropbox_tar_files else: sys.exit('File list has wrong data') else: sys.exit('Cannot get file list') #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def checkMissingFiles(local_files, dropbox_tar_files): for f in local_files: #print(f) print("<br>") if f in dropbox_tar_files: print(f + " is in dropbox") print("<br>") if local_files[f] == dropbox_tar_files[f]: print(f + " size matches") print("<br>") continue else: print(f + " size mitchmatch in dropbox") print("<br>") result = uploadMissingFiles(f) if result == True: print(f + " uploaded successfully") print("<br>") else: print(f + " is not in dropbox") print("<br>") result = uploadMissingFiles(f) if result == True: print(f + " uploaded successfully") print("<br>") #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def uploadMissingFiles(f) -> bool: headers: dict[str, str] = generateHeaders("upload") headers['Dropbox-API-Arg'] = '{"autorename":false,"mode":"add","mute":false,"path":"/' + f + '","strict_conflict":false}' url: str='https://content.dropboxapi.com/2/files/upload' data = open(f, "rb").read() res: requests.Response = session.post(url, data=data, headers=headers, timeout=10, allow_redirects=False) if res.status_code == 200: if res.json()['name'] == f: return True else: sys.exit('Error uploading') else: sys.exit('Error uploading') #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- def deleteUploadedFiles(local_files, dropbox_tar_files): for f in dropbox_tar_files: if f in local_files: print(f + " exists in dropbox") print("<br>") if local_files[f] == dropbox_tar_files[f]: print(f + " size matches") print("<br>") os.remove(f) else: print(f + " size doesn't match") print("<br>") sys.exit('Size mismatch after upload') else: print(f + " is not in dropbox") print("<br>") sys.exit('File not in dropbox after upload') #-------------------------------------------------------------------------- print("Starting") print("<br>") local_files= getLocalBackupFiles(local_backup_files_folder) if len(local_files) == 0: exit(0) print(local_files) print("<br>") check = checkDropboxConnection() if check: dropbox_tar_files = listDropboxFolder() else: sys.exit('Error connecting to DropBox') print(dropbox_tar_files) print("<br>") print("------------------------------------------") print("<br>") checkMissingFiles(local_files, dropbox_tar_files) dropbox_tar_files = listDropboxFolder() print("------------------------------------------") print("<br>") deleteUploadedFiles(local_files, dropbox_tar_files) print("------------------------------------------") print("<br>") local_files= getLocalBackupFiles(local_backup_files_folder) print(local_files) print("<br>") Replace the: dropbox_app_key = "" dropbox_app_secret = "" dropbox_basic_token = "" dropbox_access_token = "" with you own values. 5) Setup a cron job to fetch the python url and execute the script. If you're having issues running python in this folder I used the .htaccess file in the folder: Options +ExecCGI AddHandler cgi-script .py DirectoryIndex backup_export.py where backup_export.py is the name of the script above. Hope this is of use. If anyone improves on this and wants to share with the rest of us please go ahead.
-
I am aware of the downtime due to the HD replacement but my vps is still down. I was talking with baloons on discord and his has already booted some hours ago, so maybe there is something wrong with the bootup of my VPS. Can you please check?
-
username: fcsltd server: tommy transaction ID: 8N328382AR8057942
-
For those like me who have been suspended for too many emails, a counter that keeps track is handy and helps in keeping within the 50 emails per day limit. This PHP script takes advantage of the report generated by cpanel track delivery tab. I filtered the generated report to include only the outgoing emails and then counted. I am not 100% sure this is foolproof as the filtering available is not clean cut. I have in mind of running a cron job (offsite) to execute the script (onsite) which checks the count. If anything changed it will generate a report and store it in the mail folder (this avoids adding to the sendmail count). Once the mail is synced with your home device the report in your mailbox will show the new daily count + some extra details. Please feel free to modify to tailor to your needs. Any suggestions welcome. PS my logging into heliohost is via 2FA, therefore I had to use the GoogleAuthenticator.php and FixedByteNotation.php scripts which should be place in a lib subfolder. GoogleAuthenticator.php FixedByteNotation.php KeyGenerator.php Logon.php
-
Sorry but it was my fault. I set my outlook mail software to copy a hotmail account for all outgoing mail to keep a backup and this was adding a +1 to each email i sent. So 30 emails are actually 60 emails! I thought an email is 1 email but every cc is an additional email.
-
thank you. my ip is still blocked though. I'll post the log as soon as I can get into Cpanel. Maybe I'm wrong.
-
I am quite sure that this time I haven't gone over the 50 emails as I also removed all fowarding as this was counting against the 50 emails. I will check the mail route on cpanel to check how many emails are actually being sent and will revert. At your convenience please unsuspend. Thanks.
-
Hi I just started getting an "invalid login" when I try to go into Cpanel. My username is fcsltd and I am on tommy. Can you please look into it? Thanks
-
sorry but it looks like still blocked!! it's ok now. seems like it takes a while to unblock
-
Can you please unblock my IP again. My username is fcsltd on tommy. Thanks.
-
A couple of days ago my account what suspended due to excess emails. When this happens you cannot access your POP server, nonetheless the email client keeps on hammerring on interval to get in. I think this is what caused it.
-
For some reason my IP was blocked! Can you please look into it. main site: fcs.com.mt username: fcsltd server tommy Thanks.
-
Thanks for unsuspending. Is there a counter I can monitor not to go over the limit?