Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daflyinbed committed Apr 24, 2024
1 parent a33f4e6 commit 78358a9
Show file tree
Hide file tree
Showing 15 changed files with 11,424 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
log default {
level DEBUG
}
}
http://localhost {
root * /workspaces/mw
encode gzip
php_fastcgi app:9000
file_server
}
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "mw",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"remoteUser": "vscode",
"postStartCommand": "php-fpm"
}
47 changes: 47 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
app:
image: ghcr.io/mooncellwiki/mw-devcontainer:latest

volumes:
- ../..:/workspaces
- ./php/php.ini:/usr/local/etc/php/php.ini
environment:
- HTTP_RPXOY=http://172.22.240.1:7890
- HTTPS_RPXOY=http://172.22.240.1:7890
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
caddy:
image: caddy:2.7
volumes:
- ../..:/workspaces
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
ports:
- 81:80
db:
image: mysql:8.0
restart: unless-stopped
volumes:
- mysql-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql

# Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
memcached:
image: memcached:1.6
restart: unless-stopped

redis:
image: redis:7.0
restart: unless-stopped

volumes:
mysql-data:
caddy_data:
99 changes: 99 additions & 0 deletions .devcontainer/php/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
; This directive allows you to disable certain functions.
; It receives a comma-delimited list of function names.
; https://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,ini_alter,ini_restore,dl,openlog,syslog,readlink,popepassthru,stream_socket_server

; Maximum amount of memory a script may consume
; https://php.net/memory-limit
memory_limit = 256M

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it is automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
; E_DEPRECATED - warn about code that will not work in future versions
; of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
; E_ALL (Show all errors, warnings and notices including coding standards.)
; E_ALL & ~E_NOTICE (Show all errors, except for notices)
; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; Default Value: E_ALL
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; https://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_USER_DEPRECATED & ~E_USER_NOTICE &~E_WARNING

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; https://php.net/post-max-size
post_max_size = 50M

; Maximum allowed size for uploaded files.
; https://php.net/upload-max-filesize
upload_max_filesize = 50M

[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = Asia/Shanghai

[apcu]
;The size of each shared memory segment
apc.shm_size=128M
;apc.enable_cli=1

[opcache]
; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=64

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=60

;The amount of shared memory to reserve for compiled JIT code. A zero value disables the JIT.
opcache.jit_buffer_size=8M
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ sftp-config.json
/maintenance/.mweval_history
/maintenance/.mwsql_history
/maintenance/dev/data
/LocalSettings.php
/includes/PlatformSettings.php

/etc/
# Building & testing
npm-debug.log
node_modules/
Expand All @@ -62,7 +61,11 @@ phpunit.xml
.phan/local-config.php

# Composer
/composer.lock
/vendor
/extensions/AWS
/extensions/DynamicPageList3
/extensions/SemanticMediaWiki
/extensions/SemanticResultFormats
/composer.phar

# Operating systems
Expand Down
11 changes: 11 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,14 @@
path = extensions/DeleteUserPages
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/DeleteUserPages
branch = REL1_39
[submodule "extensions/CharInset"]
path = extensions/CharInset
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/CharInsert
branch = REL1_39
[submodule "extensions/CharInsert"]
path = extensions/CharInsert
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/CharInsert
branch = REL1_39
[submodule "extensions/LanguageParser"]
path = extensions/LanguageParser
url = https://github.com/MooncellWiki/mediawiki-extension-LanguageParser.git
Loading

0 comments on commit 78358a9

Please sign in to comment.