Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vichan-devel/vichan
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: vichan-devel-5.1.5
Choose a base ref
...
head repository: vichan-devel/vichan
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 7,470 additions and 5,321 deletions.
  1. +4 −0 .dockerignore
  2. +69 −0 .github/ISSUE_TEMPLATE/bug_report.yml
  3. +20 −0 .github/ISSUE_TEMPLATE/feature_request.md
  4. +1 −0 .gitignore
  5. +16 −31 README.md
  6. +5 −17 b.php
  7. +40 −0 compose.yml
  8. +22 −8 composer.json
  9. +366 −50 composer.lock
  10. +20 −0 docker/doc.md
  11. +8 −0 docker/nginx/Dockerfile
  12. +34 −0 docker/nginx/nginx.conf
  13. +40 −0 docker/nginx/proxy.conf
  14. +66 −0 docker/nginx/vichan.conf
  15. +88 −0 docker/php/Dockerfile
  16. +16 −0 docker/php/Dockerfile.profile
  17. +87 −0 docker/php/bootstrap.sh
  18. +2 −0 docker/php/jit.ini
  19. +13 −0 docker/php/www.conf
  20. +7 −0 docker/php/xdebug-prof.ini
  21. +28 −0 inc/Data/Driver/ApcuCacheDriver.php
  22. +28 −0 inc/Data/Driver/ArrayCacheDriver.php
  23. +38 −0 inc/Data/Driver/CacheDriver.php
  24. +28 −0 inc/Data/Driver/ErrorLogLogDriver.php
  25. +61 −0 inc/Data/Driver/FileLogDriver.php
  26. +155 −0 inc/Data/Driver/FsCachedriver.php
  27. +131 −0 inc/Data/Driver/HttpDriver.php
  28. +22 −0 inc/Data/Driver/LogDriver.php
  29. +26 −0 inc/Data/Driver/LogTrait.php
  30. +43 −0 inc/Data/Driver/MemcacheCacheDriver.php
  31. +26 −0 inc/Data/Driver/NoneCacheDriver.php
  32. +48 −0 inc/Data/Driver/RedisCacheDriver.php
  33. +27 −0 inc/Data/Driver/StderrLogDriver.php
  34. +35 −0 inc/Data/Driver/SyslogLogDriver.php
  35. +1 −187 inc/anti-bot.php
  36. +84 −65 inc/api.php
  37. +242 −88 inc/bans.php
  38. +59 −155 inc/cache.php
  39. +1 −1 inc/captcha/captcha.php
  40. +0 −9 inc/captcha/dbschema.sql
  41. +1 −3 inc/captcha/readme.md
  42. +473 −410 inc/config.php
  43. +91 −0 inc/context.php
  44. +4 −4 inc/controller.php
  45. +107 −77 inc/display.php
  46. +96 −69 inc/filters.php
  47. +248 −434 inc/functions.php
  48. +114 −0 inc/functions/dice.php
  49. +28 −0 inc/functions/format.php
  50. +16 −0 inc/functions/net.php
  51. +33 −0 inc/functions/num.php
  52. +98 −0 inc/functions/theme.php
  53. +47 −112 inc/image.php
  54. +0 −186 inc/image/bmp.php
  55. +0 −45 inc/lib/twig/extensions/Extension/I18n.php
  56. +0 −137 inc/lib/twig/extensions/Extension/Tinyboard.php
  57. +0 −133 inc/lib/twig/extensions/Node/Trans.php
  58. +0 −80 inc/lib/twig/extensions/TokenParser/Trans.php
  59. +0 −2 inc/locale/pl_PL/LC_MESSAGES/tinyboard.po
  60. +69 −32 inc/lock.php
  61. +132 −75 inc/mod/auth.php
  62. +0 −10 inc/mod/ban.php
  63. +4 −0 inc/mod/config-editor.php
  64. +1,106 −922 inc/mod/pages.php
  65. +0 −28 inc/polyfill.php
  66. +92 −43 inc/queue.php
  67. +0 −64 inc/remote.php
  68. +1 −0 inc/secrets.php
  69. +143 −0 inc/service/captcha-queries.php
  70. +177 −19 inc/template.php
  71. +98 −94 install.php
  72. +22 −36 install.sql
  73. +3 −1 js/auto-reload.js
  74. +34 −39 js/catalog-link.js
  75. +14 −14 js/catalog-search.js
  76. +7 −7 js/download-original.js
  77. +34 −29 js/expand-all-images.js
  78. +53 −0 js/expand-filename.js
  79. +0 −39 js/expand-too-long.js
  80. +271 −231 js/expand-video.js
  81. +5 −0 js/file-selector.js
  82. +23 −0 js/hide-form.js
  83. +11 −11 js/inline-expanding-filename.js
  84. +36 −20 js/local-time.js
  85. +10 −8 js/mod/ban-list.js
  86. +12 −0 js/mod/mod_snippets.js
  87. +21 −2 js/post-filter.js
  88. +93 −86 js/post-hover.js
  89. +54 −62 js/quote-selection.js
  90. +29 −24 js/show-backlinks.js
  91. +11 −12 js/smartphone-spoiler.js
  92. +12 −12 js/style-select.js
  93. +10 −12 js/youtube.js
  94. +39 −42 mod.php
  95. +554 −398 post.php
  96. +7 −0 search.php
  97. BIN static/banners/defaultbanner.png
  98. BIN static/clickme.gif
  99. BIN static/cycle.png
  100. BIN static/flags/ao.png
  101. BIN static/flags/aq.png
  102. BIN static/flags/bl.png
  103. BIN static/flags/bu.png
  104. BIN static/flags/cd.png
  105. BIN static/flags/cp.png
  106. BIN static/flags/cw.png
  107. BIN static/flags/ec.png
  108. BIN static/flags/eh.png
  109. BIN static/flags/flags.png
  110. BIN static/flags/fr.png
  111. BIN static/flags/fx.png
  112. BIN static/flags/gb.png
  113. BIN static/flags/gf.png
  114. BIN static/flags/gg.png
  115. BIN static/flags/gt.png
  116. BIN static/flags/ht.png
  117. BIN static/flags/im.png
  118. BIN static/flags/iq.png
  119. BIN static/flags/je.png
  120. BIN static/flags/ls.png
  121. BIN static/flags/ly.png
  122. BIN static/flags/me.png
  123. BIN static/flags/mf.png
  124. BIN static/flags/mm.png
  125. BIN static/flags/mq.png
  126. BIN static/flags/mr.png
  127. BIN static/flags/py.png
  128. BIN static/flags/re.png
  129. BIN static/flags/ss.png
  130. BIN static/flags/sx.png
  131. BIN static/flags/us.png
  132. +0 −33 static/unapplied patches/5d31f3bab70de7f983fd56aa18817ede38d1d4f3.patch
  133. +28 −10 stylesheets/style.css
  134. +121 −0 stylesheets/uboachan-gray.css
  135. +13 −2 stylesheets/yotsuba.css
  136. +19 −18 templates/banned.html
  137. +1 −1 templates/footer.html
  138. +55 −49 templates/header.html
  139. +0 −12 templates/important.html
  140. +18 −6 templates/index.html
  141. +11 −9 templates/installer/check-requirements.html
  142. +3 −0 templates/installer/config.html
  143. +206 −146 templates/main.js
  144. +2 −2 templates/mod/ban_appeals.html
  145. +34 −7 templates/mod/ban_form.html
  146. +9 −9 templates/mod/ban_list.html
  147. +7 −5 templates/mod/config-editor-php.html
  148. +54 −50 templates/mod/config-editor.html
  149. +23 −22 templates/mod/dashboard.html
  150. +10 −8 templates/mod/debug/apc.html
  151. +1 −1 templates/mod/debug/recent_posts.html
  152. +1 −1 templates/mod/edit_page.html
  153. +1 −1 templates/mod/inbox.html
  154. +1 −1 templates/mod/log.html
  155. +9 −7 templates/mod/move.html
  156. +1 −1 templates/mod/move_reply.html
  157. +1 −1 templates/mod/news.html
  158. +1 −1 templates/mod/noticeboard.html
  159. +2 −2 templates/mod/pages.html
  160. +2 −2 templates/mod/recent_posts.html
  161. +8 −2 templates/mod/report.html
  162. +1 −1 templates/mod/search_results.html
  163. +1 −1 templates/mod/themes.html
  164. +8 −6 templates/mod/user.html
  165. +7 −84 templates/mod/view_ip.html
  166. +2 −2 templates/notbanned.html
  167. +2 −2 templates/post/fileinfo.html
  168. +3 −3 templates/post/image.html
  169. +1 −1 templates/post/time.html
  170. +40 −32 templates/post_form.html
  171. +7 −3 templates/post_reply.html
  172. +7 −4 templates/post_thread.html
  173. +2 −2 templates/post_thread_fileboard.html
  174. +2 −2 templates/posts.sql
  175. +6 −6 templates/themes/basic/index.html
  176. +37 −37 templates/themes/catalog/catalog.html
  177. +1 −6 templates/themes/catalog/info.php
  178. +14 −0 templates/themes/catalog/theme.php
  179. +8 −1 templates/themes/categories/frames.html
  180. +3 −3 templates/themes/categories/news.html
  181. +2 −2 templates/themes/categories/sidebar.html
  182. +3 −3 templates/themes/frameset/news.html
  183. +2 −2 templates/themes/frameset/sidebar.html
  184. +25 −14 templates/themes/index/index.html
  185. +9 −2 templates/themes/index/info.php
  186. +8 −1 templates/themes/index/theme.php
  187. +10 −10 templates/themes/recent/recent.html
  188. +2 −2 templates/themes/rss/rss.xml
  189. +3 −3 templates/themes/sitemap/sitemap.xml
  190. +3 −0 templates/thread.html
  191. +17 −0 tools/hash-passwords.php
  192. +40 −0 tools/maintenance.php
  193. +1 −1 tools/rebuild.php
  194. +1 −1 tools/rebuild2.php
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/.git
**/.gitignore
/local-instances
**/.gitkeep
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Bug Report
description: File a bug report for Vichan
title: "[BUG] "
labels: ["bug"]
assignees: []

body:
- type: markdown
attributes:
value: |
**Thank you for reporting a bug! Please provide as much detail as possible.**
Before submitting, check the [Vichan Wiki](https://vichan.info) to see if there's already a solution to your problem.
- type: textarea
id: bug_description
attributes:
label: "Describe the bug"
description: "A clear and concise description of what the bug is."
placeholder: "Posting doesn't go through and displays a collation error. The exact error message given is the text below and I've attached a screenshot..."
validations:
required: true

- type: textarea
id: steps_to_reproduce
attributes:
label: "Steps to Reproduce"
description: "Provide step-by-step instructions to reproduce the issue. If you're unsure on how, that is alright, just try and explain as well as you can."
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: markdown
validations:
required: true

- type: textarea
id: expected_behavior
attributes:
label: "Expected Behavior"
description: "What did you expect to happen?"
placeholder: "Expected behavior here..."
render: markdown
validations:
required: true

- type: textarea
id: server_specs
attributes:
label: "Server Specifications"
description: "Provide details about your server environment. If you're unsure about any of this, you might be using shared hosting (Hostinger, HostGator, Serv00, etc). If so, put the name of your hosting provider here."
placeholder: |
- OS: (Ubuntu, CentOS, Windows Server 2025, etc.)
- PHP Version: (e.g., 7.4, 8.0, 8.4)
- Web Server: (Apache, NGINX, etc.)
- Database: (MySQL, MariaDB, etc.)
- Vichan Version: (5.2.0, 5.3.0 (dev branch), etc)
render: markdown
validations:
required: true

- type: textarea
id: additional_context
attributes:
label: "Additional Context"
description: "Any other details we should know?"
placeholder: "Add any additional context here..."
render: markdown
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -44,5 +44,6 @@ Thumbs.db
#vichan custom
favicon.ico
/static/spoiler.png
/local-instances

/vendor/
47 changes: 16 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
vichan - A lightweight and full featured PHP imageboard.
========================================================

**Vichan was recently taken on by new maintainers. Please stay tuned for updates. The new maintainers at this time are basedgentoo, along with Kuz and Angeleno of KolymaNET**

**Please do not contact Fredrick Brennan in regards to vichan issues.**

**A community support board is coming soon. In the meantime you can join our IRC support channel. Connection details are below!**

As of 29 August 2022 it supports PHP8.1.

##### Unapplied patches

Some patches remain unapplied due to their uncertain maintenance burden. You may wish to apply them:

<ul dir="auto">
<li><a class="commit-link" href="https://github.com/vichan-devel/vichan/commit/5d31f3bab70de7f983fd56aa18817ede38d1d4f3"><tt>5d31f3b</tt></a> (<span class="reference"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1530457642" data-permission-text="Title is private" data-url="https://github.com/vichan-devel/vichan/issues/527" data-hovercard-type="pull_request" data-hovercard-url="/vichan-devel/vichan/pull/527/hovercard" href="https://github.com/vichan-devel/vichan/pull/527">Allow open parentheses before cite: "(&gt;&gt;1"<span class="issue-shorthand">&nbsp;#527</span></a></span>) by <a class="user-mention notranslate" href="https://github.com/discomrade">@discomrade</a></li>
</ul>

They will be collected in `static/unapplied patches` upon rejection.

About
------------
vichan is a free light-weight, fast, highly configurable and user-friendly
imageboard software package. It is written in PHP and has few dependencies.

For support, feel free to join our [IRC channel](https://chat.kolyma.net/#/connect?channels=vichan) at irc.kolyma.net.

Some documentation may be found on our [wiki](https://github.com/vichan-devel/vichan/wiki). (feel free to contribute)

History
@@ -37,18 +21,18 @@ improvements.
![](static/doc/timeline.svg)

### Maintainer timeline
1. Development Commission lead by [@basedgentoo](https://github.com/basedgentoo), [@kuz-sysadmin](https://github.com/kuz-sysadmin), and [@RealAngeleno](https://github.com/RealAngeleno). (2023 - )
2. [@h00j](https://github.com/h00j) (2021 - ???)
3. [@ctrlcctrlv](https://github.com/ctrlcctrlv) (2017 - 2021)
4. [@czaks](https://github.com/czaks) (2014 - 2017) (The author of vichan fork)
5. [@savetheinternet](https://github.com/savetheinternet) (2010 - 2014) (The creator of Tinyboard)
1. [@perdedora](https://github.com/perdedora) and [@RealAngeleno](https://github.com/RealAngeleno) - 2023-Present.
2. Development Commission lead by [@basedgentoo](https://github.com/basedgentoo), [@kuz-sysadmin](https://github.com/kuz-sysadmin), and [@RealAngeleno](https://github.com/RealAngeleno). (2023 - 2023)
3. [@h00j](https://github.com/h00j) (2021 - ???)
4. [@ctrlcctrlv](https://github.com/ctrlcctrlv) (2017 - 2021)
5. [@czaks](https://github.com/czaks) (2014 - 2017) (The author of vichan fork)
6. [@savetheinternet](https://github.com/savetheinternet) (2010 - 2014) (The creator of Tinyboard)

Requirements
------------
1. PHP >= 5.4 (we still try to keep compatibility with php 5.3 as much as possible)
PHP 7.0 is explicitly supported. PHP 7.2 works as well, but may cause as yet unreported bugs.
1. PHP >= 7.4
2. MySQL/MariaDB server
3. [mbstring](http://www.php.net/manual/en/mbstring.installation.php)
3. [mbstring](http://www.php.net/manual/en/mbstring.installation.php)
4. [PHP GD](http://www.php.net/manual/en/intro.image.php)
5. [PHP PDO](http://www.php.net/manual/en/intro.pdo.php)
6. A Unix-like OS, preferrably FreeBSD or GNU/Linux
@@ -58,9 +42,7 @@ We try to make sure vichan is compatible with all major web servers. vichan does
### Recommended
1. MySQL/MariaDB server >= 5.5.3
2. ImageMagick (command-line ImageMagick or GraphicsMagick preferred).
3. ~~[APC (Alternative PHP Cache)](http://php.net/manual/en/book.apc.php)~~,
[APCu (Alternative PHP Cache)](http://php.net/manual/en/book.apcu.php),
[XCache](http://xcache.lighttpd.net/),
3. [APCu (Alternative PHP Cache)](http://php.net/manual/en/book.apcu.php),
[Memcached](http://www.php.net/manual/en/intro.memcached.php) or
[Redis](https://redis.io/docs/about/)

@@ -73,12 +55,11 @@ You can contribute to vichan by:

Installation
-------------
1. Download and extract vichan to your web directory or get the latest
development version with:
1. Get the latest development version with:

git clone git://github.com/vichan-devel/vichan.git

2. run ```composer install``` inside the directory
2. run ```composer install``` inside the directory
3. Navigate to ```install.php``` in your web browser and follow the
prompts.
4. vichan should now be installed. Log in to ```mod.php``` with the
@@ -138,6 +119,11 @@ WebM support
------------
Read `inc/lib/webm/README.md` for information about enabling webm.

Docker
------------
Vichan comes with a Dockerfile and docker-compose configuration, the latter aimed primarily at development and testing.
See the `docker/doc.md` file for more information.

vichan API
----------
vichan provides by default a 4chan-compatible JSON API. For documentation on this, see:
@@ -146,4 +132,3 @@ https://github.com/vichan-devel/vichan-API/ .
License
--------
See [LICENSE.md](http://github.com/vichan-devel/vichan/blob/master/LICENSE.md).

22 changes: 5 additions & 17 deletions b.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
<?php
$dir = "static/banners/";
$files = scandir($dir, SCANDIR_SORT_NONE);
$images = array_diff($files, array('.', '..'));
$name = $images[array_rand($images)];
// open the file in a binary mode
$fp = fopen($dir . $name, 'rb');

// send the right headers
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1
header('Pragma: no-cache'); // HTTP 1.0
header('Expires: 0'); // Proxies
$fstat = fstat($fp);
header('Content-Type: ' . mime_content_type($dir . $name));
header('Content-Length: ' . $fstat['size']);
$files = scandir('static/banners/', SCANDIR_SORT_NONE);
$files = array_diff($files, ['.', '..']);

// dump the picture and stop the script
fpassthru($fp);
exit;
?>
$name = $files[array_rand($files)];
header("Location: /static/banners/$name", true, 307);
header('Cache-Control: no-cache');
40 changes: 40 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
services:
#nginx webserver + php 8.x
web:
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
ports:
- "9090:80"
depends_on:
- db
volumes:
- ./local-instances/${INSTANCE:-0}/www:/var/www/html
- ./docker/nginx/vichan.conf:/etc/nginx/conf.d/default.conf
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/proxy.conf:/etc/nginx/conf.d/proxy.conf
links:
- php

php:
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- ./local-instances/${INSTANCE:-0}/www:/var/www
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./docker/php/jit.ini:/usr/local/etc/php/conf.d/jit.ini

#MySQL Service
db:
image: mysql:8.0.35
container_name: db
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: vichan
MYSQL_ROOT_PASSWORD: password
volumes:
- ./local-instances/${INSTANCE:-0}/mysql:/var/lib/mysql
30 changes: 22 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -2,16 +2,24 @@
"name": "vichan-devel/vichan",
"description": "vichan imageboard",
"type": "project",
"config": {
"platform": {
"php": "7.4"
}
},
"require": {
"ext-mbstring": ">=5.4",
"ext-gd": ">=5.4",
"ext-pdo": ">=5.4",
"twig/twig": "^1.44.2",
"php": ">=7.4",
"ext-mbstring": ">=7.4",
"ext-gd": ">=7.4",
"ext-pdo": ">=7.4",
"twig/twig": "^2.9",
"phpmyadmin/twig-i18n-extension": "^4.0",
"lifo/ip": "^1.0",
"gettext/gettext": "^1.0",
"gettext/gettext": "^5.5",
"mrclay/minify": "^2.1.6",
"geoip/geoip": "^1.17",
"dapphp/securimage": "^4.0"
"dapphp/securimage": "^4.0",
"erusev/parsedown": "^1.7.4"
},
"autoload": {
"classmap": ["inc/"],
@@ -25,8 +33,14 @@
"inc/mod/auth.php",
"inc/lock.php",
"inc/queue.php",
"inc/polyfill.php",
"inc/functions.php"
"inc/functions.php",
"inc/functions/dice.php",
"inc/functions/format.php",
"inc/functions/net.php",
"inc/functions/num.php",
"inc/functions/theme.php",
"inc/service/captcha-queries.php",
"inc/context.php"
]
},
"license": "Tinyboard + vichan",
Loading