mirror of
				https://github.com/miawinter98/just-short-it.git
				synced 2025-10-31 16:15:28 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "9ef8baa17ce2a644420933c7d095b4a9a9179d26" and "c57c5a269fcbc295c3ad720b16c4ccfbf7995b98" have entirely different histories.
		
	
	
		
			9ef8baa17c
			...
			c57c5a269f
		
	
		
|  | @ -7,13 +7,10 @@ | |||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
|     <base href="/" /> | ||||
| 
 | ||||
|     <link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||||
|     <link rel="icon" type="image/png" sizes="512x512" href="/android-chrome-512x512.png"> | ||||
|     <link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png"> | ||||
|     <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | ||||
|     <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | ||||
|     <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | ||||
|     <link rel="manifest" href="/site.webmanifest"> | ||||
|     <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | ||||
| 
 | ||||
|     <link rel="stylesheet" href="/css/main.min.css" asp-append-version="true" /> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| @page "/" | ||||
| @page "/{Id:nonfile}" | ||||
| @page "/{Id}" | ||||
| @using Microsoft.Extensions.Caching.Distributed | ||||
| 
 | ||||
| @inject IDistributedCache Db | ||||
|  |  | |||
|  | @ -10,10 +10,10 @@ | |||
| 
 | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Humanizer.Core" Version="2.14.1" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.8" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.8" /> | ||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" /> | ||||
|     <PackageReference Include="StackExchange.Redis" Version="2.8.16" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.0" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0" /> | ||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" /> | ||||
|     <PackageReference Include="StackExchange.Redis" Version="2.7.4" /> | ||||
|   </ItemGroup> | ||||
| 
 | ||||
| </Project> | ||||
|  |  | |||
							
								
								
									
										80
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										80
									
								
								README.md
									
									
									
									
									
								
							|  | @ -17,13 +17,15 @@ The most KISS single user URL shortener there is. | |||
| docker run -e JSI_BaseUrl=<your-url> \ | ||||
|            -e JSI_Account__Username=<your-username> \ | ||||
|            -e JSI_Account__Password=<your-password> \ | ||||
|            -p 80:8080 \ | ||||
|            -p 80:8080 | ||||
|            miawinter/just-short-it:latest | ||||
| ``` | ||||
| 
 | ||||
| 
 | ||||
| ## In Docker Compose: | ||||
| ```yaml | ||||
| version: '3.4' | ||||
| 
 | ||||
| services: | ||||
|   just-short-it: | ||||
|     container_name: JustShortIt | ||||
|  | @ -48,6 +50,8 @@ and optional `JSI_Redis__InstanceName` (default is "JustShortIt"). | |||
| If you want to run both with compose, the most simple setup looks like this: | ||||
| 
 | ||||
| ```yaml | ||||
| version: '3.4' | ||||
| 
 | ||||
| services: | ||||
|   just-short-it: | ||||
|     container_name: JustShortIt | ||||
|  | @ -78,77 +82,16 @@ There you go, now your urls survive a restart! | |||
| # Https | ||||
| 
 | ||||
| Just Short It! is not supporting Https, I reconmend using a reverse Proxy for hosting | ||||
| that handles SSL. I personally have experience with two types of reverse proxies here: caddy  | ||||
| and nginx-proxy. | ||||
| 
 | ||||
| ## Caddy | ||||
| 
 | ||||
| The easiest way to get https with a reverse proxy is [Caddy](https://hub.docker.com/_/caddy). | ||||
| 
 | ||||
| ```yaml | ||||
| services: | ||||
|   # Just Short It  | ||||
|   just-short-it: | ||||
|     container_name: JustShortIt | ||||
|     image: miawinter/just-short-it:latest | ||||
|     environment: | ||||
|       - "JSI_BaseUrl=<your-url>" | ||||
|       - "JSI_Account__Username=<your-username>" | ||||
|       - "JSI_Account__Password=<your-password>" | ||||
|       - "JSI_Redis__ConnectionString=redis,password=<your-redis-password>" | ||||
|     depends_on: | ||||
|       - redis | ||||
|   redis: | ||||
|     container_name: Redis | ||||
|     image: redis:alpine | ||||
|     environment: | ||||
|       - "REDIS_PASSWORD=<your-redis-password>" | ||||
|     volumes: | ||||
|       - redis:/data | ||||
|   caddy: | ||||
|     container_name: Caddy | ||||
|     image: caddy:latest | ||||
|     ports: | ||||
|       - "80:80" | ||||
|       - "443:443" | ||||
|       - "443:443/udp" | ||||
|     volumes: | ||||
|       - caddy_sites: /sites | ||||
|       - caddy_data: /data | ||||
|       - caddy_config:/config | ||||
|       - ./Caddyfile:/etc/caddy/Caddyfile | ||||
| 
 | ||||
| volumes: | ||||
|   redis: | ||||
|   caddy_sites: | ||||
|   caddy_data: | ||||
|   caddy_config: | ||||
| ``` | ||||
| 
 | ||||
| Then you need a `Caddyfile`: | ||||
| 
 | ||||
| ``` | ||||
| <your_domain> { | ||||
|   tls <your-email> | ||||
|   reverse_proxy JustShortIt:8080 | ||||
| } | ||||
| ``` | ||||
| 
 | ||||
| The tls property is the email used for let's encrypt, there you would be notified if a  | ||||
| certificate is about to expire (which won't happen as long as caddy is running, because  | ||||
| it automatically requests new ones before they do).   | ||||
| The domain should only be [subdomain?].[domain].[tls], if you prefix it with http or https | ||||
| caddy will only support that, but without this caddy responds to both and will automatically  | ||||
| redirect from http to https, as well as take care of the https certificates. | ||||
| 
 | ||||
| ## nginx-prodxy | ||||
| 
 | ||||
| jwilders [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) togehter with  | ||||
| [acme-companion](https://github.com/nginx-proxy/acme-companion). | ||||
| that handles SSL. I can highly reconmend jwilders  | ||||
| [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) togehter with  | ||||
| [acme-companion](https://github.com/nginx-proxy/acme-companion),  | ||||
| there is no easier way to get a reverse proxy with automatic certificate renewal. | ||||
| 
 | ||||
| Here is an Example of how to use Just Short It! togehter with nginx-proxy: | ||||
| 
 | ||||
| ```yaml | ||||
| version: '3.4' | ||||
| 
 | ||||
| services: | ||||
|   # Just Short It | ||||
|   just-short-it: | ||||
|  | @ -216,6 +159,7 @@ volumes: | |||
|   conf: | ||||
|   vhost: | ||||
|   html: | ||||
| 
 | ||||
| ``` | ||||
| 
 | ||||
| # License and Attribution | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue