Skip to content

Commit

Permalink
Add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
RainLoop committed Jan 16, 2021
1 parent 1979f84 commit 20e0c14
Show file tree
Hide file tree
Showing 17 changed files with 2,079 additions and 2,081 deletions.
4 changes: 2 additions & 2 deletions .cmds
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ webpack --color --watch

#
gpg --import x
gpg --detach-sign --armor --openpgp -u 87DA4591 x
for ff in `ls *.zip`; do gpg --detach-sign --armor --openpgp -u 87DA4591 $ff; done
gpg --detach-sign --armor --openpgp -u 87DA4591 --passphrase ?? x
for ff in `ls ./build/dist/releases/**/**/*.zip | xargs`; do gpg --detach-sign --no-tty --yes --armor --openpgp -u 87DA4591 --passphrase ?? $ff; done
10 changes: 6 additions & 4 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 install -y \
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 \
libxft-dev libfreetype6 libfreetype6-dev \
libpng-dev libjpeg62-turbo-dev \
libfontconfig1 libfontconfig1-dev libzip-dev

RUN pecl install mcrypt-1.0.2 && \
RUN pecl install mcrypt && \
docker-php-ext-enable mcrypt

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

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./build/dist/releases/*"]'
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"title": "RainLoop Webmail",
"description": "Simple, modern & fast web-based email client",
"private": true,
"version": "1.14.0",
"ownCloudVersion": "5.3.0",
"version": "1.15.0",
"ownCloudVersion": "5.4.0",
"homepage": "https://www.rainloop.net",
"author": {
"name": "RainLoop Team",
Expand All @@ -17,7 +17,9 @@
},
"scripts": {
"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",
"licenses": [
Expand Down Expand Up @@ -86,6 +88,7 @@
"gulp-size": "3.0.0",
"gulp-sourcemaps": "2.6.5",
"gulp-stripbom": "1.0.5",
"gulp-terser": "^1.2.0",
"gulp-through": "0.4.0",
"gulp-util": "3.0.8",
"gulp-zip": "5.0.1",
Expand Down Expand Up @@ -115,11 +118,8 @@
"rimraf": "3.0.2",
"simplestatemanager": "4.1.1",
"style-loader": "1.1.3",
"underscore": "1.9.2"
},
"dependencies": {
"gulp-terser": "^1.2.0",
"webpack": "4.42.0",
"webpack-cli": "3.3.11"
"webpack-cli": "3.3.11",
"underscore": "1.9.2"
}
}
2 changes: 1 addition & 1 deletion rainloop/v/0.0.0/app/handle.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function rainLoopSplAutoloadRegisterFunction($sClassName)
return false;
}

\spl_autoload_register('rainLoopSplAutoloadRegisterFunction', false);
\spl_autoload_register('rainLoopSplAutoloadRegisterFunction');
}

if (\class_exists('RainLoop\Api'))
Expand Down
15 changes: 0 additions & 15 deletions rainloop/v/0.0.0/app/libraries/MailSo/Base/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2249,21 +2249,6 @@ public static function FunctionExistsAndEnabled($mFunctionNameOrNames)

$aCache = \explode(',', $sDisableFunctions);
$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);
Expand Down
2 changes: 1 addition & 1 deletion rainloop/v/0.0.0/app/libraries/MailSo/MailSo.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function MailSoSplAutoloadRegisterFunction($sClassName)
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'))
{
Expand Down
21 changes: 13 additions & 8 deletions rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,20 @@ public function AddText($sHtmlOrPlainText, $bIsHtml = false)

/**
* @param string $sContentType
* @param string|resource $mData
* @param string $sData
* @param string $sContentTransferEncoding = ''
* @param array $aCustomContentTypeParams = array()
*
* @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;
}
Expand Down Expand Up @@ -712,7 +717,7 @@ private function createNewMessageAlternativePartBody($aAlternativeData)
private function createNewMessageSimpleOrAlternativeBody()
{
$oResultPart = null;
if (1 < count($this->aAlternativeParts))
if (1 < \count($this->aAlternativeParts))
{
$oResultPart = Part::NewInstance();

Expand All @@ -739,7 +744,7 @@ private function createNewMessageSimpleOrAlternativeBody()
}

}
else if (1 === count($this->aAlternativeParts))
else if (1 === \count($this->aAlternativeParts))
{
$oAlternativePart = $this->createNewMessageAlternativePartBody($this->aAlternativeParts[0]);
if ($oAlternativePart)
Expand All @@ -759,7 +764,7 @@ private function createNewMessageSimpleOrAlternativeBody()
else
{
$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();

Expand All @@ -784,7 +789,7 @@ private function createNewMessageRelatedBody($oIncPart)
$oResultPart = null;

$aAttachments = $this->oAttachmentCollection->LinkedAttachments();
if (0 < count($aAttachments))
if (0 < \count($aAttachments))
{
$oResultPart = Part::NewInstance();

Expand Down Expand Up @@ -824,7 +829,7 @@ private function createNewMessageMixedBody($oIncPart)
$oResultPart = null;

$aAttachments = $this->oAttachmentCollection->UnlinkedAttachments();
if (0 < count($aAttachments))
if (0 < \count($aAttachments))
{
$oResultPart = Part::NewInstance();

Expand Down
9 changes: 4 additions & 5 deletions rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,7 @@ public function Logger()
$sPdo = empty($sPdo) ? '~' : $sPdo;

$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').
'][PDO:'.$sPdo.
(\RainLoop\Utils::IsOwnCloud() ? '][cloud:true' : '').
Expand Down Expand Up @@ -1845,7 +1844,7 @@ public function AppData($bAdmin, $bMobile = false, $bMobileDevice = false, $sAut
$aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', 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['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);

// user
Expand Down Expand Up @@ -1997,7 +1996,7 @@ public function AppData($bAdmin, $bMobile = false, $bMobileDevice = false, $sAut
// Mobile override
if ($bMobile)
{
$aResult['Layout'] = \RainLoop\Enumerations\Layout::NO_PREVIW;
$aResult['Layout'] = \RainLoop\Enumerations\Layout::NO_PREVIEW;

$aResult['SoundNotification'] = false;
$aResult['DesktopNotifications'] = false;
Expand Down Expand Up @@ -5086,7 +5085,7 @@ public function DoSettingsUpdate()
});

$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)) ?
$iValue : \RainLoop\Enumerations\Layout::SIDE_PREVIEW);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ public function Set($sSectionKey, $sParamKey, $mParamValue)
switch ($sType)
{
default:
case 'float':
case 'string':
$this->aData[$sSectionKey][$sParamKey][0] = (string) $mParamValue;
break;
case 'float':
case 'double':
$this->aData[$sSectionKey][$sParamKey][0] = (float) $mParamValue;
break;
case 'int':
case 'integer':
$this->aData[$sSectionKey][$sParamKey][0] = (int) $mParamValue;
Expand Down Expand Up @@ -321,6 +324,7 @@ public function Save()
break;
case 'int':
case 'integer':
case 'double':
$sValue = $mParamValue[0];
break;
case 'bool':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ protected function defaultValues()

'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
once they closed the browser window.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Layout
{
const NO_PREVIW = 0;
const NO_PREVIEW = 0;
const SIDE_PREVIEW = 1;
const BOTTOM_PREVIEW = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class SignMeType
{
const DEFAILT_OFF = 'DefaultOff';
const DEFAILT_ON = 'DefaultOn';
const DEFAULT_OFF = 'DefaultOff';
const DEFAULT_ON = 'DefaultOn';
const UNUSED = 'Unused';
}
2 changes: 1 addition & 1 deletion rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public function ServiceRaw()
if (\method_exists($this->oActions, $sMethodName))
{
@\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 = '';
$this->oActions->SetActionParams(array(
Expand Down
4 changes: 2 additions & 2 deletions rainloop/v/0.0.0/app/templates/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
{{BaseAppHeadScriptLink}}
{{BaseAppFaviconPngLinkTag}}
{{BaseAppFaviconTouchLinkTag}}
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" />
<link type="text/css" rel="stylesheet" href="{{BaseAppThemeCssLink}}" id="app-theme-link" />
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" rel="preload" />
<link type="text/css" rel="stylesheet" href="{{BaseAppThemeCssLink}}" id="app-theme-link" rel="preload" />
<link rel="manifest" href="{{BaseAppManifestLink}}" />
</head>

Expand Down
4 changes: 3 additions & 1 deletion tasks/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ const jsMin = () =>
.pipe(rename({ suffix: '.min' }))
.pipe(
terser({
output: {comments: false}
output: {
comments: false
}
})
)
.pipe(eol('\n', true))
Expand Down
Loading

0 comments on commit 20e0c14

Please sign in to comment.