Skip to content

Commit

Permalink
Merge pull request #6 from 0neTX/dev
Browse files Browse the repository at this point in the history
feat:Enable output log to file
  • Loading branch information
0neTX authored Jan 30, 2024
2 parents ba7799d + c39b863 commit 32af0e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The following are created by the docker image:
services:
bw-export:
container_name: bw-export
image: bw-export
image: 0netx/bw-export:latest
volumes:
- ./export:/var
environment:
Expand All @@ -71,6 +71,8 @@ The following are created by the docker image:
# Optional: Map the container's internal user to a user on the host machine
# - PUID=1000
# - PGID=1000
# Optional: Execution logging file. Please check output path is mapping inside a volume
# - FILE_LOG=/var/data/bw-export-logfile.log
```

* Configure each required variable and volumes.
Expand Down
7 changes: 3 additions & 4 deletions docker-compose.secrets.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ services:
bw-export:
container_name: bw-export
tty: true
image: bw-export
build:
context: .
dockerfile: ./Dockerfile
image: 0netx/bw-export:latest
volumes:
- D:\_ROOT\repos_my_devops\Bitwarden_Export\export:/var
environment:
Expand All @@ -21,6 +18,8 @@ services:
# - OUTPUT_PATH=<Output path i.e. /var/data/ >
# Optional: By default, /var/attachment/
# - ATTACHMENTS_PATH=<attachment path i.e. /var/attachment/ >
# Optional: Execution logging file. Please check output path is mapping inside a volume
# - FILE_LOG=/var/data/bw-export-logfile.log
secrets:
- bwclientid
- bwsecret
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
bw-export:
container_name: bw-export
image: bw-export
image: 0netx/bw-export:latest
volumes:
- ./export:/var/data
- ./export:/var/attachment
Expand All @@ -18,4 +18,6 @@ services:
- EXPORT_PASSWORD=<Export password. Export will be encrypted with this password>
# Optional: If not provided, the service will export all organizations in vault.
# - BW_ORGANIZATIONS_LIST=<Organization list id, comma separated>
# Optional: Execution logging file. Please check output path is mapping inside a volume
# - FILE_LOG=/var/data/bw-export-logfile.log

9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env bash
/etc/cont-init.d/10-adduser
su bitwarden -c /app/bw_export.sh

Cyan='\033[0;36m' # Cyan
if [[ -z "${FILE_LOG}" ]]; then
su bitwarden -c /app/bw_export.sh
else
echo -e "\n${Cyan}Output log enabled: $FILE_LOG "
su bitwarden -c /app/bw_export.sh 2>&1 | tee $FILE_LOG
fi

0 comments on commit 32af0e1

Please sign in to comment.