card-mod-script 0.14.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/real.yml +50 -0
- data/lib/ansi2html.rb +69 -0
- data/lib/card/mod/script.rb +1 -0
- data/set/abstract/00_script.rb +4 -4
- data/set/abstract/02_coffee_script.rb +9 -1
- data/set/all/head_javascript.rb +13 -22
- data/set/right/script.rb +1 -1
- data/set/type/coffee_script.rb +6 -0
- data/set/type/java_script.rb +6 -0
- data/set/type/local_script_folder_group.rb +2 -0
- data/set/type/local_script_manifest_group.rb +2 -0
- data/set/type_plus_right/mod/script.rb +1 -5
- data/set/type_plus_right/set/script.rb +3 -1
- metadata +13 -119
- data/assets/script/decko/autosave.js.coffee +0 -30
- data/assets/script/decko/bridge.js.coffee +0 -31
- data/assets/script/decko/card_menu.js.coffee +0 -26
- data/assets/script/decko/components.js.coffee +0 -49
- data/assets/script/decko/decko.js.coffee +0 -82
- data/assets/script/decko/doubleclick.js.coffee +0 -30
- data/assets/script/decko/editor.js.coffee +0 -57
- data/assets/script/decko/filter.js.coffee +0 -183
- data/assets/script/decko/filter_items.js.coffee +0 -128
- data/assets/script/decko/filter_links.js.coffee +0 -81
- data/assets/script/decko/follow.js.coffee +0 -22
- data/assets/script/decko/layout.js.coffee +0 -76
- data/assets/script/decko/link_editor.js.coffee +0 -61
- data/assets/script/decko/mod.js.coffee +0 -79
- data/assets/script/decko/modal.js.coffee +0 -113
- data/assets/script/decko/name_editor.js.coffee +0 -40
- data/assets/script/decko/navbox.js.coffee +0 -74
- data/assets/script/decko/nest_editor.js.coffee +0 -166
- data/assets/script/decko/nest_editor_name.js.coffee +0 -102
- data/assets/script/decko/nest_editor_options.js.coffee +0 -93
- data/assets/script/decko/nest_editor_rules.js.coffee +0 -3
- data/assets/script/decko/overlay.js.coffee +0 -54
- data/assets/script/decko/pointer_config.js.coffee +0 -79
- data/assets/script/decko/pointer_list_editor.js.coffee +0 -67
- data/assets/script/decko/recaptcha.js.coffee +0 -19
- data/assets/script/decko/selectable_filtered_content.js.coffee +0 -12
- data/assets/script/decko/slot.js.coffee +0 -182
- data/assets/script/decko/slot_ready.js.coffee +0 -12
- data/assets/script/decko/slotter.js.coffee +0 -268
- data/assets/script/decko/type_editor.js.coffee +0 -21
- data/assets/script/decko/upload.js.coffee +0 -64
- data/assets/script/jquery-ui.min.js +0 -13
- data/assets/script/jquery.autosize.js +0 -274
- data/assets/script/manifest.yml +0 -57
- data/db/migrate_core_cards/20200804112348_add_mod_script_assets_type.rb +0 -30
- data/vendor/jquery_file_upload/LICENSE.txt +0 -20
- data/vendor/jquery_file_upload/README.md +0 -224
- data/vendor/jquery_file_upload/SECURITY.md +0 -227
- data/vendor/jquery_file_upload/VULNERABILITIES.md +0 -118
- data/vendor/jquery_file_upload/cors/postmessage.html +0 -85
- data/vendor/jquery_file_upload/cors/result.html +0 -26
- data/vendor/jquery_file_upload/css/jquery.fileupload-noscript.css +0 -22
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui-noscript.css +0 -17
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +0 -68
- data/vendor/jquery_file_upload/css/jquery.fileupload.css +0 -36
- data/vendor/jquery_file_upload/docker-compose.yml +0 -55
- data/vendor/jquery_file_upload/img/loading.gif +0 -0
- data/vendor/jquery_file_upload/img/progressbar.gif +0 -0
- data/vendor/jquery_file_upload/index.html +0 -357
- data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +0 -126
- data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +0 -97
- data/vendor/jquery_file_upload/js/demo.js +0 -75
- data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +0 -101
- data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +0 -347
- data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +0 -170
- data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +0 -759
- data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +0 -119
- data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +0 -101
- data/vendor/jquery_file_upload/js/jquery.fileupload.js +0 -1604
- data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +0 -227
- data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +0 -805
- data/vendor/jquery_file_upload/package-lock.json +0 -6853
- data/vendor/jquery_file_upload/package.json +0 -116
- data/vendor/jquery_file_upload/server/gae-python/app.yaml +0 -18
- data/vendor/jquery_file_upload/server/gae-python/main.py +0 -204
- data/vendor/jquery_file_upload/server/gae-python/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-python/static/robots.txt +0 -2
- data/vendor/jquery_file_upload/server/php/Dockerfile +0 -44
- data/vendor/jquery_file_upload/server/php/UploadHandler.php +0 -1480
- data/vendor/jquery_file_upload/server/php/index.php +0 -15
- data/vendor/jquery_file_upload/server/php/php.ini +0 -5
- data/vendor/jquery_file_upload/test/index.html +0 -49
- data/vendor/jquery_file_upload/test/unit.js +0 -989
- data/vendor/jquery_file_upload/test/vendor/chai.js +0 -10854
- data/vendor/jquery_file_upload/test/vendor/mocha.css +0 -325
- data/vendor/jquery_file_upload/test/vendor/mocha.js +0 -18178
- data/vendor/jquery_file_upload/wdio/LICENSE.txt +0 -20
- data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
- data/vendor/jquery_file_upload/wdio/conf/chrome.js +0 -40
- data/vendor/jquery_file_upload/wdio/conf/firefox.js +0 -25
- data/vendor/jquery_file_upload/wdio/hooks/index.js +0 -36
- data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +0 -79
- data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +0 -25
- data/vendor/jquery_file_upload/wdio/wdio.conf.js +0 -4
- data/vendor/jquery_rails/CHANGELOG.md +0 -359
- data/vendor/jquery_rails/CONTRIBUTING.md +0 -132
- data/vendor/jquery_rails/Gemfile +0 -22
- data/vendor/jquery_rails/MIT-LICENSE +0 -21
- data/vendor/jquery_rails/README.md +0 -75
- data/vendor/jquery_rails/Rakefile +0 -59
- data/vendor/jquery_rails/VERSIONS.md +0 -62
- data/vendor/jquery_rails/jquery-rails.gemspec +0 -26
- data/vendor/jquery_rails/lib/jquery/assert_select.rb +0 -149
- data/vendor/jquery_rails/lib/jquery/rails/engine.rb +0 -6
- data/vendor/jquery_rails/lib/jquery/rails/version.rb +0 -9
- data/vendor/jquery_rails/lib/jquery/rails.rb +0 -8
- data/vendor/jquery_rails/lib/jquery-rails.rb +0 -1
- data/vendor/jquery_rails/test/assert_select_jquery_test.rb +0 -85
- data/vendor/jquery_rails/test/test_helper.rb +0 -6
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.js +0 -11008
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.js +0 -5
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.map +0 -1
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.js +0 -9814
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.js +0 -4
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.map +0 -1
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.js +0 -10364
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.js +0 -2
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.map +0 -1
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js +0 -555
@@ -1,116 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "blueimp-file-upload",
|
3
|
-
"version": "10.32.0",
|
4
|
-
"title": "jQuery File Upload",
|
5
|
-
"description": "File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
|
6
|
-
"keywords": [
|
7
|
-
"jquery",
|
8
|
-
"file",
|
9
|
-
"upload",
|
10
|
-
"widget",
|
11
|
-
"multiple",
|
12
|
-
"selection",
|
13
|
-
"drag",
|
14
|
-
"drop",
|
15
|
-
"progress",
|
16
|
-
"preview",
|
17
|
-
"cross-domain",
|
18
|
-
"cross-site",
|
19
|
-
"chunk",
|
20
|
-
"resume",
|
21
|
-
"gae",
|
22
|
-
"go",
|
23
|
-
"python",
|
24
|
-
"php",
|
25
|
-
"bootstrap"
|
26
|
-
],
|
27
|
-
"homepage": "https://github.com/blueimp/jQuery-File-Upload",
|
28
|
-
"author": {
|
29
|
-
"name": "Sebastian Tschan",
|
30
|
-
"url": "https://blueimp.net"
|
31
|
-
},
|
32
|
-
"repository": {
|
33
|
-
"type": "git",
|
34
|
-
"url": "git://github.com/blueimp/jQuery-File-Upload.git"
|
35
|
-
},
|
36
|
-
"license": "MIT",
|
37
|
-
"peerDependencies": {
|
38
|
-
"jquery": ">=1.7"
|
39
|
-
},
|
40
|
-
"optionalDependencies": {
|
41
|
-
"blueimp-canvas-to-blob": "3",
|
42
|
-
"blueimp-load-image": "5",
|
43
|
-
"blueimp-tmpl": "3"
|
44
|
-
},
|
45
|
-
"devDependencies": {
|
46
|
-
"eslint": "7",
|
47
|
-
"eslint-config-blueimp": "2",
|
48
|
-
"eslint-config-prettier": "8",
|
49
|
-
"eslint-plugin-jsdoc": "36",
|
50
|
-
"eslint-plugin-prettier": "4",
|
51
|
-
"prettier": "2",
|
52
|
-
"stylelint": "13",
|
53
|
-
"stylelint-config-prettier": "8",
|
54
|
-
"stylelint-config-recommended": "5"
|
55
|
-
},
|
56
|
-
"stylelint": {
|
57
|
-
"extends": [
|
58
|
-
"stylelint-config-recommended",
|
59
|
-
"stylelint-config-prettier"
|
60
|
-
],
|
61
|
-
"ignoreFiles": [
|
62
|
-
"css/*.min.css",
|
63
|
-
"css/vendor/*",
|
64
|
-
"test/vendor/*"
|
65
|
-
]
|
66
|
-
},
|
67
|
-
"eslintConfig": {
|
68
|
-
"extends": [
|
69
|
-
"blueimp",
|
70
|
-
"plugin:jsdoc/recommended",
|
71
|
-
"plugin:prettier/recommended"
|
72
|
-
],
|
73
|
-
"env": {
|
74
|
-
"browser": true
|
75
|
-
}
|
76
|
-
},
|
77
|
-
"eslintIgnore": [
|
78
|
-
"*.min.js",
|
79
|
-
"test/vendor"
|
80
|
-
],
|
81
|
-
"prettier": {
|
82
|
-
"arrowParens": "avoid",
|
83
|
-
"proseWrap": "always",
|
84
|
-
"singleQuote": true,
|
85
|
-
"trailingComma": "none"
|
86
|
-
},
|
87
|
-
"scripts": {
|
88
|
-
"lint": "stylelint '**/*.css' && eslint .",
|
89
|
-
"unit": "docker-compose run --rm mocha",
|
90
|
-
"wdio": "docker-compose run --rm wdio",
|
91
|
-
"test": "npm run lint && npm run unit && npm run wdio && npm run wdio -- conf/firefox.js",
|
92
|
-
"posttest": "docker-compose down -v",
|
93
|
-
"preversion": "npm test",
|
94
|
-
"postversion": "git push --tags origin master && npm publish"
|
95
|
-
},
|
96
|
-
"files": [
|
97
|
-
"css/jquery.fileupload-noscript.css",
|
98
|
-
"css/jquery.fileupload-ui-noscript.css",
|
99
|
-
"css/jquery.fileupload-ui.css",
|
100
|
-
"css/jquery.fileupload.css",
|
101
|
-
"img/loading.gif",
|
102
|
-
"img/progressbar.gif",
|
103
|
-
"js/cors/jquery.postmessage-transport.js",
|
104
|
-
"js/cors/jquery.xdr-transport.js",
|
105
|
-
"js/vendor/jquery.ui.widget.js",
|
106
|
-
"js/jquery.fileupload-audio.js",
|
107
|
-
"js/jquery.fileupload-image.js",
|
108
|
-
"js/jquery.fileupload-process.js",
|
109
|
-
"js/jquery.fileupload-ui.js",
|
110
|
-
"js/jquery.fileupload-validate.js",
|
111
|
-
"js/jquery.fileupload-video.js",
|
112
|
-
"js/jquery.fileupload.js",
|
113
|
-
"js/jquery.iframe-transport.js"
|
114
|
-
],
|
115
|
-
"main": "js/jquery.fileupload.js"
|
116
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
runtime: python27
|
2
|
-
api_version: 1
|
3
|
-
threadsafe: true
|
4
|
-
|
5
|
-
libraries:
|
6
|
-
- name: PIL
|
7
|
-
version: latest
|
8
|
-
|
9
|
-
handlers:
|
10
|
-
- url: /(favicon\.ico|robots\.txt)
|
11
|
-
static_files: static/\1
|
12
|
-
upload: static/(.*)
|
13
|
-
expiration: '1d'
|
14
|
-
- url: /.*
|
15
|
-
script: main.app
|
16
|
-
|
17
|
-
automatic_scaling:
|
18
|
-
max_instances: 1
|
@@ -1,204 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# jQuery File Upload Plugin GAE Python Example
|
4
|
-
# https://github.com/blueimp/jQuery-File-Upload
|
5
|
-
#
|
6
|
-
# Copyright 2011, Sebastian Tschan
|
7
|
-
# https://blueimp.net
|
8
|
-
#
|
9
|
-
# Licensed under the MIT license:
|
10
|
-
# https://opensource.org/licenses/MIT
|
11
|
-
#
|
12
|
-
|
13
|
-
from google.appengine.api import memcache, images
|
14
|
-
import json
|
15
|
-
import os
|
16
|
-
import re
|
17
|
-
import urllib
|
18
|
-
import webapp2
|
19
|
-
|
20
|
-
DEBUG=os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
|
21
|
-
WEBSITE = 'https://blueimp.github.io/jQuery-File-Upload/'
|
22
|
-
MIN_FILE_SIZE = 1 # bytes
|
23
|
-
# Max file size is memcache limit (1MB) minus key size minus overhead:
|
24
|
-
MAX_FILE_SIZE = 999000 # bytes
|
25
|
-
IMAGE_TYPES = re.compile('image/(gif|p?jpeg|(x-)?png)')
|
26
|
-
ACCEPT_FILE_TYPES = IMAGE_TYPES
|
27
|
-
THUMB_MAX_WIDTH = 80
|
28
|
-
THUMB_MAX_HEIGHT = 80
|
29
|
-
THUMB_SUFFIX = '.'+str(THUMB_MAX_WIDTH)+'x'+str(THUMB_MAX_HEIGHT)+'.png'
|
30
|
-
EXPIRATION_TIME = 300 # seconds
|
31
|
-
# If set to None, only allow redirects to the referer protocol+host.
|
32
|
-
# Set to a regexp for custom pattern matching against the redirect value:
|
33
|
-
REDIRECT_ALLOW_TARGET = None
|
34
|
-
|
35
|
-
class CORSHandler(webapp2.RequestHandler):
|
36
|
-
def cors(self):
|
37
|
-
headers = self.response.headers
|
38
|
-
headers['Access-Control-Allow-Origin'] = '*'
|
39
|
-
headers['Access-Control-Allow-Methods'] =\
|
40
|
-
'OPTIONS, HEAD, GET, POST, DELETE'
|
41
|
-
headers['Access-Control-Allow-Headers'] =\
|
42
|
-
'Content-Type, Content-Range, Content-Disposition'
|
43
|
-
|
44
|
-
def initialize(self, request, response):
|
45
|
-
super(CORSHandler, self).initialize(request, response)
|
46
|
-
self.cors()
|
47
|
-
|
48
|
-
def json_stringify(self, obj):
|
49
|
-
return json.dumps(obj, separators=(',', ':'))
|
50
|
-
|
51
|
-
def options(self, *args, **kwargs):
|
52
|
-
pass
|
53
|
-
|
54
|
-
class UploadHandler(CORSHandler):
|
55
|
-
def validate(self, file):
|
56
|
-
if file['size'] < MIN_FILE_SIZE:
|
57
|
-
file['error'] = 'File is too small'
|
58
|
-
elif file['size'] > MAX_FILE_SIZE:
|
59
|
-
file['error'] = 'File is too big'
|
60
|
-
elif not ACCEPT_FILE_TYPES.match(file['type']):
|
61
|
-
file['error'] = 'Filetype not allowed'
|
62
|
-
else:
|
63
|
-
return True
|
64
|
-
return False
|
65
|
-
|
66
|
-
def validate_redirect(self, redirect):
|
67
|
-
if redirect:
|
68
|
-
if REDIRECT_ALLOW_TARGET:
|
69
|
-
return REDIRECT_ALLOW_TARGET.match(redirect)
|
70
|
-
referer = self.request.headers['referer']
|
71
|
-
if referer:
|
72
|
-
from urlparse import urlparse
|
73
|
-
parts = urlparse(referer)
|
74
|
-
redirect_allow_target = '^' + re.escape(
|
75
|
-
parts.scheme + '://' + parts.netloc + '/'
|
76
|
-
)
|
77
|
-
return re.match(redirect_allow_target, redirect)
|
78
|
-
return False
|
79
|
-
|
80
|
-
def get_file_size(self, file):
|
81
|
-
file.seek(0, 2) # Seek to the end of the file
|
82
|
-
size = file.tell() # Get the position of EOF
|
83
|
-
file.seek(0) # Reset the file position to the beginning
|
84
|
-
return size
|
85
|
-
|
86
|
-
def write_blob(self, data, info):
|
87
|
-
key = urllib.quote(info['type'].encode('utf-8'), '') +\
|
88
|
-
'/' + str(hash(data)) +\
|
89
|
-
'/' + urllib.quote(info['name'].encode('utf-8'), '')
|
90
|
-
try:
|
91
|
-
memcache.set(key, data, time=EXPIRATION_TIME)
|
92
|
-
except: #Failed to add to memcache
|
93
|
-
return (None, None)
|
94
|
-
thumbnail_key = None
|
95
|
-
if IMAGE_TYPES.match(info['type']):
|
96
|
-
try:
|
97
|
-
img = images.Image(image_data=data)
|
98
|
-
img.resize(
|
99
|
-
width=THUMB_MAX_WIDTH,
|
100
|
-
height=THUMB_MAX_HEIGHT
|
101
|
-
)
|
102
|
-
thumbnail_data = img.execute_transforms()
|
103
|
-
thumbnail_key = key + THUMB_SUFFIX
|
104
|
-
memcache.set(
|
105
|
-
thumbnail_key,
|
106
|
-
thumbnail_data,
|
107
|
-
time=EXPIRATION_TIME
|
108
|
-
)
|
109
|
-
except: #Failed to resize Image or add to memcache
|
110
|
-
thumbnail_key = None
|
111
|
-
return (key, thumbnail_key)
|
112
|
-
|
113
|
-
def handle_upload(self):
|
114
|
-
results = []
|
115
|
-
for name, fieldStorage in self.request.POST.items():
|
116
|
-
if type(fieldStorage) is unicode:
|
117
|
-
continue
|
118
|
-
result = {}
|
119
|
-
result['name'] = urllib.unquote(fieldStorage.filename)
|
120
|
-
result['type'] = fieldStorage.type
|
121
|
-
result['size'] = self.get_file_size(fieldStorage.file)
|
122
|
-
if self.validate(result):
|
123
|
-
key, thumbnail_key = self.write_blob(
|
124
|
-
fieldStorage.value,
|
125
|
-
result
|
126
|
-
)
|
127
|
-
if key is not None:
|
128
|
-
result['url'] = self.request.host_url + '/' + key
|
129
|
-
result['deleteUrl'] = result['url']
|
130
|
-
result['deleteType'] = 'DELETE'
|
131
|
-
if thumbnail_key is not None:
|
132
|
-
result['thumbnailUrl'] = self.request.host_url +\
|
133
|
-
'/' + thumbnail_key
|
134
|
-
else:
|
135
|
-
result['error'] = 'Failed to store uploaded file.'
|
136
|
-
results.append(result)
|
137
|
-
return results
|
138
|
-
|
139
|
-
def head(self):
|
140
|
-
pass
|
141
|
-
|
142
|
-
def get(self):
|
143
|
-
self.redirect(WEBSITE)
|
144
|
-
|
145
|
-
def post(self):
|
146
|
-
if (self.request.get('_method') == 'DELETE'):
|
147
|
-
return self.delete()
|
148
|
-
result = {'files': self.handle_upload()}
|
149
|
-
s = self.json_stringify(result)
|
150
|
-
redirect = self.request.get('redirect')
|
151
|
-
if self.validate_redirect(redirect):
|
152
|
-
return self.redirect(str(
|
153
|
-
redirect.replace('%s', urllib.quote(s, ''), 1)
|
154
|
-
))
|
155
|
-
if 'application/json' in self.request.headers.get('Accept'):
|
156
|
-
self.response.headers['Content-Type'] = 'application/json'
|
157
|
-
self.response.write(s)
|
158
|
-
|
159
|
-
class FileHandler(CORSHandler):
|
160
|
-
def normalize(self, str):
|
161
|
-
return urllib.quote(urllib.unquote(str), '')
|
162
|
-
|
163
|
-
def get(self, content_type, data_hash, file_name):
|
164
|
-
content_type = self.normalize(content_type)
|
165
|
-
file_name = self.normalize(file_name)
|
166
|
-
key = content_type + '/' + data_hash + '/' + file_name
|
167
|
-
data = memcache.get(key)
|
168
|
-
if data is None:
|
169
|
-
return self.error(404)
|
170
|
-
# Prevent browsers from MIME-sniffing the content-type:
|
171
|
-
self.response.headers['X-Content-Type-Options'] = 'nosniff'
|
172
|
-
content_type = urllib.unquote(content_type)
|
173
|
-
if not IMAGE_TYPES.match(content_type):
|
174
|
-
# Force a download dialog for non-image types:
|
175
|
-
content_type = 'application/octet-stream'
|
176
|
-
elif file_name.endswith(THUMB_SUFFIX):
|
177
|
-
content_type = 'image/png'
|
178
|
-
self.response.headers['Content-Type'] = content_type
|
179
|
-
# Cache for the expiration time:
|
180
|
-
self.response.headers['Cache-Control'] = 'public,max-age=%d' \
|
181
|
-
% EXPIRATION_TIME
|
182
|
-
self.response.write(data)
|
183
|
-
|
184
|
-
def delete(self, content_type, data_hash, file_name):
|
185
|
-
content_type = self.normalize(content_type)
|
186
|
-
file_name = self.normalize(file_name)
|
187
|
-
key = content_type + '/' + data_hash + '/' + file_name
|
188
|
-
result = {key: memcache.delete(key)}
|
189
|
-
content_type = urllib.unquote(content_type)
|
190
|
-
if IMAGE_TYPES.match(content_type):
|
191
|
-
thumbnail_key = key + THUMB_SUFFIX
|
192
|
-
result[thumbnail_key] = memcache.delete(thumbnail_key)
|
193
|
-
if 'application/json' in self.request.headers.get('Accept'):
|
194
|
-
self.response.headers['Content-Type'] = 'application/json'
|
195
|
-
s = self.json_stringify(result)
|
196
|
-
self.response.write(s)
|
197
|
-
|
198
|
-
app = webapp2.WSGIApplication(
|
199
|
-
[
|
200
|
-
('/', UploadHandler),
|
201
|
-
('/(.+)/([^/]+)/([^/]+)', FileHandler)
|
202
|
-
],
|
203
|
-
debug=DEBUG
|
204
|
-
)
|
Binary file
|
@@ -1,44 +0,0 @@
|
|
1
|
-
FROM php:8.0.11-apache
|
2
|
-
|
3
|
-
# Enable the Apache Headers module:
|
4
|
-
RUN ln -s /etc/apache2/mods-available/headers.load \
|
5
|
-
/etc/apache2/mods-enabled/headers.load
|
6
|
-
|
7
|
-
# Enable the Apache Rewrite module:
|
8
|
-
RUN ln -s /etc/apache2/mods-available/rewrite.load \
|
9
|
-
/etc/apache2/mods-enabled/rewrite.load
|
10
|
-
|
11
|
-
# Install GD, Imagick and ImageMagick as image conversion options:
|
12
|
-
RUN DEBIAN_FRONTEND=noninteractive \
|
13
|
-
apt-get update && apt-get install -y --no-install-recommends \
|
14
|
-
libpng-dev \
|
15
|
-
libjpeg-dev \
|
16
|
-
libmagickwand-dev \
|
17
|
-
imagemagick \
|
18
|
-
&& pecl install \
|
19
|
-
imagick \
|
20
|
-
&& docker-php-ext-enable \
|
21
|
-
imagick \
|
22
|
-
&& docker-php-ext-configure \
|
23
|
-
gd --with-jpeg=/usr/include/ \
|
24
|
-
&& docker-php-ext-install \
|
25
|
-
gd \
|
26
|
-
# Uninstall obsolete packages:
|
27
|
-
&& apt-get autoremove -y \
|
28
|
-
libpng-dev \
|
29
|
-
libjpeg-dev \
|
30
|
-
libmagickwand-dev \
|
31
|
-
# Remove obsolete files:
|
32
|
-
&& apt-get clean \
|
33
|
-
&& rm -rf \
|
34
|
-
/tmp/* \
|
35
|
-
/usr/share/doc/* \
|
36
|
-
/var/cache/* \
|
37
|
-
/var/lib/apt/lists/* \
|
38
|
-
/var/tmp/*
|
39
|
-
|
40
|
-
# Use the default development configuration:
|
41
|
-
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
42
|
-
|
43
|
-
# Add a custom configuration file:
|
44
|
-
COPY php.ini "$PHP_INI_DIR/conf.d/"
|