{"id":18770078,"url":"https://github.com/yaroslaff/locker-example-notebook","last_synced_at":"2026-02-27T01:30:58.014Z","repository":{"id":135906142,"uuid":"371757929","full_name":"yaroslaff/locker-example-notebook","owner":"yaroslaff","description":"Simple notebook (no backend), example application of locker-server technology","archived":false,"fork":false,"pushed_at":"2022-09-09T09:30:09.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T03:57:02.387Z","etag":null,"topics":["example","frontend","locker","notebook","tutorial"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaroslaff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-28T16:21:49.000Z","updated_at":"2022-09-07T17:12:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"70ea07a6-dd4a-4cfe-9488-8de4215bb651","html_url":"https://github.com/yaroslaff/locker-example-notebook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yaroslaff/locker-example-notebook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Flocker-example-notebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Flocker-example-notebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Flocker-example-notebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Flocker-example-notebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaroslaff","download_url":"https://codeload.github.com/yaroslaff/locker-example-notebook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaroslaff%2Flocker-example-notebook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","frontend","locker","notebook","tutorial"],"created_at":"2024-11-07T19:18:04.840Z","updated_at":"2026-02-27T01:30:57.989Z","avatar_url":"https://github.com/yaroslaff.png","language":"HTML","readme":"# locker-example-notebook\n\nSimple example notebook application to show how easy to write secure multi-user web application with locker.\n\n## Quickstart (Stage 1): Development/testing on localhost\n\nThis is short guide to create and deploy your first locker application on localhost and then deploy it on free CDN. \n\n### Clone this repository\n`git clone https://github.com/yaroslaff/locker-example-notebook.git` and `cd locker-example-notebook`.\n\n### Create app on locker server \nCreate application in [myapps](https://myapps.www-security.com):\n\n![Image of locker myapps dashboard](readme/lockerhostkey.png)\n\n### Create .env file\n~~~shell\nLOCKER_HOST=notebook-u1.rudev.www-security.net   # Your host here\nLOCKER_KEY=VXhqog....                            # Your key here\n~~~\n\nNow, all further `locker-admin` commands require either LOCKER_KEY and LOCKER_HOST env variables, or must be run in directory with this `.env` file.\n\n### Test if app is created and deploy\nIn same directory with .env file, run `locker-admin ls` or `locker-admin info` to test `LOCKER_HOST` and `LOCKER_KEY` are set properly. \n\n~~~\n$ locker-admin info\nLocker host:notebook-u1.rudev.www-security.net key:VXhq...\nOrigins: ['http://localhost:8000']\nServernames: []\n~~~\n\ndeploy app:\n~~~\nlocker-admin deploy\n~~~\nThis command will upload application-specific files to your app locker.\n\nNow, if you will do `locker-admin info` again, you will see origins has `https://notebook.ll.www-security.net:8000`.\n\n\n### Start development webserver\nCreate self-signed https certificate and key for development:\n~~~\nopenssl req -subj '/CN=localhost'  -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout localhost.key -out localhost.crt\n~~~\n\nRun server:\n~~~\nlocker-admin serve\n~~~\n\n### Visit your application!\nOpen in browser\nhttps://notebook.ll.www-security.net:8000/\n\n(anything in .ll.www-security.net points to localhost)\n\nYou will see warning about your bad self-signed certificate, ignore it and proceed to website.\n\nYou see button \"Login via Google\". Click it and you will see your simple notebook... You may edit and save.  \n\nCongratulations, you deployed first locker application!\n\n\n\n## Quickstart (Stage 2): Go production! Custom domain, HTTPS and CDN\n\nWe will use custom domain for hosting our application. Website (currently: localhost) will use 'www' host in this domain, and locker (currently: notebook-u1.rudev.www-security.net) needs to be from same domain (otherwise [Third party cookies](https://cookie-script.com/all-you-need-to-know-about-third-party-cookies.html) will not work in some browsers). Our recommended approach with 'www' and 'locker' in same domain will work in all browsers (released after Michael Jackson death).\n\nIf you do not have domain for this, get free .tk/.ml/.ga/.cf/.gq domain at [freenom.com](https://freenom.com/) . (Freenom does not like VPNs, or use VPN in your country, you may get \"Some of your domains could not be registered because of a technical error. These domains have been cancelled: ...\" error message. Login from other IP then). I registered `locknote.tk` domain for this guide. Everywhere below use your domain name instead of `locknote.tk`.\n\nUse 'Add a Site' on cloudflare, and change NSes (on freenom) to cloudflare DNS servers. Create 'www' CNAME pointing to 'na-west1.surge.sh' (with proxy enabled) and 'locker' CNAME pointing to your locker host (notebook-u1.rudev.www-security.net in this guide).\n\nIn the end, you should have something like this on cloudflare: \n\n![settings CNAME to surge on cloudflare](readme/cloudflare-locker-cname.png)\n\n#### Set new locker_addr in _config.js\n\nPut new locker host address (locker.locknote.tk) into `_config.js`:\n~~~\nlocker_addr = 'https://locker.locknote.tk'\n~~~\n\n#### Set new website address in CNAME\nsurge expects sitename to be in `CNAME` file, so put it there:\n~~~\nwww.locknote.tk\n~~~\n\n#### Configure allowed origin\n\nOur locker will receive requests from www.locknote.tk, so we need to allow it (now it is not listed as valid origin in locker, use `locker-admin info` to confirm this).\n\nAdd new origin: `locker-admin set-origins + https://www.locknote.tk`. This command modifies `etc/options.json` file for your app. (You can edit it manually: `locker-admin edit etc/options.json`). Run `locker-admin info` again to see your website now listed in Origins.\n\n#### Configure new locker host\n\nThen set new servername for locker: `locker-admin set-servernames + locker.locknote.tk` (this adds new name to `etc/servernames.json`). \n\nVerify with `locker-admin info`:\n~~~\nLocker host:notebook-u1.rudev.www-security.net key:VXhq...\nOrigins: ['https://notebook.ll.www-security.net:8000', 'https://www.locknote.tk']\nServernames: ['locker.locknote.tk']\n~~~\n\nor with curl (diag for new hostname must show proper user and app):\n~~~shell\n$ curl https://locker.locknote.tk/diag\n{\n    \"checks\": [\n        \"OK: etc/options.json exists\",\n        \"OK: etc/oidc_credentials.json exists\",\n        \"Vendor credentials for google exists\"\n    ],\n    \"info\": {\n        \"counter\": 0,\n        \"sid\": \"a1ad7554-96c5-4420-aff3-4e7b93234562\",\n        \"pwd\": \"/\",\n        \"user\": \"u1\",\n        \"app\": \"notebook\",\n        \"authenticated\": false,\n        \"current_user\": \"\u003cflask_login.mixins.AnonymousUserMixin object at 0x7f8f3c50b790\u003e\"\n    },\n    \"errors\": []\n}\n~~~\n\n### Upload to surge.sh\nInstall surge: `npm install --global surge`\n\nThen just run: `surge` in locker-example-notebook directory.\n\n~~~\nxenon@braconnier:~/repo/locker-example-notebook$ surge\n\n   Running as yaroslaff@gmail.com (Student)\n\n        project: /home/xenon/repo/locker-example-notebook/\n         domain: www.locknote.tk\n         upload: [====================] 100% eta: 0.0s (14 files, 93946 bytes)\n            CDN: [====================] 100%\n             IP: 138.197.235.123\n\n   Success! - Published to www.locknote.tk\n~~~\n\nIf you will need to upload new copy of site, just use command `surge` again.\n\nOpen your website at https://www.locknote.tk/ and it should work now! Congratulations, you launched your first locker app. Secure, lightweight and hosted for free!\n\n#### Quick way (recap)\n- Create CNAMEs `www` to `na-west1.surge.sh` (with proxy) and `locker` to your app locker host (no proxy)\n- `locker-admin set-servernames + locker.locknote.tk`\n- `locker-admin set-origins + https://www.locknote.tk`\n- Put website hostname in `CNAME` file\n- Put your custom locker host to `_config.js`\n- Upload site with command: `surge`.\n\n\n#### Checklist\nIf something not working, check:\n- You have correct host in `locker_addr` in _config.js (same as `$LOCKER_HOST` in `.env` file and in myapps)\n- All possible website addresses are listed in Origin\n- locker_addr and origin are from same domain.\n\n#### Troubleshooting\n- `locker-admin log`\n- `locker-admin info`\n- https://locker.locknote.tk/diag\n- Request to `authenticated` page returns no warnings.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Flocker-example-notebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaroslaff%2Flocker-example-notebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaroslaff%2Flocker-example-notebook/lists"}