How to properly selfhost EmulatorJS reddit / selfhosted ---------------------------------------------------------------------- hirakath · 2023-12-25 22:54 I recently started looking at EmulatorJS because me and a few of my friends like to play some old GBA, GBC, and GB games. I want to provide this service for them much like how I give them access to my Plex libraries. Ideally only I should have access to manage the ROMs similar to how only I have access to manage the media files on my Plex. Ideally as well, I want me and my friends to have our own EmulatorJS profiles so that our save files don't mix with others and they will all be organized properly. A few things I noticed while I was testing out EmulatorJS locally before I set it up on my VM and point a subdomain to it like `games.domain.com` where all of us will access it from is that the backend isn't protected. You just have to point your browser to the IP address and specify the port and you're in and you're able to upload files to the server without any kind of authentication. This is a massive security issue for me because then anyone who has the domain name (it's so easy to see all of the available subdomains of a domain) and the port number and they can upload whatever they want onto my server. Another issue I have is with user profiles.. I tried setting two accounts when I was testing it out locally and a user doesn't really have to login to start playing. They just specify the IP address or the domain name and they just start playing. Anyone has any guides on how I could set up EmulatorJS the way I described above? Here's my `docker-compose.yml` file: version: '3' services: emulatorjs: image: lscr.io/linuxserver/emulatorjs:latest container_name: emulatorjs restart: unless-stopped environment: - PUID=1001 - PGID=1002 - TZ=Etc/UTC - SUBFOLDER=/ # optional ports: - 8800:3000 - 8880:80 # - 8801:4001 # optional volumes: - /var/emulatorjs/config:/config - /var/emulatorjs/data:/data networks: - gateway networks: gateway: name: npm_gateway external: true I use Nginx Proxy Manager as a reverse proxy in front of every docker container to assign certificates and manage the domain mappings to each container hence why you see some network stuff in there. ---------------------------------------------------------------------- suffocating · 2023-12-25 23:13 Looks like someone requested authentication added and the developer shut it down. There’s a couple recommendations in the thread though. https://github.com/linuxserver/emulatorjs/issues/41 ---------------------------------------------------------------------- hirakath · 2023-12-25 23:38 Thank you.. looks like I'm still a long ways away before I can get this to my friends. ---------------------------------------------------------------------- LexSoup · 2023-12-25 23:49 You could throw something like Authelia infront of it. Plenty of guides on youtube including the use with NPM. Other option to try is ( if you use cloudflare (free)) is to expose it through a cloudflare tunnel and setup cloudflare access infront of it. ---------------------------------------------------------------------- hirakath · 2023-12-25 23:50 Yeah someone shared a link and one of the suggestions was to use Authelia. I've never used it so I'll go look into it first. Thank you! ---------------------------------------------------------------------- Nintenuendo_ · 2023-12-26 05:09 You said you're using NGINX, [this is what your emulatorjs.subdomain.conf should look like](https://i.imgur.com/doNwK5Z.png) to forward properly with a login page guarding the resource (change proxy_pass ip to the correct path for you) As you can see, I'm currently using "htpasswd" authentication for my instance, but you can use LDAP or Authentik if you want, just take the "#"'s out from infront of the line and create the *.conf file, it's as simple as that. If you're doing the htpasswd method like i am, just go to your nginx/swag container and make a htpasswd file in the /config/nginx folder, and create a username with a hashed password. You now have authentication. Example - I'm not currently running emulatorJS, but other things I'm running use the exact same authentication methods, [you can click a few of them here](https://nintenuendo.tv/) if you wanna see the login prompt. ---------------------------------------------------------------------- highedutechsup · 2023-12-26 07:47 use a proxy that does that...not every app needs authentication ---------------------------------------------------------------------- lighthawk16 · 2023-12-26 08:30 In NGINX Proxy Manager you can enable basic authentication for the proxy. This will password protect the site. ---------------------------------------------------------------------- Shabbypenguin · 2023-12-26 12:07 [webrcade](https://www.webrcade.com), you can self host it but it does break [Dropbox linking](https://hub.docker.com/r/raz0red/webrcade). I can load up webrcade on any web browser with the url to my feed, link my Dropbox and suddenly I have all the games I want and my game saves are transferred over. Touch controls are coming in the next few months as currently it requires a controller/keyboard. Plays psx and n64 and older. ---------------------------------------------------------------------- daedric · 2023-12-26 15:31 To upload files, you must access emulatorjs.domain.com/filebrowser.html In NPM, set a custom location for it /filebrowser.html And and send it to http 127.0.0.1 80 Then, add another proxy host, like private-emulatorjs.domain.com, this one you protect with a access list in NPM, so that only you can add or remove files. ---------------------------------------------------------------------- hirakath · 2023-12-26 20:26 Never seen this one. Thanks! It looks like it has a better interface than EmulatorJS. ---------------------------------------------------------------------- sexyshingle · 2023-12-29 10:57 nice