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
/.vscode
/*.bak
/api.php
/error.log
/nbproject
/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/.*
/*.log
/snappymail/v/0.0.0/static/*
/node_modules
/build/local
/build/dist
@ -22,6 +13,5 @@
!/.docker/nginx/ssl/.gitempty
/dist
/data
.DS_Store
/MULTIPLY
/include.php

View file

@ -3,13 +3,13 @@ host = https://www.transifex.com
minimum_perc = 60
type = YAML
[rainloop-webmail.rainloop-webmail]
file_filter = rainloop/v/0.0.0/app/localization/webmail/<lang>.yml
source_file = rainloop/v/0.0.0/app/localization/webmail/_source.en.yml
[snappymail-webmail.snappymail-webmail]
file_filter = snappymail/v/0.0.0/app/localization/webmail/<lang>.yml
source_file = snappymail/v/0.0.0/app/localization/webmail/_source.en.yml
source_lang = en
[rainloop-webmail.rainloop-admin]
file_filter = rainloop/v/0.0.0/app/localization/admin/<lang>.yml
source_file = rainloop/v/0.0.0/app/localization/admin/_source.en.yml
[snappymail-webmail.snappymail-admin]
file_filter = snappymail/v/0.0.0/app/localization/admin/<lang>.yml
source_file = snappymail/v/0.0.0/app/localization/admin/_source.en.yml
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.
2. Issue a pull request.
@ -10,9 +10,9 @@
1. Install node.js - `https://nodejs.org/download/`
2. Install yarn - `https://yarnpkg.com/en/docs/install`
3. Install gulp - `npm install gulp -g`
4. Fork rainloop - `https://github.com/RainLoop/rainloop-webmail/issues/new#fork-destination-box`
5. Clone rainloop - `git clone git@github.com:USERNAME/rainloop-webmail.git rainloop`
6. `cd rainloop`
4. Fork snappymail - `https://github.com/the-djmaze/snappymail/issues/new#fork-destination-box`
5. Clone snappymail - `git clone git@github.com:USERNAME/snappymail.git snappymail`
6. `cd snappymail`
7. Install install all dependencies - `yarn install`
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()
{
return '';
return dirname(__DIR__) . '/rainloop-data';
return '/var/external-rainloop-data-folder'; // custom data folder path
return dirname(__DIR__) . '/snappymail-data';
return '/var/external-snappymail-data-folder'; // custom data folder path
}
/**

View file

@ -7,7 +7,7 @@ const
SERVER_PREFIX = './?',
SUB_QUERY_PREFIX = '&q[]=',
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';

2
dev/prototype.js vendored
View file

@ -43,7 +43,7 @@
Z: {timeZone: 'UTC'}
},
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;

View file

@ -31,9 +31,9 @@ services:
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: rainloop
MYSQL_PASSWORD: rainloop
MYSQL_DATABASE: rainloop
MYSQL_USER: snappymail
MYSQL_PASSWORD: snappymail
MYSQL_DATABASE: snappymail
volumes:
- mysql:/var/lib/mysql
- tmp:/tmp
@ -50,7 +50,7 @@ services:
volumes:
- ./:/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
node:
build:

View file

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

View file

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

View file

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

View file

@ -9,8 +9,8 @@ if (!$gulp) {
$package = json_decode(file_get_contents('package.json'));
$zip_destination = "rainloop-{$package->version}.zip";
$tar_destination = "rainloop-{$package->version}.tar";
$zip_destination = "snappymail-{$package->version}.zip";
$tar_destination = "snappymail-{$package->version}.tar";
@unlink($zip_destination);
@unlink($tar_destination);
@ -21,31 +21,32 @@ if ($return_var) {
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`)) {
passthru("{$gzip} -k --best {$cmddir}/js/*.js");
passthru("{$gzip} -k --best {$cmddir}/js/min/*.js");
passthru("{$gzip} -k --best {$cmddir}/css/app*.css");
unlink(__DIR__ . '/rainloop/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/boot.js.gz');
unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/min/boot.min.js.gz');
}
if ($brotli = trim(`which brotli`)) {
passthru("{$brotli} -k --best {$cmddir}/js/*.js");
passthru("{$brotli} -k --best {$cmddir}/js/min/*.js");
passthru("{$brotli} -k --best {$cmddir}/css/app*.css");
unlink(__DIR__ . '/rainloop/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/boot.js.br');
unlink(__DIR__ . '/snappymail/v/0.0.0/static/js/min/boot.min.js.br');
}
// Temporary rename folder to speed up PharData
if (!rename('rainloop/v/0.0.0', "rainloop/v/{$package->version}")){
exit('Failed to temporary rename rainloop/v/0.0.0');
//if (!rename('snappymail/v/0.0.0', "snappymail/v/{$package->version}")){
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(){
// 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();
@ -55,7 +56,7 @@ if (!$zip->open($zip_destination, ZIPARCHIVE::CREATE)) {
$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) {
$file = str_replace('\\', '/', $file);
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);
$tar->addFromString('data/.htaccess', $package->version);

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