mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-27 02:43:45 +02:00
updated dockerfiles aka. removed all configurable user credentials
This commit is contained in:
parent
f3f4d76e18
commit
7e9864cc69
@ -1,5 +1,3 @@
|
||||
ADMIN_USER=admin
|
||||
ADMIN_PASS=factorio
|
||||
RCON_PASS=
|
||||
COOKIE_ENCRYPTION_KEY=
|
||||
DOMAIN_NAME=<YOUR DOMAIN NAME>
|
||||
|
@ -3,10 +3,7 @@ FROM frolvlad/alpine-glibc
|
||||
|
||||
ENV FACTORIO_VERSION=stable \
|
||||
MANAGER_VERSION=0.9.0 \
|
||||
ADMIN_USER=admin \
|
||||
ADMIN_PASS=factorio \
|
||||
RCON_PASS="" \
|
||||
COOKIE_ENCRYPTION_KEY=""
|
||||
RCON_PASS=""
|
||||
|
||||
VOLUME /opt/fsm-data /opt/factorio/saves /opt/factorio/mods /opt/factorio/config
|
||||
|
||||
|
@ -2,10 +2,7 @@
|
||||
FROM frolvlad/alpine-glibc
|
||||
|
||||
ENV FACTORIO_VERSION=latest \
|
||||
ADMIN_USER=admin \
|
||||
ADMIN_PASS=factorio \
|
||||
RCON_PASS="" \
|
||||
COOKIE_ENCRYPTION_KEY=""
|
||||
RCON_PASS=""
|
||||
|
||||
VOLUME /opt/fsm-data /opt/factorio/saves /opt/factorio/mods /opt/factorio/config
|
||||
|
||||
|
@ -6,10 +6,7 @@ services:
|
||||
restart: "unless-stopped"
|
||||
environment:
|
||||
- "FACTORIO_VERSION=latest"
|
||||
- "ADMIN_USER"
|
||||
- "ADMIN_PASS"
|
||||
- "RCON_PASS"
|
||||
- "COOKIE_ENCRYPTION_KEY"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "34197:34197/udp"
|
||||
|
@ -6,10 +6,7 @@ services:
|
||||
restart: "unless-stopped"
|
||||
environment:
|
||||
- "FACTORIO_VERSION=latest"
|
||||
- "ADMIN_USER"
|
||||
- "ADMIN_PASS"
|
||||
- "RCON_PASS"
|
||||
- "COOKIE_ENCRYPTION_KEY"
|
||||
volumes:
|
||||
- "./fsm-data:/opt/fsm-data"
|
||||
- "./factorio-data/saves:/opt/factorio/saves"
|
||||
|
@ -3,28 +3,13 @@
|
||||
init_config() {
|
||||
jq_cmd='.'
|
||||
|
||||
if [ -n $ADMIN_USER ]; then
|
||||
jq_cmd="${jq_cmd} | .username = \"$ADMIN_USER\""
|
||||
echo "Admin username is '$ADMIN_USER'"
|
||||
fi
|
||||
if [ -n $ADMIN_PASS ]; then
|
||||
jq_cmd="${jq_cmd} | .password = \"$ADMIN_PASS\""
|
||||
echo "Admin password is '$ADMIN_PASS'"
|
||||
fi
|
||||
echo "IMPORTANT! Please create new user and delete default admin user ASAP."
|
||||
|
||||
if [ -z $RCON_PASS ]; then
|
||||
RCON_PASS="$(random_pass)"
|
||||
fi
|
||||
jq_cmd="${jq_cmd} | .rcon_pass = \"$RCON_PASS\""
|
||||
echo "Factorio rcon password is '$RCON_PASS'"
|
||||
|
||||
if [ -z $COOKIE_ENCRYPTION_KEY ]; then
|
||||
COOKIE_ENCRYPTION_KEY="$(random_pass)"
|
||||
fi
|
||||
jq_cmd="${jq_cmd} | .cookie_encryption_key = \"$COOKIE_ENCRYPTION_KEY\""
|
||||
|
||||
jq_cmd="${jq_cmd} | .database_file = \"/opt/fsm-data/auth.leveldb\""
|
||||
jq_cmd="${jq_cmd} | .sq_lite_database_file = \"/opt/fsm-data/sqlite.db\""
|
||||
jq_cmd="${jq_cmd} | .log_file = \"/opt/fsm-data/factorio-server-manager.log\""
|
||||
|
||||
jq "${jq_cmd}" /opt/fsm/conf.json >/opt/fsm-data/conf.json
|
||||
@ -47,5 +32,5 @@ fi
|
||||
|
||||
install_game
|
||||
|
||||
cd /opt/fsm && ./factorio-server-manager --conf /opt/fsm-data/conf.json --dir /opt/factorio -port 80
|
||||
cd /opt/fsm && ./factorio-server-manager --conf /opt/fsm-data/conf.json --dir /opt/factorio --port 80
|
||||
|
||||
|
@ -109,7 +109,9 @@ func (config *Config) updateConfigFile() {
|
||||
if conf.DatabaseFile != "" {
|
||||
// Migrate leveldb to sqlite
|
||||
// set new db name
|
||||
conf.SQLiteDatabaseFile = "sqlite.db"
|
||||
// just rename the file from the old path
|
||||
dbFileDir := filepath.Dir(conf.DatabaseFile)
|
||||
conf.SQLiteDatabaseFile = filepath.Join(dbFileDir, "sqlite.db")
|
||||
|
||||
MigrateLevelDBToSqlite(conf.DatabaseFile, conf.SQLiteDatabaseFile)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user