filestash
filestash copied to clipboard
[bug] Bcrypt Hashed Password for Admin Causing AWS Deployment Issues
Description of the bug
I'm trying to setup a self hosted version of Filestash on AWS Elastic Beanstalk. I am using the bcrypt hashed admin password environment variable within the docker-compose.yml
file, to automatically set an admin password upon successful deployment. I am unable to deploy the docker-compose file with the bcrypt hash password since the $
characters in the bcrypt hash are considered invalid by elastic beanstalk.
Step by step instructions to reproduce the bug
- Create a
.ebextensions
folder within thedocker
folder offilestash
- Create a
01_multicontainer.config
within.ebextensions
file with the following value:
option_settings:
aws:elasticbeanstalk:application:environment:
COMPOSE_FILE: "docker-compose.yml"
- Let the
docker-compose
file be the following:
version: '2'
services:
app:
container_name: filestash
image: machines/filestash
restart: always
environment:
- APPLICATION_URL=
- ADMIN_PASSWORD='<bcrypt_hash_password>'
ports:
- "80:8334"
- Run
eb init
from elastic beanstalk cli (installable throughbrew
orpip
) - Run
eb create filestash-env
- For subsequent deployments, use
eb deploy
Can you replicate that error from the demo?
N/A
Observed behavior
Elastic Beanstalk Returns the following error:
An error occurred during execution of command [app-deploy] -
[Docker Specific Build Application]. Stop running the command.
Error: Command /bin/sh -c docker-compose config failed with error exit status 1.
Stderr:Invalid interpolation format for "environment" option in service
"app": "ADMIN_PASSWORD="<bcrypt_hash_password>"
Expected behavior
App should deploy as usual, with admin password already configured based on the bcrypt hash.
What I've tried
- Tried using
$$
within thedocker-compose
file to escape the$
character, but that results in a different hash. The app deploys successfully but the password is not accepted anymore. - Tried escaping with
\$
- but deployment fails - Tried setting the environment variable for
ADMIN_PASSWORD
directly through elastic beanstalk environment and plugged in to the filestash app on deployment, but that doesn't work either.
The main reason this is a problem is because upon subsequent deployments of elastic beanstalk, the filestash app restarts and requests a new admin password to be set upon redeployment.
P.S
- I think you've made a great open source application, so kudos and many thanks
- Since this is clearly more of an elastic beanstalk issue than a filestash issue, I understand if that's not under your purview. I would still appreciate any tips for trial and error.