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

DirectURL setting in configuration.js won't apply after modified #365

Closed
SAW4 opened this issue Jul 26, 2017 · 4 comments
Closed

DirectURL setting in configuration.js won't apply after modified #365

SAW4 opened this issue Jul 26, 2017 · 4 comments

Comments

@SAW4
Copy link

SAW4 commented Jul 26, 2017

As mentioned by author, DircetURL's setting should be set in the file configuration.js then webUI will read it
But after many times I tried, its not worked as expected.
Finally I found a temporary solution, in js/services/rpc/rpc.js :

...
  var subscriptions = []
    , configurations = [authconf]
    , currentConf = {}
    , currentToken
    , timeout = null
    , forceNextUpdate = false;

  var cookieConf = utils.getCookie('aria2conf');
  // try at the start, so that it is presistant even when default authconf works
  if(cookieConf) configurations.unshift(cookieConf);
  if (['http', 'https'].indexOf(uri.protocol()) != -1 && uri.host() != 'localhost') {
    configurations.push({
      host: uri.host(),
      path: '/jsonrpc',
      port: 6800,
      encrypt: false,
      directURL: 'http://core:81/data_drive/'     // To add this line, as your DirectURL
    },
    {
      host: uri.host(),
      port: uri.port(),
      path: '/jsonrpc',
      encrypt: ( uri.protocol() == 'https' )
    },
    {
      host: uri.host(),
      port: uri.port(),
      path: authconf.path,
      encrypt: ( uri.protocol() == 'https' )
    });
  }
...

After changing, you may need to clear the cookies. Then every time you visit aria2-webUI (even refresh the page, restart aria2-rpc server), the default DirectURL can be read.
I have no idea why configuration.js does not work (zero knowledge in AngularJS).

@no1xsyzy
Copy link
Contributor

Reproduction

On Linux

when accessing through file:/// then works well
using http://localhost/some/path/ then not working

@no1xsyzy
Copy link
Contributor

okay, found the problem.
you should clean the cookies to make it working well.
in order to clean cookies, you MUST leave the index.html page first, since it will constantly set cookie/set cookie when leaving page.

easy way is to leave the page and remove all cookies
better way is to remove the cookies using developer tools.

@SAW4
Copy link
Author

SAW4 commented Jul 27, 2017

@no1xsyzy You are correct. I should make sure the cookies of aria2-WebUI is completely clear first. Now configuaration.js works like a charm. Thank you for your help!

@SAW4 SAW4 closed this as completed Jul 27, 2017
@recolic
Copy link

recolic commented Feb 15, 2019

I cleared cookies in my browser but it doesn't work. I tried firefox and tried editing js/services/rpc/rpc.js and tried to change client. None of them works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants