You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,8 +19,6 @@ A vanity file sharing service with support for ShareX. You can see a preview at
19
19
-[features](#features)
20
20
-[screenshots](#screenshots)
21
21
-[installation](#installation)
22
-
-[configuration](#configuration)
23
-
-[updating](#updating)
24
22
-[development](#development)
25
23
-[`web` package notes](#web-package-notes)
26
24
-[todo](#todo)
@@ -45,6 +43,7 @@ A vanity file sharing service with support for ShareX. You can see a preview at
45
43
-[x] Conversions (GIF>WebM, WebP>PNG, etc.)
46
44
-[x] Purging of old and/or large files (`config.purge`).
47
45
-[x] 2FA support
46
+
-[X] Decay files to S3 to save space
48
47
49
48
## screenshots
50
49
@@ -67,37 +66,7 @@ A vanity file sharing service with support for ShareX. You can see a preview at
67
66
68
67
## installation
69
68
70
-
> [!NOTE]
71
-
> If you need help, join the [discord server](https://discord.gg/VDMX6VQRZm). This guide assumes you are on linux with a basic understanding of linux and docker.
72
-
73
-
> [!TIP]
74
-
> If you are already familiar with docker, you can look at the [compose file](./example/compose.yml) and [config file](./example/.microrc.yaml) to get setup quickly. The below is a more detailed guide for inexperienced users.
75
-
76
-
1. Install `git` and `docker`
77
-
2. Download the files in this repository, `git clone https://github.com/sylv/micro.git`
78
-
3. Copy the example configs to the current directory, `cp ./micro/example/* ./`
79
-
4. Fill out `.microrc.yaml`, `Caddyfile` and `docker compose.yml`. **It is extremely important you read through each of the 3 files and make sure you understand what they do.** Specifically, `.microrc.yaml` contains a secret that handles authentication, if it is not a secure random string everyone can sign in as anyone they want without a password.
80
-
5. Run `docker compose up -d` to start the database and micro.
81
-
6. Get the startup invite by doing `docker compose logs micro` and copying the invite URL that should be somewhere towards the end of the log. Go to that URL to create the first account.
82
-
83
-
Setup is now complete and your instance should be working.
84
-
To add another user, sign in then go to `/api/invite` and copy the URL it gives you. This will be improved in the future.
85
-
86
-
### configuration
87
-
88
-
micro uses [venera](https://github.com/sylv/venera) to load configuration files. Configuration files are validated on startup, and may log errors if invalid setups are detected. The venera page has more information, but tl;dr:
89
-
90
-
-`.microrc.yaml` is the main configuration file.
91
-
- You can override any config value with an environment variable. The key `hosts.0.url` would be set as `MICRO_HOSTS__0__URL`
92
-
- You can use other file formats, like JSON or TOML.
93
-
94
-
### updating
95
-
96
-
You should take a full database backup before updating, but you won't, will you?
97
-
The database will be automatically migrated on startup.
98
-
99
-
1.`docker compose pull micro`
100
-
2.`docker compose up -d micro`
69
+
[See the `example` directory](./example) for how to setup micro.
This directory contains an example deployment for micro.
4
+
It uses [docker](https://docker.com) and [cloudflare tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/) to deploy it anywhere.
5
+
6
+
## usage
7
+
8
+
> [!NOTE]
9
+
> If you need help, join the [discord server](https://discord.gg/VDMX6VQRZm). This guide assumes you are on linux with a basic understanding of linux and docker.
10
+
11
+
> [!IMPORTANT]
12
+
> This guide assumes you have installed docker and cloudflare tunnel. It also assumes you have basic knowledge of them.
13
+
> If you are stuck or discover problems with this guide, ask in the [discord server](https://discord.gg/VDMX6VQRZm) or look at other guides for discord/cloudflare tunnel.
14
+
15
+
1. Clone the example to a local directory
16
+
2. Fill out `micro.yaml`, each option is documented in the file. Most importantly, make sure `secret` is changed.
17
+
3. Replace the postgresql password in `compose.yaml` with a secure password.
3. You will get a tunnel ID that looks like `168b9890-caa1-44c1-822b-12cf1a5e361e`, copy it and replace `YOUR_TUNNEL_ID` in `tunnel.yaml` with it.
22
+
4. Replace the `example.net` domain with your own domain in `tunnel.yaml`.
23
+
5. Start micro with `docker compose up -d`
24
+
6. Run `docker compose logs micro`, the initial startup will log an invite link. Go to it and setup the first account, which is given admin permissions automatically.
25
+
26
+
> [!TIP]
27
+
> Consider swapping cloudflare tunnel for something else. It's used in this example for convenience as it works behind NATs and firewalls and provides automatic SSL. You might prefer using Caddy, nginx, traefik, or something else in its place.
28
+
29
+
### configuration
30
+
31
+
All the configuration options are listed in [the example config](./micro.yaml) file. [venera](https://github.com/sylv/venera) is used to load configs, which are validated at startup and may log errors if an invalid configuration is detected. The venera page has detailed information, but tl;dr:
32
+
33
+
-`.microrc.yaml` is the main configuration file.
34
+
- You can override any config value with an environment variable. The key `hosts.0.url` would be set as `MICRO_HOSTS__0__URL`
35
+
- You can use other file formats, like JSON or TOML.
36
+
37
+
### updating micro
38
+
39
+
You should take a full database backup before updating, but you won't, will you?
40
+
The database will be automatically migrated on startup, all you have to do is run a newer version of micro.
41
+
42
+
1.`docker compose pull micro`
43
+
2.`docker compose up -d micro`
44
+
45
+
### updating postgresql
46
+
47
+
Updating postgres is an involved process. Google will have better information. In general, you will want to do something like this:
48
+
49
+
- Export your database to a `.sql` file, using something like `docker compose exec postgres pg_dump -U postgres -d micro > backup.sql`
50
+
- Stop your database
51
+
- Rename the database directory to something else, like `mv ./data ./data-old`
52
+
- Update `compose.yaml` to point to the new postgres version, for example `postgres:16-alpine` is for v16 of postgres.
53
+
- Start the database `docker compose up -d postgres`
54
+
- Restore the database using the `.sql` file
55
+
- Once it all checks out, you can delete the old database directory if you are confident you won't need it.
0 commit comments