Skip to content

Commit e95d327

Browse files
authored
Merge pull request #266 from OpenFactorioServerManager/develop
0.10.1 release
2 parents 2d536d1 + 91fa07c commit e95d327

File tree

6 files changed

+28
-7
lines changed

6 files changed

+28
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6-
## [Unreleased]
6+
## [0.10.1] - 2021-02-10
7+
### Fixed
8+
- Single admin user can no longer be deleted (so there is always a user)
9+
- fixed incompatibility to glibc 2.32 by linking dynamic on linux
10+
- Moved from alpine to ubuntu docker image base, to prevent factorio not running correctly
711

812
## [0.10.0] - 2021-02-10
913
### Added

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ factorio-server-manager-linux:
2828
@echo "Building Backend - Linux"
2929
@mkdir -p factorio-server-manager
3030
@cd src; \
31-
CGO_ENABLED=1 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -ldflags="-extldflags=-static" -o ../factorio-server-manager/factorio-server-manager .
31+
CGO_ENABLED=1 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o ../factorio-server-manager/factorio-server-manager .
3232

3333
factorio-server-manager-windows:
3434
@echo "Building Backend - Windows"

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Glibc is required for Factorio Server binaries to run
2-
FROM frolvlad/alpine-glibc
2+
FROM ubuntu
33

44
ENV FACTORIO_VERSION=stable \
5-
MANAGER_VERSION=0.10.0 \
5+
MANAGER_VERSION=0.10.1 \
66
RCON_PASS=""
77

88
VOLUME /opt/fsm-data /opt/factorio/saves /opt/factorio/mods /opt/factorio/config
99

1010
EXPOSE 80/tcp 34197/udp
1111

12-
RUN apk add --no-cache curl tar xz unzip jq
12+
RUN apt-get update && apt-get install -y curl tar xz unzip jq && rm -rf /var/lib/apt/lists/*
1313

1414
WORKDIR /opt
1515

docker/Dockerfile-local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Glibc is required for Factorio Server binaries to run
2-
FROM frolvlad/alpine-glibc
2+
FROM ubuntu
33

44
ENV FACTORIO_VERSION=latest \
55
RCON_PASS=""
@@ -8,7 +8,7 @@ VOLUME /opt/fsm-data /opt/factorio/saves /opt/factorio/mods /opt/factorio/config
88

99
EXPOSE 80/tcp 34197/udp
1010

11-
RUN apk add --no-cache curl tar xz unzip jq
11+
RUN apt-get update && apt-get install -y curl tar xz-utils unzip jq && rm -rf /var/lib/apt/lists/*
1212

1313
WORKDIR /opt
1414

src/api/auth.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package api
22

33
import (
44
"encoding/base64"
5+
"errors"
56
"log"
67
"net/http"
78

@@ -102,6 +103,21 @@ func (a *Auth) checkPassword(username, password string) error {
102103
}
103104

104105
func (a *Auth) deleteUser(username string) error {
106+
adminUsers := []User{}
107+
adminQuery := a.db.Find(&User{}).Where(&User{Role: "admin"}).Find(&adminUsers)
108+
if adminQuery.Error != nil {
109+
log.Printf("Error retrieving admin user list from database: %s", adminQuery.Error)
110+
return adminQuery.Error
111+
}
112+
113+
for _, user := range adminUsers {
114+
if user.Username == username {
115+
if adminQuery.RowsAffected == 1 {
116+
return errors.New("cannot delete single admin user")
117+
}
118+
}
119+
}
120+
105121
result := a.db.Model(&User{}).Where(&User{Username: username}).Delete(&User{})
106122
if result.Error != nil {
107123
log.Printf("Error deleting user from database: %s", result.Error)

src/factorio/saves.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func CreateSave(filePath string) (string, error) {
7676
cmdOutput, err := exec.Command(config.FactorioBinary, args...).Output()
7777
if err != nil {
7878
log.Printf("Error in creating Factorio save: %s", err)
79+
log.Println(string(cmdOutput))
7980
return "", err
8081
}
8182

0 commit comments

Comments
 (0)