Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nodejs/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var app = require('../app');
var debug = require('debug')('proxy-api:server');
var http = require('http');
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

/**
* Get port from environment and store in Express.
Expand Down
1 change: 1 addition & 0 deletions nodejs/conf/base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
// Using https://github.com/simpleworkjs/conf to handle configuration

module.exports = {
userModel: 'redis', // pam, redis, ldap
Expand Down
32 changes: 0 additions & 32 deletions nodejs/conf/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion nodejs/migrations/all_keys_es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const {createClient} = require('redis');
const objValidate = require('../utils/object_validate');
const conf = require('../conf/conf');
const conf = require('@simpleworkjs/conf');

const client = createClient({});

Expand Down
4 changes: 2 additions & 2 deletions nodejs/models/dns_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const crypto = require("crypto");

const conf = require('../conf');
const conf = require('@simpleworkjs/conf');
const Table = require('../utils/redis_model');
const ModelPs = require('../utils/model_pubsub');

Expand Down Expand Up @@ -178,7 +178,7 @@ DnsProvider.register(ModelPs(DnsProvider))


if(require.main === module){(async function(){try{
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

// console.log(await DnsProvider.findall());

Expand Down
2 changes: 1 addition & 1 deletion nodejs/models/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ModelPs = require('../utils/model_pubsub');

const tldExtract = require('tld-extract').parse_host;
const LetsEncrypt = require('../utils/letsencrypt');
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

const letsEncrypt = new LetsEncrypt({
directoryUrl: conf.environment === "production" ?
Expand Down
2 changes: 1 addition & 1 deletion nodejs/models/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

const User = require(`./user_${conf.userModel}`)

Expand Down
2 changes: 1 addition & 1 deletion nodejs/models/user_ldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { Client, Attribute, Change } = require('ldapts');
const {Token, InviteToken} = require('./token');
const conf = require('../conf').ldap;
const conf = require('@simpleworkjs/conf').ldap;

const client = new Client({
url: conf.url,
Expand Down
13 changes: 13 additions & 0 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dependencies": {
"@fortawesome/fontawesome-free": "^7.1.0",
"@popperjs/core": "^2.11.8",
"@simpleworkjs/conf": "^1.0.0",
"acme-client": "^5.4.0",
"axios": "^1.13.2",
"bcrypt": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion nodejs/routes/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const router = require('express').Router();
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');
const middleware = require('../middleware/auth');

// API routes for authentication.
Expand Down
2 changes: 1 addition & 1 deletion nodejs/routes/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require('path');
const express = require('express');
const router = require('express').Router();
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

const values ={
title: conf.environment !== 'production' ? `dev` : '',
Expand Down
2 changes: 1 addition & 1 deletion nodejs/services/host_lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const {Host} = require('../models/host');
const {SocketServerJson} = require('../utils/unix_socket_json');
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

/**
* Host Lookup Service
Expand Down
2 changes: 1 addition & 1 deletion nodejs/utils/letsencrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if(require.main === module){(async function(){try{

const tldExtract = require('tld-extract').parse_host;
const PorkBun = require('./porkbun');
const conf = require('../conf/conf');
const conf = require('@simpleworkjs/conf');

let porkBun = new PorkBun(conf.porkBun.apiKey, conf.porkBun.secretApiKey);
let letsEncrypt = new LetsEncrypt({
Expand Down
2 changes: 1 addition & 1 deletion nodejs/utils/redis_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const {createClient} = require('redis');
const objValidate = require('../utils/object_validate');
const conf = require('../conf');
const conf = require('@simpleworkjs/conf');

const client = createClient({});
client.connect();
Expand Down