Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
22ce998
Allow crated users to login
wmantly Feb 13, 2018
eca2713
Added getting groups A user is in.
wmantly Feb 13, 2018
45a99ff
Update package.json
wmantly Feb 13, 2018
aa49eee
Added getUserGroups to API docs
wmantly Feb 13, 2018
55a2f0e
added method to verify SSH public key
wmantly Feb 14, 2018
2fecb0a
Added doc for verify ssh key
wmantly Feb 14, 2018
c003fe5
Update README.md
wmantly Feb 14, 2018
dcbb30a
uped version
wmantly Feb 14, 2018
99f0355
can now add ssh keys to users
wmantly Feb 14, 2018
48b72f0
Update README.md
wmantly Feb 14, 2018
2d8c68f
Update package.json
wmantly Feb 14, 2018
d039f75
Update user.js
wmantly Feb 14, 2018
0b7eb5d
Update package.json
wmantly Feb 14, 2018
9e94bdd
promises
wmantly Feb 14, 2018
1a1544e
MD fix
wmantly Feb 14, 2018
784632b
Update README.md
wmantly Feb 14, 2018
6399df7
uped npm version
wmantly Feb 14, 2018
6adb2fe
Update README.md
wmantly Feb 14, 2018
d501188
removed is-root package
wmantly Feb 14, 2018
aee2308
removed is-root package and uped NPM version
wmantly Feb 14, 2018
6e570ef
Merge branch 'master' of https://github.com/wmantly/linux-user
wmantly Feb 14, 2018
3cbdba5
updated LRU cache
wmantly Feb 14, 2018
ccdcc39
Added tests to package.json
scriptcoded Nov 3, 2018
aba08f5
Added yarn.lock
scriptcoded Nov 3, 2018
f3bdb35
Modified username regex to allow hyphens inside username
scriptcoded Nov 3, 2018
545860e
Added .vscode to .gitignore
scriptcoded Nov 3, 2018
75aca54
Added import of should to tests
scriptcoded Nov 3, 2018
0a0ee4b
updates dependinces
wmantly Mar 8, 2019
0c27086
upped version
wmantly Mar 8, 2019
df0531c
fixed code for new version of LRU cache
wmantly Mar 8, 2019
7e46a51
upped version
wmantly Mar 8, 2019
d3e0b52
Merge pull request #1 from scriptcoded/master
wmantly May 20, 2019
c6c05a1
NPM audit
wmantly Aug 28, 2019
26e67cd
Merge pull request #2 from wmantly/secutiy_fix
wmantly Aug 28, 2019
d0774d0
removed instanbul
wmantly Aug 28, 2019
4bac8cf
removed test coverage tool
wmantly Aug 28, 2019
e2ade17
Merge pull request #3 from wmantly/secutiy_fix
wmantly Aug 28, 2019
4352f32
version update
wmantly Aug 28, 2019
660bc75
added more user commands
wmantly Aug 28, 2019
dcf34de
added more user commands
wmantly Aug 28, 2019
9d84293
updated tests
wmantly Aug 28, 2019
7ae5493
updates MD formating
wmantly Aug 28, 2019
94ce2f7
Merge pull request #4 from wmantly/shell
wmantly Aug 28, 2019
ad91adf
same usage as old version
wmantly Aug 29, 2019
a658fe9
removed lur package
wmantly Aug 29, 2019
07d33ae
Merge pull request #5 from wmantly/remove-cahce
wmantly Aug 29, 2019
e0cd436
updated lock file
wmantly Aug 29, 2019
67b8af9
Merge pull request #6 from wmantly/remove-cache
wmantly Aug 29, 2019
f21ee96
removed bluebird
wmantly Sep 2, 2019
169d83a
Merge pull request #7 from wmantly/promise
wmantly Sep 2, 2019
4484b0b
fixed support for es5
wmantly Sep 2, 2019
bbdad73
format error
wmantly Sep 2, 2019
09ecb95
updated readme and version
wmantly Sep 2, 2019
ce1ce82
fixed readme
wmantly Sep 2, 2019
abcc0ee
Merge pull request #8 from wmantly/es5
wmantly Sep 3, 2019
abedfa4
Update README.md
wmantly Dec 23, 2019
6a9b546
fixed issue with promise
wmantly Dec 23, 2019
218004d
fixed issue with promise
wmantly Dec 23, 2019
396c546
Merge pull request #9 from wmantly/promise-fix
wmantly Dec 23, 2019
40ae515
Update promise.js
Samuel-Martineau Jan 26, 2020
c592280
Merge pull request #10 from Samuel-Martineau/patch-1
wmantly Jan 30, 2020
2a10796
fixed password
wmantly Apr 9, 2020
23ed411
fixed NPM audit issue
wmantly Apr 9, 2020
59671d2
Merge pull request #11 from wmantly/password-fix
wmantly Apr 9, 2020
b1a1b3b
Bump lodash from 4.17.15 to 4.17.19
dependabot[bot] Aug 3, 2020
6b2ffa1
Merge pull request #12 from wmantly/dependabot/npm_and_yarn/lodash-4.…
wmantly Aug 14, 2020
77efc60
Add other_args parameter to addUser
rallias Jan 11, 2022
dc7a3d8
Enable other_args to be an array value.
rallias Jan 13, 2022
3dd433c
Create codeql-analysis.yml
wmantly Apr 15, 2022
f60720d
Added nyc output to gitignore
wmantly Apr 15, 2022
a503786
Moved exec to spawn
wmantly Apr 15, 2022
44d301d
Added tests for SSH keys and user add options
wmantly Apr 15, 2022
fac3d9c
updated NPM packages
wmantly Apr 15, 2022
b02f0df
updated NPM packages
wmantly Apr 15, 2022
dca4654
Merge pull request #20 from wmantly/security-fix
wmantly Apr 15, 2022
3d665f7
Changed version
wmantly Apr 15, 2022
8b5102f
Added expiration for #17
wmantly Apr 16, 2022
38f75ac
upped package version
wmantly Apr 16, 2022
d95d120
Merge pull request #21 from wmantly/feature/expire
wmantly Apr 16, 2022
758dbe2
Merge pull request #16 from rallias/master
wmantly Apr 16, 2022
d271567
upped package version
wmantly Apr 16, 2022
a5c59c0
updated NPM packages
wmantly Dec 29, 2022
f284f6e
Added test for user expiration
wmantly Dec 29, 2022
437c4e4
fixed issue #22
wmantly Dec 29, 2022
cccb8b8
updated docs on expiration
wmantly Dec 29, 2022
8b18ab7
Added warning for when module is not ran as root
wmantly Dec 29, 2022
eb0b453
Merge pull request #23 from wmantly/userExpiration_fix
wmantly Dec 29, 2022
4528156
fixed MD formating and added a note on root user
wmantly Dec 29, 2022
76de3ae
fixed MD formating
wmantly Dec 29, 2022
0010058
able to pass a Date obj as expiredate in addUser
AmyrAhmady Jun 27, 2023
04ebed7
add typescript declarations
AmyrAhmady Jun 27, 2023
4cc45b2
update package-lock.json
AmyrAhmady Jun 27, 2023
f1347b5
use "prettier" formatter to format js files
AmyrAhmady Jun 27, 2023
a6966d7
make shell argument optional
AmyrAhmady Jul 2, 2023
3385eb1
Bump @babel/traverse from 7.20.10 to 7.23.2
dependabot[bot] Oct 18, 2023
29edcbf
Merge pull request #25 from wmantly/dependabot/npm_and_yarn/babel/tra…
wmantly Oct 21, 2023
9de6e7e
dumped versions
wmantly Oct 25, 2023
44c1f64
dumped versions
wmantly Oct 25, 2023
db64463
dumped versions
wmantly Oct 25, 2023
c11d6c0
Merge branch 'master' into master
wmantly Jan 9, 2024
288f72c
Merge pull request #24 from AmyrAhmady/master
wmantly Jan 9, 2024
8a82298
1.2.0
wmantly Jan 9, 2024
612a28f
Merge pull request #26 from wmantly/package-update
wmantly Jan 9, 2024
ed6f05a
Add GitHub Pages workflow and documentation
wmantly Dec 31, 2025
24bc4b5
Revert "Merge pull request #26 from wmantly/package-update"
wmantly Dec 31, 2025
0cf7c0c
Merge branch 'master' into revert-pages-docs
wmantly Dec 31, 2025
a68ddc3
Merge pull request #29 from wmantly/revert-pages-docs
wmantly Dec 31, 2025
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
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.json]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.ts]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '36 16 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
51 changes: 51 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

# Allow this job to clone the repo and create a page artifact
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
coverage/
.tmp/
.git/
.vscode
.nyc_output/
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2024-01-09

### Added
- Promise support via `.promise()` method
- TypeScript definitions in `index.d.ts`
- SSH key management capabilities
- User expiration management (`getExpiration`, `setExpiration`)
- Comprehensive user and group management methods

### Changed
- Improved documentation structure
- Enhanced README with better examples and API documentation
- Added linting scripts to package.json
- Improved package.json with additional metadata

### Fixed
- Fixed `Array.isArray` usage in user.js (was incorrectly using `Arrays.isArray`)
- Added missing "use strict" to lib/promise.js
- Resolved JSHint linting errors

### Security
- Improved input validation
- Better error handling to prevent information disclosure

## [1.1.0] - Previous Release

### Added
- Basic user and group management functionality
- SSH key verification and management
- User expiration handling

## [1.0.0] - Initial Release

### Added
- User creation and removal
- Group management
- User information retrieval
- Password management
- SSH key management
73 changes: 73 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributing to linux-sys-user

Thank you for your interest in contributing to linux-sys-user! This document provides guidelines and information for contributors.

## Development Setup

1. Fork the repository
2. Clone your fork: `git clone https://github.com/your-username/linux-user.git`
3. Install dependencies: `npm install`
4. Run tests: `npm test`
5. Run linting: `npm run lint`

## Requirements

- Node.js >= 6.0.0
- Linux operating system
- Root access (for most operations)

## Code Style

- Use JSHint for code linting: `npm run lint`
- Follow existing code patterns and style
- Use meaningful variable and function names
- Add comments for complex logic

## Testing

- Write tests for new features
- Ensure all tests pass: `npm test`
- Run linting: `npm run lint`
- Test coverage: `npm run test-coverage`

**Note**: Most tests require root privileges. Some tests may fail if not running as root, which is expected behavior.

## Submitting Changes

1. Create a feature branch: `git checkout -b feature/your-feature-name`
2. Make your changes
3. Add tests for your changes
4. Ensure linting passes: `npm run lint`
5. Commit your changes: `git commit -m "Add your feature"`
6. Push to your fork: `git push origin feature/your-feature-name`
7. Submit a pull request

## Pull Request Guidelines

- Provide a clear description of the changes
- Reference any related issues
- Ensure all tests pass
- Follow the existing code style
- Add tests for new functionality

## Issues

When reporting issues, please include:

- Node.js version (`node --version`)
- Linux distribution and version
- Steps to reproduce the problem
- Expected vs actual behavior
- Any error messages

## Security

This module requires root privileges to function properly. Please be mindful of:

- Input validation and sanitization
- Secure handling of passwords and sensitive data
- Proper error handling to avoid information disclosure

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ test: install
$(MOCHA_OPTS) \
$(TESTS)

test-cov cov: install
@NODE_ENV=test node \
node_modules/.bin/istanbul cover \
./node_modules/.bin/_mocha \
--bail \
-- -u exports \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
--require should \
$(MOCHA_OPTS) \
$(TESTS)

test-all all: install jshint test cov

clean:
Expand Down
Loading