Skip to content

Instantly share code, notes, and snippets.

View xet7's full-sized avatar

Lauri Ojansivu xet7

View GitHub Profile
@xet7
xet7 / attachments.js
Created May 2, 2022 10:43
Limit WeKan file size and type
diff --git a/models/attachments.js b/models/attachments.js
index bbbf8e59..4b7faa7c 100644
--- a/models/attachments.js
+++ b/models/attachments.js
@@ -33,6 +33,19 @@ Attachments = new FilesCollection({
const ret = fileStoreStrategyFactory.storagePath;
return ret;
},
+ onBeforeUpload(file) {
+ // Allow upload files under 10MB, and only in png/jpg/jpeg formats
@xet7
xet7 / authentication.js
Created June 25, 2018 23:34
frame and iframe restrictions config example, in progress
import Fiber from 'fibers';
if (Meteor.isServer) {
// Have these settings in environment variables
// Allow Wekan in iframe only from this domain
BrowserPolicy.framing.restrictToOrigin('https://example.com')
BrowserPolicy.content.allowFrameAncestorsOrigin('https://example.com')
// Allow Wekan cards to have images from <img src='https://image.example.com' /> only
BrowserPolicy.content.allowImageOrigin('https://image.example.com,https://image.domain.com')
@xet7
xet7 / keybase.md
Created March 7, 2018 09:30
keybase.md

Keybase proof

I hereby claim:

  • I am xet7 on github.
  • I am wekan (https://keybase.io/wekan) on keybase.
  • I have a public key ASD85G9fbXikXEuIoLuVjuHA4C7Y_jeCGmUDOmdCG5e4IQo

To claim this, I am signing this object:

@xet7
xet7 / lint-errors.txt
Created January 25, 2018 05:53
NPM lint errors
wekan@wekan:~/repos/wekan$ npm run lint --fix
> wekan@0.65.0 lint /home/wekan/repos/wekan
> eslint --ignore-pattern 'packages/*' .
/home/wekan/repos/wekan/client/components/boards/boardHeader.js
183:5 error 'Swimlanes' is not defined no-undef
/home/wekan/repos/wekan/client/components/lists/listBody.js
@xet7
xet7 / compile.sh
Last active July 30, 2016 19:40
cegui compile, in progress
# Cleanup: Remove extra not needed dependencies and files
sudo apt-get --purge remove libfribidi-dev libglm-dev doxygen ccache libglfw-dev libgtk2.0-dev
sudo apt-get autoremove
sudo rm /usr/local/lib/libCEGUI*
sudo rm -rf /usr/local/lib/cegui-0.8
sudo rm -rf /usr/local/include/cegui-0
sudo rm -rf /usr/local/share/doc/cegui-0
# a) Ubuntu 14.04
@xet7
xet7 / move-old-irclogs.sh
Created May 20, 2016 18:46
Move irclogs older than 6 months to another directory
#!/bin/bash
# Move files older than 6 months to another directory
# 2016-05-20 First version by Lauri Ojansivu <x@xet7.org>
## Cronjob for this command:
##Move old irclogs at first day of the month.
#0 0 1 * * /path/to/move-old-irclogs.sh > /dev/null 2>&1
# Moveold function parameters:
# $1 = since date that is in filename
@xet7
xet7 / tsc.sh
Created May 19, 2016 17:30
Messages when running TSC
$ ./bin/tsc
Initializing resource manager and core classes
Game data directory: /home/USERNAME/tsc/share/tsc
User data directory: /home/USERNAME/.local/share/tsc
User cache directory: /home/USERNAME/.cache/tsc
User config directory: /home/USERNAME/.config/tsc
Initializing Package Manager
Configuration file is '/home/USERNAME/.config/tsc/config.xml'.
Translation locale is fi_FI.UTF-8
Translation support with gettext set to:
# Linux Mint 17.3 64bit
sudo apt-get install build-essential libudev-dev cmake cmake-gui libfreetype6-dev libjpeg-dev libx11-dev libxrandr-dev libxcb1-dev libxcb-image0-dev libgl1-mesa-dev libflac-dev libogg-dev libvorbis-dev libvorbisenc2 libvorbisfile3 libopenal-dev libpthread-stubs0-dev cmake-gui
git clone https://github.com/SFML/SFML.git
mkdir sfml-build
cmake-gui
# I selected SFML code directory master branch and sfml-build for binaries.
# I clicked Configure twice and Generate once, then closed cmake-gui.
@xet7
xet7 / run-windows.bat
Created March 3, 2016 00:34
Haxe Kha LiveGame compile on Win10 does not load images
Compiling on Windows
====================
- Tested on Windows 10 64bit.
- Using Chocolatey https://chocolatey.org to install most software needed.
1. Click magnifying glass "search" button (it's at right side of Start button).
2. Write:
cmd.exe
@xet7
xet7 / gitlab-http.conf
Created January 18, 2016 23:05
GitLab nginx config
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
## GitLab
## Modified from https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl & https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab
##
## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
##