Skip to content

Commit

Permalink
Merge branch 'release/0.4.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Dec 15, 2019
2 parents 85d3252 + 50cb115 commit e011329
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 15 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.4.13] - 2019-12-15
### Added
- Allow builders to change default Piping Server URLs at build-time

### Changed
- Use "./" as publicPath
- Remove public/_redirects

## [0.4.12] - 2019-12-15
### Changed
- Update dependencies
Expand Down Expand Up @@ -115,7 +123,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
- First release

[Unreleased]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.12...HEAD
[Unreleased]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.13...HEAD
[0.4.13]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.12...v0.4.13
[0.4.12]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.11...v0.4.12
[0.4.11]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.10...v0.4.11
[0.4.10]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.9...v0.4.10
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ Web UI for [Piping Server](https://github.com/nwtgck/piping-server)
- Passwordless E2E encryption by [Elliptic-curve Diffie–Hellman] and [OpenPGP.js]
- Password protection powered by [OpenPGP.js]

## Self-hosting

You can build Piping UI by yourself like the following.

```console
$ git clone https://github.com/nwtgck/piping-ui-web.git
$ cd piping-ui-web
$ npm run build
```

Then, you can publish `./dist`.
In addition, you can also use hosting services such as GitHub pages and Netlify.

### Change default Piping Server URLs at build-time

Set env `$PIPING_SERVER_URLS` to change default Piping Server URLs.

```console
$ PIPING_SERVER_URLS='["https://mypiping.server", "https://mypipi.ng"]' npm run build
```

![Build-time Piping Server URLs](doc_assets/build-time-piping-server-urls.png)

## Logo
<div>Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

Expand Down
Binary file added doc_assets/build-time-piping-server-urls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piping-ui",
"version": "0.4.12",
"version": "0.4.13",
"private": true,
"author": "Ryo Ota <[email protected]> (https://github.com/nwtgck)",
"scripts": {
Expand Down
7 changes: 0 additions & 7 deletions public/_redirects

This file was deleted.

7 changes: 2 additions & 5 deletions src/components/PipingUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,14 @@ import {strings} from "@/strings";
import {File as FilePondFile} from "filepond";
import {baseAndExt} from "@/utils";
import {Protection} from "@/datatypes";
import constants from "@/constants";
(async () => require('filepond/dist/filepond.min.css'))();
// Create component
const FilePond = () => import('vue-filepond').then(vueFilePond => vueFilePond.default());
const defaultServerUrls: ReadonlyArray<string> = [
"https://ppng.ml",
"https://piping.arukascloud.io",
"https://ppng.herokuapp.com"
];
const defaultServerUrls: ReadonlyArray<string> = constants.pipingServerUrls;
function normalizeUrl(url: string): string {
return new URL(url).href;
Expand Down
8 changes: 8 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// NOTE: The values are defined in vue.config.js
declare const PIPING_SERVER_URLS: ReadonlyArray<string>;

const c = {
pipingServerUrls: PIPING_SERVER_URLS,
};

export default c;
16 changes: 16 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
const webpack = require('webpack');

module.exports = {
// (from: https://cli.vuejs.org/config/#publicpath)
publicPath: "./",
// (base: https://stackoverflow.com/q/56127998/2885946)
css: {
sourceMap: true
},
configureWebpack: {
plugins: [
// (base: https://medium.com/curofy-engineering/a-guide-to-inject-variable-into-your-code-using-webpack-36c49fcc1dcd)
new webpack.DefinePlugin({
PIPING_SERVER_URLS: process.env.PIPING_SERVER_URLS || JSON.stringify([
"https://ppng.ml",
"https://piping.arukascloud.io",
"https://ppng.herokuapp.com"
]),
})
]
},
// (from: https://medium.com/@dougallrich/give-users-control-over-app-updates-in-vue-cli-3-pwas-20453aedc1f2)
pwa: {
workboxPluginMode: 'InjectManifest',
Expand Down

0 comments on commit e011329

Please sign in to comment.