some more tweaks

This commit is contained in:
Craig 2020-01-14 09:39:47 +00:00
parent 6c815b019d
commit 6f1a2bb77a
14 changed files with 255 additions and 86 deletions

View File

@ -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\""

View File

@ -0,0 +1,2 @@
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");

28
.docker/firefox/neko.js Normal file
View File

@ -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/");

View File

@ -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
}
}
}

View File

@ -13,9 +13,12 @@
<applications>
<!-- Match all windows and remove their decorations -->
<application class="*"> <decor>no</decor> </application>
<!-- Make the window fullscreen -->
<fullscreen>yes</fullscreen>
<application class="Firefox*" name="Navigator">
<decor>no</decor>
<maximized>true</maximized>
<focus>yes</focus>
<layer>normal</layer>
</application>
</applications>
<focus>

View File

@ -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"
}
]
}
}

View File

@ -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

View File

@ -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

BIN
.github/demo.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

View File

@ -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
#

View File

@ -2,10 +2,14 @@
<img src="https://github.com/nurdism/neko/raw/master/.github/logo.png" width="650" height="auto"/>
</div>
# 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.
<div align="center">
<img src="https://github.com/nurdism/neko/raw/master/.github/demo.gif" width="650" height="auto"/>
</div>
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:

View File

@ -1 +1 @@
NEKO_DEV=localhost:3000
VUE_APP_SERVER=localhost:3000

View File

@ -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"
},

View File

@ -66,13 +66,13 @@
<img src="@/assets/logo.svg" alt="n.eko" />
<span><b>n</b>.eko</span>
</div>
<div class="message" v-if="!connecting">
<form class="message" v-if="!connecting" @submit.stop.prevent="connect">
<span>Please enter the password:</span>
<input type="password" v-model="password" />
<span class="button" @click.stop.prevent="connect">
<button type="submit" class="button" @click.stop.prevent="connect">
Connect
</span>
</div>
</button>
</form>
<div class="spinner" v-if="connecting">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
@ -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)