Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] how do I ~/Public page #142

Open
Veraellyunjie opened this issue Aug 20, 2024 · 0 comments
Open

[QUESTION] how do I ~/Public page #142

Veraellyunjie opened this issue Aug 20, 2024 · 0 comments

Comments

@Veraellyunjie
Copy link

How do I set up a simplest "Hello, world!" webpage?

I haven't found it in man hashbang, on the website and in the repo.


cat .config/systemd/user/[email protected]`
...
#each user needs to change the port to an unused value above 1024
ExecStart=/usr/bin/python3 -m http.server %I
...

No idea, TBH.

How do I find out which ports are unused?
(the internet suggest a couple of commands, all sudo. I may not sudo, may I?)

WTF is that %I?
Now, thanks to #105 (comment) and ExecStart=/usr/bin/sh -c 'echo "%I" > wtf_I; /usr/bin/python3 -m http.server %I' and cat Public/wtf_I I know it is an argument substitution, and one runs systemctl --user start SimpleHTTPServer@UNUSED_PORT_ABOVE_1024


What is the address of the page:

  • hashbang.sh/username
  • hashbang.sh/~username
  • etc.

A port to each user. Does it mean the page's address becomes:

  • hashbang.sh:port/username
  • hashbang.sh:port/~username

Is there no way to get rid of port in address?

Again, what is the final address of the page?


I tried:

mkdir Public
echo '<html><body>Hello, world!</body></html>' > Public/index.html
systemctl --user daemon-reload
systemctl --user restart SimpleHTTPServer@...

I have tried several port numbers for SimpleHTTPServer@ and all abovementioned addresses.
The page doesn't open


Similarly, what are the steps for nginx in place of http.server?


Please:

  • make explanations more clear
  • add a howto on Public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant