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
Copy file name to clipboardExpand all lines: README.md
+34-24Lines changed: 34 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,22 @@
9
9
10
10
---
11
11
12
-
A simple self-hosted app for sharing text snippets and files within your local network across any device. It also includes and a notepad to throw rough notes in. Think of this as a simple and elegant alternative to airdrop, local-pastebin and a scratchpad. The primary features are:
13
-
14
-
- Make plain text snippets available to view/share on any device in the local network
15
-
- Upload files and make them available to view/download on any device in the local network
16
-
- Built-in Notepad with both Markdown and Rich Text editing capabilities
17
-
- Rename text snippets and files uploaded to easily find them in the UI
18
-
- Edit text snippets to modify their content as needed
19
-
- Multi-file drag-n-drop (drop into the text area) support for uploading files
20
-
- Configurable expiration per file or snippet for 1 hour, 4 hours, or 1 day
21
-
22
-
From a technology perspective, the app boasts the following:
23
-
24
-
- Pure HTTP API, i.e., *no use of websockets* - this is good because it means *no external communications needed* for the sharing aspect
25
-
- Available as a binary for MacOS, Windows, and Linux for both x86-64 and ARM64 architectures
26
-
- Multi-arch (x86-64 and ARM64) Docker image for homelab deployments
27
-
- Works well with reverse proxies in the mix (tested with Cloudflare tunnels and Nginx Proxy Manager)
28
-
- Frontend available over browsers and as a PWA (so it shows as an app with an icon on the mobile home screens)
29
-
- Clean, modern interface with dark mode support that looks good on mobile too
12
+
A simple & elegant self-hosted app for **storing/sharing text snippets and files** in your **local network** with **no setup on client devices**. Think of this as an *all-in-one alternative* to **airdrop**, **local-pastebin**, and a **scratchpad**. The primary features are:
13
+
14
+
- Make plain text **snippets** available to **view/share** on any device in the local network
15
+
-**Upload files** and make them available to **view/download** on any device in the local network
16
+
- Built-in **Notepad** with both **Markdown** and **Rich Text** editing capabilities
17
+
-**Rename** text snippets and files uploaded to easily find them in the UI
18
+
-**Edit** text snippets to modify their content as needed
19
+
-**Multi-file****drag-n-drop** (drop into the text area) support for uploading files
20
+
- Configurable **expiration (or TTL, i.e., time to live)** per file/snippet for Never, 1 hour, 4 hours, 1 day, or Custom
21
+
- Use of **SSE** to automatically inform all clients of new/deleted/edited files
22
+
- Completely **local assets**, so the app works in your network even without internet
23
+
-**Multi-arch** (x86-64 and ARM64) **Docker image** for **homelab** deployments
24
+
- Frontend available over **browsers** and as a **PWA** (progressive web apps)
25
+
- Clean, modern interface with **automatic light/dark** UI that looks good on mobile too
26
+
27
+
Make sure to look into [Tips & Notes](#tips-and-notes) if you have questions about individual functionalities.
30
28
31
29
> [!NOTE]
32
30
> This application is meant to be deployed within your homelab only. There is no authentication mechanism implemented. If you are exposing to the public, ensure there is authentication fronting it and non-destructive users using it.
@@ -56,7 +54,7 @@ From a technology perspective, the app boasts the following:
56
54
57
55
## Installation and Usage
58
56
59
-
### Using Docker (Recommended)
57
+
### Using Docker (Recommended for Self-Hosting)
60
58
61
59
Use `docker` CLI one liner and setup a persistence directory (so a container failure does not delete your data):
62
60
@@ -70,7 +68,7 @@ docker run --name local-content-share \
70
68
tanq16/local-content-share:main
71
69
```
72
70
73
-
The application will be available at `http://localhost:8080`
71
+
The application will be available at `http://localhost:8080` (or your server IP).
74
72
75
73
You can also use the following compose file with container managers like Portainer and Dockge (remember to change the mounted volume):
76
74
@@ -91,7 +89,7 @@ Download the appropriate binary for your system from the [latest release](https:
91
89
92
90
Make the binary executable (for Linux/macOS) with `chmod +x local-content-share-*` and then run the binary with `./local-content-share-*`. The application will be available at `http://localhost:8080`.
93
91
94
-
### Using Go
92
+
### Local development
95
93
96
94
With `Go 1.23+` installed, run the following to download the binary to your GOBIN:
97
95
@@ -131,17 +129,29 @@ go build .
131
129
- To delete content, click the trash icon
132
130
- To set expiration for a file or snippet
133
131
- Click the clock icon with the "Never" text (signifying no expiry) to cycle between times
134
-
- Set the cycling button to 1 hour, 4 hours, or 1 day before adding a snippet or file
135
132
- For a non-"Never" expiration, the file will automatically be removed after the specified period
133
+
- Set the cycling button to 1 hour, 4 hours, 1 day, or Custom before adding a snippet or file
134
+
- The Custom option will prompt to ask for the expiry after you click submit/upload
135
+
- The value for custom expiration can be of the format `NT` (eg. `34m`, `3w`, `2M`, `11d`)
136
+
- N is the number and T is the time denomination (m=minute, h=hour, d=day, w=week, M=month, y=year)
137
+
- Use the `DEFAULT_EXPIRY` environment variable to set a default expiration
138
+
- This value will be set as default on the home page instead of `Never`
139
+
- The other options will still be available by cycling if needed
136
140
- The Notepad is for writing something quickly and getting back to it from any device
137
141
- It supports both markdown and richtext modes
138
142
- Content is automatically saved upon inactivity in the backend and will load as is on any device
139
143
140
-
A quick note of the data structure: the application creates a `data` directory to store all uploaded files, uploaded text snippets, notepad notes (in `files`, `text`, and `notepad` subfolders respectively). File expirations are saved in an `expiration.json` file in the data directory. Make sure the application has write permissions for the directory where it runs.
144
+
### A Note on Reverse Proxies
145
+
146
+
Reverse proxies are fairly common in homelab settings to assign SSL certificates
147
+
148
+
### Backend Data Structure
149
+
150
+
The application creates a `data` directory to store all uploaded files, uploaded text snippets, notepad notes (in `files`, `text`, and `notepad` subfolders respectively). File expirations are saved in an `expiration.json` file in the data directory. Make sure the application has write permissions for the directory where it runs.
141
151
142
152
## Acknowledgements
143
153
144
154
The following people have contributed to the project:
145
155
146
156
- [TheArktect](https://github.com/TheArktect) - Added CLI argument for listen address.
147
-
- Several other users who created feature requests via GitHub issues.
157
+
- A lot of other users who created feature requests via GitHub issues.
0 commit comments