Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/postmannen/eyerimg
Web service with image uploads. Written in Go, and using certmagic to handle the https listener.
https://github.com/postmannen/eyerimg
Last synced: 1 day ago
JSON representation
Web service with image uploads. Written in Go, and using certmagic to handle the https listener.
- Host: GitHub
- URL: https://github.com/postmannen/eyerimg
- Owner: postmannen
- Created: 2019-06-11T17:12:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-30T08:20:02.000Z (over 5 years ago)
- Last Synced: 2023-02-28T09:15:44.282Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 563 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eyerImg
In progress.
Web service with Authentication against Google, and image upload to local disk on server.## To use
Start locally, just http.
`go run *go -host=localhost -hostListen=localhost -port="8080" -proto="http"`Start externally with https, will also redirect http call to https.
`go run *go -host=eyer.io -port=443 -proto=https`
We don't have to specify the -hostListen when running https.## To use with Docker
The repository includes a Dockerfile
Replaces the CMD values to fit your setup.
```Dockerfile
FROM golang:alpine
RUN apk add git
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN go get github.com/gorilla/sessions
RUN go get github.com/nfnt/resize
RUN go get golang.org/x/oauth2
RUN go get golang.org/x/oauth2/google
RUN go build -o main .
CMD ["/app/main", "-proto=http", "-host=eyer.io", "-port=:80", "-hostListen=0.0.0.0"]
```To build image
`docker build -t eyerimg .`## Environment variables
The programs expects the following environment variables set for authentication against Google Cloud.
```
cookiestorekey=some-cookie-store-key-here
googlekey=some-google-key-here
googlesecret=some-google-secret-here
```The variables can be stored in a file called for example `exports`, and can then be implemented when starting the container like this.
`docker run --env-file exports -p 80:80 eyerimg`
## Google Cloud specific things
Create an Oauth app under app credentials i Google Cloud Console.
Set the callback URL to`http://:/callback`