mirror of
https://github.com/spaytac/linkdingsync.git
synced 2026-01-21 16:54:45 +00:00
**update** README.md
**update** examples/linkding/docker-compose.yml **update** examples/wallabag/docker-compose.yml
This commit is contained in:
parent
4c942d6122
commit
fdcfba3c90
53
README.md
53
README.md
@ -35,12 +35,12 @@ Environment variables for the linkding worker.
|
|||||||
| Linkding__Key | text | The linkding application key | [Instructions](https://github.com/sissbruecker/linkding/blob/master/docs/API.md) |
|
| Linkding__Key | text | The linkding application key | [Instructions](https://github.com/sissbruecker/linkding/blob/master/docs/API.md) |
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
The following explains the configuration options.
|
The following explains the configuration options. The Configuration file must be mapped to **/app/data/config.yml**
|
||||||
### WallabagSync
|
### WallabagSync
|
||||||
The configuration is optional. In the configuration (**YAML File**) rules can be defined in regex to exclude certain domains from sync.
|
The configuration is optional. In the configuration (**YAML File**) rules can be defined in regex to exclude certain domains from sync.
|
||||||
|
|
||||||
Exampel:
|
Exampel:
|
||||||
````yaml
|
```yaml
|
||||||
excludedDomains:
|
excludedDomains:
|
||||||
- name: youtube
|
- name: youtube
|
||||||
pattern: 'https://[[a-zA-Z0-9]+\.]?(youtube)\.com(?:/.*)?'
|
pattern: 'https://[[a-zA-Z0-9]+\.]?(youtube)\.com(?:/.*)?'
|
||||||
@ -48,7 +48,7 @@ excludedDomains:
|
|||||||
pattern: 'https://[[a-zA-Z0-9]+\.]?(ebay)\.(com|de|fr)(?:/.*)?'
|
pattern: 'https://[[a-zA-Z0-9]+\.]?(ebay)\.(com|de|fr)(?:/.*)?'
|
||||||
- name: amazon
|
- name: amazon
|
||||||
pattern: 'https://[[a-zA-Z0-9]+\.]?(amazon)\.(com|de|fr)(?:/.*)?'
|
pattern: 'https://[[a-zA-Z0-9]+\.]?(amazon)\.(com|de|fr)(?:/.*)?'
|
||||||
````
|
```
|
||||||
With this configuration every matching bookmark from linkding will be excluded from the sync.
|
With this configuration every matching bookmark from linkding will be excluded from the sync.
|
||||||
|
|
||||||
### LinkdingUpdater
|
### LinkdingUpdater
|
||||||
@ -57,7 +57,7 @@ The configuration is optional. In the configuration (**YAML File**) rules can be
|
|||||||
If operated without a configuration file, only the year of the tag is added (currently).
|
If operated without a configuration file, only the year of the tag is added (currently).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
````yaml
|
```yaml
|
||||||
urlTagMapping:
|
urlTagMapping:
|
||||||
- name: microsoft_azure
|
- name: microsoft_azure
|
||||||
url: https://github.com/azure
|
url: https://github.com/azure
|
||||||
@ -97,30 +97,59 @@ taggingRule:
|
|||||||
- name: github.io
|
- name: github.io
|
||||||
pattern: https://([a-zA-Z0-9]+)\.(github)\.io[/]?([a-zA-Z0-9\-\+_]+)(?:/)?([a-zA-Z0-9\-\+_]+)?(?:/.*)?
|
pattern: https://([a-zA-Z0-9]+)\.(github)\.io[/]?([a-zA-Z0-9\-\+_]+)(?:/)?([a-zA-Z0-9\-\+_]+)?(?:/.*)?
|
||||||
replace: $1,$2,$3
|
replace: $1,$2,$3
|
||||||
````
|
```
|
||||||
|
|
||||||
|
#### urlTagMapping
|
||||||
|
If the bookmark should match one - or more - of the urlTagMappings, then value of name is added as tag to this bookmark.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
https://github.com/azure/something will be tagged with microsoft_azure
|
||||||
|
|
||||||
|
#### taggingRule
|
||||||
|
Dynamic tags can be assigned to the bookmarks on the basis of the URL using regular expression. If one of the patterns matches, the values of the groups are added to the bookmark as a tag.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Here is an example using a reddit bookmark.
|
||||||
|
Url:
|
||||||
|
- ht<span>tps://ww</span>w.reddit.com/r/selfhosted/comments/yzq6qp/running_a_mostly_sbcbased_nomad_cluster_in_my/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=2&utm_content=share_button
|
||||||
|
|
||||||
|
Pattern:
|
||||||
|
- https://(?:www\.)?(reddit)\.com(?:/r/)?([a-zA-Z0-9\-\+_]+)?(?:/.*)?
|
||||||
|
|
||||||
|
Matches:
|
||||||
|
- ht<span>tps://ww</span>w.<span style="color:red">reddit</span>.com/r/<span style="color:red">selfhosted</span>/comments/yzq6qp/running_a_mostly_sbcbased_nomad_cluster_in_my/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=2&utm_content=share_button
|
||||||
|
|
||||||
|
if you would change the pattern to the following.
|
||||||
|
Pattern:
|
||||||
|
- https://(?:www\.)?(reddit)\.com(?:/)?(r/[a-zA-Z0-9\-\+_]+)?(?:/.*)?
|
||||||
|
|
||||||
|
then the following would match.
|
||||||
|
- ht<span>tps://ww</span>w.<span style="color:red">reddit</span>.com/<span style="color:red">r/selfhosted</span>/comments/yzq6qp/running_a_mostly_sbcbased_nomad_cluster_in_my/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=2&utm_content=share_button
|
||||||
|
|
||||||
## Docker Run
|
## Docker Run
|
||||||
```
|
```bash
|
||||||
docker run --rm -it --env-file .env -v <path>/config.yml:/app/data/config.yml linkdingsync/wallabag:latest
|
docker run --rm -it --env-file .env -v <path>/config.yml:/app/data/config.yml ghcr.io/spaytac/linkding-updater:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also
|
```bash
|
||||||
|
docker run --rm -it --env-file .env -v <path>/config.yml:/app/data/config.yml ghcr.io/spaytac/wallabag-sync:latest
|
||||||
|
```
|
||||||
|
|
||||||
## Docker Compose
|
## Docker Compose
|
||||||
You can find [examples](./examples/) in the examples folder..
|
You can find [examples](./examples/) in the examples folder..
|
||||||
|
|
||||||
- [Wallabag Example](./examples/wallabag/)
|
- [WallabagSync Example](./examples/wallabag/)
|
||||||
- [LinkdingUpdater Example](./examples/linkding/)
|
- [LinkdingUpdater Example](./examples/linkding/)
|
||||||
|
|
||||||
|
|
||||||
## Build Docker Image
|
## Build Docker Images
|
||||||
|
|
||||||
### LinkdingUpdater
|
### LinkdingUpdater
|
||||||
```
|
```
|
||||||
docker build -t linkdingsync/linkdingupdater:latest -f .\Dockerfile_Linkding .
|
docker build -t linkdingsync/linkding-updater:latest -f .\Dockerfile_Linkding .
|
||||||
```
|
```
|
||||||
|
|
||||||
### WallabagSync
|
### WallabagSync
|
||||||
```
|
```
|
||||||
docker build -t linkdingsync/wallabag:latest -f .\Dockerfile_Wallabag .
|
docker build -t linkdingsync/wallabag-sync:latest -f .\Dockerfile_Wallabag .
|
||||||
```
|
```
|
||||||
@ -2,9 +2,9 @@ version: '3.9'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
linkdingupdater:
|
linkdingupdater:
|
||||||
image: linkdingsync/linkdingupdater:latest
|
image: ghcr.io/spaytac/linkding-updater:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yml:/data/config.yml
|
- ./config.yml:/app/data/config.yml
|
||||||
# env_file:
|
# env_file:
|
||||||
# - .env
|
# - .env
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@ -2,9 +2,9 @@ version: '3.9'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
wallabagsync:
|
wallabagsync:
|
||||||
image: linkdingsync/wallabag:latest
|
image: ghcr.io/spaytac/wallabag-sync:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yml:/data/config.yml
|
- ./config.yml:/app/data/config.yml
|
||||||
# env_file:
|
# env_file:
|
||||||
# - .env
|
# - .env
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@ -26,6 +26,9 @@ namespace Wallabag.Handler
|
|||||||
{
|
{
|
||||||
var settings = SettingsService.Settings;
|
var settings = SettingsService.Settings;
|
||||||
|
|
||||||
|
// var settingsString = JsonSerializer.Serialize(settings);
|
||||||
|
// logger.LogInformation($"settings: {settingsString}");
|
||||||
|
|
||||||
var tagName = configuration.GetValue<string>("Worker:SyncTag");
|
var tagName = configuration.GetValue<string>("Worker:SyncTag");
|
||||||
|
|
||||||
linkdingBookmarks =
|
linkdingBookmarks =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user