Skip to content

Commit

Permalink
added ownCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
my0419 committed Feb 17, 2022
1 parent 5863369 commit ebcae22
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myvpn",
"version": "0.4.0",
"version": "0.4.1",
"author": {
"name": "MyVPN",
"email": "support@myvpn.run"
Expand All @@ -14,7 +14,7 @@
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:windows": "node .electron-vue/build.js && electron-builder --windows --x64",
"build:linux": "node .electron-vue/build.js && electron-builder --linux deb tar.bz2",
"build:linux": "node .electron-vue/build.js && electron-builder --linux deb tar.bz2 AppImage",
"build:mac": "node .electron-vue/build.js && electron-builder --mac dmg",
"publish:windows": "node .electron-vue/build.js && electron-builder --windows --x64 -p always",
"publish:linux": "node .electron-vue/build.js && electron-builder --linux AppImage deb tar.bz2 -p always",
Expand Down
18 changes: 11 additions & 7 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ export default {
'Insert the API key from your Hetzner Cloud account': 'Вставьте API-ключ из личного кабинета Hetzner Cloud',
'Successful connection to the account': 'Вы верно указали данные, ваш аккаут подключен!',
'Choose the server region': 'Выберите регион сервера',
'Choose the connection protocol': 'Выберите протокол подключения',
'Create a server and configure the VPN': 'Создать сервер и настроить VPN',
'Connect to the server and configure the VPN': 'Подключиться к серверу и настроить VPN',
'Choose the software': 'Выберите сервис',
'Create and configure a server': 'Создать и настроить сервер',
'Connect to the server and configure the protocol': 'Подключиться к серверу и настроить протокол',
'Parameters': 'Параметры',
'The account is successfully connected': 'Аккаунт успешно подключен',
'Server configuration': 'Настройка сервера',
'Your VPN': 'Ваш VPN',
'Logout': 'Выход',
'Go to website': 'Перейти на сайт',
'Connect using the API key': 'Подключиться используя API ключ',
Expand Down Expand Up @@ -53,9 +52,9 @@ export default {
'Waiting for software setup to start on the server': 'Ожидание начала установки ПО',
'Creating a new server': 'Создается новый сервер',
'Connection failed. Removing server.': 'Не удалось подключиться к серверу. Удаление сервера.',
'Waiting for software installation': 'Установка и настройка VPN',
'Waiting for software installation': 'Установка и настройка сервера',
'Waiting time 300sec is exceeded': 'Превышено время ожидания 300 сек.',
'VPN service configured': 'Успешная настройка VPN сервера',
'Server successfully configured': 'Сервер успешно настроен',
'Generate RSA public/private key pair': 'Генерируются приватные ключи',
'Waiting for the server to start': 'Ожидание запуска нового сервера',
'Copied!': 'Скопировано!',
Expand All @@ -80,7 +79,7 @@ export default {
'Test': 'Тест',
'ms': 'ms',
'Region Name': 'Регион',
'My VPN': 'Мой VPN',
'Configuration': 'Конфигурация',
'My Server': 'Мой сервер',
'Region Code': 'Код',
'Mean': 'Средняя',
Expand Down Expand Up @@ -139,5 +138,10 @@ export default {
'Step': 'Шаг',
'Next Step': 'Вперед',
'Prev Step': 'Назад',
'Note': 'Примечание',
'If you want to use a domain name you need to follow 2 simple steps.': 'Если вы хотите использовать доменное имя вам необходимо выполнить 2 простых шага.',
'Go to your domain control panel and create a DNS record referencing the IP': 'Перейти в панель управления домена и создать А запись DNS ссылающуюся на IP',
'Go to this domain and configure the cloud by creating an administrator account.': 'Перейти к домену и произвести настройку облака создав учетную запись администратора.',
'Address': 'Адрес'
}
}
12 changes: 11 additions & 1 deletion src/lib/protocols/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import OpenvpnProtocol from "./openvpn";
import WireguardProtocol from "./wireguard";
import ShadowsocksProtocol from "./shadowsocks";
import Socks5Protocol from "./socks5";
import OwncloudProtocol from "./owncloud";

export const TYPE_L2TP = 'l2tp'
export const TYPE_PPTP = 'pptp'
export const TYPE_OPENVPN = 'openvpn'
export const TYPE_WIREGUARD = 'wireguard'
export const TYPE_SHADOWSOCKS = 'shadowsocks'
export const TYPE_SOCKS5 = 'socks5'
// extra
export const TYPE_OWNCLOUD = 'owncloud'

export class ProtocolFactory {
static create (name, params) {
Expand All @@ -27,6 +30,8 @@ export class ProtocolFactory {
return new ShadowsocksProtocol(params)
case TYPE_SOCKS5:
return new Socks5Protocol(params)
case TYPE_OWNCLOUD:
return new OwncloudProtocol(params)
default:
throw new Error(`Unknown protocol ${name}`)
}
Expand All @@ -40,6 +45,7 @@ export const PROTOCOL_CODES = [
{code: 4, type: TYPE_WIREGUARD},
{code: 5, type: TYPE_SHADOWSOCKS},
{code: 6, type: TYPE_SOCKS5},
{code: 7, type: TYPE_OWNCLOUD},
]

export const PROTOCOL_LIST = [
Expand All @@ -66,5 +72,9 @@ export const PROTOCOL_LIST = [
{
key: TYPE_SOCKS5,
title: 'SOCKS5'
}
},
{
key: TYPE_OWNCLOUD,
title: 'ownCloud'
},
]
16 changes: 16 additions & 0 deletions src/lib/protocols/owncloud.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import BaseProtocol from "./base";

class OwncloudProtocol extends BaseProtocol {

/**
* @returns {Object}
*/
/* envVariables () {
return Object.assign(super.envVariables(), {
'DB_ROOT_PASSWORD': this.params.account.accounts[0].password,
})
}*/

}

export default OwncloudProtocol
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function createWindow () {
* Initial window optionshttp://localhost:9080/static/img/background.svg
*/
mainWindow = new BrowserWindow({
height: 560,
height: 600,
useContentSize: true,
// transparent: true,
// vibrancy: 'light',
Expand Down
7 changes: 7 additions & 0 deletions src/renderer/assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ h3 {
}
}
}
.note-block {
line-height: 22px;
font-size: 12px;
ol {
padding-left: 20px;
}
}
14 changes: 7 additions & 7 deletions src/renderer/components/FormTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<style lang="scss" scoped>
@import '~mixins';
.type-radio-list {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
@include mqMAX($XXS) {
display: grid;
grid-template-columns: 1fr 1fr;
Expand All @@ -15,13 +17,11 @@
}
}
.type-radio {
margin: 10px 10px 10px 0 !important;
@include mqMAX($XXS) {
margin: 0 !important;
}
}
.type-radio:last-child {
margin-right: 0 !important;
background: rgba(0,0,0,0.2);
margin: 10px 10px 10px 0 !important;
@include mqMAX($XXS) {
margin: 0 !important;
}
}
</style>

Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<Providers />
<h3 v-if="selectedProvider !== 'custom'">{{ $t('Choose the server region')}}</h3>
<FormRegions v-if="selectedProvider !== 'custom'" />
<h3>{{ $t('Choose the connection protocol') }}</h3>
<h3>{{ $t('Choose the software') }}</h3>
<FormTypes />
<ModalAdvancedSettings />
<div class="m-top main-footer">
<el-button class="btn-group-item btn-group-item--fill" type="primary" :disabled="!configuredSuccess" v-on:click="handleProcessing" icon="el-icon-magic-stick">
<span v-if="selectedProvider !== 'custom'">{{ $t('Create a server and configure the VPN') }}</span>
<span v-else>{{ $t('Connect to the server and configure the VPN') }}</span>
<span v-if="selectedProvider !== 'custom'">{{ $t('Create and configure a server') }}</span>
<span v-else>{{ $t('Connect to the server and configure the protocol') }}</span>
</el-button>
<el-button class="btn-group-item btn-group-item--fill" v-if="isDev" type="primary" v-on:click="handleDevelopmentAccess" icon="el-icon-brush">[Dev] Access Page</el-button>
<el-button class="btn-group-item btn-group-item--fill" v-if="isDev" type="primary" v-on:click="handleDevelopmentStore" icon="el-icon-brush">[Dev] Reset Store</el-button>
<el-button class="btn-group-item btn-group-item--fill" v-if="isDev" type="primary" v-on:click="handleDevelopmentAccess" icon="el-icon-brush">Access Page</el-button>
<el-button class="btn-group-item btn-group-item--fill" v-if="isDev" type="primary" v-on:click="handleDevelopmentStore" icon="el-icon-brush">Reset Store</el-button>
</div>
<div class="app-version">
{{ $t('Version')}}: {{ appVersion }}
Expand Down
24 changes: 22 additions & 2 deletions src/renderer/components/StepAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</el-row>

<el-tabs class="step-access__tabs" data-tabs="access-tabs" v-model="activeTab">
<el-tab-pane :label="$t('My VPN')" name="1">
<el-tab-pane :label="$t('Configuration')" name="1">
<div v-if="connectionType === 'l2tp'">
<el-form class="step-access__form step-access__form-vpn">
<el-form-item :label="$root.$t('Type of connection')">
Expand Down Expand Up @@ -169,6 +169,27 @@
</el-col>
</el-row>
</div>
<div v-if="connectionType === 'owncloud'">
<el-form class="step-access__form step-access__form-vpn">
<el-form-item :label="$root.$t('Type')">
ownCloud
</el-form-item>
<el-form-item :label="$root.$t('Address')">
<Copied :text="`http://${serverIp}`" />
<div class="note-block">
{{ $t('Note') }}:<br />
{{ $t('If you want to use a domain name you need to follow 2 simple steps.')}}
<ol class="no-margin">
<li>{{ $t('Go to your domain control panel and create a DNS record referencing the IP') }} <strong>{{ serverIp }}</strong></li>
<li>{{ $t('Go to this domain and configure the cloud by creating an administrator account.')}}</li>
</ol>
</div>
</el-form-item>
<el-form-item :label="$root.$t('IP')">
<Copied :text="serverIp" />
</el-form-item>
</el-form>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('My Server')" name="2" v-if="selectedProvider !== 'custom'">
<el-form class="step-access__form step-access__form-server">
Expand Down Expand Up @@ -290,7 +311,6 @@
}
color: #fbfbfb;
&-server {
margin-left: 160px;
@include mqMAX($XS) {
margin-left: 0;
.el-form-item {
Expand Down

0 comments on commit ebcae22

Please sign in to comment.