Skip to content

Commit

Permalink
feat: remove host resolution (#143)
Browse files Browse the repository at this point in the history
* fix: correctly try additional ports on EADDRINUSE

* feat: remove passive url host resoltion

See: #139

* feat: require pasv url to be specified

* fix(pasv): check for set pasv url

* chore: update scripts

* fix(cli): remove undefined values

* chore: add cli to eslint verify

* chore: run eslint

* chore: update scripts

* feat: add maximum number of retries to port selection

* chore: simplify eslint config

* chore: simplify dev dependencies

* chore: generate contributors

* chore: update readme contributors
  • Loading branch information
trs authored Feb 21, 2019
1 parent 03ff982 commit 36f331d
Show file tree
Hide file tree
Showing 26 changed files with 2,144 additions and 1,638 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ base-build: &base-build
- node_modules
- run:
name: Lint
command: npm run verify:js
command: npm run verify
- run:
name: Test
command: npm run test:once
command: npm run test

jobs:
test_node_10:
Expand Down
7 changes: 0 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
# START_CONFIT_GENERATED_CONTENT
# Common folders to ignore
node_modules/*
bower_components/*

# Config folder (optional - you might want to lint this...)
config/*

# END_CONFIT_GENERATED_CONTENT
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test_tmp/

node_modules/

dist/
reports/
npm-debug.log
.nyc_output/
test_tmp/
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@

- Any new fixes are features should include new or updated [tests](/test).
- Commits follow the [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit), please review and commit accordingly
- Submit your pull requests to the `master` branch, these will normally be merged into a seperate branch for any finally changes before being merged into `master`.
- Submit any bugs or requests to the issues page in Github.
- Submit your pull requests to the `master` branch, these will normally be merged into a separate branch for any finally changes before being merged into `master`.
- Submit any bugs or requests to the issues page in Github.

## Setup

- Clone the repository `git clone`
- Install dependencies `npm install`
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Tyler Stewart
Copyright (c) 2019 Tyler Stewart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ connection.on('RNTO', (error, fileName) => { ... });

Occurs when a file is renamed.

`error` if successful, will be `null`
`error` if successful, will be `null`
`fileName` name of the file that was renamed

## Supported Commands
Expand Down Expand Up @@ -321,32 +321,34 @@ __Used in:__ `SITE CHMOD`
Returns a unique file name to write to
__Used in:__ `STOU`

<!--[RM_CONTRIBUTING]-->
## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

<!--[]-->

## Contributors

- [OzairP](https://github.com/OzairP)
- [qchar](https://github.com/qchar)
- [jorinvo](https://github.com/jorinvo)
- [voxsoftware](https://github.com/voxsoftware)
- [pkeuter](https://github.com/pkeuter)
- [TimLuq](https://github.com/TimLuq)
- [edin-mg](https://github.com/edin-m)
- [crabl](https://github.com/crabl)
- [hirviid](https://github.com/hirviid)
- [DiegoRBaquero](https://github.com/DiegoRBaquero)
- [edin-m](https://github.com/edin-m)
- [voxsoftware](https://github.com/voxsoftware)
- [jorinvo](https://github.com/jorinvo)
- [Johnnyrook777](https://github.com/Johnnyrook777)
- [qchar](https://github.com/qchar)
- [mikejestes](https://github.com/mikejestes)
- [pkeuter](https://github.com/pkeuter)
- [qiansc](https://github.com/qiansc)
- [broofa](https://github.com/broofa)
- [lafin](https://github.com/lafin)
- [alancnet](https://github.com/alancnet)
- [zgwit](https://github.com/zgwit)

<!--[RM_LICENSE]-->
## License

This software is licensed under the MIT Licence. See [LICENSE](LICENSE).

<!--[]-->

## References

- [https://cr.yp.to/ftp.html](https://cr.yp.to/ftp.html)
10 changes: 7 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,15 @@ function setupState(_args) {
}

function startFtpServer(_state) {
// Remove null/undefined options so they get set to defaults, below
for (const key in _state) {
if (_state[key] === undefined) delete _state[key];
}

function checkLogin(data, resolve, reject) {
const user = _state.credentials[data.username]
if (_state.anonymous || (user && user.password === data.password)) {
return resolve({root: (user && user.root) || _state.root});
const user = _state.credentials[data.username];
if (_state.anonymous || user && user.password === data.password) {
return resolve({root: user && user.root || _state.root});
}

return reject(new errors.GeneralError('Invalid username or password', 401));
Expand Down
38 changes: 0 additions & 38 deletions config/release/commitMessageConfig.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/testUnit/mocha.opts

This file was deleted.

6 changes: 0 additions & 6 deletions config/testUnit/reporters.json

This file was deleted.

162 changes: 0 additions & 162 deletions config/verify/.eslintrc

This file was deleted.

27 changes: 27 additions & 0 deletions meta/contributors/contributors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const {get} = require('https');

get('https://api.github.com/repos/trs/ftp-srv/contributors', {
headers: {
'User-Agent': 'Chrome'
}
}, (res) => {
let response = '';
res.on('data', (data) => {
response += data;
});
res.on('end', () => {
const contributors = JSON.parse(response)
.filter((contributor) => contributor.type === 'User');

for (const contributor of contributors) {
const url = contributor.html_url;
const username = contributor.login;

const markdown = `- [${username}](${url})\n`;

process.stdout.write(markdown);
}
});
}).on('error', (err) => {
process.stderr.write(err);
});
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 36f331d

Please sign in to comment.