Rename basefolder 'rainloop' to 'snappymail'

this prevents conflicts with original rainloop
This commit is contained in:
djmaze 2020-10-15 16:21:52 +02:00
parent 2655f5ea00
commit d0f686c657
962 changed files with 113 additions and 119 deletions

16
.gitignore vendored
View file

@ -1,16 +1,7 @@
/.idea /*.bak
/.vscode
/api.php /api.php
/error.log /*.log
/nbproject /snappymail/v/0.0.0/static/*
/npm-debug.log
/yarn-error.log
/rainloop.sublime-project
/rainloop.sublime-workspace
/rainloop/v/0.0.0/static/*
/rainloop/v/0.0.0/app/localization/moment/*
!/rainloop/v/0.0.0/app/localization/moment/.gitempty
/vendors/.*
/node_modules /node_modules
/build/local /build/local
/build/dist /build/dist
@ -22,6 +13,5 @@
!/.docker/nginx/ssl/.gitempty !/.docker/nginx/ssl/.gitempty
/dist /dist
/data /data
.DS_Store
/MULTIPLY /MULTIPLY
/include.php /include.php

View file

@ -3,13 +3,13 @@ host = https://www.transifex.com
minimum_perc = 60 minimum_perc = 60
type = YAML type = YAML
[rainloop-webmail.rainloop-webmail] [snappymail-webmail.snappymail-webmail]
file_filter = rainloop/v/0.0.0/app/localization/webmail/<lang>.yml file_filter = snappymail/v/0.0.0/app/localization/webmail/<lang>.yml
source_file = rainloop/v/0.0.0/app/localization/webmail/_source.en.yml source_file = snappymail/v/0.0.0/app/localization/webmail/_source.en.yml
source_lang = en source_lang = en
[rainloop-webmail.rainloop-admin] [snappymail-webmail.snappymail-admin]
file_filter = rainloop/v/0.0.0/app/localization/admin/<lang>.yml file_filter = snappymail/v/0.0.0/app/localization/admin/<lang>.yml
source_file = rainloop/v/0.0.0/app/localization/admin/_source.en.yml source_file = snappymail/v/0.0.0/app/localization/admin/_source.en.yml
source_lang = en source_lang = en

View file

@ -1,4 +1,4 @@
**Thanks for contributing to RainLoop Webmail!** **Thanks for contributing to SnappyMail Webmail!**
1. Fork the repo, do work in a feature branch. 1. Fork the repo, do work in a feature branch.
2. Issue a pull request. 2. Issue a pull request.
@ -10,9 +10,9 @@
1. Install node.js - `https://nodejs.org/download/` 1. Install node.js - `https://nodejs.org/download/`
2. Install yarn - `https://yarnpkg.com/en/docs/install` 2. Install yarn - `https://yarnpkg.com/en/docs/install`
3. Install gulp - `npm install gulp -g` 3. Install gulp - `npm install gulp -g`
4. Fork rainloop - `https://github.com/RainLoop/rainloop-webmail/issues/new#fork-destination-box` 4. Fork snappymail - `https://github.com/the-djmaze/snappymail/issues/new#fork-destination-box`
5. Clone rainloop - `git clone git@github.com:USERNAME/rainloop-webmail.git rainloop` 5. Clone snappymail - `git clone git@github.com:USERNAME/snappymail.git snappymail`
6. `cd rainloop` 6. `cd snappymail`
7. Install install all dependencies - `yarn install` 7. Install install all dependencies - `yarn install`
8. Run gulp - `gulp` 8. Run gulp - `gulp`
@ -32,4 +32,4 @@
--- ---
If you have any questions, open an issue or email support@rainloop.net. If you have any questions, open an issue or email support@snappymail.eu.

View file

@ -16,8 +16,8 @@
function __get_custom_data_full_path() function __get_custom_data_full_path()
{ {
return ''; return '';
return dirname(__DIR__) . '/rainloop-data'; return dirname(__DIR__) . '/snappymail-data';
return '/var/external-rainloop-data-folder'; // custom data folder path return '/var/external-snappymail-data-folder'; // custom data folder path
} }
/** /**

View file

@ -7,7 +7,7 @@ const
SERVER_PREFIX = './?', SERVER_PREFIX = './?',
SUB_QUERY_PREFIX = '&q[]=', SUB_QUERY_PREFIX = '&q[]=',
VERSION = Settings.app('version'), VERSION = Settings.app('version'),
VERSION_PREFIX = Settings.app('webVersionPath') || 'rainloop/v/' + VERSION + '/', VERSION_PREFIX = Settings.app('webVersionPath') || 'snappymail/v/' + VERSION + '/',
getHash = () => Settings.get('AuthAccountHash') || '0'; getHash = () => Settings.get('AuthAccountHash') || '0';

2
dev/prototype.js vendored
View file

@ -43,7 +43,7 @@
Z: {timeZone: 'UTC'} Z: {timeZone: 'UTC'}
}, },
relativeTime = { relativeTime = {
// see /rainloop/v/0.0.0/app/localization/relativetimeformat/ // see /snappymail/v/0.0.0/app/localization/relativetimeformat/
}, },
pad2 = v => 10 > v ? '0' + v : v; pad2 = v => 10 > v ? '0' + v : v;

View file

@ -31,9 +31,9 @@ services:
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
MYSQL_USER: rainloop MYSQL_USER: snappymail
MYSQL_PASSWORD: rainloop MYSQL_PASSWORD: snappymail
MYSQL_DATABASE: rainloop MYSQL_DATABASE: snappymail
volumes: volumes:
- mysql:/var/lib/mysql - mysql:/var/lib/mysql
- tmp:/tmp - tmp:/tmp
@ -50,7 +50,7 @@ services:
volumes: volumes:
- ./:/var/www - ./:/var/www
# - ./build/local/:/var/www # - ./build/local/:/var/www
- ./.docker/php/rainloop.ini:/usr/local/etc/php/conf.d/rainloop.ini - ./.docker/php/snappymail.ini:/usr/local/etc/php/conf.d/snappymail.ini
- tmp:/tmp - tmp:/tmp
node: node:
build: build:

View file

@ -7,7 +7,7 @@ const { js, jsLint } = require('./tasks/js');
const { css, cssLint } = require('./tasks/css'); const { css, cssLint } = require('./tasks/css');
const { vendors } = require('./tasks/vendors'); const { vendors } = require('./tasks/vendors');
const { watchCss } = require('./tasks/watch'); const { watchCss } = require('./tasks/watch');
const { rainloop } = require('./tasks/rainloop'); const { snappymail } = require('./tasks/snappymail');
const clean = gulp.series(cleanStatic); const clean = gulp.series(cleanStatic);
@ -25,5 +25,5 @@ exports.default = build;
exports.watchCss = watchCss; exports.watchCss = watchCss;
exports.rainloop = gulp.series(build, rainloop); exports.snappymail = gulp.series(build, snappymail);
exports.all = gulp.series(exports.rainloop); exports.all = gulp.series(exports.snappymail);

View file

@ -7,9 +7,9 @@ if (!defined('APP_VERSION'))
define('APP_INDEX_ROOT_PATH', str_replace('\\', '/', rtrim(dirname(__FILE__), '\\/').'/')); define('APP_INDEX_ROOT_PATH', str_replace('\\', '/', rtrim(dirname(__FILE__), '\\/').'/'));
} }
if (file_exists(APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php')) if (file_exists(APP_INDEX_ROOT_PATH.'snappymail/v/'.APP_VERSION.'/include.php'))
{ {
include APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php'; include APP_INDEX_ROOT_PATH.'snappymail/v/'.APP_VERSION.'/include.php';
} }
else else
{ {

View file

@ -16,7 +16,7 @@
"build", "build",
"data", "data",
"vendors", "vendors",
"rainloop", "snappymail",
"plugins", "plugins",
"node_modules", "node_modules",
"bower_components", "bower_components",

View file

@ -1,38 +1,38 @@
#!/bin/bash #!/bin/bash
#Build RainLoop Webmail Debian Package #Build SnappyMail Webmail Debian Package
PACKAGEVERSION="0"; PACKAGEVERSION="0";
#Build rainloop #Build snappymail
gulp build; gulp build;
cd build/dist/releases/webmail; cd build/dist/releases/webmail;
cd $(ls -t); #Most recent build folder cd $(ls -t); #Most recent build folder
#Working directory #Working directory
mkdir rainloop-deb-build; mkdir snappymail-deb-build;
cd rainloop-deb-build; cd snappymail-deb-build;
#Prepare zip file #Prepare zip file
unzip ../rainloop-community-latest.zip; unzip ../snappymail-community-latest.zip;
find . -type d -exec chmod 755 {} \; find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \; find . -type f -exec chmod 644 {} \;
#Set up package directory #Set up package directory
VERSION=$(cat data/VERSION); VERSION=$(cat data/VERSION);
DIR="rainloop_$VERSION-$PACKAGEVERSION"; DIR="snappymail_$VERSION-$PACKAGEVERSION";
mkdir -m 0755 -p $DIR; mkdir -m 0755 -p $DIR;
mkdir -m 0755 -p $DIR/usr; mkdir -m 0755 -p $DIR/usr;
mkdir -m 0755 -p $DIR/usr/share; mkdir -m 0755 -p $DIR/usr/share;
mkdir -m 0755 -p $DIR/usr/share/rainloop; mkdir -m 0755 -p $DIR/usr/share/snappymail;
mkdir -m 0755 -p $DIR/var; mkdir -m 0755 -p $DIR/var;
mkdir -m 0755 -p $DIR/var/lib; mkdir -m 0755 -p $DIR/var/lib;
#Move files into package directory #Move files into package directory
mv rainloop $DIR/usr/share/rainloop/rainloop; mv snappymail $DIR/usr/share/snappymail/snappymail;
mv index.php $DIR/usr/share/rainloop/index.php; mv index.php $DIR/usr/share/snappymail/index.php;
mv data $DIR/var/lib/rainloop; mv data $DIR/var/lib/snappymail;
#Update settings for Debian package #Update settings for Debian package
sed -i "s/\$sCustomDataPath = '';/\$sCustomDataPath = '\/var\/lib\/rainloop';/" $DIR/usr/share/rainloop/rainloop/v/$VERSION/include.php sed -i "s/\$sCustomDataPath = '';/\$sCustomDataPath = '\/var\/lib\/snappymail';/" $DIR/usr/share/snappymail/snappymail/v/$VERSION/include.php
#Set up Debian packaging tools #Set up Debian packaging tools
cd $DIR; cd $DIR;
@ -40,22 +40,22 @@ mkdir -m 0755 DEBIAN;
#Create Debian packging control file #Create Debian packging control file
cat >> DEBIAN/control <<-EOF cat >> DEBIAN/control <<-EOF
Package: rainloop Package: snappymail
Version: $VERSION Version: $VERSION
Section: web Section: web
Priority: optional Priority: optional
Architecture: all Architecture: all
Depends: php5-fpm (>= 5.4), php5-curl, php5-json Depends: php7-fpm (>= 7.3), php7-curl, php7-json
Maintainer: Rainloop <support@rainloop.net> Maintainer: SnappyMail <support@snappymail.net>
Installed-Size: 20330 Installed-Size: 20330
Description: Rainloop Webmail Description: SnappyMail Webmail
A modern PHP webmail client. A modern PHP webmail client.
EOF EOF
#Create Debian packaging post-install script #Create Debian packaging post-install script
cat >> DEBIAN/postinst <<-EOF cat >> DEBIAN/postinst <<-EOF
#!/bin/sh #!/bin/sh
chown -R www-data:www-data /var/lib/rainloop chown -R www-data:www-data /var/lib/snappymail
EOF EOF
chmod +x DEBIAN/postinst; chmod +x DEBIAN/postinst;
@ -66,4 +66,4 @@ fakeroot dpkg-deb -b $DIR;
#Clean up #Clean up
mv $DIR.deb ..; mv $DIR.deb ..;
cd ..; cd ..;
rm -rf rainloop-deb-build; rm -rf snappymail-deb-build;

View file

@ -6,7 +6,7 @@
* This plugin sets the IMAP and SMTP host to "example.com" upon login, and then connects to it. * This plugin sets the IMAP and SMTP host to "example.com" upon login, and then connects to it.
* *
* Based on: * Based on:
* https://github.com/RainLoop/rainloop-webmail/blob/master/plugins/override-smtp-credentials/index.php * https://github.com/the-djmaze/snappymail/blob/master/plugins/override-smtp-credentials/index.php
* *
*/ */

View file

@ -18,10 +18,10 @@ class CustomAuthExamplePlugin extends \RainLoop\Plugins\AbstractPlugin
{ {
// Your custom php logic // Your custom php logic
// You may change login credentials // You may change login credentials
if ('demo@rainloop.net' === $sEmail) if ('demo@snappymail.eu' === $sEmail)
{ {
$sEmail = 'user@rainloop.net'; $sEmail = 'user@snappymail.eu';
$sLogin = 'user@rainloop.net'; $sLogin = 'user@snappymail.eu';
$sPassword = 'super-puper-password'; $sPassword = 'super-puper-password';
} }
else else

View file

@ -9,8 +9,8 @@ if (!$gulp) {
$package = json_decode(file_get_contents('package.json')); $package = json_decode(file_get_contents('package.json'));
$zip_destination = "rainloop-{$package->version}.zip"; $zip_destination = "snappymail-{$package->version}.zip";
$tar_destination = "rainloop-{$package->version}.tar"; $tar_destination = "snappymail-{$package->version}.tar";
@unlink($zip_destination); @unlink($zip_destination);
@unlink($tar_destination); @unlink($tar_destination);
@ -21,31 +21,32 @@ if ($return_var) {
exit("gulp failed with error code {$return_var}\n"); exit("gulp failed with error code {$return_var}\n");
} }
$cmddir = escapeshellcmd(__DIR__) . '/rainloop/v/0.0.0/static'; $cmddir = escapeshellcmd(__DIR__) . '/snappymail/v/0.0.0/static';
if ($gzip = trim(`which gzip`)) { if ($gzip = trim(`which gzip`)) {
passthru("{$gzip} -k --best {$cmddir}/js/*.js"); passthru("{$gzip} -k --best {$cmddir}/js/*.js");
passthru("{$gzip} -k --best {$cmddir}/js/min/*.js"); passthru("{$gzip} -k --best {$cmddir}/js/min/*.js");
passthru("{$gzip} -k --best {$cmddir}/css/app*.css"); passthru("{$gzip} -k --best {$cmddir}/css/app*.css");
unlink(__DIR__ . '/rainloop/v/0.0.0/static/js/boot.js.gz'); unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/boot.js.gz');
unlink(__DIR__ . '/rainloop/v/0.0.0/static/js/min/boot.min.js.gz'); unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/min/boot.min.js.gz');
} }
if ($brotli = trim(`which brotli`)) { if ($brotli = trim(`which brotli`)) {
passthru("{$brotli} -k --best {$cmddir}/js/*.js"); passthru("{$brotli} -k --best {$cmddir}/js/*.js");
passthru("{$brotli} -k --best {$cmddir}/js/min/*.js"); passthru("{$brotli} -k --best {$cmddir}/js/min/*.js");
passthru("{$brotli} -k --best {$cmddir}/css/app*.css"); passthru("{$brotli} -k --best {$cmddir}/css/app*.css");
unlink(__DIR__ . '/rainloop/v/0.0.0/static/js/boot.js.br'); unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/boot.js.br');
unlink(__DIR__ . '/rainloop/v/0.0.0/static/js/min/boot.min.js.br'); unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/min/boot.min.js.br');
} }
// Temporary rename folder to speed up PharData // Temporary rename folder to speed up PharData
if (!rename('rainloop/v/0.0.0', "rainloop/v/{$package->version}")){ //if (!rename('snappymail/v/0.0.0', "snappymail/v/{$package->version}")){
exit('Failed to temporary rename rainloop/v/0.0.0'); if (!rename('snappymail/v/0.0.0', "snappymail/v/{$package->version}")) {
exit('Failed to temporary rename snappymail/v/0.0.0');
} }
register_shutdown_function(function(){ register_shutdown_function(function(){
// Rename folder back to original // Rename folder back to original
@rename("rainloop/v/{$GLOBALS['package']->version}", 'rainloop/v/0.0.0'); @rename("snappymail/v/{$GLOBALS['package']->version}", 'snappymail/v/0.0.0');
}); });
$zip = new ZipArchive(); $zip = new ZipArchive();
@ -55,7 +56,7 @@ if (!$zip->open($zip_destination, ZIPARCHIVE::CREATE)) {
$tar = new PharData($tar_destination); $tar = new PharData($tar_destination);
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('rainloop/v'), RecursiveIteratorIterator::SELF_FIRST); $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('snappymail/v'), RecursiveIteratorIterator::SELF_FIRST);
foreach ($files as $file) { foreach ($files as $file) {
$file = str_replace('\\', '/', $file); $file = str_replace('\\', '/', $file);
echo "{$file}\n"; echo "{$file}\n";
@ -69,7 +70,7 @@ foreach ($files as $file) {
} }
} }
$tar->buildFromDirectory('./', "@rainloop/v/{$package->version}@"); $tar->buildFromDirectory('./', "@snappymail/v/{$package->version}@");
$zip->addFromString('data/.htaccess', $package->version); $zip->addFromString('data/.htaccess', $package->version);
$tar->addFromString('data/.htaccess', $package->version); $tar->addFromString('data/.htaccess', $package->version);

Some files were not shown because too many files have changed in this diff Show more