fix .env file handeling
This commit is contained in:
parent
26934af19d
commit
214c8e70ac
|
@ -5,8 +5,8 @@ This is a HP ePrint clone that has similar functions to normal HP ePrint but it
|
||||||
### To be clear and to not get a C&D from HP, the core isn't similar to HP ePrint (printing over e-mail) just it's functions are similar between them (aka printing files remotely to Your printer)
|
### To be clear and to not get a C&D from HP, the core isn't similar to HP ePrint (printing over e-mail) just it's functions are similar between them (aka printing files remotely to Your printer)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Printing PDF, any image file, text, [encoded html render .ini files](https://git.fluffy.pw/matu6968/web-hp-eprint-clone/wiki/Encoded-.ini-files-that-prints-out-a-url), MS Office documents (gets converted to a .pdf files first then print out) and HTML files
|
- Printing PDF, any image file, text, [encoded html render .ini files](https://git.fluffy.pw/matu6968/web-hp-eprint-clone/wiki/Encoded-.ini-files-that-prints-out-a-url), MS Office documents (gets converted to a .pdf file first then print out) and HTML files
|
||||||
- custom print quality and page index options
|
- custom print quality and page index options
|
||||||
- REST API
|
- REST API
|
||||||
- NSFW scanning (requires DeepAI PRO account and API key)
|
- NSFW scanning (requires DeepAI PRO account and API key)
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ In the .env file this is the only thing you can set
|
||||||
```
|
```
|
||||||
PORT=8080
|
PORT=8080
|
||||||
LOG=log # enables file logging (aka copies file to user home directory under the folder imagelog so make a folder first in the home root if you wish to enable it), to disable it replace it with nolog
|
LOG=log # enables file logging (aka copies file to user home directory under the folder imagelog so make a folder first in the home root if you wish to enable it), to disable it replace it with nolog
|
||||||
NSFWSCAN=true # Requires DeepAI API key and DeepAI PRO subscription
|
NSFWCHECK=true # Requires DeepAI API key and DeepAI PRO subscription
|
||||||
```
|
```
|
||||||
## Autostart with systemd or OpenRC
|
## Autostart with systemd or OpenRC
|
||||||
|
|
||||||
|
|
8
main.go
8
main.go
|
@ -32,9 +32,15 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
nsfwcheck := os.Getenv("NSFWCHECK")
|
nsfwcheck := os.Getenv("NSFWCHECK")
|
||||||
|
if nsfwcheck == "true" {
|
||||||
|
nsfwcheck = "nsfwcheck"
|
||||||
|
} else
|
||||||
|
if nsfwcheck == "false" {
|
||||||
|
nsfwcheck = ""
|
||||||
|
} else
|
||||||
if nsfwcheck == "" {
|
if nsfwcheck == "" {
|
||||||
nsfwcheck = ""
|
nsfwcheck = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
http.HandleFunc("/", handleIndex)
|
http.HandleFunc("/", handleIndex)
|
||||||
http.HandleFunc("/upload", handleUpload)
|
http.HandleFunc("/upload", handleUpload)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user