-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pure YOURLS v1.7.2 with docker-compose
- Loading branch information
0 parents
commit de47814
Showing
11 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docker-compose.yaml | ||
volumes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
volumes/var/lib/mysql/* | ||
!volumes/var/lib/mysql/.PLACEHOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase / | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^.*$ /yourls-loader.php [L] | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM php:5.6-apache | ||
|
||
ENV YOURLS_VERSION 1.7.2 | ||
ENV YOURLS_PACKAGE https://github.com/YOURLS/YOURLS/archive/${YOURLS_VERSION}.tar.gz | ||
|
||
RUN docker-php-ext-install pdo_mysql mysqli mbstring && \ | ||
a2enmod rewrite ssl | ||
|
||
RUN mkdir -p /opt/yourls && \ | ||
curl -sSL ${YOURLS_PACKAGE} -o /tmp/yourls.tar.gz && \ | ||
tar xf /tmp/yourls.tar.gz --strip-components=1 --directory=/opt/yourls | ||
|
||
RUN sed -i -e '/ServerTokens/s/^.*$/ServerTokens Prod/g' \ | ||
-e '/ServerSignature/s/^.*$/ServerSignature Off/g' \ | ||
/etc/apache2/conf-available/security.conf | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y git-core && \ | ||
apt-get clean | ||
|
||
ADD conf/ / | ||
|
||
WORKDIR /opt/yourls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<VirtualHost *:80> | ||
ServerName yourls | ||
|
||
ServerAdmin no-reply@localhost | ||
DocumentRoot /opt/yourls | ||
|
||
<Directory /opt/yourls> | ||
DirectoryIndex index.php index.html | ||
Options All | ||
AllowOverride All | ||
Require all granted | ||
</Directory> | ||
|
||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | ||
# error, crit, alert, emerg. | ||
# It is also possible to configure the loglevel for particular | ||
# modules, e.g. | ||
LogLevel info ssl:warn | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
# For most configuration files from conf-available/, which are | ||
# enabled or disabled at a global level, it is possible to | ||
# include a line for only one particular virtual host. For example the | ||
# following line enables the CGI configuration for this host only | ||
# after it has been globally disabled with "a2disconf". | ||
#Include conf-available/serve-cgi-bin.conf | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase / | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^.*$ /yourls-loader.php [L] | ||
</IfModule> | ||
|
||
<IfModule mod_autoindex.c> | ||
Options -Indexes | ||
</IfModule> | ||
|
||
<files config.php> | ||
order allow,deny | ||
deny from all | ||
</files> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
/* | ||
** MySQL settings - You can get this info from your web host | ||
*/ | ||
|
||
/** MySQL database username */ | ||
define( 'YOURLS_DB_USER', 'yourls' ); | ||
|
||
/** MySQL database password */ | ||
define( 'YOURLS_DB_PASS', 'mysecretpassword' ); | ||
|
||
/** The name of the database for YOURLS */ | ||
define( 'YOURLS_DB_NAME', 'yourls' ); | ||
|
||
/** MySQL hostname. | ||
** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */ | ||
define( 'YOURLS_DB_HOST', 'mysql' ); | ||
|
||
/** MySQL tables prefix */ | ||
define( 'YOURLS_DB_PREFIX', 'yourls_' ); | ||
|
||
/* | ||
** Site options | ||
*/ | ||
|
||
/** YOURLS installation URL -- all lowercase and with no trailing slash. | ||
** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */ | ||
define( 'YOURLS_SITE', 'http://localhost' ); | ||
|
||
/** Server timezone GMT offset */ | ||
define( 'YOURLS_HOURS_OFFSET', 0 ); | ||
|
||
/** YOURLS language | ||
** Change this setting to use a translation file for your language, instead of the default English. | ||
** That translation file (a .mo file) must be installed in the user/language directory. | ||
** See http://yourls.org/translations for more information */ | ||
define( 'YOURLS_LANG', '' ); | ||
|
||
/** Allow multiple short URLs for a same long URL | ||
** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior) | ||
** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */ | ||
define( 'YOURLS_UNIQUE_URLS', true ); | ||
|
||
/** Private means the Admin area will be protected with login/pass as defined below. | ||
** Set to false for public usage (eg on a restricted intranet or for test setups) | ||
** Read http://yourls.org/privatepublic for more details if you're unsure */ | ||
define( 'YOURLS_PRIVATE', true ); | ||
|
||
/** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/ | ||
define( 'YOURLS_COOKIEKEY', 'modify this text with something random' ); | ||
|
||
/** Username(s) and password(s) allowed to access the site. Passwords either in plain text or as encrypted hashes | ||
** YOURLS will auto encrypt plain text passwords in this file | ||
** Read http://yourls.org/userpassword for more information */ | ||
$yourls_user_passwords = array( | ||
'admin' => 'adminsecretpassword', | ||
// 'username2' => 'password2', | ||
// You can have one or more 'login'=>'password' lines | ||
); | ||
|
||
/** Debug mode to output some internal information | ||
** Default is false for live site. Enable when coding or before submitting a new issue */ | ||
define( 'YOURLS_DEBUG', false ); | ||
|
||
/* | ||
** URL Shortening settings | ||
*/ | ||
|
||
/** URL shortening method: 36 or 62 */ | ||
define( 'YOURLS_URL_CONVERT', 36 ); | ||
/* | ||
* 36: generates all lowercase keywords (ie: 13jkm) | ||
* 62: generates mixed case keywords (ie: 13jKm or 13JKm) | ||
* Stick to one setting. It's best not to change after you've started creating links. | ||
*/ | ||
|
||
/** | ||
* Reserved keywords (so that generated URLs won't match them) | ||
* Define here negative, unwanted or potentially misleading keywords. | ||
*/ | ||
$yourls_reserved_URL = array( | ||
'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', | ||
); | ||
|
||
/* | ||
** Personal settings would go after here. | ||
*/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '2' | ||
|
||
services: | ||
mysql: | ||
image: mysql | ||
container_name: yourls-mysql | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=rootsecretpassword | ||
- MYSQL_USER=yourls | ||
- MYSQL_PASSWORD=mysecretpassword | ||
- MYSQL_DATABASE=yourls | ||
volumes: | ||
- ./volumes/var/lib/mysql:/var/lib/mysql:rw | ||
privileged: true | ||
|
||
yourls: | ||
build: ./ | ||
container_name: yourls | ||
links: | ||
- mysql:mysql | ||
environment: | ||
- MYSQL_USER=yourls | ||
- MYSQL_PASSWORD=mysecretpassword | ||
- MYSQL_DATABASE=yourls | ||
ports: | ||
- "80:80" | ||
depends_on: | ||
- mysql |
Empty file.