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

Trouble getting docker image to work #5

Closed
Froghut opened this issue Apr 28, 2022 · 10 comments · Fixed by #6
Closed

Trouble getting docker image to work #5

Froghut opened this issue Apr 28, 2022 · 10 comments · Fixed by #6

Comments

@Froghut
Copy link

Froghut commented Apr 28, 2022

I set up couchdb config as described in th einstall doc, When I try to set the connection in StoreDown (using the ip of the couchdb instance, port 5984 and DB name "StoreDown") I get the message "Replication complete" after a while.
But when I try to add a new Item I just get an empty "Item Editor" page with a Save and Discard Button. I also tried importing the demo data which gave me the message that 5 Items were imported, but there were no items in Item List etc.
Neither the StoreDown container nor the couchdb container give me any error messages (in docker logs) during the whole process.
Any help would be appreciated!

@Ksdmg
Copy link

Ksdmg commented Apr 28, 2022

Yep I have exactly the same issue!
And no matter what I type for the username, login always succeeds.

@FoxUSA
Copy link
Owner

FoxUSA commented Apr 28, 2022

Can you bring up the developer tools in your browser(Most of the time its F12 to open) and see if there are any error messages.

@FoxUSA
Copy link
Owner

FoxUSA commented Apr 28, 2022

The other thing that comes to mind is StoreDown is built in a weird way. All the fields are configurable, when you log in without a DB it uses a default config but when you log into a DB it expects one to be there.

Can you open the Configuration and paste in the default config?

---
dataDefinition:
  - displayName: Core info
    color: light-blue darken-2 #pick colors from https://v15.vuetifyjs.com/en/framework/colors
    fields:
      - name: _id
        displayName: ID
        type: string
        disabled: true
        showInTree: true
        size: 12
      - name: idLabeled
        displayName: Item labeled with ID
        type: boolean
        color: red
      - name: name
        displayName: Name
        type: string
        showInTree: true
      - name: location
        displayName: Location
        type: path
        size: 12
        prefixes:
          box01: House1/Room1/
        #showInTree: true
      - name: description
        displayName: Description
        type: string #TODO MarkDown
        hideInList: true
        size: 12
  - displayName: Status
    color: indigo darken-2
    fields:
      - name: status
        displayName: Status
        type: libraryStyleStatus #Checkin checkout
        size: 12
        showInTree: true
      - name: lastModified
        displayName: Last Modified
        type: lastModified
      - name: lastTouchDate
        displayName: Last touch date
        type: lastDate
        dateFields:
          - name: status
            type: libraryStyleStatus
          - name: acquireDate
      - name: holdReason
        displayName: Hold reason
        type: string
        hideInList: true
        size: 12
  - displayName: Metadata
    color: light-blue accent-4
    fields:
      - name: tags
        displayName: Tags
        type: list
        size: 12
      - name: code
        displayName: Code
        type: list
        listType: upc
        size: 12
        hideInList: true
  - displayName: Facts
    color: light-blue lighten-3
    size: 12
    fields:
      - name: weight
        displayName: Weight
        type: string
      - name: dimensions
        displayName: Dimensions
        type: string
      - name: expirationDate
        displayName: Expiration Date
        type: date
      - name: imageURLs
        displayName: Image URLs
        type: list
        listType: link
        hideInList: true
      - name: manualPaths
        displayName: Manual paths
        type: list
        listType: link
        hideInList: true
  - displayName: Acquisition
    color: light-blue accent-3
    fields:
      - name: acquiredFrom
        displayName: Acquired from
        type: string
      - name: pricePaid
        displayName: Price paid without tax
        type: string
      - name: receiptURLS
        displayName: Receipt urls
        type: list
        listType: link
        hideInList: true
        size: 12
      - name: acquireDate
        displayName: Acquired date
        type: date
      - name: manufacturer
        displayName: Manufacturer
        type: string
      - name: warranty
        displayName: Warranty term
        type: string
        hideInList: true

@Froghut
Copy link
Author

Froghut commented Apr 28, 2022

The Web Developer Console gives the following error (~15 times):
Blocked loading mixed active content “http:https://192.168.90.70:5984/storedown/”
that ip is the couchdb container ip and I access the storedown instance via https://storedown.xxx.com (via traefik reverse proxy)

@FoxUSA
Copy link
Owner

FoxUSA commented Apr 28, 2022

They both needs to be https or http. Can you put storedown behind the same proxy? Thats a chrome thing not a me thing.

@Froghut
Copy link
Author

Froghut commented Apr 28, 2022

Ok, I have storedown accessible via https://storedown.xxx.com:1234 and couchdb via https://storedown-db.xxx.com:1234
Changing the config to the new host, port etc I now get:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://storedown-db.xxx.com:1234/storedown/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 302.
in the couchdb CORS settings I added both https://storedown.xxx.com and https://storedown-db.xxx.com - with and without the port, so 4 entries total.
Edit: Enabling CORS for all domains (*) makes it work.

@FoxUSA
Copy link
Owner

FoxUSA commented Apr 28, 2022

@Froghut the CORS on * is a bad practice.

The reason I believe why:
This allows your sever to accept browser requests from any domain. This keeps someone from making a man in the middle browser page. On a home server the risk is minimal.

If should work if you set it to https://storedown.xxx.com without any ports. Only the domain part matters.

Also while I was looking at this I noticed CouchDB config has changed. Just setting the required user now isn't enough. So set in the httpd section WWW-Authenticate to Basic realm="administrator". I am going to update the documentation later today.

@Froghut
Copy link
Author

Froghut commented Apr 28, 2022

I tried with just https://storedown.xxx.com in couchdb CORS setting but get the CORS missing error again - not sure why, I will try to investigate further.
Thanks for your help!

@FoxUSA
Copy link
Owner

FoxUSA commented Apr 28, 2022

@Froghut it possible your proxy isn't passing the domain to couchdb. So couchdb is evaluating the url between the poxy not the url the browser is looking at. Maybe this doc has an answer for you if you care.

Other than the CORS issues, did you have to put in a config? Or did it just start working after that was fixed?

@Froghut
Copy link
Author

Froghut commented Apr 28, 2022

I did put in the config before I tried to connect to the DB since I wanted to modify the fields a bit, so I'm not sure if it works without setting config before, sorry.

FoxUSA pushed a commit that referenced this issue Apr 28, 2022
@FoxUSA FoxUSA mentioned this issue Apr 28, 2022
@FoxUSA FoxUSA closed this as completed in #6 May 4, 2022
FoxUSA added a commit that referenced this issue May 4, 2022
* Added info on #1

* Issue #5 work

* Turns out I own the domain

* Resolves #8
FoxUSA added a commit that referenced this issue May 19, 2022
* Added info on #1
* Issue #5 work
* Resolves #8
* Fixes #10. 
* Added tests. 
* Added automatic deployment
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

Successfully merging a pull request may close this issue.

3 participants