Skip to content

Commit

Permalink
Fix CORS and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed May 7, 2024
1 parent 311cd7f commit 2802e2e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks/publish-pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ done
twine upload ./dist/*

# Tag this commit
git tag v0.2.7
git tag v0.2.8

echo "Tagged as v0.2.7"
echo "Tagged as v0.2.8"
2 changes: 1 addition & 1 deletion jinjaroot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
projectName: neurosift
pythonProjectVersion: 0.2.7
pythonProjectVersion: 0.2.8
projectAuthor: Jeremy Magland
projectAuthorEmail: [email protected]
projectDescription: Simple utility to view local NWB files using Neurosift
Expand Down
4 changes: 2 additions & 2 deletions python/neurosift/local-file-access-js/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ npm run start $NWB_DIR
**Step 3: Open the neurosift web app in your browser and point to an nwb file**

```bash
https://flatironinstitute.github.io/neurosift/?p=/nwb&url=http://localhost:61762/files/testing.nwb
https://neurosift.app/?p=/nwb&url=http://localhost:61762/files/testing.nwb
```

This will load the nwb file from `$NWB_DIR/testing.nwb`
Expand All @@ -44,4 +44,4 @@ PORT=12345 npm run start $NWB_DIR

This server will expose the contents of files in the directory you specify to anyone who can access the server. This does not include hidden files (those starting with "."). This is not a problem if you are running the server on your local machine and only accessing it from your local machine. However, if you are running the server on a machine that is accessible from the internet, you should take precautions to ensure that only authorized users can access the server, if you have sensitive files.

There is also a possibility that websites you visit could get read access to your files. However, the configuration will prevent this from happening unless the website is being served from the allowed domains (flatironinsitute.github.io and localhost:3000).
There is also a possibility that websites you visit could get read access to your files. However, the configuration will prevent this from happening unless the website is being served from the allowed domains (neurosift.app and localhost:3000).
4 changes: 2 additions & 2 deletions python/neurosift/local-file-access-js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ if (!dir) {
}
console.info('Serving files in', dir)

// Allow CORS from flatironinstitute.github.io and localhost:3000
const allowedOrigins = ['https://flatironinstitute.github.io', 'http://localhost:3000', 'http://localhost:4200']
// Allow CORS from neurosift.app flatironinstitute.github.io and localhost:3000
const allowedOrigins = ['https://neurosift.app', 'https://flatironinstitute.github.io', 'http://localhost:3000', 'http://localhost:4200']
app.use((req, resp, next) => {
const origin = req.get('origin')
const allowedOrigin = allowedOrigins.includes(origin) ? origin : undefined
Expand Down
2 changes: 1 addition & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was automatically generated by jinjaroot. Do not edit directly.
[metadata]
name = neurosift
version = 0.2.7
version = 0.2.8
author = Jeremy Magland
author_email = [email protected]
description = Simple utility to view local NWB files using Neurosift
Expand Down

0 comments on commit 2802e2e

Please sign in to comment.