GithubHelp home page GithubHelp logo

b12f / latenight.blue Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 1.75 MB

Blog style music playlist

Home Page: http://latenight.blue

JavaScript 71.23% CSS 9.30% HTML 19.47%
playlist blog-engine lightweight music

latenight.blue's Introduction

latenight.blue [DEPRECATED]

This is the v3 source for latenight.blue and eleventhirty.am. This code aims to provide no fluff, no unnecessary extras.

Deprecation

This code has been deprecated in favour of lnb-server, lnb-client and etam-client.

Features

Current master is v3. It sports the following new and old features:

  • Multiple vHosts New
  • Updating published content New
  • KoaJS as the base framework
  • Let's Encrypt integration Automatic renewal
  • Theming
  • Three views (index, admin, error)
  • One API route (GET /playlist)
  • Support for 1 (one!) data submission type
  • External hosting and streaming of all relevant data via YouTube and SoundCloud Classic
  • Publishing queue
  • One admin access
  • SEO friendly URLs like example.com/, example.com/23, example.com/40, or even example.com/80085 Classic
  • No database and caching for minimal filesystem interaction Classic

Try it out

Clone the repository

git clone [email protected]:b12f/latenight.blue.git

Enter the directory and install the required node modules.

cd latenight.blue
npm install

Create the config file.

cp config.js.example config.js

Edit the config to fit your needs.

nano config.js

Start the server

npm start

The admin panel can be found under /ap

If you use ports below 1024, you need to run as root. This is not recommended, I wouldn't trust myself with root level access to your system. See also "Port fix" below.

sudo npm start

Enjoy.

Port fix

If you wish to run this on port 80 or 443, a good practice would be to redirect the port.

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

Config options

sites: object[]

One object for each vhost you want to be running.

.hostname: string Site hostname without http(s)://

.site_title: string Site title, displayed on the homepage

.keywords: string SEO keywords

.description: object{episode: string, default: string} SEO description. episode for episode pages, default for homepage / error page.

.title: object{episode: string, default: string} Same as above, for page title

.theme: string Theme name to be used

.apUser: string Admin username

.apPass: string Admin password

.databaseFile: string Path to the desired database File

.scApiId: string (optional) SoundCloud API ID

.gaId: string (optional) Google Analytics ID

httpPort: number (optional, default: 3080)

httpsPort: number (optional, default: 3443)

loglevel: number (optional, default: 2)

  • 0: Error
  • 1: Warn
  • 2: Info
  • 3: Debug

leEnabled: boolean

Let's Encrypt enabled flag

leEmail: string (required if leEnabled)

Email address to complete Let's Encrypt ACME callback with

Migrating

Migrating from v2 to v3? Apart from the obvious settings changes, run

node ./bin/migrate [playlistDir] [queueDir] [outputDbFile]

Developing themes

Themes are stored in the /themes/[theme-name]/ folder, and have the following base structure:

public/
views/
    ap.html
    error.html
    index.html
function.js
settings.json

public/ is the theme's static root dir, all files in here will be served directly.

views/ is the view dir, in which the three view files (index.EXT, ap.EXT, error.EXT) reside.

functions.js can be used to define extra function to be used in the view templating.

settings.json stores the themes settings. Currently the only supported setting is engineMap, which should be an object mapping file extensions to view engines for koa-views.

View data

Views get the following data to be used for rendering:

settings: [object site settings (config.js current site)]
themeSettings: [object theme settings],
themeFn: [object theme functions],
buildMeta: [function build meta],
playlist: [array playlist],
queue: [array queue],
song: [undefined OR object submitted song (ap view only)],
episode: [undefined OR object current requested episode (index view only)],
success: [undefined OR string success message (ap view only)],
error: [undefined OR string error message]

Contributing

Just fork and submit pull requests. Please stay true to the philosophy of "no fluff, no unnecessary extras" and please write code in the current style. If you feel a feature is missing open an issue, we'll see if we think it fits our philosophy.

latenight.blue's People

Contributors

b12f avatar benpye avatar sheybey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

latenight.blue's Issues

can you help me?

i have run "npm start "
but error, can you help me to install this code, please


> [email protected] start
> node ./bin/www

Info:  Setting up vhost localhost
node:fs:2346
    return binding.writeFileUtf8(
                   ^

Error: ENOENT: no such file or directory, open 'I:\latenight.blue\data\latenight.blue.json'
    at Object.writeFileSync (node:fs:2346:20)
    at Object.fileSyncRead [as read] (I:\latenight.blue\node_modules\lowdb\lib\storages\file-sync.js:24:10)
    at db.read (I:\latenight.blue\node_modules\lowdb\lib\common.js:25:24)
    at Object.init (I:\latenight.blue\node_modules\lowdb\lib\common.js:55:13)
    at module.exports (I:\latenight.blue\node_modules\lowdb\lib\main.js:25:17)
    at module.exports (I:\latenight.blue\src\db.js:5:16)
    at module.exports (I:\latenight.blue\src\routes.js:13:34)
    at module.exports (I:\latenight.blue\src\app.js:12:42)
    at Object.<anonymous> (I:\latenight.blue\bin\www:38:38)
    at Module._compile (node:internal/modules/cjs/loader:1358:14) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'I:\\latenight.blue\\data\\latenight.blue.json'
}

Node.js v20.14.0

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.