fork/chhoto-url

git clone https://git.julia.blue/fork/chhoto-url

Sayantan Santrafix: Handle malformed site urls and missing protocols (#143)e742eed

unicode
6.3 KiB123 linesraw
1# SPDX-FileCopyrightText: 2023-2026 Sayantan Santra <sayantan.santra689@gmail.com>
2# SPDX-License-Identifier: MIT
3
4services:
5  chhoto-url:
6    image: sintan1729/chhoto-url:alpine
7    # image: sintan1729/chhoto-url:alpine # for extra convenience
8    # The images can also be pulled from ghcr.io
9    restart: unless-stopped
10    container_name: chhoto-url
11    tty: true
12    # mem_limit: "50m"
13    # You may enable the next two options if you want. Make sure that you run the container as the proper
14    # user. In most cases, user: 1000:1000 should work. You might also need to mount a directory with your
15    # db and not just the file itself. Make sure to adjust CHHOTO_DB_URL accordingly.
16    # It does add extra security, but I don't know enough about docker to help in case it breaks something.
17    # cap_drop:
18    #   - ALL
19    ports:
20      # If you changed the "CHHOTO_LISTEN_PORT" environment variable, adjust accordingly
21      # The number AFTER the colon should match the "CHHOTO_LISTEN_PORT" variable and the number
22      # before the colon is the port where you would access the container from outside.
23      - 4567:4567
24    environment:
25      # Change if you want to mount the database somewhere else.
26      # In this case, you can get rid of the db volume below
27      # and instead do a mount manually by specifying the location.
28      - CHHOTO_DB_URL=/data/urls.sqlite
29      # Uncomment the next line to enable WAL mode. It's highly recommended.
30      # Make sure that you mount a directory instead of a bare file
31      # since that might have a (low, but non-zero) possibility of
32      # corrupting your db since we use WAL journaling mode
33      # (In fact, I'd suggest that you do that so that you can keep
34      # a copy of your database.)
35      - CHHOTO_SQLITE_USE_WAL_MODE=True
36      # If you'd like to disable ACID compliance, uncomment the next line.
37      # Note that there are risks. Look at the README for more.
38      # - CHHOTO_SQLITE_ENSURE_ACID=False
39      # Set this to True to disable all backups. Only do it if you know what you're doing.
40      # - CHHOTO_DISABLE_BACKUPS=False
41
42      # Change this to your public-facing URL. This is optional, as the link will work at any URL as
43      # long as Chhoto URL is accessible there. This mostly enhances the frontend experience, as copying to clipboard,
44      # QR code generation will use it if available.
45      # Do not surround it using quotes. If you have any unicode characters, please use the punycode. It'll be
46      # automatically converted to the correct unicode in the frontend.
47      # - CHHOTO_SITE_URL=https://www.example.com
48
49      # If you want to provided hashed password and API Key, uncomment the next line. Read the README
50      # for instructions for the hashing. Make sure to escape $ by $$.
51      # - CHHOTO_HASH_ALGORITHM=Argon2
52
53      # Change this if you are want to run Chhoto URL on a port which is not 4567, bind to something other
54      # than 0.0.0.0 for the backend. Do not change this unless you know what you're doing.
55      # - CHHOTO_LISTEN_PORT=4567
56      # - CHHOTO_LISTEN_ADDRESS=0.0.0.0
57
58      - CHHOTO_PASSWORD=TopSecretPass
59
60      # This needs to be set in order to use programs that use the JSON interface of Chhoto URL.
61      # You will get a warning if this is insecure, and a generated value will be output
62      # You may use that value if you can't think of a secure key
63      # - CHHOTO_API_KEY=SECURE_API_KEY
64
65      # Pass the redirect method, if needed. TEMPORARY and PERMANENT
66      # are accepted values, defaults to PERMANENT.
67      - CHHOTO_REDIRECT_METHOD=TEMPORARY
68
69      # By default, the auto-generated pairs are adjective-name pairs.
70      # If you want UIDs, please change slug_style to UID.
71      # Supported values for slug_style are Pair and UID.
72      # The length is 8 by default, and a minimum of 4 is allowed.
73      - CHHOTO_SLUG_STYLE=Pair
74      # - CHHOTO_SLUG_LENGTH=8
75      # To retry (once) with a longer UID upon collision, change the following to True.
76      # - CHHOTO_TRY_LONGER_SLUG=False
77      # If you want to use capital letters in the shortlink, change the following to
78      # True. This will also allow capital letters in UID slugs, if it is enabled.
79      # - CHHOTO_ALLOW_CAPITAL_LETTERS=False
80
81      # In case you want to provide public access to adding links (and not
82      # delete, or listing), change the following option to Enable.
83      # - CHHOTO_PUBLIC_MODE=Disable
84      # Additionally, it's possible to force an expiry delay in public mode.
85      # The user can still choose a shorter expiry delay. The input must be in seconds.
86      # It defaults to 0 i.e. no expiry.
87      # - CHHOTO_PUBLIC_MODE_EXPIRY_DELAY=3600
88      # In case you want to completely disable the frontend, change the following
89      # to True.
90      # - CHHOTO_DISABLE_FRONTEND=False
91      # You can use a custom site title by using the following. "- Poweder by Chhoto URL" will
92      # automatically added in the end.
93      # - CHHOTO_CUSTOM_SITE_TITLE=Custom Title
94      # If you want to serve a custom landing page, put all your site related files, along with an
95      # index.html file in a directory, and set the following to the path of the directory. Remember to first
96      # mount the directory inside the container. The admin page will then be located at /admin/manage.
97      # - CHHOTO_CUSTOM_LANDING_DIRECTORY=/custom/dir/location
98
99      # By default, the server sends no Cache-Control headers. You can supply a
100      # comma separated list of valid header as per RFC 7234 §5.2 to send those
101      # headers instead.
102      # - CHHOTO_CACHE_CONTROL_HEADER=no-cache, private
103      # By default, the frontend paginates the shortlinks in pages of size 10. You can use the following to
104      # customize that.
105      # - CHHOTO_FRONTEND_PAGE_SIZE=10
106      # Use this to allow extra protocols for longlinks. By default, only `http`, `https`, `ftp`, and `magnet` links are allowed.
107      # It should be a comma separated list. Malformed protocols will be skipped.
108      # - CHHOTO_EXTRA_PROTOCOLS=ftps,obsidian
109
110      # You may set the TZ variable for timezone in logging, but it will only work in the alpine builds
111      # TZ=America, Chicago
112    volumes:
113      - data:/data
114    # Disable this if using the scratch images.
115    healthcheck:
116      test: wget -qO- http://127.0.0.1:1729/healthz || exit 1
117      interval: 60s
118      start_period: 10s
119      retries: 3
120      timeout: 10s
121
122volumes:
123  db: