diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index bd08062e..7b3062e4 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -11,6 +11,6 @@ services: security_opt: - seccomp:unconfined volumes: - - /home/nurd/neko:/workspace + - /home/neko/src:/workspace - /var/run/docker.sock:/var/run/docker.sock command: "/bin/sh -c \"while sleep 1000; do :; done\"" diff --git a/.docker/firefox/autoconfig.js b/.docker/firefox/autoconfig.js new file mode 100644 index 00000000..87d65796 --- /dev/null +++ b/.docker/firefox/autoconfig.js @@ -0,0 +1,2 @@ +pref("general.config.obscure_value", 0); +pref("general.config.filename", "mozilla.cfg"); \ No newline at end of file diff --git a/.docker/firefox/neko.js b/.docker/firefox/neko.js new file mode 100644 index 00000000..4a00ca31 --- /dev/null +++ b/.docker/firefox/neko.js @@ -0,0 +1,28 @@ +// firefox config for neko +lockPref("browser.tabs.closeWindowWithLastTab", false); +lockPref("app.update.auto", false); +lockPref("app.update.enabled", false); +lockPref("app.update.silent", true); +lockPref("browser.cache.disk.capacity", 1000); +lockPref("browser.download.useDownloadDir", false); +lockPref("browser.rights.3.shown", true); +lockPref("browser.search.update", false); +lockPref("browser.shell.checkDefaultBrowser", false); +lockPref("extensions.update.enabled", false); +lockPref("plugin.default_plugin_disabled", false); +lockPref("plugin.scan.plid.all", true); +lockPref("plugins.hide_infobar_for_missing_plugin", true); +lockPref("profile.allow_automigration", false); +lockPref("signon.prefillForms", false); +lockPref("signon.rememberSignons", false); +lockPref("xpinstall.enabled", false); +lockPref("xpinstall.whitelist.required", true); +lockPref("browser.download.manager.retention", 0); +lockPref("browser.download.folderList", 2); +lockPref("browser.download.forbid_open_with", true); +lockPref("browser.safebrowsing.downloads.enabled", false); +lockPref("browser.safebrowsing.downloads.remote.enabled", false); +lockPref("browser.helperApps.alwaysAsk.force", false); +lockPref("browser.helperApps.neverAsk.saveToDisk", "application/zip,application/octet-stream,image/jpeg,application/vnd.ms-outlook,text/html,application/pdf"); +lockPref("browser.helperApps.neverAsk.openFile", "application/zip,application/octet-stream,image/jpeg,application/vnd.ms-outlook,text/html,application/pdf"); +lockPref("browser.newtabpage.activity-stream.default.sites", "https://www.youtube.com/,https://netflix.com,https://www.hulu.com/,https://9anime.to/,https://www.funimation.com/,https://www.disneyplus.com/,https://play.hbonow.com/,https://www.twitch.tv/"); diff --git a/.docker/firefox/policies.json b/.docker/firefox/policies.json new file mode 100644 index 00000000..f48f45fd --- /dev/null +++ b/.docker/firefox/policies.json @@ -0,0 +1,187 @@ +{ + "policies": { + "BlockAboutAddons": true, + "BlockAboutConfig": true, + "BlockAboutProfiles": true, + "BlockAboutSupport": true, + "Bookmarks": [ + { + "Title": "YouTube", + "URL": "https://www.youtube.com/", + "Favicon": "https://www.youtube.com/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Netflix", + "URL": "https://netflix.com", + "Favicon": "https://www.netflix.com/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Hulu", + "URL": "https://www.hulu.com/", + "Favicon": "https://www.hulu.com/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "9Anime", + "URL": "https://9anime.to/", + "Favicon": "https://staticf.akacdn.ru/assets/favicons/favicon.png", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Crunchy Roll", + "URL": "https://www.crunchyroll.com/", + "Favicon": "https://www.crunchyroll.com/favicons/favicon-16x16.png", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Funimation", + "URL": "https://www.funimation.com/", + "Favicon": "https://www.funimation.com/static/img/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Disney+", + "URL": "https://www.disneyplus.com/", + "Favicon": "https://prod-static.disney-plus.net/builds/79e07c421f069edf597cdaa753376b64e5de337f_1578322635943/images/favicons/favicon-32x32.png", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "HBO Now", + "URL": "https://play.hbonow.com/", + "Favicon": "https://play.hbonow.com/assets/images/branding/desktop/hbonow/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Amazon Video", + "URL": "https://www.amazon.com/Amazon-Video/b?node=2858778011", + "Favicon": "https://www.amazon.com/favicon.ico", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "VRV", + "URL": "https://vrv.co/", + "Favicon": "https://static.vrv.co/vrvweb/assets/img/favicons/favicon-16x16.png", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Twitch", + "URL": "https://www.twitch.tv/", + "Favicon": "https://static.twitchcdn.net/assets/favicon-16-2d5d1f5ddd489ee10398.png", + "Folder": "Media", + "Placement": "toolbar" + }, + { + "Title": "Mixer", + "URL": "https://mixer.com/", + "Favicon": "https://mixer.com/_latest/assets/favicons/favicon-16x16.png", + "Folder": "Media", + "Placement": "toolbar" + } + ], + "CaptivePortal": false, + "DisableAppUpdate": true, + "DisableBuiltinPDFViewer": true, + "DisableDeveloperTools": true, + "DisableFeedbackCommands": true, + "DisableFirefoxAccounts": true, + "DisableFirefoxScreenshots": true, + "DisableFirefoxStudies": true, + "DisableForgetButton": true, + "DisableMasterPasswordCreation": true, + "DisablePocket": true, + "DisablePrivateBrowsing": true, + "DisableProfileImport": true, + "DisableProfileRefresh": true, + "DisableSafeMode": true, + "DisableSetDesktopBackground": true, + "DisableSystemAddonUpdate": true, + "DisableTelemetry": true, + "DisplayBookmarksToolbar": false, + "DontCheckDefaultBrowser": true, + "EnableTrackingProtection": { + "Cryptomining": true, + "Fingerprinting": true, + "Value": true + }, + "ExtensionSettings": { + "*": { + "installation_mode": "blocked" + }, + "uBlock0@raymondhill.net": { + "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi", + "installation_mode": "force_installed" + } + }, + "ExtensionUpdate": false, + "FirefoxHome": { + "Highlights": false, + "Pocket": false, + "Search": true, + "Snippets": false, + "TopSites": true + }, + "FlashPlugin": {}, + "HardwareAcceleration": false, + "Homepage": { + "StartPage": "none" + }, + "NewTabPage": true, + "NoDefaultBookmarks": true, + "OfferToSaveLogins": false, + "OfferToSaveLoginsDefault": false, + "OverrideFirstRunPage": "", + "OverridePostUpdatePage": "", + "PasswordManagerEnabled": false, + "Permissions": { + "Camera": { + "BlockNewRequests": true + }, + "Location": { + "BlockNewRequests": true + }, + "Microphone": { + "BlockNewRequests": true + }, + "Notifications": { + "BlockNewRequests": true + } + }, + "Preferences": { + "browser.tabs.warnOnClose": false, + "browser.urlbar.suggest.bookmark": false, + "browser.urlbar.suggest.history": false, + "browser.urlbar.suggest.openpage": false, + "datareporting.policy.dataSubmissionPolicyBypassNotification": true, + "dom.disable_window_flip": true, + "dom.disable_window_move_resize": true, + "dom.event.contextmenu.enabled": false, + "extensions.getAddons.showPane": false, + "places.history.enabled": false, + "privacy.file_unique_origin": true, + "ui.key.menuAccessKeyFocuses": false + }, + "PromptForDownloadLocation": false, + "SanitizeOnShutdown": { + "Cache": true, + "Cookies": true, + "Downloads": true, + "FormData": true, + "History": true, + "OfflineApps": true, + "Sessions": true, + "SiteSettings": true + } + } +} \ No newline at end of file diff --git a/.docker/openbox.xml b/.docker/openbox.xml index 255fe3da..9410a010 100644 --- a/.docker/openbox.xml +++ b/.docker/openbox.xml @@ -13,9 +13,12 @@ - no - - yes + + no + true + yes + normal + diff --git a/.docker/policies.json b/.docker/policies.json deleted file mode 100644 index f60e52dd..00000000 --- a/.docker/policies.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "policies": { - "DisableAppUpdate": true, - "DisableTelemetry": true, - "DontCheckDefaultBrowser": true, - "DisableFirefoxAccounts": true, - "DisablePrivateBrowsing": true, - "DisableProfileImport": true, - "BlockAboutConfig": true, - "BlockAboutProfiles": true, - "BlockAboutSupport": true, - "OverrideFirstRunPage": "", - "OfferToSaveLogins": false, - "PromptForDownloadLocation":false, - "DisableSetDesktopBackground":false, - "DisableDeveloperTools":false, - "DisableFeedbackCommands":false, - "DisableFirefoxScreenshots":false, - "DisableProfileRefresh":false, - "OfferToSaveLoginsDefault":false, - "PasswordManagerEnabled":false, - "SanitizeOnShutdown": { - "Cache": true, - "Cookies": true, - "Downloads": true, - "FormData": true, - "History": true, - "Sessions": true, - "SiteSettings": true, - "OfflineApps": true - }, - "FirefoxHome": { - "Search": true, - "TopSites": true, - "Highlights": false, - "Pocket": false, - "Snippets": false, - "Locked": false - }, - "ExtensionSettings": { - "uBlock0@raymondhill.net": { - "installation_mode": "force_installed", - "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi" - } - }, - "WebsiteFilter": { - "Block": [], - "Exceptions": [] - }, - "Homepage": { - "Additional": [], - "StartPage": "none" - }, - "Bookmarks": [ - { - "Title": "9 Anime", - "URL": "https://9anime.xyz/", - "Favicon": "https://9anime.xyz/favicon.png", - "Placement": "toolbar" - } - ] - } -} \ No newline at end of file diff --git a/.docker/supervisord.conf b/.docker/supervisord.conf index 875488a2..bdf0e2ad 100644 --- a/.docker/supervisord.conf +++ b/.docker/supervisord.conf @@ -21,11 +21,11 @@ autorestart=true priority=300 [program:firefox-esr] -command=/usr/lib/firefox-esr/firefox-esr --display=:%(ENV_NEKO_DISPLAY)s --setDefaultBrowser -width %(ENV_NEKO_WIDTH)s -height %(ENV_NEKO_HEIGHT)s %(ENV_NEKO_URL)s +command=/usr/lib/firefox-esr/firefox-esr --kiosk --display=:%(ENV_NEKO_DISPLAY)s --setDefaultBrowser -width %(ENV_NEKO_WIDTH)s -height %(ENV_NEKO_HEIGHT)s %(ENV_NEKO_URL)s autorestart=true priority=400 [program:neko] -command=/usr/bin/neko serve --static "/var/www" +command=/usr/bin/neko serve -d --static "/var/www" autorestart=true priority=800 \ No newline at end of file diff --git a/.docker/test b/.docker/test index 19ce65fb..436c50b6 100755 --- a/.docker/test +++ b/.docker/test @@ -5,12 +5,15 @@ sudo mkdir -p /var/run/dbus /etc/neko sudo /etc/init.d/dbus start +sudo cp default.pa /etc/pulse/default.pa + +sudo cp firefox/neko.js /usr/lib/firefox-esr/mozilla.cfg +sudo cp firefox/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js +sudo cp firefox/policies.json /usr/lib/firefox-esr/distribution/policies.json + sudo cp supervisord.conf /etc/neko/supervisord.conf sudo cp openbox.xml /etc/neko/openbox.xml -sudo cp default.pa /etc/pulse/default.pa -sudo cp policies.json /usr/lib/firefox-esr/distribution/policies.json - if [ ! -f /usr/lib/firefox-esr/distribution/extensions/uBlock0@raymondhill.net.xpi ]; then sudo mkdir -p /usr/lib/firefox-esr/distribution/extensions sudo curl -o /usr/lib/firefox-esr/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi diff --git a/.github/demo.gif b/.github/demo.gif new file mode 100644 index 00000000..7acde5ef Binary files /dev/null and b/.github/demo.gif differ diff --git a/Dockerfile b/Dockerfile index 30311313..5ecfcb2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,8 @@ ENV DEBIAN_FRONTEND=noninteractive # Install dependencies ttf-freefont RUN apt-get update \ && apt-get -y install curl apt-utils supervisor openbox dbus-x11 xvfb pulseaudio firefox-esr \ - && apt-get -y install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio libxcb-xkb-dev libxkbcommon-x11-dev \ + && apt-get -y install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio \ + && apt-get -y install libxcb-xkb-dev libxkbcommon-x11-dev \ # # Create a non-root user && groupadd --gid $USER_GID $USERNAME \ @@ -49,7 +50,9 @@ RUN apt-get update \ COPY .docker/openbox.xml /etc/neko/openbox.xml COPY .docker/supervisord.conf /etc/neko/supervisord.conf COPY .docker/default.pa /etc/pulse/default.pa -COPY .docker/policies.json /usr/lib/firefox-esr/distribution/policies.json +COPY .docker/firefox/neko.js /usr/lib/firefox-esr/mozilla.cfg +COPY .docker/firefox/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js +COPY .docker/firefox/policies.json /usr/lib/firefox-esr/distribution/policies.json # # Neko files @@ -67,7 +70,7 @@ ENV NEKO_HEIGHT=720 ENV NEKO_PASSWORD=neko ENV NEKO_BIND=:8080 -# Nayn +# Neko Nyan (=^-ω-^=) ENV NEKO_URL=https://www.youtube.com/embed/QH2-TGUlwu4 # diff --git a/README.md b/README.md index bb9bf038..7385f7e3 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,14 @@ -# n.eko -This is a proof of concept project I threw together over the last few days, its ugly its not perfect but it looks nice. This uses web rtc to stream a desktop inside of a docker container, I made this because [rabb.it](https://en.wikipedia.org/wiki/Rabb.it) went under and my internet can't handle streaming and discord keeps crashing. I just want to watch anime with my friends ლ(ಠ益ಠლ) so I started digging throughout the net and found a few *kinda* clones, but non of them had the virtual browser, then I found [Turtus](https://github.com/Khauri/Turtus) and I was able to figure out the rest. +
+ +
-This is by no means a fully featured clone of rabbit. It has no concept of other peers. It has bugs, but for the most part it works. I'm not sure what the future holds for this. If I continue to use it and like it, I'll probably keep pushing updates to it. I'd be happy to accept PRs for any improvements. +# n.eko +This is a proof of concept project I threw together over the last few days, it's ugly, it's not perfect, but it looks nice. This uses web rtc to stream a desktop inside of a docker container, I made this because [rabb.it](https://en.wikipedia.org/wiki/Rabb.it) went under and my internet can't handle streaming and discord keeps crashing. I just want to watch anime with my friends ლ(ಠ益ಠლ) so I started digging throughout the net and found a few *kinda* clones, but non of them had the virtual browser, then I found [Turtus](https://github.com/Khauri/Turtus) and I was able to figure out the rest. + +This is by no means a fully featured clone of rabbit. The client has no concept of other peers. It has bugs, but for the most part it works. I'm not sure what the future holds for this. If I continue to use it and like it, I'll probably keep pushing updates to it. I'd be happy to accept PRs for any improvements. ### Why n.eko? I like cats, I'm a weeb and a nerd, I own the domain [n.eko.moe](https://n.eko.moe/) and I love that logo I came across, had to use it for something /shrug @@ -13,7 +17,7 @@ I like cats, I'm a weeb and a nerd, I own the domain [n.eko.moe](https://n.eko.m ### I need help setting this up! Its a docker container, you need to have docker installed, you then need to build the image ``` -cd .docker && ./build.sh +cd .docker && ./build ``` Then run the container: diff --git a/client/.env.development b/client/.env.development index 4e3b4138..3022d8be 100644 --- a/client/.env.development +++ b/client/.env.development @@ -1 +1 @@ -NEKO_DEV=localhost:3000 +VUE_APP_SERVER=localhost:3000 diff --git a/client/package.json b/client/package.json index a44753ef..843f96ec 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Client for neko streaming server", "scripts": { - "serve": "vue-cli-service serve", + "serve": "vue-cli-service serve --mode development", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, diff --git a/client/src/App.vue b/client/src/App.vue index e8fe0719..f66ff27c 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -66,13 +66,13 @@ n.eko n.eko -
+
Please enter the password: - +
+ +
@@ -471,7 +471,9 @@ connect() { this.ws = new WebSocket( - process.env.NODE_ENV === 'development' ? `ws://${process.env.NEKO_DEV}/ws?password=${this.password}` : `${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}` , + process.env.NODE_ENV === 'development' + ? `ws://${process.env.VUE_APP_SERVER}/ws?password=${this.password}` + : `${/https/gi.test(location.protocol) ? 'wss' : 'ws'}://${location.host}/ws?password=${this.password}`, ) this.ws.onmessage = this.onMessage.bind(this)