Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent add and create torrent options #2750

Merged
merged 3 commits into from
Oct 23, 2024
Merged

Conversation

jevenski
Copy link
Contributor

This PR adds persistent options for add torrent and create torrent dialog windows. For add torrent, the 4 options will be saved to WebUI settings on close. For create torrent, the 4 options (piece size, start seeding, private torrent, hybrid torrent) will be saved to the plugin-specific cache file rtrackers.dat.

Related: #2728

@stickz
Copy link
Collaborator

stickz commented Oct 23, 2024

1) I managed to create the following error and break the web interface by deleting my rtrackers.dat file. It's trying to initialize the recent trackers button, but there's no data available for it to populate.

webui.js?v=51B2:2463 Uncaught TypeError: Cannot read properties of undefined (reading '__count__') from TypeError: Cannot read properties of undefined (reading '__count__')
    at propsCount (https://192.168.1.102/rutorrent/js/common.js?v=51B2:290:15)
    at plugin.getRecentTrackers (<anonymous>:222:93)
    at Object.<anonymous> (https://192.168.1.102/rutorrent/js/rtorrent.js?v=51B2:1301:22)
    at c (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:25304)
    at Object.fireWith [as resolveWith] (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:26053)
    at l (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:77782)
    at XMLHttpRequest.<anonymous> (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:80265)
app.js:1424 init Objectbrowser: {tableEntryPrefix: '_flm_', uiTable: ce.fn.init, clipaboardEvent: null, clipboardEntries: Array(0), selectedEntries: Array(0), …}console: {loader: 'create', loaded: null, dialog: ƒ, writeConsole: ƒ, loadConsole: ƒ, …}dialogs: {activeDialogs: {…}, onStartEvent: null, startedPromise: null, dirBrowser: {…}, forms: {…}, …}disableNavigation: ƒ ()enableNavigation: ƒ ()formatDate: ƒ (timestamp)getDialogs: ƒ ()getPopupId: ƒ (popupName)init: ƒ ()initFileBrowser: ƒ ()onSettingsShow: ƒ (call)settings: {defaults: {…}, getSettingValue: ƒ, getSettings: ƒ, onShow: ƒ, onSave: ƒ}showArchive: ƒ ()showPermissions: ƒ ()showSFVcreate: ƒ ()updateNavbarPath: ƒ ()viewNFO: ƒ (file)[[Prototype]]: Object
webui.js?v=51B2:2463 Uncaught TypeError: Cannot read properties of undefined (reading '__count__') from TypeError: Cannot read properties of undefined (reading '__count__')
    at propsCount (https://192.168.1.102/rutorrent/js/common.js?v=51B2:290:15)
    at theWebUI.showRecentTrackers (<anonymous>:225:66)
    at HTMLButtonElement.<anonymous> (<anonymous>:233:2168)
    at HTMLButtonElement.dispatch (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:40035)
    at v.handle (https://192.168.1.102/rutorrent/js/jquery.js?v=51B2:2:38006)

2) Recent trackers are being put into the rtrackers.dat file, but when you refresh the page (after creating a torrent) they do not get put into the text area.

@jevenski
Copy link
Contributor Author

Thanks, I'll see and try to fix that later.

Regarding the recent trackers, I think there might be a potential security or privacy concern. When we put the trackers used last time into the trackers area straight forward, it poses a potential information leak if the tracker address contains a passkey. Although the passkeys are going to be stored in the recentTrackers object anyway, at least they are not shown on the screen directly.

@stickz
Copy link
Collaborator

stickz commented Oct 23, 2024

Thanks, I'll see and try to fix that later.

Regarding the recent trackers, I think there might be a potential security or privacy concern. When we put the trackers used last time into the trackers area straight forward, it poses a potential information leak if the tracker address contains a passkey. Although the passkeys are going to be stored in the recentTrackers object anyway, at least they are not shown on the screen directly.

Nope, there is no security risk factor greater than already present. The passkeys are anonymous and they are already stored inside torrent files that ruTorrent saves. Please feel free to proceed with this task and enable it by default.

@jevenski
Copy link
Contributor Author

jevenski commented Oct 23, 2024

I think the errors are now fixed, with some other minor fixes like preventing adding duplicate trackers using the recent tracker menu.

Beside the create plugin itself, there's one thing to note that the second line of the error output has an app.js in it so I guess it might be related to the FileManager plugin. I haven't tested that though.

@stickz
Copy link
Collaborator

stickz commented Oct 23, 2024

Thanks so much! Functionality is perfect now!

@stickz stickz merged commit e15310f into Novik:master Oct 23, 2024
@jevenski jevenski deleted the trt-options branch October 23, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants