Skip to content

Commit ad0b0e7

Browse files
committed
fix: fixed Dockerfile and documentation.
1 parent d4f359e commit ad0b0e7

5 files changed

Lines changed: 29 additions & 99 deletions

File tree

.github/workflows/buildx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
- name: Build and push
2424
uses: docker/build-push-action@v5
2525
with:
26-
platforms: linux/amd64, linux/arm64, linux/arm, darwin/amd64, darwin/arm64, windows/amd64, windows/arm64
26+
platforms: linux/amd64, linux/arm64, linux/arm
2727
push: true
2828
tags: evilsocket/arc:latest

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM golang:1.22.2
33
ADD . /go/src/github.com/evilsocket/arc
44
WORKDIR /go/src/github.com/evilsocket/arc
55

6-
RUN go build -o build/arc cmd/arc/*.go
6+
RUN go build -o /bin/arc cmd/arc/*.go
77
EXPOSE 8443
88
EXPOSE 443
9-
ENTRYPOINT ./build/arc -config /config.toml
9+
ENTRYPOINT ["/bin/arc"]

README.md

Lines changed: 17 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -44,105 +44,35 @@ The idea is to use Arc as a single storage and manager for your passwords, encry
4444

4545
## Usage
4646

47-
You can find binary releases of Arc [here](https://github.com/evilsocket/arc/releases), if instead you want to build it from source, make sure you have Go >= 1.22.x installed and configured correctly, then clone this repository, install the dependencies and compile the `arc` server component:
47+
The simplest way to run `arc` is as a Docker container. First, make sure to copy `sample_config.toml` into your own `config.toml`.
4848

49-
go install github.com/evilsocket/arc/cmd/arc@latest
50-
51-
Once you either extracted the release archive or compiled it yourself, copy `sample_config.toml` to a new `config.toml` file and customize it. The most important fields to change are the `secret` ( a key used for token authentication ), the `username` and the `password`, which is the `bcrypt` hash of the authentication password you want to use, you can generate a new one with:
52-
53-
arc password "your-new-password" <optional-cost>
49+
The most important fields to change are the `secret` ( a key used for token authentication ), the `username` and the `password`, which is the `bcrypt` hash of the authentication password you want to use, you can generate a new one with:
5450

55-
Once everything is ready, youn can finally start the `arc` server:
56-
57-
arc -config config.toml -app arc
58-
59-
Now browse `https://localhost:8443/` ( or the address and port you configured ) and login with the configured credentials (make sure to add the generated HTTPS certificate as an exception in your browser).
51+
```sh
52+
docker run -it evilsocket/arc:latest password "your-new-password" <optional-cost>
53+
```
6054

6155
**NOTE**
6256

6357
Other than the username and the password, during login you need to specify an additional encryption key. This second key is not used to login to the system itself but to encrypt and decrypt your records client side. You can specify different keys each time you login, as long as you remember which key you used to encrypt which record :)
6458

65-
## Configuration
59+
Once everything is ready and you updated the configuration file, you can finally start the `arc` server:
6660

67-
This is the example configuration file you need to customize the first time.
61+
```sh
62+
docker run -it --network host \
63+
-v /path/to/your/config.toml:/etc/arc/config.toml \
64+
-v /path/to/data:/arc \
65+
-v $HOME/.config/tsnet-arc:/root/.config/tsnet-arc \
66+
evilsocket/arc:latest
67+
```
6868

69-
```toml
70-
##
71-
# Core configuration.
72-
##
73-
# address and port to bind the API to
74-
# NOTE: if tailscale is enabled, the address will be ignored.
75-
address = "0.0.0.0"
76-
port = 8443
77-
# Secret key to use for authentication token signing and verification.
78-
secret = ""
79-
# HTTPS certificate PEM file (if it does not exist, it will be automatically generated).
80-
certificate = "~/arc-certificate.pem"
81-
# HTTPS private key PEM file (if it does not exist, it will be automatically generated).
82-
key = "~/arc-key.pem"
83-
# API access username.
84-
username = "arc"
85-
# API access password `bcrypt` hash.
86-
password = "$2a$10$RuOcSEwPNNFlA/lxjpRY3.3J0tR0LG/FyfG/IXolgdDxPh7.urgGe"
87-
# Database root directory.
88-
database = "~/db"
89-
# Validity in minutes of a JWT API token after it's being generated.
90-
token_duration = 60
91-
# If true, records bigger than 1024 bytes will be asynchronously gzipped and served as compressed streams to the client.
92-
compression = true
93-
94-
# Tailscale specific configuration.
95-
[tailscale]
96-
# If true, will run this as a tailscale server node and won't be visible outside the tailscale network.
97-
# In order to authenticate the node, set the TS_AUTHKEY environment variable or follow the onscreen instructions.
98-
enabled = false
99-
# Tailscale hostname, if left empty the system hostname will be used.
100-
# NOTE: Make sure that HTTPS certificates are enabled for this tailscale host and that the hostname
101-
# matches the certificate.
102-
hostname = "stevie"
69+
Now browse `https://localhost:8443/` ( or the address and port you configured ) and login with the configured credentials (make sure to add the generated HTTPS certificate as an exception in your browser).
10370

104-
# Periodic tasks.
105-
[scheduler]
106-
# Scheduler is enabled by default.
107-
enabled = true
108-
# Period in seconds of the scheduler.
109-
period = 10
71+
Alternatively, you can find binary releases of Arc [here](https://github.com/evilsocket/arc/releases).
11072

111-
# Report system events.
112-
[scheduler.reports]
113-
enabled = false
114-
rate_limit = 60
115-
filter = ["login_ok", "login_ko", "token_ko", "update", "record_expired"]
116-
to = "youremail@gmail.com"
117-
118-
# If reports are enabled, this SMTP configuration is required for email notifications.
119-
[scheduler.reports.smtp]
120-
address = "smtp.gmail.com"
121-
port = 587
122-
username = "youremail@gmail.com"
123-
password = "your smtp password"
124-
125-
# Email notifications can be optionally encrypted with PGP.
126-
[scheduler.reports.pgp]
127-
enabled = true
128-
129-
# PGP Keys.
130-
[scheduler.reports.pgp.keys]
131-
# The ARC server PGP private key.
132-
private = "~/server.private.key.asc"
133-
# The emails recipient PGP public key.
134-
public = "~/my.public.key.asc"
135-
136-
# Backup configuration.
137-
[backups]
138-
enabled = false
139-
# Every 1800 run the command on that folder.
140-
period = 1800
141-
run = "scp arc-backup.tar user@backup-server:/media/arc_backup/"
142-
folder = "/some/backup/path/"
143-
```
73+
If instead you want to build it from source, make sure you have Go >= 1.22.x installed and configured correctly, then clone this repository, install the dependencies and compile the `arc` server component:
14474

145-
It is necessary to change only the `secret`, `username` and `password` access parameters of Arc, while the others can be left to their default values.
75+
go install github.com/evilsocket/arc/cmd/arc@latest
14676

14777
## Tailscale / Headscale Integration
14878

cmd/arc/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var (
4242
)
4343

4444
func init() {
45-
flag.StringVar(&confFile, "config", "", "JSON configuration file.")
45+
flag.StringVar(&confFile, "config", "/etc/arc/config.toml", "Configuration file.")
4646
flag.BoolVar(&noAuth, "no-auth", noAuth, "Disable authentication.")
4747
flag.BoolVar(&noUpdates, "no-updates", noUpdates, "Disable updates check.")
4848

sample_config.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
address = "0.0.0.0"
77
port = 8443
88
# Secret key to use for authentication token signing and verification.
9-
secret = ""
9+
secret = "p9ry34908fh34890fgh8934ghr8934hgr9834r9h8349hf9348hf94h"
1010
# HTTPS certificate PEM file (if it does not exist, it will be automatically generated).
11-
certificate = "~/arc-certificate.pem"
11+
certificate = "/arc/arc-certificate.pem"
1212
# HTTPS private key PEM file (if it does not exist, it will be automatically generated).
13-
key = "~/arc-key.pem"
13+
key = "/arc/arc-key.pem"
1414
# API access username.
1515
username = "arc"
16-
# API access password `bcrypt` hash.
17-
password = "$2a$10$RuOcSEwPNNFlA/lxjpRY3.3J0tR0LG/FyfG/IXolgdDxPh7.urgGe"
16+
# API access password `bcrypt` hash. CHANGE THIS.
17+
password = "$2a$10$LxGzW9Nrp9PHQFd6ijtP5O0XGHr61Yj6jhCBDmBCfe/PETnxAVZVq"
1818
# Database root directory.
19-
database = "~/db"
19+
database = "/arc/db"
2020
# Validity in minutes of a JWT API token after it's being generated.
2121
token_duration = 60
2222
# If true, records bigger than 1024 bytes will be asynchronously gzipped and served as compressed streams to the client.
@@ -62,9 +62,9 @@ enabled = true
6262
# PGP Keys.
6363
[scheduler.reports.pgp.keys]
6464
# The ARC server PGP private key.
65-
private = "~/server.private.key.asc"
65+
private = "/arc/pgp-server.private.key.asc"
6666
# The emails recipient PGP public key.
67-
public = "~/my.public.key.asc"
67+
public = "/arc/pgp-my.public.key.asc"
6868

6969
# Backup configuration.
7070
[backups]

0 commit comments

Comments
 (0)