Cleanup rootdir
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-03-23 20:31:13 +01:00
parent e8419b1e77
commit 5b5b344f82
Signed by: peter
GPG Key ID: 374322D56E5209E8
3 changed files with 45 additions and 2 deletions

6
TODO.md Normal file
View File

@ -0,0 +1,6 @@
# TODO
- Compile templates into binary (with go.rice)
- Increase ease of use for people who want to try Ekster
- Hosted version??
- Per user backends

View File

@ -1,7 +1,7 @@
version: '2' version: '2'
services: services:
redis: redis:
image: "redis" image: "redis:5"
web: web:
image: "pstuifzand/eksterd:alpine" image: "pstuifzand/eksterd:alpine"
@ -9,10 +9,14 @@ services:
links: links:
- redis:redis - redis:redis
volumes: volumes:
- .:/app:ro
- ./data:/opt/microsub - ./data:/opt/microsub
entrypoint: /app/eksterd
command: -auth=false -port 80 -templates /app/templates
ports: ports:
- 80 - 8089:80
environment: environment:
- "FEEDBIN_USER=" - "FEEDBIN_USER="
- "FEEDBIN_PASS=" - "FEEDBIN_PASS="
- "EKSTER_BASEURL=" - "EKSTER_BASEURL="
- "EKSTER_TEMPLATES=/app/templates"

33
pkg/fetch/fetch_test.go Normal file
View File

@ -0,0 +1,33 @@
package fetch
import (
"net/http"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func fetcher(fetchURL string) (*http.Response, error) {
return nil, nil
}
func TestFeedHeader(t *testing.T) {
doc := `
<html>
<body>
<div class="h-card">
<p class="p-name"><a href="/" class="u-url">Title</a></p>
<img class="u-photo" src="profile.jpg" />
</div>
</body>
</html>
`
feed, err := FeedHeader(fetcher, "https://example.com/", "text/html", strings.NewReader(doc))
if assert.NoError(t, err) {
assert.Equal(t, "feed", feed.Type)
assert.Equal(t, "Title", feed.Name)
assert.Equal(t, "https://example.com/", feed.URL)
assert.Equal(t, "https://example.com/profile.jpg", feed.Photo)
}
}