Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

got a problem during deploy #159

Closed
astwyg opened this issue Apr 20, 2016 · 6 comments
Closed

got a problem during deploy #159

astwyg opened this issue Apr 20, 2016 · 6 comments

Comments

@astwyg
Copy link

astwyg commented Apr 20, 2016

hi, everyone:

i am trying deploy saltpad on my Falsk project, but when i open browser got an error from createBrowserHistory.js:117:

Uncaught (in promise) DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://login/' cannot be created in a document with origin 'http://127.0.0.1:8000'.

but npm run start works fine, it seems something wrong with React-Route. Thank you any idea about this problem.

@Lothiraldan
Copy link
Owner

Hi @astwyg, which saltpad version did you tried to run? How did you tried to run it?

@astwyg
Copy link
Author

astwyg commented Apr 20, 2016

thank you for responding @Lothiraldan

i am using salt 2015.8.8, with saltpad 0.3.1

i just found this pair can ONLY work on embedded cherrypy...

when i config them , i tried to login , but my browser send a XHR to http://localhost:8000/login.

my salt-master config is :

rest_cherrypy:
  port: 8000
  host: 0.0.0.0
  disable_ssl: true
  websockets: true
  cors_origin: '*'
  static: /home/ctyun/saltpad/static
  static_path: /static
  app: /home/ctyun/saltpad/templates/index.html
  app_path: /salt

external_auth:
  pam:
    salt:
    -  .*
    -  '@runner'
    -  '@wheel'

my saltpad config is :

{
    "API_URL": "localhost:8000",
    "SECURE_HTTP": false,
    "templates": {
    },
    "EAUTH": "pam",
    "FLAVOUR": "rest_cherrypy",
    "PATH_PREFIX": "/salt/"
}

will you please help me find out where goes bad? tyvm.

:)

@javadevmtl
Copy link

javadevmtl commented May 12, 2016

Getting same issue I'm using tornado.

createBrowserHistory.js:117 Uncaught (in promise) DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://login/' cannot be created in a document with origin 'http://myhostnamehere' and URL 'http://myhostnamehere/'

I'm configured on default apache2 on port 80.

salt-api 2015.8.8.2
salt 2015.8.8.2

settings.json

{
    "API_URL": "myhostnamehere:5417",
    "SECURE_HTTP": false,
    "templates": {
        "basic": {
            "description": "Basic template",
            "matcher": "glob",
            "target": "*",
            "moduleFunction": "test.fib",
            "arguments": {
                "num": 10
            }
        },

        "version": {
            "description": "Basic version",
            "matcher": "glob",
            "target": "Celeste",
            "moduleFunction": "test.version",
            "arguments": {}
        }
    },
    "EAUTH": "pam",
    "FLAVOUR": "rest_tornado",
    "PATH_PREFIX": "/"
}

The API is working.

HTTP/1.1 200 OK
Date: Thu, 12 May 2016 20:38:11 GMT
Content-Length: 188
Content-Type: application/json
Server: TornadoServer/4.2.1

{"return": [{"perms": [".*", "@runner", "@wheel"], "start": 1463085491.264282, "token": "04cbfd644605c2e185de27ff59c18695", "expire": 1463128691.264283, "user": "xxxxxx", "eauth": "pam"}]}xxx@xxxx:/var/www/saltpad$

@Lothiraldan
Copy link
Owner

Hi @astwyg, saltpad will tell your browser to contact the salt-api on the URL configured under API_URL, if it's not on your localhost, you need to set either the public IP address or the DNS of your salt-api.

@javadevmtl The weird thing about the error message is this URL: http://login/, did you strip the hostname part or is it directly pasted from the console?

@Lothiraldan
Copy link
Owner

@javadevmtl I think your problem is the same as #168

@astwyg
Copy link
Author

astwyg commented May 30, 2016

thx~

@astwyg astwyg closed this as completed May 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants