This commit is contained in:
parent
e8419b1e77
commit
5b5b344f82
6
TODO.md
Normal file
6
TODO.md
Normal 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
|
|
@ -1,7 +1,7 @@
|
|||
version: '2'
|
||||
services:
|
||||
redis:
|
||||
image: "redis"
|
||||
image: "redis:5"
|
||||
|
||||
web:
|
||||
image: "pstuifzand/eksterd:alpine"
|
||||
|
@ -9,10 +9,14 @@ services:
|
|||
links:
|
||||
- redis:redis
|
||||
volumes:
|
||||
- .:/app:ro
|
||||
- ./data:/opt/microsub
|
||||
entrypoint: /app/eksterd
|
||||
command: -auth=false -port 80 -templates /app/templates
|
||||
ports:
|
||||
- 80
|
||||
- 8089:80
|
||||
environment:
|
||||
- "FEEDBIN_USER="
|
||||
- "FEEDBIN_PASS="
|
||||
- "EKSTER_BASEURL="
|
||||
- "EKSTER_TEMPLATES=/app/templates"
|
||||
|
|
33
pkg/fetch/fetch_test.go
Normal file
33
pkg/fetch/fetch_test.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user