rename binary to rmfakecloud-proxy
This commit is contained in:
parent
3ddeb5ae39
commit
743a38c344
4 changed files with 9 additions and 13 deletions
6
Makefile
6
Makefile
|
@ -1,6 +1,6 @@
|
||||||
BINARY=dist/rmfake-proxy
|
BINARY=dist/rmfakecloud-proxy
|
||||||
WINBINARY=dist/rmfake-proxy.exe
|
WINBINARY=dist/rmfakecloud-proxy.exe
|
||||||
LINUXBINARY=dist/rmfake-proxy64
|
LINUXBINARY=dist/rmfakecloud-proxy64
|
||||||
INSTALLER=dist/installer.sh
|
INSTALLER=dist/installer.sh
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
all: $(INSTALLER) $(WINBINARY) $(LINUXBINARY)
|
all: $(INSTALLER) $(WINBINARY) $(LINUXBINARY)
|
||||||
|
|
|
@ -6,7 +6,7 @@ Single-minded HTTPS reverse proxy
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
```
|
```
|
||||||
usage: secure [-addr host:port] -cert certfile -key keyfile upstream
|
usage: rmfakecloud-proxy [-addr host:port] -cert certfile -key keyfile upstream
|
||||||
-addr string
|
-addr string
|
||||||
listen address (default ":443")
|
listen address (default ":443")
|
||||||
-cert string
|
-cert string
|
||||||
|
@ -20,7 +20,7 @@ usage: secure [-addr host:port] -cert certfile -key keyfile upstream
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```
|
```
|
||||||
secure -cert cert.pem -key key.pem http://localhost:6060
|
rmfakecloud-proxy -cert cert.pem -key key.pem http://localhost:6060
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configfile
|
## Configfile
|
||||||
|
|
2
main.go
2
main.go
|
@ -58,7 +58,7 @@ func getConfig() (config *Config, err error) {
|
||||||
|
|
||||||
if configFile != "" {
|
if configFile != "" {
|
||||||
var data []byte
|
var data []byte
|
||||||
data, err = ioutil.ReadFile(configFile)
|
data, err = os.ReadFile(configFile)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
UNIT_NAME=proxy
|
UNIT_NAME=rmfakecloud-proxy
|
||||||
BINARY=rmfake-proxy
|
BINARY=rmfakecloud-proxy
|
||||||
DESTINATION="/home/root/rmfakecloud"
|
DESTINATION="/home/root/rmfakecloud"
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,19 +26,15 @@ function install_proxyservice(){
|
||||||
cloudurl=$1
|
cloudurl=$1
|
||||||
echo "Setting cloud sync to: ${cloudurl}"
|
echo "Setting cloud sync to: ${cloudurl}"
|
||||||
workdir=$DESTINATION
|
workdir=$DESTINATION
|
||||||
cat > $workdir/proxy.cfg <<EOF
|
|
||||||
URL=
|
|
||||||
EOF
|
|
||||||
cat > /etc/systemd/system/${UNIT_NAME}.service <<EOF
|
cat > /etc/systemd/system/${UNIT_NAME}.service <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=reverse proxy
|
Description=rmfakecloud reverse proxy
|
||||||
#StartLimitIntervalSec=600
|
#StartLimitIntervalSec=600
|
||||||
#StartLimitBurst=4
|
#StartLimitBurst=4
|
||||||
After=home.mount
|
After=home.mount
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=HOME=/home/root
|
Environment=HOME=/home/root
|
||||||
#EnvironmentFile=$workdir/proxy.cfg
|
|
||||||
WorkingDirectory=$workdir
|
WorkingDirectory=$workdir
|
||||||
ExecStart=$workdir/${BINARY} -cert $workdir/proxy.bundle.crt -key $workdir/proxy.key ${cloudurl}
|
ExecStart=$workdir/${BINARY} -cert $workdir/proxy.bundle.crt -key $workdir/proxy.key ${cloudurl}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue