infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
4.72k stars 875 forks source link

Problems with docker-compose #451

Closed ghost closed 1 year ago

ghost commented 1 year ago

Docker-compose The easiest way to get faraday up and running is using our docker-compose

I followed the demonstration on the homepage wget https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml docker-compose up

But I've run into some problems eg: faraday_app | mv: cannot move '/server.ini' to '/home/faraday/.faraday/config/.': No such file or directory

Snipaste_2022-08-06_19-31-24

I have not changed any information in the yaml file How do I need to fix it? thanks

ghost commented 1 year ago

I tried to use docke pull, but the problem is the same as above.

docker run -d \ --name postgres \ -v /home/trapshell/docker-date/postgres/:/var/lib/postgresql/data \ -p 5432:5432 \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ -e POSTGRES_DB=faraday_db \ postgres

docker run \ -v /home/trapshell/docker-date/faraday/:/home/faraday/.faraday \ -p 5985:5985 \ -e PGSQL_USER='postgres' \ -e PGSQL_PASSWD='postgres' \ -e PGSQL_DBNAME='faraday_db' \ faradaysec/faraday:latest

Snipaste_2022-08-06_20-51-24
ghost commented 1 year ago

server.ini It looks like it's missing from the faraday docker Is it a problem with me? Or what is the problem?

ezk06eer commented 1 year ago

Hi @Trapshell , sorry about the inconvenience, you need to start over, please remove all the volumes, images, and the contents of ~/{your-user/.faraday

it seems you have an old image of faraday.

please share the docker-compose startup logs.

in advance try this:

The commands:

mkdir /tmp/faraday
cp /home/$(whoami)/.faraday /tmp/faraday/
rm -rf /home/$(whoami)/.faraday
docker-compose down
docker rmi $(docker images -q) ## remove all the images.
docker kill $(docker ps -q) #this will kill all the docker instances you have up, check if you have something besides faraday that you dont want to stop.
docker rm $(docker ps -a -q) ###this will remove *ALL* the containers you have running, run it wisely, if you have other containers don't run it like this
docker volume rm $(docker volume ls -q) ### this will also destroy any volume that can be up.

cd ~
wget https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml
docker-compose up

please share the logs again to us. Cheers!

ezk06eer commented 1 year ago

in Addition, this is what it lookslike right now for a clean install.

esteban@neptuno-b  ~  wget https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml
docker-compose up
--2022-08-06 15:02:47--  https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 827 [text/plain]
Saving to: ‘docker-compose.yaml’

docker-compose.yaml                               100%[=============================================================================================================>]     827  --.-KB/s    in 0s

2022-08-06 15:02:47 (14.3 MB/s) - ‘docker-compose.yaml’ saved [827/827]

WARNING: Found multiple config files with supported names: docker-compose.yaml, compose.yaml
WARNING: Using docker-compose.yaml

Creating volume "esteban_db" with local driver
Creating faraday_db    ... done
Creating faraday_redis ... done
Creating faraday_app   ... done
Attaching to faraday_redis, faraday_db, faraday_app
faraday_db | The files belonging to this database system will be owned by user "postgres".
faraday_db | This user must also own the server process.
faraday_db |
faraday_redis | 1:C 06 Aug 2022 18:02:49.970 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
faraday_redis | 1:C 06 Aug 2022 18:02:49.970 # Redis version=6.2.7, bits=64, commit=00000000, modified=0, pid=1, just started
faraday_redis | 1:C 06 Aug 2022 18:02:49.970 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
faraday_db | The database cluster will be initialized with locale "en_US.utf8".
faraday_db | The default database encoding has accordingly been set to "UTF8".
faraday_redis | 1:M 06 Aug 2022 18:02:49.971 * monotonic clock: POSIX clock_gettime
faraday_db | The default text search configuration will be set to "english".
faraday_db |
faraday_db | Data page checksums are disabled.
faraday_db |
faraday_redis | 1:M 06 Aug 2022 18:02:49.974 # A key '__redis__compare_helper' was added to Lua globals which is not on the globals allow list nor listed on the deny list.
faraday_db | fixing permissions on existing directory /var/lib/postgresql/data ... ok
faraday_redis | 1:M 06 Aug 2022 18:02:49.975 * Running mode=standalone, port=6379.
faraday_redis | 1:M 06 Aug 2022 18:02:49.975 # Server initialized
faraday_redis | 1:M 06 Aug 2022 18:02:49.976 * Ready to accept connections
faraday_db | creating subdirectories ... ok
faraday_db | selecting dynamic shared memory implementation ... posix
faraday_db | selecting default max_connections ... 100
faraday_db | selecting default shared_buffers ... 128MB
faraday_db | selecting default time zone ... UTC
faraday_db | creating configuration files ... ok
faraday_db | running bootstrap script ... ok
faraday_app | Sat Aug  6 18:02:50 UTC 2022 Creating server.ini
faraday_app | Waiting for postgres on db
faraday_db | performing post-bootstrap initialization ... sh: locale: not found
faraday_db | 2022-08-06 18:02:50.718 UTC [30] WARNING:  no usable system locales were found
faraday_db | ok
faraday_db | syncing data to disk ... ok
faraday_db |
faraday_db |
faraday_db | Success. You can now start the database server using:
faraday_db |
faraday_db |     pg_ctl -D /var/lib/postgresql/data -l logfile start
faraday_db |
faraday_db | initdb: warning: enabling "trust" authentication for local connections
faraday_db | You can change this by editing pg_hba.conf or using the option -A, or
faraday_db | --auth-local and --auth-host, the next time you run initdb.
faraday_db | waiting for server to start....2022-08-06 18:02:51.425 UTC [35] LOG:  starting PostgreSQL 12.7 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
faraday_db | 2022-08-06 18:02:51.426 UTC [35] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
faraday_db | 2022-08-06 18:02:51.439 UTC [36] LOG:  database system was shut down at 2022-08-06 18:02:51 UTC
faraday_db | 2022-08-06 18:02:51.442 UTC [35] LOG:  database system is ready to accept connections
faraday_db |  done
faraday_db | server started
faraday_db | CREATE DATABASE
faraday_db |
faraday_db |
faraday_db | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
faraday_db |
faraday_db | waiting for server to shut down...2022-08-06 18:02:51.656 UTC [35] LOG:  received fast shutdown request
faraday_db | .2022-08-06 18:02:51.657 UTC [35] LOG:  aborting any active transactions
faraday_db | 2022-08-06 18:02:51.658 UTC [35] LOG:  background worker "logical replication launcher" (PID 42) exited with exit code 1
faraday_db | 2022-08-06 18:02:51.658 UTC [37] LOG:  shutting down
faraday_db | 2022-08-06 18:02:51.668 UTC [35] LOG:  database system is shut down
faraday_db |  done
faraday_db | server stopped
faraday_db |
faraday_db | PostgreSQL init process complete; ready for start up.
faraday_db |
faraday_db | 2022-08-06 18:02:51.790 UTC [1] LOG:  starting PostgreSQL 12.7 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
faraday_db | 2022-08-06 18:02:51.791 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
faraday_db | 2022-08-06 18:02:51.791 UTC [1] LOG:  listening on IPv6 address "::", port 5432
faraday_db | 2022-08-06 18:02:51.800 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
faraday_db | 2022-08-06 18:02:51.821 UTC [49] LOG:  database system was shut down at 2022-08-06 18:02:51 UTC
faraday_db | 2022-08-06 18:02:51.825 UTC [1] LOG:  database system is ready to accept connections
faraday_app | Sat Aug  6 18:02:52 UTC 2022 Creating tables on database faraday...
faraday_app | Creating tables
faraday_app | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
faraday_app | INFO  [alembic.runtime.migration] Will assume transactional DDL.
faraday_app | INFO  [alembic.runtime.migration] Running stamp_revision  -> 99a740945c44
faraday_app | Tables created successfully!
faraday_app | Sat Aug  6 18:02:57 UTC 2022 Creating superuser...
faraday_app | User faraday created successfully!
faraday_app | Admin user created with username: faraday password: 5ddbQQ]quC-+d
faraday_app | Sat Aug  6 18:02:59 UTC 2022 Running migrations ...
faraday_app | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
faraday_app | INFO  [alembic.runtime.migration] Will assume transactional DDL.
faraday_app | Sat Aug  6 18:03:02 UTC 2022 Starting application...
faraday_app | 2022-08-06T18:03:03+0000 - alembic.runtime.migration - INFO {MainThread} [pid:40] [migration.py:204 - __init__()]  Context impl PostgresqlImpl.
faraday_app | 2022-08-06T18:03:03+0000 - alembic.runtime.migration - INFO {MainThread} [pid:40] [migration.py:207 - __init__()]  Will assume transactional DDL.
faraday_app | 2022-08-06T18:03:03+0000 - faraday.start_server - WARNING {MainThread} [pid:40] [start_server.py:53 - check_postgresql()]  No workspaces found
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.web - INFO {MainThread} [pid:40] [web.py:87 - __init__()]  Starting web server at http://0.0.0.0:5985/
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.threads.reports_processor - INFO {ReportsManager-Thread} [pid:40] [reports_processor.py:100 - run()]  Reports Manager Thread [Start]
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.threads.ping_home - INFO {PingHomeThread} [pid:40] [ping_home.py:18 - run()]  Ping Home Thread [Start]
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.web - INFO {MainThread} [pid:40] [web.py:155 - run()]  Starting webserver with 8 threads.
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.web - INFO {MainThread} [pid:40] [web.py:105 - __build_websockets_resource()]  Starting websocket server at port 9000 with bind address 0.0.0.0.
faraday_app | 2022-08-06T18:03:03+0000 - faraday.server.web - INFO {MainThread} [pid:40] [web.py:164 - run()]  Faraday Server is ready
ghost commented 1 year ago

docker run --name faraday \ -v $HOME/.faraday:/home/faraday/.faraday \ -p 5985:5985 \ -e PGSQL_USER='postgres' \ -e PGSQL_PASSWD='postgres' \ -e PGSQL_DBNAME='faraday_db' \ faradaysec/faraday:latest mv: cannot move '/server.ini' to '/home/faraday/.faraday/config/.': No such file or directory Restoring config file

docker logs -f faraday mv: cannot move '/server.ini' to '/home/faraday/.faraday/config/.': No such file or directory Restoring config file

mv: cannot move '/server.ini' to '/home/faraday/.faraday/config/.': No such file or directory

Thank you for your reply But that doesn't solve the problem :( I have tried to delete all data completely

ghost commented 1 year ago

@ezk06eer I followed the home page docker instructions exactly, but unfortunately, I still encountered the same problem. I am using the method of docker pull

aenima-x commented 1 year ago

@Trapshell that "restoring config file" message is old, you are not using the latest image.

Can you show me the output of docker image ls

ghost commented 1 year ago

I use this commanddocker pull faradaysec/faraday:latest @aenima-x

aenima-x commented 1 year ago

@Trapshell ok but show me the output, because it make no sense that you see that message

ghost commented 1 year ago

Already solved the problem, the problem was that the database was not configured properly.

andyoulovexy commented 1 year ago

Already solved the problem, the problem was that the database was not configured properly.

I had same errors,how to solve it?tks