Skip to content

lachlanshoesmith/slimcontroller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

slimcontroller ๐Ÿง™

a stupidly simple URL shortener. or lengthener. redirectioner.

running

to run slimcontroller, you'll need to have a valkey/redis server running somewhere. spinning up a valkey server locally is easy:

docker run -d --name valkey -p 6379:6379 valkey/valkey:latest

note that valkey is not persistent by default, so all shorthands created will be wiped when the server is restarted. it's up to you on how you handle this. more info here

docker

  1. docker build -t slimcontroller .
  2. docker run -p <SERVER_PORT>:<SERVER_PORT> -e REDIS_URL=<REDIS_URL> slimcontroller

from source

  1. cargo build --release
  2. ./target/release/slimcontroller <SERVER_PORT> <REDIS_URL>
  3. the frontend can then be accessed via localhost:SERVER_PORT.

mandatory arguments

any of the following may be supplied as environment variables.

  • SERVER_PORT can be any u16
  • REDIS_URL can be a URL (String) or port (u16)
    • if a port alone is provided, it's assumed your server's running locally
    • a valid REDIS_URL might be 127.0.0.1:6379 if you ran the above command

you should specify an --admin-password. see authentication for more information.

deployment

i recommend following the above docker instructions. don't forget to set the --server-hostname (may be an environment variable SERVER_HOSTNAME).

authentication

if you'd like, you can make individual set/delete operations require a password. just pass in the --password <PASSWORD> flag.

you should provide an --admin-password when running slimcontroller. if you don't provide one, your admin password will be the same as your --password. if you provide neither, you will not be able to access the /admin panel at all.

so long as you have an admin password of some variety, you can access the /admin panel.