vagrant update
This commit is contained in:
Vendored
+9
-6
@@ -34,7 +34,7 @@ Vagrant.configure("2") do |config|
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://vagrantcloud.com/search.
|
||||
config.vm.box = "ubuntu/bionic64"
|
||||
config.vm.box = "ubuntu/jammy64"
|
||||
config.vm.synced_folder '.', '/vagrant' # The vagrant dir just stopped automounting
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
@@ -66,9 +66,11 @@ Vagrant.configure("2") do |config|
|
||||
# documentation for more information about their specific syntax and use.
|
||||
config.vm.provision "shell", inline: <<~SHELL
|
||||
apt-get update
|
||||
if ! apt list ruby2.6-dev | grep installed; then
|
||||
apt-add-repository ppa:brightbox/ruby-ng -y
|
||||
sudo apt-get install -y build-essential resolvconf ruby2.6 ruby2.6-dev gem
|
||||
if ! apt list ruby-dev | grep installed; then
|
||||
# apt-add-repository ppa:brightbox/ruby-ng -y
|
||||
sudo apt-get install -y build-essential resolvconf ruby-full gem
|
||||
gem install chef -v 17.10.0
|
||||
|
||||
fi
|
||||
|
||||
if ! which berks >/dev/null; then
|
||||
@@ -90,7 +92,8 @@ Vagrant.configure("2") do |config|
|
||||
SHELL
|
||||
|
||||
config.vm.provision 'chef_solo' do |chef|
|
||||
chef.version = '14.12.3' # version 14.12.9 fails to run
|
||||
chef.arguments = "--chef-license accept"
|
||||
# chef.version = '15.7.31' # version 14.12.9 fails to run
|
||||
chef.cookbooks_path = [
|
||||
'ops/cookbooks/',
|
||||
'ops/cookbooks/vendor/'
|
||||
@@ -111,7 +114,7 @@ Vagrant.configure("2") do |config|
|
||||
'nodejs': {
|
||||
'working-dir': 'nodejs',
|
||||
'port': '3000',
|
||||
'install_version': 13,
|
||||
'install_version': 18,
|
||||
'exec_file': 'bin/www',
|
||||
'service': true,
|
||||
},
|
||||
|
||||
@@ -28,6 +28,8 @@ User.add = async function(data) {
|
||||
data['backing'] = data['backing'] || 'redis';
|
||||
|
||||
|
||||
console.log('set password', data)
|
||||
|
||||
return this.__proto__.add(data);
|
||||
|
||||
}catch(error){
|
||||
@@ -104,17 +106,18 @@ module.exports = {User};
|
||||
|
||||
|
||||
(async function(){
|
||||
var defaultUser = 'proxyadmin2'
|
||||
try{
|
||||
await User.get('proxyadmin1');
|
||||
console.info('proxyadmin1 user exists');
|
||||
let user = await User.get(defaultUser);
|
||||
|
||||
}catch(error){
|
||||
try{
|
||||
let user = await User.add({
|
||||
username:'proxyadmin1',
|
||||
password: 'proxyadmin1',
|
||||
created_by:'proxyadmin1'
|
||||
username:defaultUser,
|
||||
password: defaultUser,
|
||||
created_by:defaultUser
|
||||
});
|
||||
console.log('proxyadmin1 created', user);
|
||||
console.log(defaultUser, 'created', user);
|
||||
}catch(error){
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
Generated
+594
-563
File diff suppressed because it is too large
Load Diff
+2
-3
@@ -12,14 +12,13 @@
|
||||
"start": "node ./bin/www"
|
||||
},
|
||||
"dependencies": {
|
||||
"authenticate-pam": "github:WeiAnAn/node-authenticate-pam",
|
||||
"bcrypt": "^5.0.0",
|
||||
"ejs": "^3.0.1",
|
||||
"express": "~4.16.1",
|
||||
"express": "^4.18.2",
|
||||
"extend": "^3.0.2",
|
||||
"ldapts": "^2.2.1",
|
||||
"linux-sys-user": "^1.1.0",
|
||||
"redis": "^2.8.0"
|
||||
"redis": "^4.6.5"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+12
-14
@@ -5,21 +5,19 @@ const config = {
|
||||
prefix: 'proxy_'
|
||||
}
|
||||
|
||||
function client() {
|
||||
return createClient(config);
|
||||
}
|
||||
var _client = createClient(config);
|
||||
_client.connect()
|
||||
|
||||
const _client = client();
|
||||
|
||||
module.exports = {
|
||||
client: client,
|
||||
HGET: promisify(_client.HGET).bind(_client),
|
||||
HDEL: promisify(_client.HDEL).bind(_client),
|
||||
SADD: promisify(_client.SADD).bind(_client),
|
||||
SREM: promisify(_client.SREM).bind(_client),
|
||||
DEL: promisify(_client.DEL).bind(_client),
|
||||
HSET: promisify(_client.HSET).bind(_client),
|
||||
HGETALL: promisify(_client.HGETALL).bind(_client),
|
||||
SMEMBERS: promisify(_client.SMEMBERS).bind(_client),
|
||||
RENAME: promisify(_client.RENAME).bind(_client),
|
||||
client: _client,
|
||||
// HGET: promisify(_client.HGET).bind(_client),
|
||||
// HDEL: promisify(_client.HDEL).bind(_client),
|
||||
// SADD: promisify(_client.SADD).bind(_client),
|
||||
// SREM: promisify(_client.SREM).bind(_client),
|
||||
// DEL: promisify(_client.DEL).bind(_client),
|
||||
// HSET: promisify(_client.HSET).bind(_client),
|
||||
// HGETALL: promisify(_client.HGETALL).bind(_client),
|
||||
// SMEMBERS: promisify(_client.SMEMBERS).bind(_client),
|
||||
// RENAME: promisify(_client.RENAME).bind(_client),
|
||||
};
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const client = require('../utils/redis');
|
||||
const {createClient} = require('redis');
|
||||
const objValidate = require('../utils/object_validate');
|
||||
|
||||
var client = createClient({});
|
||||
client.connect()
|
||||
|
||||
|
||||
let table = {};
|
||||
|
||||
@@ -20,7 +23,7 @@ table.get = async function(data){
|
||||
let res = await client.HGETALL(`${this._name}_${data[this._key]}`);
|
||||
|
||||
// If the redis query resolved to something, prepare the data.
|
||||
if(res){
|
||||
if(Object.keys(res).length){
|
||||
|
||||
// Redis always returns strings, use the keyMap schema to turn them
|
||||
// back to native values.
|
||||
@@ -106,12 +109,13 @@ table.add = async function(data, noMemberAdd){
|
||||
|
||||
// Add the values for this entry.
|
||||
for(let key of Object.keys(data)){
|
||||
await client.HSET(`${this._name}_${data[this._key]}`, key, data[key]);
|
||||
await client.hSet(`${this._name}_${data[this._key]}`, key, String(data[key]));
|
||||
}
|
||||
|
||||
// return the created redis entry as entry instance.
|
||||
return await this.get(data[this._key]);
|
||||
} catch(error){
|
||||
console.error('redis model | table.add:', error)
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="targetssl" id="targetssl-true" value="true">
|
||||
Proxt to HTTPS
|
||||
Proxy to HTTPS
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
|
||||
Reference in New Issue
Block a user