当前位置:网站首页>Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud

Lightweight deployment of firefoxsend temporary file sharing service using Tencent cloud

2022-06-24 10:43:00 Fu'er

Firefox Send It's under the flag of fox temporary Network disk , It can be The whole platform Use , Webpage operation , No add ons are required ( and No speed limit ), Can be used in any modern browser . Share in the form of hyperlinks , Files that can be shared amount of downloads 、 Time and password , After reaching the specified number of downloads or duration, the file will automatically expire , And automatically from Send Delete... From the server , In a way, it's equivalent to Burn after reading .

what's more ,Firefox Send Is a Open source software .(GitHub Address

This means that any user can build their own Firefox Send

It is a pity , Because of the malicious use of criminals , stay 2020 year 9 month 17 Japan , Official team Mozilla Officially announce : Permanently shut down the Firefox Send service .

Let's record our deployment FirefoxSend The process of

Get ready

  • A cloud server
  • Install the pagoda panel

The latest Tencent cloud 618 The activity was very good , Among them Light weight 2 nucleus 4G5M It only takes... A year 288.

618 Activity Links :https://cloud.tencent.com/act/618go

Tencent cloud lightweight server link :https://cloud.tencent.com/act/pro/lighthouse2021

install

Firefox Send The basic building needs at least Node.js 10.x

Installation in Pagoda pm2 Manager and redis

stay pm2 Select the appropriate... In the manager node edition ( need 10.x Version and above )

The official installation process uses root User execution npm run build It's going to go wrong , An error is as follows :

mode: production

/var/www/send/node_modules/webpack/lib/optimize/ConcatenatedModule.js:679

          throw err;

          ^



SyntaxError: Unexpected token (3:25)

| !(function webpackMissingModule() { var e = new Error("Cannot find module 'webcrypto-core'"); e.code = 'MODULE_NOT_FOUND'; throw e; }());

| 

| class LinerError extends !(function webpackMissingModule() { var e = new Error("Cannot find module 'webcrypto-core'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()) {

|   constructor() {

|     super(...arguments);

...

So we create a new normal user

useradd -d /home/firefoxsend -m send

cd /home/firefoxsend Enter folder , Go into execution git clone https://github.com/mozilla/send.git from GitHub Pull source code

Domestic servers pull github If it's too slow , But first https://github.com/mozilla/send/releases Download to local , Then upload it to the server

take firefoxsend Directory user permissions changed to new user send

chown -R send:send firefoxsend

Then we modify Webpack.config.js Turn off auto check ,, If you don't modify the parameters, turn off the auto check , Cannot access after binding domain name .

Add... In the position shown in the figure below disableHostCheck: true,

Then we do the installation

Switching users su send

Execute in the source folder npm install

Use :npm run build Compile the production environment .

Last run npm run prod

The visiting address is ip:1443 Don't forget to open the port

Domain access

We can use the reverse generation of the pagoda .

Add the following to the configuration file :

location /api/ws {

       proxy_redirect off;

       proxy_pass http://0.0.0.0:1443;

       proxy_http_version 1.1;

       proxy_set_header Upgrade $http_upgrade;

       proxy_set_header Connection "upgrade";

       proxy_set_header Host $http_host;

   }

Need agent /api/ws This path , Because firefox-send File upload uses websocket agreement

Configure background boot

Use npm run prod After starting , close ssh, The service was shut down . We can use screen perhaps pm2 Manager to make it run in the background

At the pagoda pm2 Manager , It can be configured as shown in the figure

原网站

版权声明
本文为[Fu'er]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/06/20210618190514891l.html