Skip to content

Commit 0d8803c

Browse files
authored
Merge pull request #167 from mroote/develop
Develop
2 parents 8fbd4db + 80cc8c3 commit 0d8803c

33 files changed

+5551
-235
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ mix-manifest.json
1616
/app/**/vendor/
1717
/app/*.js*
1818
/app/*.css*
19+
.vscode

.travis.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
language: go
2-
go:
3-
- "1.10"
4-
- "1.11"
5-
- "1.12"
6-
- tip
7-
8-
install:
9-
- go get github.com/apexskier/httpauth
10-
- go get github.com/go-ini/ini
11-
- go get github.com/gorilla/mux
12-
- go get github.com/hpcloud/tail
13-
- go get github.com/gorilla/websocket
14-
- go get github.com/majormjr/rcon
15-
- export GOPATH="$HOME/gopath/src/github.com/mroote/factorio-server-manager/:$GOPATH"
16-
17-
script:
18-
- go test -v ./...
1+
jobs:
2+
include:
3+
- stage: deploy
4+
go: 1.x
5+
language: minimal
6+
before_install:
7+
- docker build -f "docker/Dockerfile-build" -t factorio-server-manager docker
8+
script:
9+
- mkdir /home/travis/build/mroote/build
10+
- docker run -t -e FAC_BRANCH=$TRAVIS_BRANCH -v /home/travis/build/mroote/build:/build factorio-server-manager
11+
- mv /home/travis/build/mroote/build/factorio-server-manager-linux.zip /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
12+
- mv /home/travis/build/mroote/build/factorio-server-manager-windows.zip /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip
13+
deploy:
14+
provider: releases
15+
api_key: "${GITHUB_TOKEN}"
16+
draft: true
17+
skip_cleanup: true
18+
on:
19+
tags: true
20+
file:
21+
- /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
22+
- /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ endif
1212

1313
build: $(release)
1414

15-
$(shell mkdir -p build)
16-
build/factorio-server-manager-%.zip: app/bundle.js factorio-server-manager-%
15+
build/factorio-server-manager-%.zip: clean app/bundle factorio-server-manager-%
16+
@mkdir -p build/
1717
@echo "Packaging Build - $@"
1818
@cp -r app/ factorio-server-manager/
1919
@cp conf.json.example factorio-server-manager/conf.json
2020
@zip -r $@ factorio-server-manager > /dev/null
21-
@rm -r factorio-server-manager
2221

2322
app/bundle:
2423
@echo "Building Frontend"
2524
@npm install && npm run build
2625

27-
factorio-server-manager-linux: godeps
26+
factorio-server-manager-linux:
2827
@echo "Building Backend - Linux"
29-
@GOPATH="${GOPATH}:${PDW}"
3028
@mkdir -p factorio-server-manager
31-
@GOOS=linux GOARCH=amd64 go build -o factorio-server-manager/factorio-server-manager ./src
29+
@cd src; \
30+
GOOS=linux GOARCH=amd64 go build -o ../factorio-server-manager/factorio-server-manager .
3231

33-
factorio-server-manager-windows: godeps
32+
factorio-server-manager-windows:
3433
@echo "Building Backend - Windows"
35-
@GOPATH="${GOPATH}:${PDW}"
3634
@mkdir -p factorio-server-manager
37-
@GOOS=windows GOARCH=386 go build -o factorio-server-manager/factorio-server-manager.exe ./src
38-
39-
godeps:
40-
@echo "Installing Packages"
41-
@cat gopkglist | xargs go get
35+
@cd src; \
36+
GOOS=windows GOARCH=386 go build -o ../factorio-server-manager/factorio-server-manager.exe .
4237

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

4641
clean:
4742
@echo "Cleaning"
48-
@rm -r build/
49-
@rm app/bundle.js
50-
@rm app/bundle.css
51-
@rm app/fonts/vendor
52-
@rm app/images/vendor
43+
@-rm -r build/
44+
@-rm app/bundle.js
45+
@-rm app/bundle.js.map
46+
@-rm app/style.css
47+
@-rm app/style.css.map
48+
@-rm -r app/fonts/vendor/
49+
@-rm -r app/images/vendor/
50+
@-rm -r node_modules/
51+
@-rm -r pkg/
52+
@-rm -r factorio-server-manager

README.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ This tool runs on a Factorio server and allows management of the Factorio server
2929
1. Download the latest release
3030
* [https://github.com/mroote/factorio-server-manager/releases](https://github.com/mroote/factorio-server-manager/releases)
3131
2. Download the Factorio Standalone server and install to a known directory.
32-
3. Run the server binary file, use the --dir flag to point the management server to your Factorio installation.
32+
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.
3333
* ```./factorio-server-manager --dir /home/user/.factorio ```
34+
* ```./factorio-server-manager --dir /home/user/.steam/steam/steamapps/common/Factorio ```
3435
4. Visit [localhost:8080](localhost:8080) in your web browser.
3536

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

4445
## Usage
45-
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.
46+
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.
4647
```
4748
Usage of ./factorio-server-manager:
4849
-bin string
@@ -59,11 +60,21 @@ Usage of ./factorio-server-manager:
5960
Maximum filesize for uploaded files (default 20MB). (default 20971520)
6061
-port string
6162
Specify a port for the server. (default "8080")
62-
63+
-glibc-custom string
64+
Specify if custom glibc is used (default false) [true/false]
65+
-glibc-loc string
66+
Path to the glibc ld.so file (default "/opt/glibc-2.18/lib/ld-2.18.so")
67+
-glibc-lib-loc
68+
Path to the glibc lib folder (default "/opt/glibc-2.18/lib")
69+
6370
Example:
6471
6572
./factorio-server-manager --dir /home/user/.factorio --host 10.0.0.1
6673
74+
Custom glibc example:
75+
76+
./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
77+
6778
```
6879

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

90101
#### Requirements
91-
+ Go 1.7
92-
+ NodeJS 4.2.6
102+
+ Go 1.11
103+
+ NodeJS
93104

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

122133
##### For development
123-
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.
134+
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.
124135

125136
It has different variants to build the frontend, provided by laravel-mix:
126137
- `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.
@@ -133,46 +144,31 @@ In every of those cases, also images and fonts will be copied to the app-folder.
133144
1. Download the latest release source zip file
134145
* [https://github.com/mroote/factorio-server-manager/releases](https://github.com/mroote/factorio-server-manager/releases)
135146
2. Unzip the Factorio Standalone server and move it to a known directory.
136-
3. Download and install Go 1.7 or newer. https://golang.org/dl/
137-
4. Download and install NodeJS 4.2.6 64-bit or 32-bit depending on your operating system, if unsure download 32-bit
138-
* https://nodejs.org/download/release/v4.2.6/node-v4.2.6-x64.msi 64-bit
139-
* https://nodejs.org/download/release/v4.2.6/node-v4.2.6-x86.msi 32-bit
140-
5. Download and install NVM, when asked if you want it to use NodeJS 4.2.6 accept
141-
* https://github.com/coreybutler/nvm-windows/releases/download/1.1.1/nvm-setup.zip
142-
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.
143-
7. Under System Variables click New. For Variable name use GOPATH and Variable value C:\Go\
147+
3. Download and install Go 1.11 or newer. https://golang.org/dl/
148+
4. Download and install NodeJS 64-bit or 32-bit depending on your operating system, most users need 64-bit nowadays.
149+
* https://nodejs.org/dist/v12.13.0/node-v12.13.0-x64.msi 64-bit
150+
* https://nodejs.org/dist/v12.13.0/node-v12.13.0-x86.msi 32-bit
144151

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

147154
1. Open the folder where ever you unzipped from step #2 above.
148155
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.
149-
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.
150-
151-
```
152-
go get github.com/apexskier/httpauth
153-
go get github.com/go-ini/ini
154-
go get github.com/gorilla/mux
155-
go get github.com/hpcloud/tail
156-
go get github.com/gorilla/websocket
157-
go get github.com/majormjr/rcon
158-
```
159-
160-
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"
156+
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"
161157
4. Type this into the command prompt then hit enter:
162158

163159
```
164160
go build
165161
```
166162

167163
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.
168-
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:
164+
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:
169165

170166
```
171167
npm install
172168
npm run build
173169
```
174170

175-
7. Now execute the src file created in step #4 above
171+
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)
176172
8. You can now Visit [localhost:8080](localhost:8080) in your web browser to start using the Factorio server Manager
177173

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

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

193189
## License

docker/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# glibc is required for Factorio Server binaries to run
22
FROM frolvlad/alpine-glibc
33

4-
MAINTAINER Mitch Roote <[email protected]>
5-
64
ENV FACTORIO_VERSION=latest \
7-
MANAGER_VERSION=0.8.1 \
5+
MANAGER_VERSION=0.8.2 \
86
ADMIN_PASSWORD=factorio
97

108
VOLUME /opt/factorio/saves /opt/factorio/mods /opt/factorio/config /security

docker/Dockerfile-build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM alpine:latest
2+
3+
RUN apk add --no-cache git make musl-dev go nodejs npm zip
4+
5+
ENV FAC_BRANCH=develop
6+
ENV GOROOT /usr/lib/go
7+
ENV GOPATH /go
8+
ENV PATH /go/bin:$PATH
9+
ENV FAC_ROOT /go/src/factorio-server-manager
10+
11+
COPY build.sh /usr/local/bin/build.sh
12+
13+
RUN mkdir -p ${GOPATH}/bin
14+
RUN chmod u+x /usr/local/bin/build.sh
15+
16+
WORKDIR $FAC_ROOT
17+
18+
VOLUME /build
19+
20+
CMD ["/usr/local/bin/build.sh"]

docker/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ SECURITY_PATH ?= $(FACTORIO_PATH)/security
55
SAVES_PATH ?= $(FACTORIO_PATH)/saves
66
MODS_PATH ?= $(FACTORIO_PATH)/mods
77
PORT_FORWARD ?= -p 80:80 -p 443:443 -p 34197:34197/udp
8+
FACTORIO_BRANCH ?= develop
89

910
build:
11+
docker build --build-arg FAC_BRANCH=$FACTORIO_BRANCH -f Dockerfile-build -t fsm-build .
1012
docker build -t factorio-server-manager .
1113

1214
logs:
13-
docker logs factorio-server
14-
echo "Nginx Access Logs"
15-
docker exec -it factorio-server cat /var/log/nginx/access.log
16-
echo "Nginx Error Logs"
17-
docker exec -it factorio-server cat /var/log/nginx/error.log
15+
docker logs factorio-server -f
1816

1917
run:
2018
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
@@ -25,3 +23,5 @@ stop:
2523

2624
clean:
2725
docker rmi factorio-server-manager
26+
docker stop fsm-build
27+
docker rmi fsm-build

docker/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
echo "Cloning ${FAC_BRANCH}"
4+
git clone -b ${FAC_BRANCH} https://github.com/mroote/factorio-server-manager.git ${FAC_ROOT}
5+
echo "Creating build..."
6+
make gen_release
7+
echo "Copying build artifacts..."
8+
cp -v build/* /build/

gopkglist

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@
2424
},
2525
"homepage": "https://github.com/mroote/factorio-server-manager#readme",
2626
"devDependencies": {
27-
"@babel/core": "^7.2.2",
28-
"@babel/preset-env": "^7.2.3",
27+
"@babel/core": "^7.4.5",
28+
"@babel/preset-env": "^7.4.5",
2929
"@babel/preset-react": "^7.0.0",
30-
"@fortawesome/fontawesome-free": "^5.6.3",
30+
"@fortawesome/fontawesome-free": "^5.8.2",
3131
"admin-lte": "^3.0.0-alpha.2",
32-
"babel-loader": "^8.0.5",
33-
"bootstrap": "^4.2.1",
34-
"bootstrap-fileinput": "^4.5.2",
32+
"babel-loader": "^8.0.6",
33+
"bootstrap": "^4.3.1",
34+
"bootstrap-fileinput": "^5.0.3",
3535
"classnames": "^2.2.6",
3636
"css-loader": "^2.1.0",
3737
"file-loader": "^3.0.1",
38-
"jquery": "^3.3.1",
38+
"jquery": "^3.4.1",
3939
"locks": "^0.2.2",
40-
"mini-css-extract-plugin": "^0.5.0",
41-
"node-sass": "^4.11.0",
40+
"mini-css-extract-plugin": "^0.7.0",
41+
"node-sass": "^4.12.0",
4242
"optimize-css-assets-webpack-plugin": "^5.0.1",
43-
"prop-types": "^15.6.2",
44-
"react": "^16.7.0",
45-
"react-dom": "^16.7.0",
46-
"react-native-listener": "^1.0.2",
47-
"react-router": "^4.3.1",
48-
"react-router-dom": "^4.3.1",
49-
"resolve-url-loader": "^3.0.0",
43+
"prop-types": "^15.7.2",
44+
"react": "^16.8.6",
45+
"react-dom": "^16.8.6",
46+
"react-native-listener": "^1.1.0",
47+
"react-router": "^5.0.0",
48+
"react-router-dom": "^5.0.0",
49+
"resolve-url-loader": "^3.1.0",
5050
"sass-loader": "^7.1.0",
51-
"semver": "^5.6.0",
52-
"sweetalert2": "^7.33.1",
53-
"sweetalert2-react-content": "^1.0.1",
54-
"webpack": "^4.28.4",
55-
"webpack-cli": "^3.2.1",
56-
"webpack-fix-style-only-entries": "0.1.0"
51+
"semver": "^6.1.1",
52+
"sweetalert2": "^8.11.6",
53+
"sweetalert2-react-content": "^1.1.0",
54+
"webpack": "^4.32.2",
55+
"webpack-cli": "^3.3.2",
56+
"webpack-fix-style-only-entries": "^0.2.0"
5757
}
5858
}

0 commit comments

Comments
 (0)