Tygs / 0bin

Client side encrypted pastebin
https://0bin.net
Do What The F*ck You Want To Public License
1.37k stars 198 forks source link

How to build from source and start a local server? #143

Closed niltonvasques closed 3 years ago

niltonvasques commented 3 years ago

Hello guys,

I'm trying to customize a bit the app, but after several tries, I could not figure out the right way to do it.

I tried with the following commands:

pip install -r dev-requirements.txt
apt install uglifyjs -y
pip install shiv
doit build
doit build_pyz
python setup.py install

python dist/zerobin.pyz --host 0.0.0.0 --port 3260

The app starts, however the modifications that I made are not applied.

I performed a small change to style.css, but I cant make it propate to the app after the build.

ksamuel commented 3 years ago

What CSS files are served when you look at the HTML source from the browser ?

niltonvasques commented 3 years ago

After all this commands I performed a find to search all the CSS files in the system and looks like that there is an outdated css in the shiv folder. See:

root@a6935bdf18bd:/data# find / -name *style.min* | xargs -I {} md5sum {}
19b6007eda23496c402ef3248edae316  /root/.shiv/zerobin_cf8a10b0db2f8aaaa91e3e01c9575ba6faddea9598b83a5621cae2514477937f/site-packages/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /usr/local/lib/python3.7/site-packages/zerobin-2.0.0-py3.7.egg/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /data/build/lib/zerobin/static/css/style.min.css
4e1ddc3a4a04a69f0553fd09d861dad0  /data/zerobin/static/css/style.min.css

Thes first one is served to the browser. See:

root@a6935bdf18bd:/tmp$ curl -s http://localhost:3260/static/css/style.min.css?1.0.5 | md5sum
19b6007eda23496c402ef3248edae316  -

Same problem happens if I changed the python scripts or the .tpl templates from views folder.

niltonvasques commented 3 years ago

Any idea from what could be happening @ksamuel ?

revij commented 3 years ago

@niltonvasques Try this:

rm -rf build
rm -rf dist
python setup.py build
python setup.py install

zerobin --host 0.0.0.0 --port 3260

Also, based on the utils.py under the zerobin folder, it will create a .config folder on your home directory, from where it will read the settings.

niltonvasques commented 3 years ago

Flawless working @revij ! :100: Thanks a lot dude! :beers: