aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b78a42d35f69cf81fa0b6914eb5016f90883ed0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[![Go Report Card](https://goreportcard.com/badge/github.com/Necoro/feed2imap-go)](https://goreportcard.com/report/github.com/Necoro/feed2imap-go)

# feed2imap-go

A software to convert rss feeds into mails. feed2imap-go acts as an RSS/Atom feed aggregator. After downloading feeds 
(over HTTP or HTTPS), it uploads them to a specified folder of an IMAP mail server. The user can then access the feeds 
using their preferred client (Mutt, Evolution, Mozilla Thunderbird, webmail,...).

It is a rewrite in Go of the wonderful, but unfortunately now unmaintained, [feed2imap](https://github.com/feed2imap/feed2imap).
It also includes the features that up to now only lived on [my own branch][nec].

It aims to be compatible in functionality and configuration, and should mostly work as a drop-in replacement 
(but see [Changes](#changes)).

An example configuration can be found [here](config.yml.example) with additional information in the [wiki](https://github.com/Necoro/feed2imap-go/wiki/Detailed-Options).

See [the Installation section](#installation) on how to install feed2imap-go. (Spoiler: It's easy ;)).

## Features

* Support for most feed formats. See [gofeed documentation](https://github.com/mmcdole/gofeed/blob/master/README.md#features) 
for details.
* Connection to any IMAP server, using IMAP, IMAP+STARTTLS, or IMAPS.
* Detection of duplicates: Heuristics what feed items have already been uploaded.
* Update mechanism: When a feed item is updated, so is the mail.
* Detailed configuration options per feed (fetch frequency, should images be included, tune change heuristics, ...)

## Changes

### Additions to feed2imap

* Groups: Have the ability to group feeds that share characteristics, most often the same parent folder in the hiearchy.
  But also allows to share options between feeds. Usages: Categories ("News", "Linux") and merging different feeds of the same origin.
* Heavier use of parallel processing (it's Go after all ;)). Also, it is way faster.
* Global `target` and each feed only specifies the folder relative to that target. 
(feature contained also in [fork of the original][nec]) 
* Fix `include-images` option: It now includes images as mime-parts. An additional `embed-images` option serves the images 
as inline base64-encoded data (the old default behavior of feed2imap).
* Improved image inclusion: Support any relative URLs, including `//example.com/foo.png`
* Use HTML-Parser instead of regular expressions for modifying the HTML content.
* STARTTLS-Support. As it turned out only in testing, the old feed2imap never supported it...
* `item-filter` option that allows to specify an inline filter expression on the items of a feed.

### Subtle differences

* **Feed rendering**: Unfortunately, semantics of RSS and Atom tags are very broad. As we use a different feed parser 
ibrary than the original, the interpretation (e.g., what tag is "the author") can differ.
* **Caching**: We do not implement the caching algorithm of feed2imap point by point. In general, we opted for fewer 
heuristics and more optimism (belief that GUID is filled correctly). If this results in a problem, file a bug and include the `X-Feed2Imap-Reason` header of the mail.
* **Configuration**: We took the liberty to restructure the configuration options. Old configs are supported, but a 
warning is issued when an option should now be in another place or is no longer supported (i.e., the option is without function).

### Unsupported features of feed2imap

* IMAP-Target per Feed ([issue #6][i6]); targets only specify the folder relative to the global target
* Maildir ([issue #4][i4])

## Installation

The easiest way of installation is to head over to [the releases page](https://github.com/Necoro/feed2imap-go/releases/latest)
and get the appropriate download package. Go is all about static linking, thus for all platforms the result is a single
binary which can be placed whereever you need.

Please open an issue if you are missing your platform.

### Install from source

Clone the repository and, optionally, switch to the tag you want:
````bash
git clone https://github.com/Necoro/feed2imap-go
git checkout v0.5.0
````

The official way of building feed2imap-go is using [goreleaser](https://github.com/goreleaser/goreleaser):
````bash
goreleaser --snapshot --rm-dist
````
The built binary is then inside the corresponding arch folder in `dist`.

In case you do not want to install yet another build tool, doing
````bash
go build
````
should also suffice, but does not embed version information in the binary (and the result is slightly larger).

If you are only interested in getting the latest build out of the `master` branch, do
````bash
go get https://github.com/Necoro/feed2imap-go
````
Note that this is not recommended, because it is a) not obvious which version you are actually building
and b) the update process is not clear, especially regarding the dependencies.


### Run in docker

Most times, putting feed2imap-go somewhere and adding a cron job does everything you need. For the times where it isn't, we provide docker containers for your convenience at [Github Packages](https://github.com/Necoro/feed2imap-go/packages) and at [Docker Hub](https://hub.docker.com/r/necorodm/feed2imap-go).

The container is configured to expect both config file and cache under `/app/data/`, thus needs it mounted there.
When both are stored in `~/feed`, you can do:
````bash
docker run -v ~/feed:/app/data necorodm/feed2imap-go:latest
````

Alternatively, build the docker image yourself (requires the `feed2imap-go` binary at toplevel):
````bash
docker build -t feed2imap-go .
````
Note that the supplied binary must not be linked to glibc, i.e. has to be built with `CGO_ENABLED=0`. When using `goreleaser`, you'll find this in  `dist/docker_linux_amd64`.

Or you can roll your own Dockerfile, supplying a glibc...

**NB**: feed2imap-go employs no server-mode. Thus, each run terminates directly after a couple seconds. Therefore, the docker container in itself is not that useful and you have to have a mechanism in place to spin up the container regularly.

## Support

Thanks to [JetBrains][jb] for supporting this project.

[![JetBrains](https://necoro.dev/data/jetbrains_small2.png)][jb]

[i6]: https://github.com/Necoro/feed2imap-go/issues/6
[i4]: https://github.com/Necoro/feed2imap-go/issues/4
[i9]: https://github.com/Necoro/feed2imap-go/issues/9
[nec]: https://github.com/Necoro/feed2imap
[jb]: https://www.jetbrains.com/?from=feed2imap-go
d=e976df27952ca1e450c1c3d420532ac9f5e3036b&follow=1'>Add support for repo.commit-filter and repo.source-filterLars Hjemli6-21/+35 These options can be used to override the default commit- and source- filter settings per repository. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-08-08Expose file extension in tree lists as class to allow nicer tree stylingMartin Szulecki1-1/+7 Signed-off-by: Martin Szulecki <opensuse@sukimashita.com> 2009-08-08Introduce noplainemail option to hide email adresses from spambotsMartin Szulecki7-7/+22 Signed-off-by: Martin Szulecki <opensuse@sukimashita.com> 2009-07-31ui-commit: add support for 'commit-filter' optionLars Hjemli4-0/+17 This new option specifies a filter which is executed on the commit message, i.e. the commit message is written to the filters STDIN and the filters STDOUT is included verbatim as the commit message. This can be used to implement commit linking by creating a simple shell script in e.g. /usr/bin/cgit-commit-filter.sh like this: #/bin/sh sed -re 's|\b([0-9a-fA-F]{6,40})\b|<a href="./?id=\1">\1</a>|g' Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-31ui-tree: add support for source-filter optionLars Hjemli4-4/+25 This new option is used to specify an external command which will be executed when displaying blob content in the tree view. Blob content will be written to STDIN of the filter and STDOUT from the filter will be included verbatim in the html output from cgit. The file name of the blob will be passed as the only argument to the filter command. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-31ui-snapshot: use cgit_{open|close}_filter() to execute compressorsLars Hjemli1-28/+7 This simplifies the code in ui-snapshot.c and makes the test-suite verify the new filter-functions. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-31Add generic filter/plugin infrastructureLars Hjemli3-0/+62 The functions cgit_open_filter() and cgit_close_filter() can be used to execute filters on the output stream from cgit. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25Add support for mime type registration and lookupLars Hjemli4-5/+45 This patch makes it possible to register mappings from filename extension to mime type in cgitrc and use this mapping when returning blob content in `plain` view. The reason for adding this mapping to cgitrc (as opposed to parsing something like /etc/mime.types) is to allow quick lookup of a limited number of filename extensions (/etc/mime-types on my machine currently contains over 700 entries). NB: A nice addition to this patch would be to parse /etc/mime.types when `plain` view is requested for a file with an extension for which there is no mapping registered in cgitrc. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25cgit.h: keep config flags sortedLars Hjemli1-2/+2 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25cgitrc.5.txt: document 'embedded' and 'noheader'Lars Hjemli1-0/+9 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25Add support for 'noheader' optionLars Hjemli3-7/+16 This option can be used to disable the standard cgit page header, which might be useful in combination with the 'embedded' option. Suggested-by: Mark Constable <markc@renta.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25cgitrc.5.txt: document 'head-include'Lars Hjemli1-0/+4 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli1-1/+7 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon1-1/+4 Signed-off-by: Remko Tronçon <git@el-tramo.be> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro2-3/+6 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro2-0/+12 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli3-0/+6 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-06-07Add head-include configuration option.Mark Lodato3-1/+6 This patch adds an option to the configuration file, "head-include", which works just like "header" or "footer", except the content is put into the HTML's <head> tag. 2009-03-15CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 When size is zero, subtracting one from it turns it into ULONG_MAX which causes an out-of-bounds access on buf. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 This is a quick 'n dirty hack which makes cgit honor HEAD requests. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 When downloading a blob identified by its path, the client might want to know if the blob has been modified since a previous download of the same path. To this end, an ETag containing the blob SHA1 seems to be ideal. Todo: add support for HEAD requests... Suggested-by: Owen Taylor <otaylor@redhat.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17 Signed-off-by: Lars Hjemli <hjemli@gmail.com>