Add github action

This commit is contained in:
RainLoop Team 2021-01-16 17:51:14 +03:00
parent 1979f84dab
commit 20e0c1417d
17 changed files with 2038 additions and 2040 deletions

4
.cmds
View file

@ -15,5 +15,5 @@ webpack --color --watch
# #
gpg --import x gpg --import x
gpg --detach-sign --armor --openpgp -u 87DA4591 x gpg --detach-sign --armor --openpgp -u 87DA4591 --passphrase ?? x
for ff in `ls *.zip`; do gpg --detach-sign --armor --openpgp -u 87DA4591 $ff; done for ff in `ls ./build/dist/releases/**/**/*.zip | xargs`; do gpg --detach-sign --no-tty --yes --armor --openpgp -u 87DA4591 --passphrase ?? $ff; done

View file

@ -1,20 +1,22 @@
FROM php:7.3-fpm # FROM php:7.3-fpm
# FROM php:7.4-fpm
FROM php:8.0-fpm
RUN apt-get update RUN apt-get update
RUN apt-get install -y \ RUN apt-get install -y \
git unzip wget zip curl mlocate \ git unzip wget zip curl mlocate \
libmcrypt-dev libicu-dev libpcre3-dev libicu-dev \ libmcrypt-dev libicu-dev libpcre3-dev \
build-essential chrpath libssl-dev \ build-essential chrpath libssl-dev \
libxft-dev libfreetype6 libfreetype6-dev \ libxft-dev libfreetype6 libfreetype6-dev \
libpng-dev libjpeg62-turbo-dev \ libpng-dev libjpeg62-turbo-dev \
libfontconfig1 libfontconfig1-dev libzip-dev libfontconfig1 libfontconfig1-dev libzip-dev
RUN pecl install mcrypt-1.0.2 && \ RUN pecl install mcrypt && \
docker-php-ext-enable mcrypt docker-php-ext-enable mcrypt
RUN docker-php-ext-configure intl && \ RUN docker-php-ext-configure intl && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
docker-php-ext-install opcache pdo_mysql zip intl gd docker-php-ext-install opcache pdo_mysql zip intl gd
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

57
.github/workflows/builder.yml vendored Normal file
View file

@ -0,0 +1,57 @@
name: Builder
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Create Cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: os-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --check-files
- run: yarn build
- run: yarn build-pro
- name: Configure GPG Key
run: |
mkdir -p ~/.gnupg/
printf "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key
gpg --import ~/.gnupg/private.key
for ff in `ls ./build/dist/releases/**/**/*.zip | xargs`; do gpg --detach-sign --no-tty --yes --armor --openpgp -u 87DA4591 --passphrase $GPG_PASSPHRASE $ff; done
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./build/dist/releases/*"]'

View file

@ -3,8 +3,8 @@
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"private": true, "private": true,
"version": "1.14.0", "version": "1.15.0",
"ownCloudVersion": "5.3.0", "ownCloudVersion": "5.4.0",
"homepage": "https://www.rainloop.net", "homepage": "https://www.rainloop.net",
"author": { "author": {
"name": "RainLoop Team", "name": "RainLoop Team",
@ -17,7 +17,9 @@
}, },
"scripts": { "scripts": {
"watch-css": "gulp watchCss", "watch-css": "gulp watchCss",
"watch-js": "webpack --color --watch" "watch-js": "webpack --color --watch",
"build": "gulp all",
"build-pro": "gulp all --pro"
}, },
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"licenses": [ "licenses": [
@ -86,6 +88,7 @@
"gulp-size": "3.0.0", "gulp-size": "3.0.0",
"gulp-sourcemaps": "2.6.5", "gulp-sourcemaps": "2.6.5",
"gulp-stripbom": "1.0.5", "gulp-stripbom": "1.0.5",
"gulp-terser": "^1.2.0",
"gulp-through": "0.4.0", "gulp-through": "0.4.0",
"gulp-util": "3.0.8", "gulp-util": "3.0.8",
"gulp-zip": "5.0.1", "gulp-zip": "5.0.1",
@ -115,11 +118,8 @@
"rimraf": "3.0.2", "rimraf": "3.0.2",
"simplestatemanager": "4.1.1", "simplestatemanager": "4.1.1",
"style-loader": "1.1.3", "style-loader": "1.1.3",
"underscore": "1.9.2"
},
"dependencies": {
"gulp-terser": "^1.2.0",
"webpack": "4.42.0", "webpack": "4.42.0",
"webpack-cli": "3.3.11" "webpack-cli": "3.3.11",
"underscore": "1.9.2"
} }
} }

View file

@ -60,7 +60,7 @@ if (!\defined('RAINLOOP_APP_LIBRARIES_PATH'))
return false; return false;
} }
\spl_autoload_register('rainLoopSplAutoloadRegisterFunction', false); \spl_autoload_register('rainLoopSplAutoloadRegisterFunction');
} }
if (\class_exists('RainLoop\Api')) if (\class_exists('RainLoop\Api'))

View file

@ -2249,21 +2249,6 @@ END;
$aCache = \explode(',', $sDisableFunctions); $aCache = \explode(',', $sDisableFunctions);
$aCache = \is_array($aCache) && 0 < \count($aCache) ? $aCache : array(); $aCache = \is_array($aCache) && 0 < \count($aCache) ? $aCache : array();
if (\extension_loaded('suhosin'))
{
$sSuhosin = @\ini_get('suhosin.executor.func.blacklist');
$sSuhosin = \is_string($sSuhosin) && 0 < \strlen($sSuhosin) ? $sSuhosin : '';
$aSuhosinCache = \explode(',', $sSuhosin);
$aSuhosinCache = \is_array($aSuhosinCache) && 0 < \count($aSuhosinCache) ? $aSuhosinCache : array();
if (0 < \count($aSuhosinCache))
{
$aCache = \array_merge($aCache, $aSuhosinCache);
$aCache = \array_unique($aCache);
}
}
} }
return !\in_array($mFunctionNameOrNames, $aCache); return !\in_array($mFunctionNameOrNames, $aCache);

View file

@ -27,7 +27,7 @@ if (!\defined('MAILSO_LIBRARY_ROOT_PATH'))
include MAILSO_LIBRARY_ROOT_PATH.\str_replace('\\', '/', \substr($sClassName, 7)).'.php' : false; include MAILSO_LIBRARY_ROOT_PATH.\str_replace('\\', '/', \substr($sClassName, 7)).'.php' : false;
} }
\spl_autoload_register('MailSo\MailSoSplAutoloadRegisterFunction', false); \spl_autoload_register('MailSo\MailSoSplAutoloadRegisterFunction');
if (\class_exists('MailSo\Base\Loader')) if (\class_exists('MailSo\Base\Loader'))
{ {

View file

@ -493,15 +493,20 @@ class Message
/** /**
* @param string $sContentType * @param string $sContentType
* @param string|resource $mData * @param string $sData
* @param string $sContentTransferEncoding = '' * @param string $sContentTransferEncoding = ''
* @param array $aCustomContentTypeParams = array() * @param array $aCustomContentTypeParams = array()
* *
* @return \MailSo\Mime\Message * @return \MailSo\Mime\Message
*/ */
public function AddAlternative($sContentType, $mData, $sContentTransferEncoding = '', $aCustomContentTypeParams = array()) public function AddAlternative($sContentType, $sData, $sContentTransferEncoding = '')
{ {
$this->aAlternativeParts[] = array($sContentType, $mData, $sContentTransferEncoding, $aCustomContentTypeParams); $this->aAlternativeParts[] = array(
$sContentType,
\preg_replace('/\\r?\\n/', Enumerations\Constants::CRLF, \trim($sData)),
$sContentTransferEncoding,
array()
);
return $this; return $this;
} }
@ -712,7 +717,7 @@ class Message
private function createNewMessageSimpleOrAlternativeBody() private function createNewMessageSimpleOrAlternativeBody()
{ {
$oResultPart = null; $oResultPart = null;
if (1 < count($this->aAlternativeParts)) if (1 < \count($this->aAlternativeParts))
{ {
$oResultPart = Part::NewInstance(); $oResultPart = Part::NewInstance();
@ -739,7 +744,7 @@ class Message
} }
} }
else if (1 === count($this->aAlternativeParts)) else if (1 === \count($this->aAlternativeParts))
{ {
$oAlternativePart = $this->createNewMessageAlternativePartBody($this->aAlternativeParts[0]); $oAlternativePart = $this->createNewMessageAlternativePartBody($this->aAlternativeParts[0]);
if ($oAlternativePart) if ($oAlternativePart)
@ -759,7 +764,7 @@ class Message
else else
{ {
$aAttachments = $this->oAttachmentCollection->CloneAsArray(); $aAttachments = $this->oAttachmentCollection->CloneAsArray();
if (\is_array($aAttachments) && 1 === count($aAttachments) && isset($aAttachments[0])) if (\is_array($aAttachments) && 1 === \count($aAttachments) && isset($aAttachments[0]))
{ {
$this->oAttachmentCollection->Clear(); $this->oAttachmentCollection->Clear();
@ -784,7 +789,7 @@ class Message
$oResultPart = null; $oResultPart = null;
$aAttachments = $this->oAttachmentCollection->LinkedAttachments(); $aAttachments = $this->oAttachmentCollection->LinkedAttachments();
if (0 < count($aAttachments)) if (0 < \count($aAttachments))
{ {
$oResultPart = Part::NewInstance(); $oResultPart = Part::NewInstance();
@ -824,7 +829,7 @@ class Message
$oResultPart = null; $oResultPart = null;
$aAttachments = $this->oAttachmentCollection->UnlinkedAttachments(); $aAttachments = $this->oAttachmentCollection->UnlinkedAttachments();
if (0 < count($aAttachments)) if (0 < \count($aAttachments))
{ {
$oResultPart = Part::NewInstance(); $oResultPart = Part::NewInstance();

View file

@ -1154,8 +1154,7 @@ class Actions
$sPdo = empty($sPdo) ? '~' : $sPdo; $sPdo = empty($sPdo) ? '~' : $sPdo;
$this->oLogger->Write('['. $this->oLogger->Write('['.
'Suhosin:'.(\extension_loaded('suhosin') || @\ini_get('suhosin.get.max_value_length') ? 'on' : 'off'). 'APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off').
'][APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off').
'][MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off'). '][MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off').
'][PDO:'.$sPdo. '][PDO:'.$sPdo.
(\RainLoop\Utils::IsOwnCloud() ? '][cloud:true' : ''). (\RainLoop\Utils::IsOwnCloud() ? '][cloud:true' : '').
@ -1845,7 +1844,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins
$aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true); $aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true);
$aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true); $aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true);
$aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024; $aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024;
$aResult['SignMe'] = (string) $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAILT_OFF); $aResult['SignMe'] = (string) $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAULT_OFF);
$aResult['UseLocalProxyForExternalImages'] = (bool) $oConfig->Get('labs', 'use_local_proxy_for_external_images', false); $aResult['UseLocalProxyForExternalImages'] = (bool) $oConfig->Get('labs', 'use_local_proxy_for_external_images', false);
// user // user
@ -1997,7 +1996,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins
// Mobile override // Mobile override
if ($bMobile) if ($bMobile)
{ {
$aResult['Layout'] = \RainLoop\Enumerations\Layout::NO_PREVIW; $aResult['Layout'] = \RainLoop\Enumerations\Layout::NO_PREVIEW;
$aResult['SoundNotification'] = false; $aResult['SoundNotification'] = false;
$aResult['DesktopNotifications'] = false; $aResult['DesktopNotifications'] = false;
@ -5086,7 +5085,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins
}); });
$this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) { $this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) {
return (int) (\in_array((int) $iValue, array(\RainLoop\Enumerations\Layout::NO_PREVIW, return (int) (\in_array((int) $iValue, array(\RainLoop\Enumerations\Layout::NO_PREVIEW,
\RainLoop\Enumerations\Layout::SIDE_PREVIEW, \RainLoop\Enumerations\Layout::BOTTOM_PREVIEW)) ? \RainLoop\Enumerations\Layout::SIDE_PREVIEW, \RainLoop\Enumerations\Layout::BOTTOM_PREVIEW)) ?
$iValue : \RainLoop\Enumerations\Layout::SIDE_PREVIEW); $iValue : \RainLoop\Enumerations\Layout::SIDE_PREVIEW);
}); });

View file

@ -97,10 +97,13 @@ abstract class AbstractConfig
switch ($sType) switch ($sType)
{ {
default: default:
case 'float':
case 'string': case 'string':
$this->aData[$sSectionKey][$sParamKey][0] = (string) $mParamValue; $this->aData[$sSectionKey][$sParamKey][0] = (string) $mParamValue;
break; break;
case 'float':
case 'double':
$this->aData[$sSectionKey][$sParamKey][0] = (float) $mParamValue;
break;
case 'int': case 'int':
case 'integer': case 'integer':
$this->aData[$sSectionKey][$sParamKey][0] = (int) $mParamValue; $this->aData[$sSectionKey][$sParamKey][0] = (int) $mParamValue;
@ -321,6 +324,7 @@ abstract class AbstractConfig
break; break;
case 'int': case 'int':
case 'integer': case 'integer':
case 'double':
$sValue = $mParamValue[0]; $sValue = $mParamValue[0];
break; break;
case 'bool': case 'bool':

View file

@ -276,7 +276,7 @@ class Application extends \RainLoop\Config\AbstractConfig
'login_lowercase' => array(true, ''), 'login_lowercase' => array(true, ''),
'sign_me_auto' => array(\RainLoop\Enumerations\SignMeType::DEFAILT_OFF, 'sign_me_auto' => array(\RainLoop\Enumerations\SignMeType::DEFAULT_OFF,
'This option allows webmail to remember the logged in user 'This option allows webmail to remember the logged in user
once they closed the browser window. once they closed the browser window.

View file

@ -4,7 +4,7 @@ namespace RainLoop\Enumerations;
class Layout class Layout
{ {
const NO_PREVIW = 0; const NO_PREVIEW = 0;
const SIDE_PREVIEW = 1; const SIDE_PREVIEW = 1;
const BOTTOM_PREVIEW = 2; const BOTTOM_PREVIEW = 2;
} }

View file

@ -4,7 +4,7 @@ namespace RainLoop\Enumerations;
class SignMeType class SignMeType
{ {
const DEFAILT_OFF = 'DefaultOff'; const DEFAULT_OFF = 'DefaultOff';
const DEFAILT_ON = 'DefaultOn'; const DEFAULT_ON = 'DefaultOn';
const UNUSED = 'Unused'; const UNUSED = 'Unused';
} }

View file

@ -506,7 +506,7 @@ class ServiceActions
if (\method_exists($this->oActions, $sMethodName)) if (\method_exists($this->oActions, $sMethodName))
{ {
@\header('X-Raw-Action: '.$sMethodName, true); @\header('X-Raw-Action: '.$sMethodName, true);
@\header('Content-Security-Policy: script-src \'none\'; frame-src \'none\'; child-src \'none\'', true); @\header('Content-Security-Policy: script-src \'none\'; child-src \'none\'', true);
$sRawError = ''; $sRawError = '';
$this->oActions->SetActionParams(array( $this->oActions->SetActionParams(array(

View file

@ -21,8 +21,8 @@
{{BaseAppHeadScriptLink}} {{BaseAppHeadScriptLink}}
{{BaseAppFaviconPngLinkTag}} {{BaseAppFaviconPngLinkTag}}
{{BaseAppFaviconTouchLinkTag}} {{BaseAppFaviconTouchLinkTag}}
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" /> <link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" rel="preload" />
<link type="text/css" rel="stylesheet" href="{{BaseAppThemeCssLink}}" id="app-theme-link" /> <link type="text/css" rel="stylesheet" href="{{BaseAppThemeCssLink}}" id="app-theme-link" rel="preload" />
<link rel="manifest" href="{{BaseAppManifestLink}}" /> <link rel="manifest" href="{{BaseAppManifestLink}}" />
</head> </head>

View file

@ -66,7 +66,9 @@ const jsMin = () =>
.pipe(rename({ suffix: '.min' })) .pipe(rename({ suffix: '.min' }))
.pipe( .pipe(
terser({ terser({
output: {comments: false} output: {
comments: false
}
}) })
) )
.pipe(eol('\n', true)) .pipe(eol('\n', true))

3918
yarn.lock

File diff suppressed because it is too large Load diff