move files
This commit is contained in:
parent
781d56d0ff
commit
a9c798deda
11
Dockerfile
11
Dockerfile
|
@ -11,12 +11,6 @@ WORKDIR /app
|
||||||
RUN npm ci --omit=dev &&\
|
RUN npm ci --omit=dev &&\
|
||||||
mv node_modules /node_modules
|
mv node_modules /node_modules
|
||||||
|
|
||||||
# Copy script wg-password
|
|
||||||
COPY wg-password /wgpw
|
|
||||||
WORKDIR /wgpw
|
|
||||||
RUN npm i --omit=dev &&\
|
|
||||||
mv node_modules /node_modules_wg
|
|
||||||
|
|
||||||
# Copy build result to a new image.
|
# Copy build result to a new image.
|
||||||
# This saves a lot of disk space.
|
# This saves a lot of disk space.
|
||||||
FROM docker.io/library/node:20-alpine
|
FROM docker.io/library/node:20-alpine
|
||||||
|
@ -33,10 +27,7 @@ COPY --from=build_node_modules /app /app
|
||||||
COPY --from=build_node_modules /node_modules /node_modules
|
COPY --from=build_node_modules /node_modules /node_modules
|
||||||
|
|
||||||
# Copy the needed wg-password scripts
|
# Copy the needed wg-password scripts
|
||||||
COPY --from=build_node_modules /node_modules_wg /node_modules_wg
|
COPY --from=build_node_modules /app/wgpw.sh /bin/wgpw
|
||||||
COPY --from=build_node_modules /wgpw/index.mjs /wgpw/index.mjs
|
|
||||||
COPY --from=build_node_modules /wgpw/wgpw.sh /bin/wgpw
|
|
||||||
|
|
||||||
RUN chmod +x /bin/wgpw
|
RUN chmod +x /bin/wgpw
|
||||||
|
|
||||||
# Install Linux packages
|
# Install Linux packages
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
# This script is intended to be run only inside a docker container, not on the development host machine
|
# This script is intended to be run only inside a docker container, not on the development host machine
|
||||||
set -e
|
set -e
|
||||||
# proxy command
|
# proxy command
|
||||||
export NODE_PATH="/node_modules_wg"
|
node /app/wgpw.mjs "$@"
|
||||||
node /wgpw/index.mjs "$@"
|
|
|
@ -1,2 +0,0 @@
|
||||||
pnpm-lock.yaml
|
|
||||||
node_modules
|
|
|
@ -1,25 +0,0 @@
|
||||||
# wg-password
|
|
||||||
|
|
||||||
`wg-password` is a script that generates bcrypt password hashes for use with `wg-easy`, enhancing security by requiring passwords.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- Generate bcrypt password hashes.
|
|
||||||
- Easily integrate with `wg-easy` to enforce password requirements.
|
|
||||||
|
|
||||||
## Usage with Docker
|
|
||||||
|
|
||||||
To generate a bcrypt password hash using Docker, run the following command:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run ghcr.io/wg-easy/wg-easy wgpw YOUR_PASSWORD
|
|
||||||
PASSWORD_HASH='$2b$12$coPqCsPtcFO.Ab99xylBNOW4.Iu7OOA2/ZIboHN6/oyxca3MWo7fW' // litteraly YOUR_PASSWORD
|
|
||||||
```
|
|
||||||
|
|
||||||
## Important
|
|
||||||
|
|
||||||
Make sure to enclose your password in single quotes when you run a linux host and *don't use double* `$`. [See](../How_to_generate_an_bcrypt_hash.md#generating-bcrypt-hash-from-an-script-file).
|
|
||||||
|
|
||||||
## LICENSE
|
|
||||||
|
|
||||||
[wg-easy license](../LICENSE)
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"name": "wg-password",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"description": "A binary to create bcrypt password hashes for wg-easy, enhancing security.",
|
|
||||||
"main": "index.mjs",
|
|
||||||
"author": "tetuaoro <65575727+tetuaoro@users.noreply.github.com>",
|
|
||||||
"dependencies": {
|
|
||||||
"bcryptjs": "^2.4.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue