chibisafe / chibisafe

Blazing fast file vault written in TypeScript! 🚀
https://chibisafe.app
MIT License
1.65k stars 266 forks source link

Can't use my real ip #121

Closed KroadD closed 6 years ago

KroadD commented 6 years ago

So I already made a issue about this(https://github.com/WeebDev/lolisafe/issues/120) , and tried what RyoshiKayo suggested for me.But after 2 hours of trying I couldn't make it.So let me explain again.

I have a Windows VPS With some storage and would like to make my own image hosting.But I can manage only to go for 127.0.0.1:(The port I enter[The one I use is 9999]), I tried nginx , but I couldn't make it :(. I hope y'all can help me and thanks for reading again!

config.js `module.exports = {

/*
    If set to true the user will need to specify the auto-generated token
    on each API call, meaning random strangers wont be able to use the service
    unless they have the token lolisafe provides you with.
    If it's set to false, then upload will be public for anyone to use.
*/
private: false,

// If true, users will be able to create accounts and access their uploaded files
enableUserAccounts: true,

/*
    Here you can decide if you want lolisafe to serve the files or if you prefer doing so via nginx.
    The main difference between the two is the ease of use and the chance of analytics in the future.
    If you set it to `true`, the uploaded files will be located after the host like:
        https://lolisafe.moe/yourFile.jpg

    If you set it to `false`, you need to set nginx to directly serve whatever folder it is you are serving your
    downloads in. This also gives you the ability to serve them, for example, like this:
        https://files.lolisafe.moe/yourFile.jpg

    Both cases require you to type the domain where the files will be served on the `domain` key below.
    Which one you use is ultimately up to you.
*/
serveFilesWithNode: false,
domain: '',

// Port on which to run the server
port: 9999,

// Pages to process for the frontend
pages: ['home', 'auth', 'dashboard', 'faq'],

// Add file extensions here which should be blocked
blockedExtensions: [
    '.jar',
    '.exe',
    '.msi',
    '.com',
    '.bat',
    '.cmd',
    '.scr',
    '.ps1',
    '.sh'
],

// Uploads config
uploads: {

    // Folder where images should be stored
    folder: 'uploads',

    /*
        Max file size allowed. Needs to be in MB
        Note: When maxSize is greater than 1 MiB, you must set the client_max_body_size to the same as maxSize.
    */
    maxSize: '512MB',

    // The length of the random generated name for the uploaded files
    fileLength: 32,

    /*
        This option will limit how many times it will try to generate random names
        for uploaded files. If this value is higher than 1, it will help in cases
        where files with the same name already exists (higher chance with shorter file name length).
    */
    maxTries: 1,

    /*
        NOTE: Thumbnails are only for the admin panel and they require you
        to install a separate binary called graphicsmagick (http://www.graphicsmagick.org)
        for images and ffmpeg (https://ffmpeg.org/) for video files
    */
    generateThumbnails: false,

    /*
        Allows users to download a .zip file of all files in an album.
        The file is generated when the user clicks the download button in the view
        and is re-used if the album has not changed between download requests
    */
    generateZips: true
},

// Folder where to store logs
logsFolder: 'logs',

// The following values shouldn't be touched
database: {
    client: 'sqlite3',
    connection: { filename: './database/db' },
    useNullAsDefault: true
}

} nginx.sample.conf upstream backend { server 127.0.0.1:9999; # Change to the port you specified on lolisafe }

map $sent_http_content_type $charset { ~^text/ utf-8; }

server { listen 80; listen [::]:80;

server_name My IP Addres;
server_tokens off;

client_max_body_size 100M; # Change this to the max file size you want to allow

charset $charset;
charset_types *;

# Uncomment if you are running lolisafe behind CloudFlare.
# This requires NGINX compiled from source with:
#   --with-http_realip_module
#include /path/to/lolisafe/real-ip-from-cf;

location / {
    add_header Access-Control-Allow-Origin *;
    root /path/to/your/uploads/folder;
    try_files $uri @proxy;
}

location @proxy {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://backend;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_redirect off;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}`

giantcow commented 6 years ago

You're on your own for Windows :grimacing: We only natively support Linux distributions

KroadD commented 6 years ago

So if I buy a linux VPS , can you help me ?:), or can I contact you at discord?

giantcow commented 6 years ago

Of course, our discord link is on the read me