- numerous bug fixes
 - wtv-news goodies, ready for local testing
   - custom patched nntp-server node module with support for POSTing
   - should be able to post locally
   - 4 groups are made by default
   - can override in user_config.json (look at the config.json changes but dont do them there)
   - can sync down from an upstream server with sync_nntp.js
   - sync does not push new posts to upstream yet
This commit is contained in:
zefie
2022-10-11 21:44:18 -04:00
parent 1165b245ce
commit b89e0e932c
181 changed files with 4333 additions and 688 deletions

View File

@@ -24,7 +24,6 @@ class WTVRegister {
checkUsernameSanity(username) {
var regex_str = "^([A-Za-z0-9\-\_]{" + this.minisrv_config.config.user_accounts.min_username_length + "," + this.minisrv_config.config.user_accounts.max_username_length + "})$";
var regex = new RegExp(regex_str);
console.log(username, username.length, regex.test(username));
return regex.test(username);
}
@@ -37,12 +36,14 @@ class WTVRegister {
if (directory) search_dir = directory;
this.fs.readdirSync(search_dir).forEach(file => {
if (self.fs.lstatSync(search_dir + self.path.sep + file).isDirectory() && !return_val) {
return_val = self.checkUsernameAvailable(username, search_dir + self.path.sep + file);
if (search_dir.match(/minisrv\_internal\_nntp/)) return;
return_val = !self.checkUsernameAvailable(username, search_dir + self.path.sep + file);
}
if (!file.match(/.*\.json/ig)) return;
if (!file.match(/user.*\.json/ig)) return;
try {
var temp_session_data_file = self.fs.readFileSync(search_dir + self.path.sep + file, 'Utf8');
var temp_session_data = JSON.parse(temp_session_data_file);
console.log(temp_session_data.subscriber_username.toLowerCase());
if (temp_session_data.subscriber_username.toLowerCase() == username.toLowerCase()) {
return_val = true;
}