* extract scan code to libscan, (wip)

* submodules

* replace curl with mongoose (wip)

* replace onion with mongoose (wip)

* replace onion with mongoose (wip)

* It compiles! (I think)

* Update readme

* Entirely remove libonion (WIP)

* unscramble submodules

* recover screenshot

* Update mappings

* Bug fixes

* update

* media meta fix

* memory fixes

* More bug fixes...

* Bug fix w/ libmagic & vfile

* libmagic fix (again)

* Better lightbox, better video handler, random reloads fix

* Use svg for info icon

* re-enable http auth

* mobi support #41, fix logs

* Update README & cleanup
This commit is contained in:
simon987 2020-04-21 14:42:20 -04:00 committed by GitHub
parent 4501a7810f
commit e436af7b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
104 changed files with 1338 additions and 4292 deletions

View file

@ -2,15 +2,15 @@
rm -rf index.sist2/
rm web/js/bundle.js 2> /dev/null
cat `ls web/js/*.min.js` > web/js/bundle.js
cat web/js/{util,dom,search}.js >> web/js/bundle.js
rm src/static/js/bundle.js 2> /dev/null
cat `ls src/static/js/*.min.js` > src/static/js/bundle.js
cat src/static/js/{util,dom,search}.js >> src/static/js/bundle.js
rm web/css/bundle*.css 2> /dev/null
cat web/css/*.min.css > web/css/bundle.css
cat web/css/light.css >> web/css/bundle.css
cat web/css/*.min.css > web/css/bundle_dark.css
cat web/css/dark.css >> web/css/bundle_dark.css
rm src/static/css/bundle*.css 2> /dev/null
cat src/static/css/*.min.css > src/static/css/bundle.css
cat src/static/css/light.css >> src/static/css/bundle.css
cat src/static/css/*.min.css > src/static/css/bundle_dark.css
cat src/static/css/dark.css >> src/static/css/bundle_dark.css
python3 scripts/mime.py > src/parsing/mime_generated.c
python3 scripts/serve_static.py > src/web/static_generated.c

View file

@ -1,128 +0,0 @@
#!/usr/bin/env bash
THREADS=$(nproc)
cd lib
cd mupdf
CFLAGS=-fPIC make USE_SYSTEM_HARFBUZZ=yes USE_SYSTEM_OPENJPEG=yes HAVE_X11=no HAVE_GLUT=no -j $THREADS
cd ..
mv mupdf/build/release/libmupdf.a .
mv mupdf/build/release/libmupdf-third.a .
# openjp2
cd openjpeg
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O3 -DNDEBUG -fPIC"
make -j $THREADS
cd ..
mv openjpeg/bin/libopenjp2.a .
# harfbuzz
cd harfbuzz
./autogen.sh
CFLAGS=-fPIC ./configure --disable-shared --enable-static
make -j $THREADS
cd ..
mv harfbuzz/src/.libs/libharfbuzz.a .
# ffmpeg
cd ffmpeg
./configure --disable-shared --enable-static --disable-ffmpeg --disable-ffplay \
--disable-ffprobe --disable-doc\
--disable-manpages --disable-postproc --disable-avfilter \
--disable-alsa --disable-lzma --disable-xlib --disable-debug\
--disable-vdpau --disable-vaapi --disable-sdl2 --disable-network\
--extra-cflags=-fPIC
make -j $THREADS
cd ..
mv ffmpeg/libavcodec/libavcodec.a .
mv ffmpeg/libavformat/libavformat.a .
mv ffmpeg/libavutil/libavutil.a .
mv ffmpeg/libswresample/libswresample.a .
mv ffmpeg/libswscale/libswscale.a .
# onion
cd onion
mkdir build 2> /dev/null
cd build
cmake -DONION_USE_SSL=false -DONION_USE_PAM=false -DONION_USE_PNG=false -DONION_USE_JPEG=false \
-DONION_USE_JPEG=false -DONION_USE_XML2=false -DONION_USE_SYSTEMD=false -DONION_USE_SQLITE3=false \
-DONION_USE_REDIS=false -DONION_USE_GC=false -DONION_USE_TESTS=false -DONION_EXAMPLES=false \
-DONION_USE_BINDINGS_CPP=false ..
make -j $THREADS
cd ../..
mv onion/build/src/onion/libonion_static.a .
#bzip2
cd bzip2-1.0.6
make -j $THREADS
cd ..
mv bzip2-1.0.6/libbz2.a .
# magic
cd libmagic
./autogen.sh
./configure --enable-static --disable-shared
make -j $THREADS
cd ..
mv libmagic/src/.libs/libmagic.a .
# tesseract
cd tesseract
mkdir build
cd build
cmake -DSTATIC=on -DBUILD_TRAINING_TOOLS=off -DBUILD_TESTS=off -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fPIC" -DAUTO_OPTIMIZE=off ..
make -j $THREADS
cd ../..
mv tesseract/build/libtesseract.a .
# leptonica
cd leptonica
./autogen.sh
CFLAGS="-fPIC" ./configure --without-zlib --without-jpeg --without-giflib \
--without-giflib --without-libwebp --without-libwebpmux --without-libopenjpeg \
--enable-static --disable-shared
make -j $THREADS
cd ..
mv leptonica/src/.libs/liblept.a .
# tiff
cd libtiff
./autogen.sh
CFLAGS="-fPIC" CXXFLAGS="-fPIC" CXX_FLAGS="-fPIC" ./configure --enable-static --disable-shared --disable-lzw --disable-jpeg --disable-webp \
--disable-lzma --disable-zstd --disable-jbig
make -j $THREADS
cd ..
mv libtiff/libtiff/.libs/libtiff.a .
# png
cd libpng
CFLAGS="-fPIC" ./configure --enable-static --disable-shared
make -j $THREADS
cd ..
mv libpng/.libs/libpng16.a .
# openssl...
git clone --depth 1 -b OpenSSL_1_1_0-stable https://github.com/openssl/openssl
cd openssl
./config --prefix=$(pwd)/../ssl
make depend
make -j $THREADS
make install
cd ..
mv ./openssl/libcrypto.a ./openssl/libssl.a .
# curl
wget -nc https://curl.haxx.se/download/curl-7.68.0.tar.gz
tar -xzf curl-7.68.0.tar.gz
cd curl-7.68.0
./configure --disable-ldap --disable-ldaps --without-librtmp --disable-rtsp --disable-crypto-auth \
--disable-smtp --without-libidn2 --without-nghttp2 --without-brotli --enable-static --disable-shared \
--without-libpsl --with-ssl=$(pwd)/../ssl
make -j $THREADS
cd ..
mv curl-7.68.0/lib/.libs/libcurl.a .

430
scripts/mime.csv Normal file
View file

@ -0,0 +1,430 @@
application/arj, arj
application/base64, mme
application/binhex, hqx
application/book, boo|book
application/CDFV2-corrupt,
application/CDFV2, sdv
application/clariscad, ccad
application/commonground, dp
application/csv,
application/dicom, dcm
application/drafting, drw
application/epub+zip, epub
application/freeloader, frl
application/futuresplash, spl
application/groupwise, vew
application/gzip, gz
application/hta, hta
application/i-deas, unv
application/iges, iges|igs
application/inf, inf
application/java-archive, jar
application/java, class
application/javascript,
application/json, json
application/marc, mrc
application/mbedlet, mbd
application/mime, aps
application/mspowerpoint, ppz
application/msword, doc|dot|w6w|wiz|word
application/netmc, mcp
application/octet-stream, bin|dump|gpg
application/oda, oda
application/ogg, ogv
application/pdf, pdf
application/pgp-keys,
application/pgp-signature, pgp
application/pkcs7-signature, p7s
application/pkix-cert, cer|crt
application/postscript, ai|ps
application/pro_eng, part|prt
application/ringing-tones, rng
application/smil, smi|smil
application/solids, sol
application/sounder, sdr
application/step, step|stp
application/streamingmedia, ssm
application/vda, vda
application/vnd.fdf, fdf
application/vnd.font-fontforge-sfd, sfd
application/vnd.hp-hpgl, hgl|hpg|hpgl
application/vnd.iccprofile, icm
application/vnd.iccprofile, icm
application/vnd.lotus-1-2-3,
application/vnd.ms-cab-compressed, cab
application/vnd.ms-excel, xlb|xlc|xll|xlm|xls|xlw
application/vnd.ms-fontobject, eot
application/vnd.ms-opentype, otf
application/vnd.ms-pki.certstore, sst
application/vnd.ms-pki.pko, pko
application/vnd.ms-pki.seccat, cat
application/vnd.ms-powerpoint, pot|ppa|pps|ppt|pwz
application/vnd.ms-project, mpp
application/vnd.oasis.opendocument.base, odb
application/vnd.oasis.opendocument.formula, odf
application/vnd.oasis.opendocument.graphics, odg
application/vnd.oasis.opendocument.presentation, odp
application/vnd.oasis.opendocument.spreadsheet, ods
application/vnd.oasis.opendocument.text, odt
application/vnd.openxmlformats-officedocument.presentationml.presentation, pptx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xlsx
application/vnd.openxmlformats-officedocument.wordprocessingml.document, docx
application/vnd.symbian.install,
application/vnd.tcpdump.pcap, pcap
application/vnd.wap.wmlc, wmlc
application/vnd.wap.wmlscriptc, wmlsc
application/vnd.xara, web
application/vocaltec-media-desc, vmd
application/vocaltec-media-file, vmf
application/warc, warc
application/winhelp, hlp
application/wordperfect6.0, w60
application/wordperfect6.1, w61
application/wordperfect, wp|wp5|wp6|wpd
application/x-123, wk1
application/x-7z-compressed, 7z
application/x-aim, aim
application/x-apple-diskimage,
application/x-arc,
application/x-archive, a
application/x-atari-7800-rom, a78
application/x-authorware-bin, aab
application/x-authorware-map, aam
application/x-authorware-seg, aas
application/x-avira-qua,
application/x-bcpio, bcpio
application/x-bittorrent, torrent
application/x-bsh, bsh
application/x-bytecode.python, pyc
application/x-bzip2, boz|bz2
application/x-bzip, bz
application/x-cbr, cbr
application/x-cbz, cbz
application/x-cdlink, vcd
application/x-chat, cha|chat
application/x-chrome-extension,
application/x-cocoa, cco
application/x-conference, nsc
application/x-coredump,
application/x-cpio, cpio
application/x-dbf, dbf
application/x-dbt,
application/x-debian-package, deb
application/x-deepv, deepv
application/x-director, dcr|dir|dxr
application/x-dmp, dmp
application/x-dosdriver,
application/x-dosexec, dll
application/x-dvi, dvi
application/x-elc, elc
application/x-empty,
application/x-envoy, env|evy
application/x-esrehber, es
application/x-excel, xla|xld|xlk|xlt|xlv
application/x-executable, exe
application/x-font-gdos,
application/x-font-pf2, pf2
application/x-font-pfm, pfm
application/x-font-sfn,
application/x-font-ttf, ttf|ttc
application/x-fptapplication/x-dbt,
application/x-freelance, pre
application/x-gamecube-rom,
application/x-gdbm,
application/x-gettext-translation,
application/x-git,
application/x-gsp, gsp
application/x-gss, gss
application/x-gtar, gtar
application/x-gzip, gzip
application/x-hdf, hdf
application/x-helpfile, help
application/x-httpd-imap, imap
application/x-ima, ima
application/x-innosetup,
application/x-internett-signup, ins
application/x-inventor, iv
application/x-ip2, ip
application/x-java-applet,
application/x-java-commerce, jcm
application/x-java-image,
application/x-java-jmod, jmod
application/x-java-keystore,
application/x-kdelnk,
application/x-koan, skd|skm|skp|skt
application/x-latex, latex|ltx
application/x-livescreen, ivy
application/x-lotus, wq1
application/x-lz4+json, jsonlz4
application/x-lz4, lz4
application/x-lz4, lz4
application/x-lzh-compressed,
application/x-lzh, lzh
application/x-lzip, lz
application/x-lzma, lzma
application/x-lzop, lzo
application/x-lzx, lzx
application/x-mach-binary, jnilib|dylib
application/x-mach-executable,
application/x-magic-cap-package-1.0, mc$
application/x-mathcad, mcd
application/x-maxis-dbpf,
application/x-meme, mm
application/x-midi, midi
application/x-mif, mif
application/x-mix-transfer, nix
application/xml, opf
application/x-mobipocket-ebook, mobi
application/vnd.amazon.mobi8-ebook, azw|azw3
application/x-msaccess, accdb
application/x-ms-compress-szdd, fon
application/x-ms-pdb, pdb
application/x-ms-reader, lit
application/x-n64-rom, z64
application/x-navi-animation, ani
application/x-navidoc, nvd
application/x-navimap, map
application/x-navistyle, stl
application/x-nes-rom, nes
application/x-netcdf, cdf|nc
application/x-newton-compatible-pkg, pkg
application/x-nintendo-ds-rom,
application/x-object, o
application/x-omcdatamaker, omcd
application/x-omc, omc
application/x-omcregerator, omcr
application/x-pagemaker, pm4|pm5
application/x-pcl, pcl
application/x-pgp-keyring,
application/x-pixclscript, plx
application/x-pkcs7-certreqresp, p7r
application/x-pkcs7-signature, p7a
application/x-project, mpc|mpt|mpv|mpx
application/x-qpro, wb1
application/x-rar, rar
application/x-rpm, rpm
application/x-sdp, sdp
application/x-sea, sea
application/x-seelogo, sl
application/x-setupscript,
application/x-sharedlib, so
application/x-shar, shar
application/x-shockwave-flash, swf
application/x-snappy-framed,
application/x-sprite, spr|sprite
application/x-sqlite3,
application/x-stargallery-thm,
application/x-stuffit, sit
application/x-sv4cpio, sv4cpio
application/x-sv4crc, sv4crc
application/x-tar, tar
application/x-tbook, sbk|tbk
application/x-terminfo,
application/x-terminfo2,
application/x-texinfo, texi|texinfo
application/x-tex-tfm, tfm
application/x-ustar, ustar
application/x-visio, vsd|vst|vsw
application/x-vnd.audioexplosion.mzz, mzz
application/x-vnd.ls-xpix, xpix
application/x-vrml, vrml
application/x-wais-source, src|wsrc
application/x-wine-extension-ini,
application/x-wintalk, wtk
application/x-world, svr
application/x-wri, wri
application/x-x509-ca-cert, der
application/x-xz, xz
application/x-zip,
application/x-zstd, zst
application/zip, zip
application/zlib, z
!audio/basic, au
audio/it, it
audio/make, funk|my|pfunk
audio/midi, kar
audio/mid, rmi
audio/mp4, m4b
audio/mpeg, m2a|mpa
audio/ogg, ogg
audio/s3m, s3m
audio/tsp-audio, tsi
audio/tsplayer, tsp
audio/vnd.qcelp, qcp
audio/voxware, vox
audio/x-aiff, aiff|aif
audio/x-flac, flac
audio/x-gsm, gsd|gsm
audio/x-hx-aac-adts,
audio/x-jam, jam
audio/x-liveaudio, lam
audio/x-m4a, m4a
audio/x-midi, mid
audio/x-mod,
audio/x-mp4a-latm,
audio/x-mpeg-3, mp3
audio/x-mpequrl,
audio/xm, xm
audio/x-nspaudio, lma
audio/x-pn-realaudio, ram|rm|rmm|rmp
audio/x-psid, sid
audio/x-realaudio, ra
audio/x-s3m,
audio/x-twinvq-plugin, vqe|vql
audio/x-twinvq, vqf
audio/x-voc, voc
audio/x-wav, wav
!audio/x-xbox360-executable, xex
!audio/x-xbox-executable, xbe
font/otf,
font/sfnt,
font/woff2, woff2
font/woff, woff
image/bmp,
image/cmu-raster, rast
image/fif, fif
image/florian, flo|turbot
image/g3fax, g3
image/gif, gif
image/heic, heic
image/ief, ief|iefs
image/jpeg, jfif|jfif-tbnl|jpe|jpeg|jpg
image/jutvision, jut
image/naplps, nap|naplps
image/pict, pic|pict
image/png, png|x-png
!image/svg, svg
!image/svg+xml,
image/tiff,
!image/vnd.adobe.photoshop, psd
!image/vnd.djvu, djvu
image/vnd.fpx, fpx
image/vnd.microsoft.icon,
image/vnd.rn-realflash, rf
image/vnd.rn-realpix, rp
image/vnd.wap.wbmp, wbmp
image/vnd.xiff, xif
image/webp, webp
image/wmf,
image/x-3ds, 3ds
image/x-award-bioslogo,
image/x-cmu-raster, ras
image/x-cur, tga
image/x-dwg, dwg|dxf|svf
image/x-eps,
image/x-exr, exr
image/x-gem,
image/x-icns,
!image/x-icon, ico
image/x-jg, art
image/x-jps, jps
image/x-ms-bmp, bm|bmp
image/x-niff, nif|niff
image/x-pcx, pcx
image/x-pict, pct
image/x-portable-bitmap, pbm
image/x-portable-graymap, pgm
image/x-portable-pixmap, ppm
image/x-quicktime, qif|qti|qtif
image/x-rgb, rgb
image/x-tga,
image/x-tiff, tif|tiff
image/x-win-bitmap,
!image/x-xcf, xcf
!image/x-xpixmap, xpm
image/x-xwindowdump, xwd
message/news,
message/rfc822, mht|mhtml|mime
model/vnd.dwf, dwf
model/vnd.gdl, gdl
model/vnd.gs.gdl, gdsl
model/vrml, wrz
model/x-pov, pov
text/asp, asp
text/css, css
text/html, acgi|htm|html|htmls|htx|shtml
text/javascript, js
text/mcf, mcf
text/pascal, pas
text/PGP,
text/plain, com|cmd|conf|def|g|idc|list|lst|mar|sdml|text|txt|md|groovy|license|properties|desktop|ini|rst|cmake|ipynb|readme|less|lo|go|yml|d|cs|hpp|srt|nfo|sfv|m3u|csv|eml
text/richtext, rt|rtf|rtx
text/rtf,
text/scriplet, wsc
text/tab-separated-values, tsv
text/troff, man|me|ms|roff|t|tr
text/uri-list, uji|unis|uri|uris
text/vnd.abc, abc
text/vnd.fmi.flexstor, flx
text/vnd.wap.wmlscript, wmls
text/vnd.wap.wml, wml
text/webviewhtml, htt
text/x-Algol68,
text/x-asm, asm|s
text/x-audiosoft-intra, aip
text/x-awk, awk
text/x-bcpl,
text/x-c, c|cc|h
text/x-c++, cpp|cxx|c++
text/x-component, htc
text/x-diff,
text/x-fortran, f|f77|f90|for
text/x-java, jav|java
text/x-la-asf, lsx
text/x-lisp, el
text/x-m4, m4|ac
text/x-makefile, am|mak
text/xml, xml|pom|iml|plist
text/x-m, m
text/x-msdos-batch, bat
text/x-ms-regedit, reg
text/x-objective-c,
text/x-pascal, p
text/x-perl, pl
text/x-php, php
text/x-po, po
text/x-python, py
text/x-ruby, rb
text/x-sass, sass
text/x-scss, scss
text/x-server-parsed-html, ssi
text/x-setext, etx
text/x-sgml, sgm|sgml
text/x-shellscript, sh
text/x-speech, talk
text/x-tcl,
text/x-tex, tex
text/x-uil, uil
text/x-uuencode, uue
text/x-vcalendar, vcs
text/x-vcard, vcf
video/animaflex, afl
video/avi, avi
video/avs-video, avs
video/MP2T,
video/mp4, mp4
video/mpeg, m1v|m2v|mpe|mpeg|mpg
video/quicktime, moov|mov|qt
video/vdo, vdo
video/vivo, viv|vivo
video/vnd.rn-realvideo, rv
video/vosaic, vos
video/webm, webm
video/x-amt-demorun, xdr
video/x-amt-showrun, xsr
video/x-atomic3d-feature, fmf
video/x-dl, dl
video/x-dv, dif|dv
video/x-fli, fli
video/x-flv, flv
video/x-isvideo, isu
!video/x-jng, jng
video/x-m4v, m4v
video/x-matroska, mkv
video/x-mng, mng
video/x-motion-jpeg, mjpg
video/x-ms-asf, asf|asx|wmv
video/x-msvideo, divx
video/x-qtc, qtc
video/x-sgi-movie, movie|mv
x-epoc/x-sisx-app,
1 application/arj arj
2 application/base64 mme
3 application/binhex hqx
4 application/book boo|book
5 application/CDFV2-corrupt
6 application/CDFV2 sdv
7 application/clariscad ccad
8 application/commonground dp
9 application/csv
10 application/dicom dcm
11 application/drafting drw
12 application/epub+zip epub
13 application/freeloader frl
14 application/futuresplash spl
15 application/groupwise vew
16 application/gzip gz
17 application/hta hta
18 application/i-deas unv
19 application/iges iges|igs
20 application/inf inf
21 application/java-archive jar
22 application/java class
23 application/javascript
24 application/json json
25 application/marc mrc
26 application/mbedlet mbd
27 application/mime aps
28 application/mspowerpoint ppz
29 application/msword doc|dot|w6w|wiz|word
30 application/netmc mcp
31 application/octet-stream bin|dump|gpg
32 application/oda oda
33 application/ogg ogv
34 application/pdf pdf
35 application/pgp-keys
36 application/pgp-signature pgp
37 application/pkcs7-signature p7s
38 application/pkix-cert cer|crt
39 application/postscript ai|ps
40 application/pro_eng part|prt
41 application/ringing-tones rng
42 application/smil smi|smil
43 application/solids sol
44 application/sounder sdr
45 application/step step|stp
46 application/streamingmedia ssm
47 application/vda vda
48 application/vnd.fdf fdf
49 application/vnd.font-fontforge-sfd sfd
50 application/vnd.hp-hpgl hgl|hpg|hpgl
51 application/vnd.iccprofile icm
52 application/vnd.iccprofile icm
53 application/vnd.lotus-1-2-3
54 application/vnd.ms-cab-compressed cab
55 application/vnd.ms-excel xlb|xlc|xll|xlm|xls|xlw
56 application/vnd.ms-fontobject eot
57 application/vnd.ms-opentype otf
58 application/vnd.ms-pki.certstore sst
59 application/vnd.ms-pki.pko pko
60 application/vnd.ms-pki.seccat cat
61 application/vnd.ms-powerpoint pot|ppa|pps|ppt|pwz
62 application/vnd.ms-project mpp
63 application/vnd.oasis.opendocument.base odb
64 application/vnd.oasis.opendocument.formula odf
65 application/vnd.oasis.opendocument.graphics odg
66 application/vnd.oasis.opendocument.presentation odp
67 application/vnd.oasis.opendocument.spreadsheet ods
68 application/vnd.oasis.opendocument.text odt
69 application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
70 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
71 application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
72 application/vnd.symbian.install
73 application/vnd.tcpdump.pcap pcap
74 application/vnd.wap.wmlc wmlc
75 application/vnd.wap.wmlscriptc wmlsc
76 application/vnd.xara web
77 application/vocaltec-media-desc vmd
78 application/vocaltec-media-file vmf
79 application/warc warc
80 application/winhelp hlp
81 application/wordperfect6.0 w60
82 application/wordperfect6.1 w61
83 application/wordperfect wp|wp5|wp6|wpd
84 application/x-123 wk1
85 application/x-7z-compressed 7z
86 application/x-aim aim
87 application/x-apple-diskimage
88 application/x-arc
89 application/x-archive a
90 application/x-atari-7800-rom a78
91 application/x-authorware-bin aab
92 application/x-authorware-map aam
93 application/x-authorware-seg aas
94 application/x-avira-qua
95 application/x-bcpio bcpio
96 application/x-bittorrent torrent
97 application/x-bsh bsh
98 application/x-bytecode.python pyc
99 application/x-bzip2 boz|bz2
100 application/x-bzip bz
101 application/x-cbr cbr
102 application/x-cbz cbz
103 application/x-cdlink vcd
104 application/x-chat cha|chat
105 application/x-chrome-extension
106 application/x-cocoa cco
107 application/x-conference nsc
108 application/x-coredump
109 application/x-cpio cpio
110 application/x-dbf dbf
111 application/x-dbt
112 application/x-debian-package deb
113 application/x-deepv deepv
114 application/x-director dcr|dir|dxr
115 application/x-dmp dmp
116 application/x-dosdriver
117 application/x-dosexec dll
118 application/x-dvi dvi
119 application/x-elc elc
120 application/x-empty
121 application/x-envoy env|evy
122 application/x-esrehber es
123 application/x-excel xla|xld|xlk|xlt|xlv
124 application/x-executable exe
125 application/x-font-gdos
126 application/x-font-pf2 pf2
127 application/x-font-pfm pfm
128 application/x-font-sfn
129 application/x-font-ttf ttf|ttc
130 application/x-fptapplication/x-dbt
131 application/x-freelance pre
132 application/x-gamecube-rom
133 application/x-gdbm
134 application/x-gettext-translation
135 application/x-git
136 application/x-gsp gsp
137 application/x-gss gss
138 application/x-gtar gtar
139 application/x-gzip gzip
140 application/x-hdf hdf
141 application/x-helpfile help
142 application/x-httpd-imap imap
143 application/x-ima ima
144 application/x-innosetup
145 application/x-internett-signup ins
146 application/x-inventor iv
147 application/x-ip2 ip
148 application/x-java-applet
149 application/x-java-commerce jcm
150 application/x-java-image
151 application/x-java-jmod jmod
152 application/x-java-keystore
153 application/x-kdelnk
154 application/x-koan skd|skm|skp|skt
155 application/x-latex latex|ltx
156 application/x-livescreen ivy
157 application/x-lotus wq1
158 application/x-lz4+json jsonlz4
159 application/x-lz4 lz4
160 application/x-lz4 lz4
161 application/x-lzh-compressed
162 application/x-lzh lzh
163 application/x-lzip lz
164 application/x-lzma lzma
165 application/x-lzop lzo
166 application/x-lzx lzx
167 application/x-mach-binary jnilib|dylib
168 application/x-mach-executable
169 application/x-magic-cap-package-1.0 mc$
170 application/x-mathcad mcd
171 application/x-maxis-dbpf
172 application/x-meme mm
173 application/x-midi midi
174 application/x-mif mif
175 application/x-mix-transfer nix
176 application/xml opf
177 application/x-mobipocket-ebook mobi
178 application/vnd.amazon.mobi8-ebook azw|azw3
179 application/x-msaccess accdb
180 application/x-ms-compress-szdd fon
181 application/x-ms-pdb pdb
182 application/x-ms-reader lit
183 application/x-n64-rom z64
184 application/x-navi-animation ani
185 application/x-navidoc nvd
186 application/x-navimap map
187 application/x-navistyle stl
188 application/x-nes-rom nes
189 application/x-netcdf cdf|nc
190 application/x-newton-compatible-pkg pkg
191 application/x-nintendo-ds-rom
192 application/x-object o
193 application/x-omcdatamaker omcd
194 application/x-omc omc
195 application/x-omcregerator omcr
196 application/x-pagemaker pm4|pm5
197 application/x-pcl pcl
198 application/x-pgp-keyring
199 application/x-pixclscript plx
200 application/x-pkcs7-certreqresp p7r
201 application/x-pkcs7-signature p7a
202 application/x-project mpc|mpt|mpv|mpx
203 application/x-qpro wb1
204 application/x-rar rar
205 application/x-rpm rpm
206 application/x-sdp sdp
207 application/x-sea sea
208 application/x-seelogo sl
209 application/x-setupscript
210 application/x-sharedlib so
211 application/x-shar shar
212 application/x-shockwave-flash swf
213 application/x-snappy-framed
214 application/x-sprite spr|sprite
215 application/x-sqlite3
216 application/x-stargallery-thm
217 application/x-stuffit sit
218 application/x-sv4cpio sv4cpio
219 application/x-sv4crc sv4crc
220 application/x-tar tar
221 application/x-tbook sbk|tbk
222 application/x-terminfo
223 application/x-terminfo2
224 application/x-texinfo texi|texinfo
225 application/x-tex-tfm tfm
226 application/x-ustar ustar
227 application/x-visio vsd|vst|vsw
228 application/x-vnd.audioexplosion.mzz mzz
229 application/x-vnd.ls-xpix xpix
230 application/x-vrml vrml
231 application/x-wais-source src|wsrc
232 application/x-wine-extension-ini
233 application/x-wintalk wtk
234 application/x-world svr
235 application/x-wri wri
236 application/x-x509-ca-cert der
237 application/x-xz xz
238 application/x-zip
239 application/x-zstd zst
240 application/zip zip
241 application/zlib z
242 !audio/basic au
243 audio/it it
244 audio/make funk|my|pfunk
245 audio/midi kar
246 audio/mid rmi
247 audio/mp4 m4b
248 audio/mpeg m2a|mpa
249 audio/ogg ogg
250 audio/s3m s3m
251 audio/tsp-audio tsi
252 audio/tsplayer tsp
253 audio/vnd.qcelp qcp
254 audio/voxware vox
255 audio/x-aiff aiff|aif
256 audio/x-flac flac
257 audio/x-gsm gsd|gsm
258 audio/x-hx-aac-adts
259 audio/x-jam jam
260 audio/x-liveaudio lam
261 audio/x-m4a m4a
262 audio/x-midi mid
263 audio/x-mod
264 audio/x-mp4a-latm
265 audio/x-mpeg-3 mp3
266 audio/x-mpequrl
267 audio/xm xm
268 audio/x-nspaudio lma
269 audio/x-pn-realaudio ram|rm|rmm|rmp
270 audio/x-psid sid
271 audio/x-realaudio ra
272 audio/x-s3m
273 audio/x-twinvq-plugin vqe|vql
274 audio/x-twinvq vqf
275 audio/x-voc voc
276 audio/x-wav wav
277 !audio/x-xbox360-executable xex
278 !audio/x-xbox-executable xbe
279 font/otf
280 font/sfnt
281 font/woff2 woff2
282 font/woff woff
283 image/bmp
284 image/cmu-raster rast
285 image/fif fif
286 image/florian flo|turbot
287 image/g3fax g3
288 image/gif gif
289 image/heic heic
290 image/ief ief|iefs
291 image/jpeg jfif|jfif-tbnl|jpe|jpeg|jpg
292 image/jutvision jut
293 image/naplps nap|naplps
294 image/pict pic|pict
295 image/png png|x-png
296 !image/svg svg
297 !image/svg+xml
298 image/tiff
299 !image/vnd.adobe.photoshop psd
300 !image/vnd.djvu djvu
301 image/vnd.fpx fpx
302 image/vnd.microsoft.icon
303 image/vnd.rn-realflash rf
304 image/vnd.rn-realpix rp
305 image/vnd.wap.wbmp wbmp
306 image/vnd.xiff xif
307 image/webp webp
308 image/wmf
309 image/x-3ds 3ds
310 image/x-award-bioslogo
311 image/x-cmu-raster ras
312 image/x-cur tga
313 image/x-dwg dwg|dxf|svf
314 image/x-eps
315 image/x-exr exr
316 image/x-gem
317 image/x-icns
318 !image/x-icon ico
319 image/x-jg art
320 image/x-jps jps
321 image/x-ms-bmp bm|bmp
322 image/x-niff nif|niff
323 image/x-pcx pcx
324 image/x-pict pct
325 image/x-portable-bitmap pbm
326 image/x-portable-graymap pgm
327 image/x-portable-pixmap ppm
328 image/x-quicktime qif|qti|qtif
329 image/x-rgb rgb
330 image/x-tga
331 image/x-tiff tif|tiff
332 image/x-win-bitmap
333 !image/x-xcf xcf
334 !image/x-xpixmap xpm
335 image/x-xwindowdump xwd
336 message/news
337 message/rfc822 mht|mhtml|mime
338 model/vnd.dwf dwf
339 model/vnd.gdl gdl
340 model/vnd.gs.gdl gdsl
341 model/vrml wrz
342 model/x-pov pov
343 text/asp asp
344 text/css css
345 text/html acgi|htm|html|htmls|htx|shtml
346 text/javascript js
347 text/mcf mcf
348 text/pascal pas
349 text/PGP
350 text/plain com|cmd|conf|def|g|idc|list|lst|mar|sdml|text|txt|md|groovy|license|properties|desktop|ini|rst|cmake|ipynb|readme|less|lo|go|yml|d|cs|hpp|srt|nfo|sfv|m3u|csv|eml
351 text/richtext rt|rtf|rtx
352 text/rtf
353 text/scriplet wsc
354 text/tab-separated-values tsv
355 text/troff man|me|ms|roff|t|tr
356 text/uri-list uji|unis|uri|uris
357 text/vnd.abc abc
358 text/vnd.fmi.flexstor flx
359 text/vnd.wap.wmlscript wmls
360 text/vnd.wap.wml wml
361 text/webviewhtml htt
362 text/x-Algol68
363 text/x-asm asm|s
364 text/x-audiosoft-intra aip
365 text/x-awk awk
366 text/x-bcpl
367 text/x-c c|cc|h
368 text/x-c++ cpp|cxx|c++
369 text/x-component htc
370 text/x-diff
371 text/x-fortran f|f77|f90|for
372 text/x-java jav|java
373 text/x-la-asf lsx
374 text/x-lisp el
375 text/x-m4 m4|ac
376 text/x-makefile am|mak
377 text/xml xml|pom|iml|plist
378 text/x-m m
379 text/x-msdos-batch bat
380 text/x-ms-regedit reg
381 text/x-objective-c
382 text/x-pascal p
383 text/x-perl pl
384 text/x-php php
385 text/x-po po
386 text/x-python py
387 text/x-ruby rb
388 text/x-sass sass
389 text/x-scss scss
390 text/x-server-parsed-html ssi
391 text/x-setext etx
392 text/x-sgml sgm|sgml
393 text/x-shellscript sh
394 text/x-speech talk
395 text/x-tcl
396 text/x-tex tex
397 text/x-uil uil
398 text/x-uuencode uue
399 text/x-vcalendar vcs
400 text/x-vcard vcf
401 video/animaflex afl
402 video/avi avi
403 video/avs-video avs
404 video/MP2T
405 video/mp4 mp4
406 video/mpeg m1v|m2v|mpe|mpeg|mpg
407 video/quicktime moov|mov|qt
408 video/vdo vdo
409 video/vivo viv|vivo
410 video/vnd.rn-realvideo rv
411 video/vosaic vos
412 video/webm webm
413 video/x-amt-demorun xdr
414 video/x-amt-showrun xsr
415 video/x-atomic3d-feature fmf
416 video/x-dl dl
417 video/x-dv dif|dv
418 video/x-fli fli
419 video/x-flv flv
420 video/x-isvideo isu
421 !video/x-jng jng
422 video/x-m4v m4v
423 video/x-matroska mkv
424 video/x-mng mng
425 video/x-motion-jpeg mjpg
426 video/x-ms-asf asf|asx|wmv
427 video/x-msvideo divx
428 video/x-qtc qtc
429 video/x-sgi-movie movie|mv
430 x-epoc/x-sisx-app

View file

@ -62,6 +62,11 @@ doc = (
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
)
mobi = (
"application/x-mobipocket-ebook",
"application/vnd.amazon.mobi8-ebook"
)
cnt = 1
@ -82,6 +87,8 @@ def mime_id(mime):
mime_id += " | 0x08000000"
elif mime in doc:
mime_id += " | 0x04000000"
elif mime in mobi:
mime_id += " | 0x02000000"
elif mime == "application/x-empty":
return "1"
return mime_id
@ -91,7 +98,7 @@ def clean(t):
return t.replace("/", "_").replace(".", "_").replace("+", "_").replace("-", "_")
with open("mime.csv") as f:
with open("scripts/mime.csv") as f:
for l in f:
mime, ext_list = l.split(",")
if l.startswith("!"):
@ -103,7 +110,7 @@ with open("mime.csv") as f:
print("// **Generated by mime.py**")
print("#ifndef MIME_GENERATED_C")
print("#define MIME_GENERATED_C")
print("#include <glib-2.0/glib.h>\n")
print("#include <glib.h>\n")
print("#include <stdlib.h>\n")
# Enum
print("enum mime {")

View file

@ -1,10 +1,10 @@
files = [
"web/css/bundle.css",
"web/css/bundle_dark.css",
"web/js/bundle.js",
"web/img/sprite-skin-flat.png",
"web/img/sprite-skin-flat-dark.png",
"web/search.html",
"src/static/css/bundle.css",
"src/static/css/bundle_dark.css",
"src/static/js/bundle.js",
"src/static/img/sprite-skin-flat.png",
"src/static/img/sprite-skin-flat-dark.png",
"src/static/search.html",
]