GithubHelp home page GithubHelp logo

keeldev / ss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from riteable/soulsearch

0.0 1.0 0.0 253 KB

A simple web UI and API based on the Soulseek protocol.

JavaScript 42.35% CSS 11.88% Vue 45.04% Dockerfile 0.73%

ss's Introduction

Soulsearch

A simple web UI and API based on the Soulseek protocol.

Demo

Go here to check it out.

Development

If you're planning to customize the source code, follow these steps first:

1. Install Node.js dependencies

$ npm install

2. Copy .env.example to .env and edit the variables.

$ cp .env.example .env

3. Run development server

$ npm run dev

Production

First make sure your .env variables are set properly, most importantly the following:

NODE_ENV=production
VIRTUAL_HOST=yourdomain.com
LETSENCRYPT_HOST=yourdomain.com
[email protected]
API_URL_BROWSER=https://yourdomain.com/api
SLSK_USER=uniqueusername
SLSK_PASS=somepassword

To run the application in production there are a couple of options. The easiest are the Docker options, but you need to have Docker and Docker Compose installed.

Option 1: Docker Compose

$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build

Option 2: Docker Swarm mode

If you haven't enabled Swarm mode, you can run:

$ docker swarm init

If Swarm mode is enabled successfully, you can run your stack as follows:

$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.swarm.yml config | docker stack deploy -c - <YOUR-STACK-NAME>

Option 3: PM2

First make sure the app is built for production:

$ npm run build

Then, you need to have PM2 installed globally to run the following:

$ pm2 start pm2.config.js --env production

Also, for this option you need to configure your own proxy (e.g. Nginx) to forward the requests to your app.

Optional config

Below are some optional steps to go through to setup your app.

Redirect www to non-www

If you want your www subdomain to redirect to your domain, you can add the following config to proxy/conf.d/your-proxy.conf:

# Redirect unencrypted www traffic to non-www SSL domain
server {
  listen 80;
  server_name www.yourdomain.com;
  return 301 https://yourdomain.com$request_uri;
}

# Redirect encrypted www traffic to non-www SSL domain
server {
  listen 443 ssl;
  server_name www.yourdomain.com;
  ssl_certificate /etc/nginx/certs/yourdomain.com.crt;
  ssl_certificate_key /etc/nginx/certs/yourdomain.com.key;
  ssl_dhparam /etc/nginx/certs/yourdomain.com.dhparam.pem;
  return 301 https://yourdomain.com$request_uri;
}

If you do this, make sure your VIRTUAL_HOST doesn't contain your www.yourdomain.com host. But make sure LETSENCRYPT_HOST does include the subdomain host.

Protect access with basic auth

You can restrict access to your app with basic authentication. Use htpasswd to generate username and password credentials:

$ htpasswd -Bc proxy/htpasswd/yourdomain.com <YOUR-USERNAME>

ss's People

Contributors

riteable avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.