mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 22:50:53 +03:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fff664947 | ||
|
|
439ac0ab7c | ||
|
|
dee6b3e9cc | ||
|
|
dc9d072472 | ||
|
|
65730db0db | ||
|
|
a86221b1cc | ||
|
|
bcc53f73c6 | ||
|
|
b0444f488b | ||
|
|
70a11e5300 | ||
|
|
f62a99882d | ||
|
|
309c7d63ac | ||
|
|
1d75366f66 | ||
|
|
0a849fb7c6 | ||
|
|
88725df09d | ||
|
|
5a92e7e5e7 | ||
|
|
71541fc2b6 | ||
|
|
5b4c0d2540 | ||
|
|
e7f3c91d0b | ||
|
|
8bb198b73e | ||
|
|
9e188bc76c | ||
|
|
1353a54c49 | ||
|
|
4ae007167d | ||
|
|
660f36e584 |
137
.gitlab-ci.yml
137
.gitlab-ci.yml
@@ -1,105 +1,72 @@
|
|||||||
image: "node:15-slim"
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- artifact
|
|
||||||
- release
|
- release
|
||||||
|
|
||||||
before_script:
|
|
||||||
# Install dependencies
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y git python3 build-essential libxtst6
|
|
||||||
|
|
||||||
# Prepare Chrome for puppeteer
|
|
||||||
- apt-get install -y wget gnupg
|
|
||||||
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
|
||||||
- sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends
|
|
||||||
|
|
||||||
# Build Send, run npm tests
|
# Build Send, run npm tests
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
image: "node:16-slim"
|
||||||
|
only:
|
||||||
|
- api
|
||||||
|
- branches
|
||||||
|
- chat
|
||||||
|
- merge_requests
|
||||||
|
- pushes
|
||||||
|
- schedules
|
||||||
|
- tags
|
||||||
|
- triggers
|
||||||
|
- web
|
||||||
|
before_script:
|
||||||
|
# Install dependencies
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y git python3 build-essential libxtst6
|
||||||
|
|
||||||
|
# Prepare Chrome for puppeteer
|
||||||
|
- apt-get install -y wget gnupg
|
||||||
|
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||||
|
- sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils
|
||||||
|
- apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends
|
||||||
script:
|
script:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
# Build Docker image, export Docker image artifact
|
|
||||||
artifact-docker:
|
|
||||||
stage: artifact
|
|
||||||
image: docker:latest
|
|
||||||
needs: []
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
variables:
|
|
||||||
IMG_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
|
||||||
IMG_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
|
||||||
before_script: []
|
|
||||||
script:
|
|
||||||
- docker build -t $IMG_NAME .
|
|
||||||
- docker image save -o $IMG_FILE $IMG_NAME
|
|
||||||
artifacts:
|
|
||||||
name: artifact-docker
|
|
||||||
paths:
|
|
||||||
- $IMG_FILE
|
|
||||||
expire_in: 1 week
|
|
||||||
|
|
||||||
# Release public Docker image for the master branch
|
|
||||||
release-docker-master:
|
|
||||||
stage: release
|
|
||||||
image: docker:latest
|
|
||||||
dependencies:
|
|
||||||
- artifact-docker
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
variables:
|
|
||||||
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
|
||||||
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
|
||||||
IMG_NAME: "registry.gitlab.com/timvisee/send:master-$CI_COMMIT_SHORT_SHA"
|
|
||||||
before_script: []
|
|
||||||
script:
|
|
||||||
# Login in to registry
|
|
||||||
- 'docker login registry.gitlab.com -u $DOCKER_USER -p $DOCKER_PASS'
|
|
||||||
|
|
||||||
# Load existing, retag for new image images
|
|
||||||
- docker image load -i $IMG_IMPORT_FILE
|
|
||||||
- docker tag $IMG_IMPORT_NAME $IMG_NAME
|
|
||||||
|
|
||||||
# Publish tagged image
|
|
||||||
- docker push $IMG_NAME
|
|
||||||
|
|
||||||
- 'echo "Docker image artifact published, available as:" && echo " docker pull $IMG_NAME"'
|
|
||||||
|
|
||||||
# Release public Docker image for a version tag
|
|
||||||
release-docker:
|
release-docker:
|
||||||
stage: release
|
stage: release
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
dependencies:
|
|
||||||
- artifact-docker
|
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
only:
|
only:
|
||||||
- /^v(\d+\.)*\d+$/
|
- api
|
||||||
variables:
|
- branches
|
||||||
IMG_IMPORT_FILE: "send:git-$CI_COMMIT_SHORT_SHA.tar"
|
- chat
|
||||||
IMG_IMPORT_NAME: "send:git-$CI_COMMIT_SHORT_SHA"
|
- merge_requests
|
||||||
IMG_NAME: "registry.gitlab.com/timvisee/send:$CI_COMMIT_REF_NAME"
|
- pushes
|
||||||
IMG_NAME_LATEST: "registry.gitlab.com/timvisee/send:latest"
|
- schedules
|
||||||
before_script: []
|
- tags
|
||||||
|
- triggers
|
||||||
|
- web
|
||||||
script:
|
script:
|
||||||
# Login in to registry
|
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
||||||
- 'docker login registry.gitlab.com -u $DOCKER_USER -p $DOCKER_PASS'
|
- docker build -t send .
|
||||||
|
- |
|
||||||
# Load existing, retag for new image images
|
if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then
|
||||||
- docker image load -i $IMG_IMPORT_FILE
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE/mr:$CI_MERGE_REQUEST_IID"
|
||||||
- docker tag $IMG_IMPORT_NAME $IMG_NAME
|
elif [ "$CI_COMMIT_TAG" != "" ]; then
|
||||||
- docker tag $IMG_IMPORT_NAME $IMG_NAME_LATEST
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG $CI_REGISTRY_IMAGE:latest"
|
||||||
|
else
|
||||||
# Publish tagged image
|
IMAGE_NAMES="$CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHORT_SHA"
|
||||||
- docker push $IMG_NAME
|
fi
|
||||||
- docker push $IMG_NAME_LATEST
|
- |
|
||||||
|
for image in $IMAGE_NAMES; do
|
||||||
- 'echo "Docker image artifact published, available as:" && echo " docker pull $IMG_NAME_LATEST" && echo " docker pull $IMG_NAME"'
|
docker tag send $image
|
||||||
|
docker push $image
|
||||||
|
done
|
||||||
|
- |
|
||||||
|
echo "Container image pushed. You can pull it with";
|
||||||
|
for image in $IMAGE_NAMES; do
|
||||||
|
echo "docker pull $image"
|
||||||
|
done
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ AWS example using Ubuntu Server `20.04`: [docs/AWS.md](docs/AWS.md)
|
|||||||
- Web: _this repository_
|
- Web: _this repository_
|
||||||
- Command-line: [`ffsend`](https://github.com/timvisee/ffsend)
|
- Command-line: [`ffsend`](https://github.com/timvisee/ffsend)
|
||||||
- Android: _see [Android](#android) section_
|
- Android: _see [Android](#android) section_
|
||||||
- Thunderbird: [FileLink provider for Send](https://addons.thunderbird.net/en-US/thunderbird/addon/filelink-provider-for-send/)
|
- Thunderbird: [FileLink provider for Send](https://addons.thunderbird.net/thunderbird/addon/filelink-provider-for-send/)
|
||||||
|
|
||||||
#### Android
|
#### Android
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default class Archive {
|
|||||||
constructor(files = [], defaultTimeLimit = 86400, defaultDownloadLimit = 1) {
|
constructor(files = [], defaultTimeLimit = 86400, defaultDownloadLimit = 1) {
|
||||||
this.files = Array.from(files);
|
this.files = Array.from(files);
|
||||||
this.defaultTimeLimit = defaultTimeLimit;
|
this.defaultTimeLimit = defaultTimeLimit;
|
||||||
|
this.defaultDownloadLimit = defaultDownloadLimit;
|
||||||
this.timeLimit = defaultTimeLimit;
|
this.timeLimit = defaultTimeLimit;
|
||||||
this.dlimit = defaultDownloadLimit;
|
this.dlimit = defaultDownloadLimit;
|
||||||
this.password = null;
|
this.password = null;
|
||||||
@@ -76,7 +77,7 @@ export default class Archive {
|
|||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this.files = [];
|
this.files = [];
|
||||||
this.dlimit = 1;
|
this.dlimit = this.defaultDownloadLimit;
|
||||||
this.timeLimit = this.defaultTimeLimit;
|
this.timeLimit = this.defaultTimeLimit;
|
||||||
this.password = null;
|
this.password = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function expiryInfo(translate, archive) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function password(state) {
|
function password(state) {
|
||||||
const MAX_LENGTH = 32;
|
const MAX_LENGTH = 4096;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="mb-2 px-1">
|
<div class="mb-2 px-1">
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module.exports = function(state, emit) {
|
|||||||
class="w-full border-l border-t border-b rounded-l-lg rounded-r-none ${invalid
|
class="w-full border-l border-t border-b rounded-l-lg rounded-r-none ${invalid
|
||||||
? 'border-red dark:border-red-40'
|
? 'border-red dark:border-red-40'
|
||||||
: 'border-grey'} leading-loose px-2 py-1 dark:bg-grey-80"
|
: 'border-grey'} leading-loose px-2 py-1 dark:bg-grey-80"
|
||||||
maxlength="32"
|
maxlength="4096"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="${state.translate('unlockInputPlaceholder')}"
|
placeholder="${state.translate('unlockInputPlaceholder')}"
|
||||||
oninput="${inputChanged}"
|
oninput="${inputChanged}"
|
||||||
|
|||||||
5766
package-lock.json
generated
5766
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "send",
|
"name": "send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"version": "3.4.21",
|
"version": "3.4.23",
|
||||||
"author": "Mozilla (https://mozilla.org)",
|
"author": "Mozilla (https://mozilla.org)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Tim Visee <3a4fb3964f@sinenomine.email> (https://timvisee.com)"
|
"Tim Visee <3a4fb3964f@sinenomine.email> (https://timvisee.com)"
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
"husky": "^3.0.9",
|
"husky": "^3.0.9",
|
||||||
"intl-pluralrules": "^1.3.1",
|
"intl-pluralrules": "^1.3.1",
|
||||||
"lint-staged": "^9.4.2",
|
"lint-staged": "^9.4.2",
|
||||||
"mocha": "^6.2.2",
|
"mocha": "^10.1.0",
|
||||||
"morgan": "^1.9.1",
|
"morgan": "^1.9.1",
|
||||||
"nanobus": "^4.5.0",
|
"nanobus": "^4.5.0",
|
||||||
"nanohtml": "^1.9.0",
|
"nanohtml": "^1.9.0",
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
"choo": "^7.0.0",
|
"choo": "^7.0.0",
|
||||||
"cldr-core": "^35.1.0",
|
"cldr-core": "^35.1.0",
|
||||||
"configstore": "github:dannycoates/configstore#master",
|
"configstore": "github:dannycoates/configstore#master",
|
||||||
"convict": "^6.2.3",
|
"convict": "^6.2.4",
|
||||||
"convict-format-with-validator": "^6.2.0",
|
"convict-format-with-validator": "^6.2.0",
|
||||||
"double-ended-queue": "^2.1.0-0",
|
"double-ended-queue": "^2.1.0-0",
|
||||||
"express": "^4.17.3",
|
"express": "^4.17.3",
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ const conf = convict({
|
|||||||
},
|
},
|
||||||
base_url: {
|
base_url: {
|
||||||
format: 'url',
|
format: 'url',
|
||||||
default: 'https://send.firefox.com',
|
default: 'https://send.example.com',
|
||||||
env: 'BASE_URL'
|
env: 'BASE_URL'
|
||||||
},
|
},
|
||||||
custom_title: {
|
custom_title: {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ module.exports = async function(req) {
|
|||||||
facebook: baseUrl + '/' + assets.get('send-fb.jpg'),
|
facebook: baseUrl + '/' + assets.get('send-fb.jpg'),
|
||||||
twitter: baseUrl + '/' + assets.get('send-twitter.jpg'),
|
twitter: baseUrl + '/' + assets.get('send-twitter.jpg'),
|
||||||
wordmark: assets.get('wordmark.svg') + '#logo',
|
wordmark: assets.get('wordmark.svg') + '#logo',
|
||||||
custom_css: assets.get('undefined')
|
custom_css: ''
|
||||||
};
|
};
|
||||||
Object.keys(uiAssets).forEach(index => {
|
Object.keys(uiAssets).forEach(index => {
|
||||||
if (config.ui_custom_assets[index] !== '')
|
if (config.ui_custom_assets[index] !== '')
|
||||||
|
|||||||
Reference in New Issue
Block a user