szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.65k stars 167 forks source link

.env file provided by docker-setup.sh has incorrect examples #188

Open decaby7e opened 1 year ago

decaby7e commented 1 year ago

Example:

# Hides the navigation bar on every page.
# Default value: 8080
export MICROBIN_HIDE_HEADER=false

# Hides the footer on every page.
# Default value: 8080
export MICROBIN_HIDE_FOOTER=false

# Hides the MicroBin logo from the navigation bar on every
# page.
# Default value: 8080
export MICROBIN_HIDE_LOGO=false

# Disables the /pastalist endpoint, essentially making all
# pastas private.
# Default value: 8080
export MICROBIN_NO_LISTING=false
szabodanika commented 1 year ago

Yeah, those are definitely not the actual default values. I think in the documentation I fixed these but apparently not in the default .env? Thanks for catching this and letting me know! By the way, all boolean variables have false as their default value.

simonl169 commented 1 year ago

I have a problem that is probably related to this. I use docker-compose with Portainer to deploy ma instance. I only use a few env-variables, like admin-PW, those are set correctly, but the ones I dont set (to get the default values/settings) dont match the defaults in the documentation, eg. Syntax-highlighting

szabodanika commented 1 year ago

@simonl169 that sounds annoying, can you say which ones seem to have different defaults from what's documented in the .env file? I should fix these ASAP

simonl169 commented 1 year ago

I believe its basically every variable. Everyone is set to false or unset, except those I manually set. I screenshotted them and marked which I set manually, I unfortunately dont have time to compare to the documentation

Screenshot from 2023-07-16 13-25-18

I also append my docker-compose:

services:
  paste:
    image: danielszabo99/microbin:2.0.4
    restart: always
    ports:
     - "9013:8080"
    volumes:
     - microbin-data:/app/pasta_data
    environment:
      MICROBIN_ADMIN_USERNAME: redacted
      MICROBIN_ADMIN_PASSWORD: redacted
      MICROBIN_HIGHLIGHTSYNTAX: true
      MICROBIN_DEFAULT_EXPIRY: 1week

volumes:
  microbin-data:  

Maybe the standard .env file inside the container is not loaded correctly?

simonl169 commented 1 year ago

Just had a look at the docs and I'm correct. Any variable to be said true iby default in the docs is set to false here, eg. ENABLE_READONLY

mcdent commented 1 year ago

I'm seeing something similar. With a blank environment file loaded, the CSS, dark mode etc renders correctly. As soon as I begin to use the default environment file, the CSS styling seems to disappear and the microbic logo vanishes too? See below.

Screenshot 2023-07-16 at 22 11 59

szabodanika commented 1 year ago

I think the styling getting messed up has to do with the public path variable. In the console you will probably find errors about trying to load the styling and the logo from a nonexistent path. This is really strange behaviour that I am pretty sure I tested for before but I will have another look. In the meantime please do use the .env files (remember, without any configuration, your server will use the default admin login as well)