Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
57a5e4d
Merge branch 'fix-#123' into develop
knoxfighter Feb 28, 2019
9ed5146
Merge remote-tracking branch 'upstream/develop' into develop
knoxfighter Mar 2, 2019
98e7454
fixed login-page design
knoxfighter Mar 3, 2019
2b94eaf
missing login-designs
knoxfighter Mar 3, 2019
d82eb44
updated npm packages (w/o sweetalert2)
knoxfighter Mar 3, 2019
4b721bd
also updated sweetalert2
knoxfighter Mar 3, 2019
3b207fc
fixed sweetalert2 API changes
knoxfighter Mar 3, 2019
870ab38
fixed #139
knoxfighter Mar 13, 2019
1a5941d
use bootstrap-fileinput for savefile upload
knoxfighter Mar 14, 2019
30ae0a5
fixed filepaths for Windows
knoxfighter Mar 21, 2019
27a5f62
added windows-os to travis
knoxfighter Mar 21, 2019
dbcaba7
switched from path to filepath for files
knoxfighter Mar 21, 2019
f5e75dc
Merge pull request #145 from knoxfighter/fix-windows-paths
mroote Mar 24, 2019
5cbac61
Merge pull request #143 from knoxfighter/fix-139
mroote Mar 24, 2019
9ed3164
Update README.md
May 10, 2019
aeb5ab9
Merge pull request #1 from adrianvanderwal/adrianvanderwal-readme-patch
May 10, 2019
05d80e4
Update Footer.jsx
May 10, 2019
cfd0401
fix #149
knoxfighter May 10, 2019
db5dcfb
fixed hardcoded SettingsPath
knoxfighter May 12, 2019
0ab8ae4
added support for new server-adminlist
knoxfighter May 13, 2019
3abe254
moved file to config-dir & set it to factorio per parameter
knoxfighter May 13, 2019
a6bc451
only append server-adminlist, when 0.17 or newer
knoxfighter May 13, 2019
abf903a
Merge pull request #152 from knoxfighter/Bugfix/admin-server-settings
knoxfighter May 29, 2019
7a1e2d3
Merge pull request #150 from knoxfighter/Bugfix/log-path
knoxfighter May 29, 2019
3848491
Merge pull request #148 from adrianvanderwal/master
knoxfighter May 29, 2019
da1e746
fixed filepath mistake
knoxfighter May 29, 2019
91bcf5c
updated npm dependencies
knoxfighter May 29, 2019
f872345
Merge pull request #137 from knoxfighter/fix-login-page
knoxfighter May 29, 2019
844c925
Merge branch 'develop' into Feature/savefile-design
knoxfighter May 29, 2019
743aeff
fixed weird hover design
knoxfighter May 29, 2019
e9c6d69
Merge pull request #144 from knoxfighter/Feature/savefile-design
knoxfighter May 29, 2019
8e21cde
only run tip when on linux & test-removal of GOPATH
knoxfighter May 29, 2019
fc471f2
use latest v1.x to test
knoxfighter May 29, 2019
1d98925
use newest patch instead of patch 0
knoxfighter May 29, 2019
d0c266f
Merge pull request #153 from knoxfighter/Bugfix/travis_windows_tip
knoxfighter May 30, 2019
2fe4d3d
Added support for custom glibc location (RHEL/CENTOS)
Jul 24, 2019
02ce64d
Fixed logging of factorio version, removed commented line
Jul 24, 2019
759aae4
Optimised GLIBC fix, added autostart feature
Jul 26, 2019
7c05665
Removed extra log line, moving autostart feature to new development b…
Jul 30, 2019
b967f1c
Add .vscode to gitignore
mroote Aug 1, 2019
fad1021
Merge pull request #155 from Psychomantis71/master
mroote Aug 1, 2019
118cd8b
remove param
mroote Aug 1, 2019
cf3972c
Makefile: Fix app bundle dependency in zip build target
dgw Aug 6, 2019
f713161
Merge pull request #157 from dgw/makefile-bundle-fix
knoxfighter Aug 6, 2019
e7f3ce9
added missing file.Close() & some closing error handling
knoxfighter Oct 13, 2019
dfe8a65
Merge pull request #164 from knoxfighter/Bugfix/windows-filelock
mroote Oct 19, 2019
5ea4af5
added package management via go modules (go v1.11)
knoxfighter Oct 29, 2019
13a5bcf
disabled go-get installs
knoxfighter Oct 29, 2019
e42840c
set module environmental variable
knoxfighter Oct 29, 2019
fdead2a
run test in correct subdirectory
knoxfighter Oct 29, 2019
5ebe154
go 1.11 is not supported by gomodules
knoxfighter Oct 29, 2019
4266251
changed makefile to run with go modules
knoxfighter Oct 29, 2019
8cca1b2
added more things to clean & added clean before creating build
knoxfighter Oct 29, 2019
7c23146
removed unneeded gopkglist
knoxfighter Oct 29, 2019
3d984b6
ran `go mod tidy` to cleanup go.mod
knoxfighter Oct 29, 2019
3cdf79d
updated readme for new package management
knoxfighter Oct 29, 2019
a3c1814
use mkdir-p to ignore exists error
knoxfighter Oct 30, 2019
cd1ec3b
Merge pull request #166 from knoxfighter/Feature/go-deps
mroote Jan 7, 2020
8d58ddb
Add dockerfile to build release
mroote Aug 7, 2019
e765d54
Deploy to github
mroote Aug 8, 2019
f7bfd33
run on develop
mroote Aug 8, 2019
89405d5
Fix multiple go versions
mroote Aug 30, 2019
1cdfe28
remove windows os
mroote Aug 30, 2019
0ca3516
Add packagelock.json
mroote Jan 8, 2020
86801ac
Update ci pipeline
mroote Jan 8, 2020
80cc8c3
Merge pull request #158 from mroote/improve_ci_build
mroote Jan 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ mix-manifest.json
/app/**/vendor/
/app/*.js*
/app/*.css*
.vscode
40 changes: 22 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
language: go
go:
- "1.10"
- "1.11"
- "1.12"
- tip

install:
- go get github.com/apexskier/httpauth
- go get github.com/go-ini/ini
- go get github.com/gorilla/mux
- go get github.com/hpcloud/tail
- go get github.com/gorilla/websocket
- go get github.com/majormjr/rcon
- export GOPATH="$HOME/gopath/src/github.com/mroote/factorio-server-manager/:$GOPATH"

script:
- go test -v ./...
jobs:
include:
- stage: deploy
go: 1.x
language: minimal
before_install:
- docker build -f "docker/Dockerfile-build" -t factorio-server-manager docker
script:
- mkdir /home/travis/build/mroote/build
- docker run -t -e FAC_BRANCH=$TRAVIS_BRANCH -v /home/travis/build/mroote/build:/build factorio-server-manager
- mv /home/travis/build/mroote/build/factorio-server-manager-linux.zip /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
- mv /home/travis/build/mroote/build/factorio-server-manager-windows.zip /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip
deploy:
provider: releases
api_key: "${GITHUB_TOKEN}"
draft: true
skip_cleanup: true
on:
tags: true
file:
- /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
- /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ endif

build: $(release)

$(shell mkdir -p build)
build/factorio-server-manager-%.zip: app/bundle.js factorio-server-manager-%
build/factorio-server-manager-%.zip: clean app/bundle factorio-server-manager-%
@mkdir -p build/
@echo "Packaging Build - $@"
@cp -r app/ factorio-server-manager/
@cp conf.json.example factorio-server-manager/conf.json
@zip -r $@ factorio-server-manager > /dev/null
@rm -r factorio-server-manager

app/bundle:
@echo "Building Frontend"
@npm install && npm run build

factorio-server-manager-linux: godeps
factorio-server-manager-linux:
@echo "Building Backend - Linux"
@GOPATH="${GOPATH}:${PDW}"
@mkdir -p factorio-server-manager
@GOOS=linux GOARCH=amd64 go build -o factorio-server-manager/factorio-server-manager ./src
@cd src; \
GOOS=linux GOARCH=amd64 go build -o ../factorio-server-manager/factorio-server-manager .

factorio-server-manager-windows: godeps
factorio-server-manager-windows:
@echo "Building Backend - Windows"
@GOPATH="${GOPATH}:${PDW}"
@mkdir -p factorio-server-manager
@GOOS=windows GOARCH=386 go build -o factorio-server-manager/factorio-server-manager.exe ./src

godeps:
@echo "Installing Packages"
@cat gopkglist | xargs go get
@cd src; \
GOOS=windows GOARCH=386 go build -o ../factorio-server-manager/factorio-server-manager.exe .

gen_release: build/factorio-server-manager-linux.zip build/factorio-server-manager-windows.zip
@echo "Done"

clean:
@echo "Cleaning"
@rm -r build/
@rm app/bundle.js
@rm app/bundle.css
@rm app/fonts/vendor
@rm app/images/vendor
@-rm -r build/
@-rm app/bundle.js
@-rm app/bundle.js.map
@-rm app/style.css
@-rm app/style.css.map
@-rm -r app/fonts/vendor/
@-rm -r app/images/vendor/
@-rm -r node_modules/
@-rm -r pkg/
@-rm -r factorio-server-manager
54 changes: 25 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ This tool runs on a Factorio server and allows management of the Factorio server
1. Download the latest release
* [https://github.com/mroote/factorio-server-manager/releases](https://github.com/mroote/factorio-server-manager/releases)
2. Download the Factorio Standalone server and install to a known directory.
3. Run the server binary file, use the --dir flag to point the management server to your Factorio installation.
3. Run the server binary file, use the --dir flag to point the management server to your Factorio installation. If you are using the steam installation, point FSM to the steam directory.
* ```./factorio-server-manager --dir /home/user/.factorio ```
* ```./factorio-server-manager --dir /home/user/.steam/steam/steamapps/common/Factorio ```
4. Visit [localhost:8080](localhost:8080) in your web browser.

## Installation Windows
Expand All @@ -42,7 +43,7 @@ This tool runs on a Factorio server and allows management of the Factorio server
4. Visit [localhost:8080](localhost:8080) in your web browser.

## Usage
Run the UI server and specify the directory of your Factorio server installation and the interface to run the HTTP server on. Edit the conf.json file with your desired credentials for authentication.
Run the UI server and specify the directory of your Factorio server installation and the interface to run the HTTP server on. Edit the conf.json file with your desired credentials for authentication.
```
Usage of ./factorio-server-manager:
-bin string
Expand All @@ -59,11 +60,21 @@ Usage of ./factorio-server-manager:
Maximum filesize for uploaded files (default 20MB). (default 20971520)
-port string
Specify a port for the server. (default "8080")

-glibc-custom string
Specify if custom glibc is used (default false) [true/false]
-glibc-loc string
Path to the glibc ld.so file (default "/opt/glibc-2.18/lib/ld-2.18.so")
-glibc-lib-loc
Path to the glibc lib folder (default "/opt/glibc-2.18/lib")

Example:

./factorio-server-manager --dir /home/user/.factorio --host 10.0.0.1

Custom glibc example:

./factorio-server-manager --dir /home/user/.factorio --host 10.0.0.1 --glibc-custom true --glibc-loc /opt/glibc-2.18/lib/ld-2.18.so --glibc-lib-loc /opt/glibc-2.18/lib

```

## Manage Factorio Server
Expand All @@ -88,8 +99,8 @@ It also acts as the webserver to serve the front end react application
All api actions are accessible with the /api route. The frontend is accessible from /.

#### Requirements
+ Go 1.7
+ NodeJS 4.2.6
+ Go 1.11
+ NodeJS

#### Building Releases
Creates a release zip for windows and linux: (this will install the dependencies listed in gopkgdeps)
Expand Down Expand Up @@ -120,7 +131,7 @@ make app/bundle
```

##### For development
The frontend is completly build by npm with laravel-mix. All plugins are buld into the compiled files. No plugins need to be load fro external sources.
The frontend is completely build by npm with laravel-mix. All plugins are build into the compiled files. No plugins need to be load fro external sources.

It has different variants to build the frontend, provided by laravel-mix:
- `npm run dev` Build the code for development. This will also generate map-files, so the browser, can show, what line and file causes the output.
Expand All @@ -133,46 +144,31 @@ In every of those cases, also images and fonts will be copied to the app-folder.
1. Download the latest release source zip file
* [https://github.com/mroote/factorio-server-manager/releases](https://github.com/mroote/factorio-server-manager/releases)
2. Unzip the Factorio Standalone server and move it to a known directory.
3. Download and install Go 1.7 or newer. https://golang.org/dl/
4. Download and install NodeJS 4.2.6 64-bit or 32-bit depending on your operating system, if unsure download 32-bit
* https://nodejs.org/download/release/v4.2.6/node-v4.2.6-x64.msi 64-bit
* https://nodejs.org/download/release/v4.2.6/node-v4.2.6-x86.msi 32-bit
5. Download and install NVM, when asked if you want it to use NodeJS 4.2.6 accept
* https://github.com/coreybutler/nvm-windows/releases/download/1.1.1/nvm-setup.zip
6. You will need to setup GOPATH in environmental settings in windows. You will want to go into Control Panel\System and Security\System From there on the left hand side click "Advanced system settings". A window will open and you need to click Environment Variables.
7. Under System Variables click New. For Variable name use GOPATH and Variable value C:\Go\
3. Download and install Go 1.11 or newer. https://golang.org/dl/
4. Download and install NodeJS 64-bit or 32-bit depending on your operating system, most users need 64-bit nowadays.
* https://nodejs.org/dist/v12.13.0/node-v12.13.0-x64.msi 64-bit
* https://nodejs.org/dist/v12.13.0/node-v12.13.0-x86.msi 32-bit

Once everything is installed and ready to go you will need to compile the source for windows

1. Open the folder where ever you unzipped from step #2 above.
2. My folder structure is like this "C:\FS\factorio-server-manager\" C:\FS is where my factorio files are located C:\FS\factorio-server-manager\ is where the server manager files are.
3. You will now need to install some dependencies for Go. You will need to open up a command prompt and one at a time type each of these and hit enter before typing the next one.

```
go get github.com/apexskier/httpauth
go get github.com/go-ini/ini
go get github.com/gorilla/mux
go get github.com/hpcloud/tail
go get github.com/gorilla/websocket
go get github.com/majormjr/rcon
```

3. Now you will want to go into the src folder for example "C:\FS\factorio-server-manager\src" once there hold down left shift and right click an empty area of the folder. Then click "Open command windows here"
3. Now you will want to go into the src folder for example "C:\FS\factorio-server-manager\src" once there hold down shift and right click an empty area of the folder. Then click "Open command windows here"
4. Type this into the command prompt then hit enter:

```
go build
```

5. Once finished you will now see src.exe or src file inside the folder. You need to move that file to the C:\FS\factorio-server-manager\ or the folder that is before your src folder.
6. From here you need to build the web front-end by going into your ui folder for me its C:\FS\factorio-server-manager\ui\ and again hold shift and left click in an empty area then select open command prompt here. You then need to type this:
6. From here you need to build the web front-end. Again hold shift and right click in an empty area then select open command prompt here. You then need to type this:

```
npm install
npm run build
```

7. Now execute the src file created in step #4 above
7. Now execute the src file created in step #4 above. You have to specify the directory, where the factorio-server is located, as parameter. More about the parameter under [Usage](#Usage)
8. You can now Visit [localhost:8080](localhost:8080) in your web browser to start using the Factorio server Manager

## Contributing
Expand All @@ -187,7 +183,7 @@ go build
* **Mitch Roote** - [roote.ca](https://roote.ca)

## Special Thanks
- **[All Contributions]**(https://github.com/mroote/factorio-server-manager/graphs/contributors)
- **[All Contributions](https://github.com/mroote/factorio-server-manager/graphs/contributors)**
- **mickael9** for reverseengineering the factorio-save-file: https://forums.factorio.com/viewtopic.php?f=5&t=8568#

## License
Expand Down
4 changes: 1 addition & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# glibc is required for Factorio Server binaries to run
FROM frolvlad/alpine-glibc

MAINTAINER Mitch Roote <mitch@r00t.ca>

ENV FACTORIO_VERSION=latest \
MANAGER_VERSION=0.8.1 \
MANAGER_VERSION=0.8.2 \
ADMIN_PASSWORD=factorio

VOLUME /opt/factorio/saves /opt/factorio/mods /opt/factorio/config /security
Expand Down
20 changes: 20 additions & 0 deletions docker/Dockerfile-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:latest

RUN apk add --no-cache git make musl-dev go nodejs npm zip

ENV FAC_BRANCH=develop
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
ENV FAC_ROOT /go/src/factorio-server-manager

COPY build.sh /usr/local/bin/build.sh

RUN mkdir -p ${GOPATH}/bin
RUN chmod u+x /usr/local/bin/build.sh

WORKDIR $FAC_ROOT

VOLUME /build

CMD ["/usr/local/bin/build.sh"]
10 changes: 5 additions & 5 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ SECURITY_PATH ?= $(FACTORIO_PATH)/security
SAVES_PATH ?= $(FACTORIO_PATH)/saves
MODS_PATH ?= $(FACTORIO_PATH)/mods
PORT_FORWARD ?= -p 80:80 -p 443:443 -p 34197:34197/udp
FACTORIO_BRANCH ?= develop

build:
docker build --build-arg FAC_BRANCH=$FACTORIO_BRANCH -f Dockerfile-build -t fsm-build .
docker build -t factorio-server-manager .

logs:
docker logs factorio-server
echo "Nginx Access Logs"
docker exec -it factorio-server cat /var/log/nginx/access.log
echo "Nginx Error Logs"
docker exec -it factorio-server cat /var/log/nginx/error.log
docker logs factorio-server -f

run:
docker run -d --name factorio-server -v $(SECURITY_PATH):/security -v $(SAVES_PATH):/opt/factorio/saves -v $(MODS_PATH):/opt/factorio/mods $(PORT_FORWARD) factorio-server-manager
Expand All @@ -25,3 +23,5 @@ stop:

clean:
docker rmi factorio-server-manager
docker stop fsm-build
docker rmi fsm-build
8 changes: 8 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

echo "Cloning ${FAC_BRANCH}"
git clone -b ${FAC_BRANCH} https://github.com/mroote/factorio-server-manager.git ${FAC_ROOT}
echo "Creating build..."
make gen_release
echo "Copying build artifacts..."
cp -v build/* /build/
6 changes: 0 additions & 6 deletions gopkglist

This file was deleted.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@
},
"homepage": "https://github.com/mroote/factorio-server-manager#readme",
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@fortawesome/fontawesome-free": "^5.6.3",
"@fortawesome/fontawesome-free": "^5.8.2",
"admin-lte": "^3.0.0-alpha.2",
"babel-loader": "^8.0.5",
"bootstrap": "^4.2.1",
"bootstrap-fileinput": "^4.5.2",
"babel-loader": "^8.0.6",
"bootstrap": "^4.3.1",
"bootstrap-fileinput": "^5.0.3",
"classnames": "^2.2.6",
"css-loader": "^2.1.0",
"file-loader": "^3.0.1",
"jquery": "^3.3.1",
"jquery": "^3.4.1",
"locks": "^0.2.2",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"mini-css-extract-plugin": "^0.7.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-native-listener": "^1.0.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"resolve-url-loader": "^3.0.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-native-listener": "^1.1.0",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"resolve-url-loader": "^3.1.0",
"sass-loader": "^7.1.0",
"semver": "^5.6.0",
"sweetalert2": "^7.33.1",
"sweetalert2-react-content": "^1.0.1",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1",
"webpack-fix-style-only-entries": "0.1.0"
"semver": "^6.1.1",
"sweetalert2": "^8.11.6",
"sweetalert2-react-content": "^1.1.0",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2",
"webpack-fix-style-only-entries": "^0.2.0"
}
}
1 change: 1 addition & 0 deletions src/factorio_save.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func OpenArchiveFile(path string, name string) (r io.ReadCloser, err error) {
}
}

archive.Close()
return nil, errors.New("file not found")
}

Expand Down
Loading