mirror of
https://github.com/jlengrand/RemarkablePocket.git
synced 2026-03-10 08:41:19 +00:00
@@ -52,7 +52,7 @@ from https://docs.docker.com/get-docker/. Then run the following command to star
|
||||
have not tested it on Windows yet):
|
||||
|
||||
```
|
||||
touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.3.0
|
||||
touch ~/.remarkable-pocket ~/.rmapi && mkdir -p ~/.rmapi-cache && docker run -it --env TZ=Europe/Amsterdam -p 65112:65112 -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.4.0
|
||||
```
|
||||
|
||||
The first time you run the application, you will be asked to authorize Pocket and Remarkable Cloud. Once you have done
|
||||
|
||||
@@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "nl.carosi"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
|
||||
@@ -2,7 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
remarkable-pocket:
|
||||
image: ghcr.io/nov1n/remarkable-pocket:0.3.0
|
||||
image: ghcr.io/nov1n/remarkable-pocket:0.4.0
|
||||
restart: always
|
||||
environment:
|
||||
- TZ=Europe/Amsterdam
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<array>
|
||||
<string>/bin/sh</string>
|
||||
<string>-c</string>
|
||||
<string>while ! /usr/local/bin/docker version > /dev/null 2>&1; do sleep 5; done && /usr/local/bin/docker run --env TZ=Europe/Amsterdam -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.3.0 1>>$HOME/.remarkable-pocket.log 2>&1</string>
|
||||
<string>while ! /usr/local/bin/docker version > /dev/null 2>&1; do sleep 5; done && /usr/local/bin/docker run --env TZ=Europe/Amsterdam -v ~/.remarkable-pocket:/root/.remarkable-pocket -v ~/.rmapi:/root/.rmapi -v ~/.rmapi-cache:/root/.cache/rmapi ghcr.io/nov1n/remarkable-pocket:0.4.0 1>>$HOME/.remarkable-pocket.log 2>&1</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
|
||||
@@ -20,7 +20,6 @@ import pl.codeset.pocket.read.Sort;
|
||||
|
||||
final class PocketService {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PocketService.class);
|
||||
|
||||
private final String tagFilter;
|
||||
private final Pocket pocket;
|
||||
|
||||
|
||||
@@ -78,11 +78,11 @@ public class RemarkableApi {
|
||||
new Thread(
|
||||
() -> {
|
||||
Scanner sc = new Scanner(src);
|
||||
sc.useDelimiter(Pattern.compile("\\n|: "));
|
||||
sc.useDelimiter(Pattern.compile("\\n|\\): "));
|
||||
while (sc.hasNext()) {
|
||||
String token = sc.next();
|
||||
if (token.equals("Refreshing tree...")) {
|
||||
consumer.accept("Refreshing cache... This may take a while.");
|
||||
if (token.startsWith("Enter one-time code")) {
|
||||
consumer.accept(token + "):");
|
||||
} else {
|
||||
consumer.accept(token);
|
||||
}
|
||||
@@ -101,16 +101,15 @@ public class RemarkableApi {
|
||||
public void login() {
|
||||
try {
|
||||
Process proc =
|
||||
new ProcessBuilder(RMAPI_EXECUTABLE, "version").redirectInput(INHERIT).start();
|
||||
new ProcessBuilder(RMAPI_EXECUTABLE, "account").redirectInput(INHERIT).start();
|
||||
logStream(proc.getInputStream(), LOG::info);
|
||||
logStream(proc.getErrorStream(), LOG::error);
|
||||
int exitCode = proc.waitFor();
|
||||
LOG.info("");
|
||||
if (exitCode != 0) {
|
||||
throw new RuntimeException("Could not authenticate to Remarkable API");
|
||||
throw new RuntimeException("Could not connect to Remarkable Cloud");
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException("Could not authenticate to Remarkable API", e);
|
||||
throw new RuntimeException("Could not connect to Remarkable Cloud", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +138,7 @@ public class RemarkableApi {
|
||||
try {
|
||||
return objectMapper.readValue(Strings.join(info, '\n'), Document.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException("Error parsing Remarkable API response", e);
|
||||
throw new RuntimeException("Error parsing Remarkable Cloud response", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import pl.codeset.pocket.Pocket;
|
||||
SyncService.class,
|
||||
})
|
||||
public class SyncApplication {
|
||||
|
||||
@Bean
|
||||
DocumentBuilder documentBuilder() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
|
||||
@@ -41,7 +42,7 @@ public class SyncApplication {
|
||||
try {
|
||||
return new Pocket(authenticator.getAuth());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Could not authenticate with Pocket", e);
|
||||
throw new RuntimeException("Could not connect to Pocket", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import picocli.CommandLine.Option;
|
||||
sortOptions = false,
|
||||
usageHelpAutoWidth = true,
|
||||
// TODO: Read from gradle.properties
|
||||
version = "0.3.0",
|
||||
version = "0.4.0",
|
||||
mixinStandardHelpOptions = true)
|
||||
class SyncCommand implements Callable<Integer> {
|
||||
@Option(
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
19
update_rmapi_binaries.sh
Executable file
19
update_rmapi_binaries.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: ./update_rmapi_binaries.sh <repo> <version>
|
||||
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
|
||||
cd "${1}" || exit
|
||||
git fetch
|
||||
git checkout "${2}"
|
||||
|
||||
move() {
|
||||
mv rmapi "${SCRIPT_DIR}"/src/main/jib/usr/local/bin/rmapi_"${1}"
|
||||
}
|
||||
|
||||
GOOS=linux GOARCH=arm64 go build && move "aarch64"
|
||||
GOOS=linux GOARCH=arm GOARM=5 go build && move "arm"
|
||||
GOOS=linux GOARCH=amd64 go build && move "amd64"
|
||||
|
||||
cd "${SCRIPT_DIR}" || exit
|
||||
Reference in New Issue
Block a user