├── conf ├── opt │ └── yourls │ │ ├── index.php │ │ ├── user │ │ ├── plugins │ │ │ ├── .PLACEHOLDER │ │ │ └── fallback_url_config │ │ │ │ └── plugin.php │ │ └── config.php │ │ └── .htaccess └── etc │ └── apache2 │ └── sites-enabled │ └── 000-default.conf ├── volumes └── docker-entrypoint-initdb.d │ └── .PLACEHOLDER ├── .env ├── .dockerignore ├── .gitignore ├── .github └── workflows │ ├── stale.yml │ └── ci.yaml ├── backup.sh ├── env.mysql ├── run.sh ├── docker-compose.yaml ├── env.yourls ├── Dockerfile └── README.md /conf/opt/yourls/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /conf/opt/yourls/user/plugins/.PLACEHOLDER: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /volumes/docker-entrypoint-initdb.d/.PLACEHOLDER: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # env file for docker-compose 2 | COMPOSE_PROJECT_NAME=yourls 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | docker-compose.yaml 2 | volumes 3 | *.md 4 | *.sh 5 | .env 6 | env.* 7 | .git 8 | .git* 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.sql 3 | volumes/var/lib/mysql/* 4 | !volumes/var/lib/mysql/.PLACEHOLDER 5 | volumes/docker-entrypoint-initdb.d/* 6 | !volumes/docker-entrypoint-initdb.d/.PLACEHOLDER 7 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues and pull requests 7 | 8 | on: 9 | schedule: 10 | - cron: '30 2 * * *' 11 | 12 | jobs: 13 | stale: 14 | runs-on: ubuntu-latest 15 | permissions: 16 | issues: write 17 | pull-requests: write 18 | 19 | steps: 20 | - uses: actions/stale@v10 21 | -------------------------------------------------------------------------------- /backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BACKUP_FILE="mysql-dump-$(date +%Y-%m-%d-%H%m%S).sql" 4 | 5 | docker info >/dev/null 6 | 7 | docker compose exec mysql \ 8 | sh -c ' \ 9 | exec /usr/bin/mysqldump \ 10 | -h localhost \ 11 | -u${MYSQL_USER} \ 12 | -p${MYSQL_PASSWORD} \ 13 | --add-drop-database \ 14 | --add-drop-trigger \ 15 | --flush-privileges \ 16 | --dump-date \ 17 | ${MYSQL_DATABASE} 18 | ' 2>/dev/null > ${BACKUP_FILE} 19 | 20 | if [ $? -eq 0 ]; then 21 | echo "BACKUP FILE: ${BACKUP_FILE}" 22 | else 23 | echo "Abort, execution failed, try to execute the script with 'sudo'" 24 | exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /conf/opt/yourls/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteBase / 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteRule ^.*$ /yourls-loader.php [L] 8 | 9 | 10 | 11 | Options -Indexes 12 | 13 | 14 | 15 | Require all denied 16 | 17 | 18 | 19 | Require all denied 20 | 21 | 22 | 23 | Require all denied 24 | 25 | 26 | 27 | Require all denied 28 | 29 | -------------------------------------------------------------------------------- /env.mysql: -------------------------------------------------------------------------------- 1 | # settings for mysql container 2 | 3 | # ***************************************************************************** 4 | # Limitations: 5 | # - All variables should not contains ('=', equal sign). 6 | # - All variables should not contains (' ', space). 7 | # - All variables should not contains ('#', number sign). 8 | # ***************************************************************************** 9 | 10 | MYSQL_ROOT_PASSWORD=rootsecretpassword 11 | 12 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `YOURLS_DB_USER` in `env.yourls` 13 | MYSQL_USER=yourls 14 | 15 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `YOURLS_DB_PASS` in `env.yourls` 16 | MYSQL_PASSWORD=mysecretpassword 17 | 18 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `YOURLS_DB_NAME` in `env.yourls` 19 | MYSQL_DATABASE=yourls 20 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | IMAGE_VERSION=1.9.2 4 | 5 | CONTAINER_CMD="finch" 6 | CONTAINER_REPO="guessi/docker-yourls" 7 | 8 | function build() { 9 | ${CONTAINER_CMD} build -t ${CONTAINER_REPO}:${IMAGE_VERSION} --target yourls . 10 | ${CONTAINER_CMD} build -t ${CONTAINER_REPO}:${IMAGE_VERSION}-theme --target theme . 11 | ${CONTAINER_CMD} build -t ${CONTAINER_REPO}:${IMAGE_VERSION}-noadmin --target noadmin . 12 | } 13 | 14 | function publish() { 15 | ${CONTAINER_CMD} push ${CONTAINER_REPO}:${IMAGE_VERSION} 16 | ${CONTAINER_CMD} push ${CONTAINER_REPO}:${IMAGE_VERSION}-theme 17 | ${CONTAINER_CMD} push ${CONTAINER_REPO}:${IMAGE_VERSION}-noadmin 18 | 19 | ${CONTAINER_CMD} tag ${CONTAINER_REPO}:${IMAGE_VERSION} ${CONTAINER_REPO}:latest 20 | 21 | ${CONTAINER_CMD} push ${CONTAINER_REPO} 22 | } 23 | 24 | function cleanup() { 25 | ${CONTAINER_CMD} compose down 26 | rm -rvf ./volumes/docker-entrypoint-initdb.d/* 27 | ${CONTAINER_CMD} volume rm yourls_mysql-data 28 | } 29 | 30 | $@ 31 | -------------------------------------------------------------------------------- /conf/etc/apache2/sites-enabled/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName yourls 3 | 4 | ServerAdmin no-reply@localhost 5 | DocumentRoot /opt/yourls 6 | 7 | 8 | DirectoryIndex index.php index.html 9 | Options -Indexes +FollowSymLinks 10 | AllowOverride All 11 | Require all granted 12 | 13 | 14 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 15 | # error, crit, alert, emerg. 16 | # It is also possible to configure the loglevel for particular 17 | # modules, e.g. 18 | LogLevel info ssl:warn 19 | 20 | ErrorLog ${APACHE_LOG_DIR}/error.log 21 | CustomLog ${APACHE_LOG_DIR}/access.log combined 22 | 23 | # For most configuration files from conf-available/, which are 24 | # enabled or disabled at a global level, it is possible to 25 | # include a line for only one particular virtual host. For example the 26 | # following line enables the CGI configuration for this host only 27 | # after it has been globally disabled with "a2disconf". 28 | #Include conf-available/serve-cgi-bin.conf 29 | 30 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | mysql: 5 | image: mysql:5.7 6 | env_file: 7 | - env.mysql 8 | volumes: 9 | - type: volume 10 | source: mysql-data 11 | target: /var/lib/mysql 12 | read_only: false 13 | - type: bind 14 | source: ./volumes/docker-entrypoint-initdb.d 15 | target: /docker-entrypoint-initdb.d 16 | read_only: true 17 | logging: 18 | driver: json-file 19 | options: 20 | max-size: 20m 21 | max-file: "30" 22 | 23 | yourls: 24 | # replace "image" with "build" for developing purpose 25 | # build: ./Dockerfile 26 | # 27 | # or even more integrated with theme Sleeky 28 | # image: guessi/docker-yourls:1.9.2-theme 29 | # 30 | # or with "x.y.z-noadmin" for production environment 31 | # image: guessi/docker-yourls:1.9.2-noadmin 32 | image: guessi/docker-yourls:1.9.2 33 | links: 34 | - mysql:mysql 35 | env_file: 36 | - env.yourls 37 | ports: 38 | - 80:80 39 | depends_on: 40 | - mysql 41 | logging: 42 | driver: json-file 43 | options: 44 | max-size: 20m 45 | max-file: "30" 46 | 47 | volumes: 48 | mysql-data: 49 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | tags: 8 | - '*.*.*' 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - 15 | name: Checkout 16 | uses: actions/checkout@v6 17 | - 18 | name: Docker meta 19 | id: meta 20 | uses: docker/metadata-action@v5 21 | with: 22 | images: | 23 | guessi/docker-yourls 24 | tags: | 25 | type=semver,pattern={{version}} 26 | 27 | # set latest tag for default branch 28 | type=raw,value=latest,enable={{is_default_branch}} 29 | - 30 | name: Set up QEMU 31 | uses: docker/setup-qemu-action@v3 32 | - 33 | name: Set up Docker Buildx 34 | uses: docker/setup-buildx-action@v3 35 | - 36 | name: Login to DockerHub 37 | if: github.event_name != 'pull_request' 38 | uses: docker/login-action@v3 39 | with: 40 | username: ${{ secrets.DOCKERHUB_USERNAME }} 41 | password: ${{ secrets.DOCKERHUB_TOKEN }} 42 | - 43 | name: Build and push 44 | uses: docker/build-push-action@v6 45 | with: 46 | platforms: linux/amd64,linux/arm64 47 | context: . 48 | push: ${{ github.event_name != 'pull_request' }} 49 | tags: ${{ steps.meta.outputs.tags }} 50 | labels: ${{ steps.meta.outputs.labels }} 51 | -------------------------------------------------------------------------------- /env.yourls: -------------------------------------------------------------------------------- 1 | # settings for yourls container 2 | 3 | # ***************************************************************************** 4 | # Limitations: 5 | # - All variables should not contains ('=', equal sign). 6 | # - All variables should not contains (' ', space). 7 | # - All variables should not contains ('#', number sign). 8 | # ***************************************************************************** 9 | 10 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `MYSQL_USER` in `env.mysql` 11 | YOURLS_DB_USER=yourls 12 | 13 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `MYSQL_PASSWORD` in `env.mysql` 14 | YOURLS_DB_PASS=mysecretpassword 15 | 16 | # THE VALUE HERE SHOULD BE EXACTLY THE SAME AS `MYSQL_DATABASE` in `env.mysql` 17 | YOURLS_DB_NAME=yourls 18 | 19 | # PREFIX OF MYSQL DB TABLES 20 | YOURLS_DB_PREFIX=yourls_ 21 | 22 | # NEVER CHANGE THIS LINE 23 | YOURLS_DB_HOST=mysql 24 | 25 | # change it to the real http:// **without ending backslashes** 26 | YOURLS_SITE=http://localhost 27 | 28 | # GENERATE ONE WITH RANDOM 29 | YOURLS_COOKIEKEY=63d8cd986cded909158fcc00 30 | 31 | # Upstream YOURLS have hard-coded username/password pair. 32 | # - https://github.com/YOURLS/YOURLS/blob/1.9.2/user/config-sample.php#L62-L69 33 | # 34 | # To have multi-users support, it required to have more than one user/pass pairs. 35 | # But it could be risky if any one of them remain with default value untouched. 36 | 37 | # USER FOR WEB CONSOLE LOGIN 38 | YOURLS_ADMIN_USERNAME=admin 39 | 40 | # PASSWORD FOR THE USER ABOVE (WEB) 41 | YOURLS_ADMIN_PASSWORD=my@dminP@ss 42 | 43 | # SERVER TIMEZONE GMT OFFSET 44 | YOURLS_HOURS_OFFSET=0 45 | 46 | # PREFERED LANGUAGE 47 | YOURLS_LANG= 48 | 49 | # IS THE SRC/DST MAPPING UNIQUE? 50 | YOURLS_UNIQUE_URLS=true 51 | 52 | # IS THIS PRIVATE? 53 | YOURLS_PRIVATE=true 54 | 55 | # ENABLE DEBUG MODE? Uncomment to enable debug mode 56 | # YOURLS_DEBUG=true 57 | 58 | # 36: generates all lowercase keywords (ie: 13jkm) 59 | # 62: generates mixed case keywords (ie: 13jKm or 13JKm) 60 | YOURLS_URL_CONVERT=36 61 | -------------------------------------------------------------------------------- /conf/opt/yourls/user/plugins/fallback_url_config/plugin.php: -------------------------------------------------------------------------------- 1 | Fallback URL Plugin Config 40 |

Here you can configure the URL to redirect in case the keyword is not found in database.

41 |
42 |

43 |

44 |
45 | HTML; 46 | } 47 | 48 | // Update option in database 49 | function dp_config_update_option() { 50 | $in = $_POST['fallback_url']; 51 | 52 | if( $in ) { 53 | // Validate test_option. ALWAYS validate and sanitize user input. 54 | // Here, we want an string 55 | $in = strval( $in); 56 | 57 | // Update value in database 58 | yourls_update_option( 'fallback_url', $in ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /conf/opt/yourls/user/config.php: -------------------------------------------------------------------------------- 1 | str_replace('"', '', getenv('YOURLS_ADMIN_PASSWORD')), 67 | // 'username2' => 'password2', 68 | // You can have one or more 'login'=>'password' lines 69 | ]; 70 | 71 | /** URL shortening method: either 36 or 62 72 | ** 36: generates all lowercase keywords (ie: 13jkm) 73 | ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) 74 | ** For more information, see https://yourls.org/urlconvert */ 75 | define( 'YOURLS_URL_CONVERT', getenv('YOURLS_URL_CONVERT') ?: 36 ); 76 | 77 | /** Debug mode to output some internal information 78 | ** Default is false for live site. Enable when coding or before submitting a new issue */ 79 | define( 'YOURLS_DEBUG', getenv('YOURLS_DEBUG') ?: false ); 80 | 81 | /** 82 | * Reserved keywords (so that generated URLs won't match them) 83 | * Define here negative, unwanted or potentially misleading keywords. 84 | */ 85 | $yourls_reserved_URL = [ 86 | 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 87 | ]; 88 | 89 | /* 90 | ** Personal settings would go after here. 91 | */ 92 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # PHP versions support: 2 | # +--------+ -----------------+----------------------+------------------------+ 3 | # | Branch | Initial Releasae | Active Support Until | Security Support Until | 4 | # +--------+ -----------------+----------------------+------------------------+ 5 | # | 8.1 | Nov 25, 2021 | Nov 25, 2023 | Dec 31, 2025 | 6 | # | 8.2 | Dec 8, 2022 | Dec 31, 2024 | Dec 31, 2026 | 7 | # | 8.3 | Nov 23, 2023 | Dec 31, 2025 | Dec 31, 2027 | 8 | # | 8.4 | Nov 21, 2024 | Dec 31, 2026 | Dec 31, 2028 | 9 | # +--------+ -----------------+----------------------+------------------------+ 10 | # - https://www.php.net/supported-versions.php 11 | # - https://php.watch/versions 12 | # 13 | # Container image source: 14 | # - https://hub.docker.com/_/php/tags?page=1&name=8.3-apache-bookworm 15 | 16 | FROM php:8.3-apache-bookworm AS yourls 17 | 18 | RUN sed -i -e '/^ServerTokens/s/^.*$/ServerTokens Prod/g' \ 19 | -e '/^ServerSignature/s/^.*$/ServerSignature Off/g' \ 20 | /etc/apache2/conf-available/security.conf 21 | 22 | RUN echo "expose_php=Off" > /usr/local/etc/php/conf.d/php-hide-version.ini 23 | 24 | RUN apt update && \ 25 | apt install -y --no-install-recommends libonig-dev && \ 26 | apt install -y tzdata 27 | 28 | RUN docker-php-ext-install pdo_mysql mysqli mbstring && \ 29 | a2enmod rewrite ssl 30 | 31 | ENV YOURLS_VERSION 1.9.2 32 | ENV YOURLS_PACKAGE https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz 33 | ENV YOURLS_CHECKSUM 62a95ba766d62f3305d75944cbfe12d5a90c08c88fbf2f6e67150d36412b916f 34 | 35 | RUN mkdir -p /opt/yourls && \ 36 | curl -sSL ${YOURLS_PACKAGE} -o /tmp/yourls.tar.gz && \ 37 | echo "${YOURLS_CHECKSUM} /tmp/yourls.tar.gz" | sha256sum -c - && \ 38 | tar xf /tmp/yourls.tar.gz --strip-components=1 --directory=/opt/yourls && \ 39 | rm -rf /tmp/yourls.tar.gz 40 | 41 | WORKDIR /opt/yourls 42 | 43 | ADD https://github.com/YOURLS/timezones/archive/master.tar.gz \ 44 | /opt/timezones.tar.gz 45 | ADD https://github.com/dgw/yourls-dont-track-admins/archive/master.tar.gz \ 46 | /opt/dont-track-admins.tar.gz 47 | ADD https://github.com/timcrockford/302-instead/archive/master.tar.gz \ 48 | /opt/302-instead.tar.gz 49 | ADD https://github.com/YOURLS/force-lowercase/archive/master.tar.gz \ 50 | /opt/force-lowercase.tar.gz 51 | ADD https://github.com/guessi/yourls-mobile-detect/archive/refs/tags/3.0.0.tar.gz \ 52 | /opt/mobile-detect.tar.gz 53 | ADD https://github.com/YOURLS/dont-log-bots/archive/master.tar.gz \ 54 | /opt/dont-log-bots.tar.gz 55 | ADD https://github.com/guessi/yourls-dont-log-health-checker/archive/master.tar.gz \ 56 | /opt/dont-log-health-checker.tar.gz 57 | 58 | RUN for i in $(ls /opt/*.tar.gz); do \ 59 | plugin_name="$(basename ${i} '.tar.gz')" ; \ 60 | mkdir -p user/plugins/${plugin_name} ; \ 61 | tar zxvf /opt/${plugin_name}.tar.gz \ 62 | --strip-components=1 \ 63 | -C user/plugins/${plugin_name} ; \ 64 | done 65 | 66 | ADD conf/ / 67 | 68 | # security enhancement: remove sample configs 69 | RUN rm -rf user/config-sample.php \ 70 | user/plugins/sample* && \ 71 | (find . -type d -name ".git" -exec rm -rf {} +) 72 | 73 | FROM yourls AS noadmin 74 | 75 | # security enhancement: leave only production required items 76 | # ** note that it will still available somewhere in docker image layers 77 | RUN rm -rf .git pages admin js css images sample* *.md \ 78 | user/languages \ 79 | user/plugins/random-bg \ 80 | yourls-api.php \ 81 | yourls-infos.php && \ 82 | sed -i '/base64/d' yourls-loader.php && \ 83 | (find . -type f -name "*.html" ! -name "index.html" -delete) && \ 84 | (find . -type f -name "*.json" -o -name "*.md" -o -name "*.css" | xargs rm -f) && \ 85 | (find . -type f -exec file {} + | awk -F: '{if ($2 ~/image/) print $1}' | xargs rm -f) 86 | 87 | FROM yourls AS theme 88 | 89 | # please be awared that "Flynntes/Sleeky" here have no update for years 90 | # you should take your own risk if you choose to have theme included 91 | # - https://github.com/Flynntes/Sleeky/releases 92 | # - https://github.com/Flynntes/Sleeky/issues 93 | 94 | WORKDIR /opt/yourls 95 | 96 | # sample configuration to integrate theme Sleeky-v2.5.0 97 | # - ref: https://github.com/Flynntes/Sleeky#quick-start 98 | ADD https://github.com/Flynntes/Sleeky/archive/refs/tags/v2.5.0.tar.gz \ 99 | /opt/theme-sleeky.tar.gz 100 | 101 | RUN mkdir -p /tmp/sleeky-extracted && \ 102 | tar zxvf /opt/theme-sleeky.tar.gz \ 103 | --strip-components=1 \ 104 | -C /tmp/sleeky-extracted && \ 105 | mv -vf /tmp/sleeky-extracted/sleeky-backend user/plugins/theme-sleeky && \ 106 | mv -vf /tmp/sleeky-extracted/sleeky-frontend . && \ 107 | rm -rvf /tmp/sleeky-extracted 108 | 109 | # NOTE: you will need to activate the theme manually 110 | 111 | # Uncomment the line below to include your own "config.php" setup 112 | # ADD path-to-your-config/config.php /opt/yourls/user/config.php 113 | # 114 | # ref: https://github.com/YOURLS/YOURLS/blob/1.9.2/user/config-sample.php -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerize YOURLS - Your Own URL Shortener 2 | 3 | [![Docker Stars](https://img.shields.io/docker/stars/guessi/docker-yourls.svg)](https://hub.docker.com/r/guessi/docker-yourls/) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/guessi/docker-yourls.svg)](https://hub.docker.com/r/guessi/docker-yourls/) 5 | [![Docker Automated](https://img.shields.io/docker/automated/guessi/docker-yourls.svg)](https://hub.docker.com/r/guessi/docker-yourls/) 6 | 7 | ## Before start, things you need to know... 8 | 9 | ### Difference between Official Build and why this project exist? 10 | 11 | Back in 2017, I was a user of YOURLS (_Great thanks to upstream maintainers_). I found it's hard to build YOURLS into container image so I publish my customized YOURLS image build and scripts on [May 7, 2017](https://github.com/guessi/docker-yourls/commit/de4781444ee64edb12abaa3af401b383208817e4). Around half year later, [upstream YOURLS maintainers](https://github.com/YOURLS/YOURLS/graphs/contributors) published an official repo called "[YOURLS/docker](https://github.com/YOURLS/docker)" to build container images for YOURLS project on [Nov 11, 2017](https://github.com/YOURLS/docker/commit/75e37b0cabe62ba4d4691c2d0eb883f4a811c727). So it became two different image repositories. 12 | 13 | ### Should I use it or maybe Official build is better? 14 | 15 | Ideally, official build should receive better support and it is always encourage to try Official Build first. The main differences between two projects is the way image build and w/wo plugins pre-loaded. 16 | 17 | As time goes by, please take this project as a quick start guide for YOURLS and please don't get me wrong, I'm not pushing you away (existed users), if you still like this project? it is always welcome to stay here :-) 18 | 19 | 20 | ## Integrated Items 21 | 22 | * [Yourls](http://yourls.org) - 1.9.2 23 | 24 | | Container image tag | Mobile-Detect version | PHP version | OS version | Remark | 25 | |:-------------------------|:-----------------------|:------------|:-----------|:--------------------------------------------| 26 | | 1.9.2-8 (alias of 1.9.2) | 3.74.3 | PHP 8.3 | Debian 12 | `dont-log-crawlers` removed | 27 | | 1.9.2-7 | 3.74.3 | PHP 8.3 | Debian 12 | Multi-platform support, linux/{amd64,arm64} | 28 | | 1.9.2-6 | 3.74.3 | PHP 8.3 | Debian 12 | deprecated, no code change, regular build | 29 | | 1.9.2-5 | 3.74.3 | PHP 8.3 | Debian 12 | deprecated, no code change, regular build | 30 | | 1.9.2-4 | 3.74.3 | PHP 8.3 | Debian 12 | deprecated, no code change, regular build | 31 | | 1.9.2-3 | 3.74.3 | PHP 8.3 | Debian 12 | deprecated | 32 | | 1.9.2-2 | 2.8.45 | PHP 8.0 | Debian 10 | deprecated | 33 | | 1.9.2-1 | 2.8.41 | PHP 8.0 | Debian 10 | deprecated | 34 | 35 | ## Integrated Plugins 36 | 37 | * [timezones](https://github.com/YOURLS/timezones) 38 | * [302-instead](https://github.com/timcrockford/302-instead) 39 | * [dont-track-admins](https://github.com/dgw/yourls-dont-track-admins) 40 | * [fallback_url_config](http://diegopeinador.com/fallback-url-yourls-plugin) 41 | * [force-lowercase](https://github.com/YOURLS/force-lowercase) 42 | * [mobile-detect](https://github.com/guessi/yourls-mobile-detect) 43 | * [dont-log-bots](https://github.com/YOURLS/dont-log-bots) 44 | * [dont-log-crawler](https://github.com/luixxiul/dont-log-crawlers) - removed after 1.9.2-8 due to project link is dead. 45 | * [dont-log-health-checker](https://github.com/guessi/yourls-dont-log-health-checker) 46 | 47 | 48 | ## Usage 49 | 50 | > [!IMPORTANT] 51 | > You should always change the default username/password pairs for both MySQL and YOURLS. 52 | 53 | To run YOURLS service with customized config 54 | 55 | $ vim env.mysql 56 | $ vim env.yourls 57 | $ docker compose up [--build] [-d] 58 | 59 | 60 | ## Dashboard 61 | 62 | * Default Login Page: http://localhost/admin/ 63 | * Default Username: **see env.yourls** 64 | * Default Password: **see env.yourls** 65 | 66 | 67 | ## Advanced 68 | 69 | ### Create database backup 70 | 71 | Execute `backup.sh` to get regular backup 72 | 73 | 74 | ### Restore backup from backup file 75 | 76 | Make sure there is no container running 77 | 78 | $ docker compose down 79 | $ docker ps 80 | 81 | Cleanup "mysql-data" volume 82 | 83 | $ docker volume rm yourls_mysql-data 84 | 85 | Make sure there is no sql file under "mysql-initdb" volume 86 | 87 | $ rm -vf ./volumes/docker-entrypoint-initdb.d/* 88 | 89 | Move the backup sql file to "mysql-initdb" volume 90 | 91 | $ cp -vf ./mysql-dump-YYYYMMDD-hhmmss.sql ./volumes/docker-entrypoint-initdb.d/ 92 | $ docker compose up -d 93 | 94 | 95 | ## FAQ 96 | 97 | ### Why there would have no homepage for YOURLS? 98 | 99 | Check the answer at the link below 100 | - https://github.com/orgs/YOURLS/discussions/3638#discussioncomment-7192119 101 | 102 | ### How can I use non-default password or variables? 103 | 104 | simply modify the variables inside `env.*` before your first run. 105 | 106 | ### Limitations for environment files 107 | 108 | 1. The value of `YOURLS_DB_PASS` inside `env.yourls` **SHOULD BE** exactly the same as `MYSQL_PASSWORD` in `env.mysql`. 109 | 2. The value of `YOURLS_DB_USER` inside `env.yourls` **SHOULD BE** exactly the same as `MYSQL_USER` in `env.mysql. 110 | 3. All variables inside `env.mysql` and `env.yourls` **SHOULD NOT** contain `'=' (equal sign)`, `' ' (space)`, `'#' (number sign)`. 111 | 112 | ### Why it will show `Could not auto-encrypt passwords.` when log into admin page? 113 | 114 | Check the FAQ for YOURLS for more details 115 | - https://yourls.org/docs/guide/essentials/credentials#faq 116 | 117 | ### Why it will show `Could not write file .htaccess in YOURLS root directory.`? 118 | 119 | It should only happen at 1st time deployment, you may safely ignore it. 120 | 121 | ### Any others? 122 | 123 | Here are some useful links for you 124 | - https://yourls.org/docs 125 | - https://yourls.org/docs/category/troubleshooting 126 | - https://github.com/orgs/YOURLS/discussions 127 | --------------------------------------------------------------------------------